aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/fdc
Commit message (Collapse)AuthorAgeFilesLines
* Fix the acpi attachment to always start the worker thread.John Baldwin2016-05-041-3/+2
| | | | | | | | | | | | The previous change to split the worker thread start out of fdc_attach() did not start the worker thread if the fdc device in the ACPI namespace did not have an _FDE method. This fixes hangs when booting with a floppy controller enabled on certain machines with ACPI. Tested by: joel Notes: svn path=/head/; revision=299092
* s/struct device */device_t/gAdrian Chadd2016-05-041-1/+1
| | | | | | | Submitted by: kmacy Notes: svn path=/head/; revision=299051
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-031-1/+1
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* Adjust the fdc worker thread startup to work when APs are started earlier.John Baldwin2016-04-216-11/+28
| | | | | | | | | | | | | | | | | | | - Enable the commented out locking in fd_probe(). The worker thread should not be running yet (even after these changes), but better to be safe than sorry. - Defer starting the worker thread until after the child drives have been probed. The worker thread startup is moved into a fdc_start_worker() thread that the various front ends call at the end of attach. As a side effect this fixes a few edge cases that weren't shutting down the worker thread if attach encountered a late failure. - When executing the initial reset requested by attach in the worker thread, use DELAY() instead of a tsleep() if cold is set. Tested by: Howard Su <howard0su@gmail.com> Sponsored by: Netflix Notes: svn path=/head/; revision=298426
* Don't wakeup the fdc worker thread once a second when idle.John Baldwin2016-04-051-1/+1
| | | | | | | | | | | | | | | The fdc worker thread was using a one second timeout while waiting for a new bio to arrive or for the device to detach. However, the driver already does a wakeup when queueing a new bio or asking the thread to detach, so the timeout only served to waste CPU time waking up the thread once a second just so it could go right back to sleep. Use an infinite timeout instead. Discussed with: phk Sponsored by: Netflix Notes: svn path=/head/; revision=297568
* Add raw RX-50 support. These are 400k single sided disks with 80Warner Losh2016-03-101-0/+1
| | | | | | | | | | | | tracks and 10 sectors per track. More exotic RX-50 types not supported, nor is there support for de-interleaving the first two tracks where the physical sectors are 0 1 2 3 4 5 6 7 8 9, but they should be interpreted as 0 5 1 6 2 7 3 8 4 9. This is purely to read the media with dd. The FAT that's on these disks won't work with msdosfs anyway. Notes: svn path=/head/; revision=296590
* Stop assuming that bio_cmd is a bit field.Warner Losh2016-03-101-14/+20
| | | | | | | Differential Revision: https://reviews.freebsd.org/D5587 Notes: svn path=/head/; revision=296589
* Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().Justin Hibbits2016-02-271-2/+2
| | | | | | | | | | | Most calls to bus_alloc_resource() use "anywhere" as the range, with a given count. Migrate these to use the new bus_alloc_resource_anywhere() API. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D5370 Notes: svn path=/head/; revision=296137
* Replace several bus_alloc_resource() calls using default arguments with ↵Justin Hibbits2016-02-191-2/+1
| | | | | | | | | | | | bus_alloc_resource_any() Since these calls only use default arguments, bus_alloc_resource_any() is the right call. Differential Revision: https://reviews.freebsd.org/D5306 Notes: svn path=/head/; revision=295790
* Create a generic PCCARD_PNP_INFO from the MODULE_PNP_INFO buildingWarner Losh2015-12-111-0/+1
| | | | | | | | | | | | block. Use it in all the PNP drivers to export either the current PNP table. For uart, create a custom table and export it using MODULE_PNP_INFO since it's the only one that matches on function number. Differential Review: https://reviews.freebsd.org/D3461 Notes: svn path=/head/; revision=292079
* Merge the PC98 fdc(4) driver into the MI driver. While here, replaceJohn Baldwin2014-09-253-8/+433
| | | | | | | | | | the magic numbers used with NE7CMD_SPECIFY with invocations of the NE7_SPEC_x() macros. Approved by: nyan Notes: svn path=/head/; revision=272129
* Reimplement the FDOPT_NOERROR feature that was kicked out in r134081.Joerg Wunsch2013-08-261-5/+18
| | | | | | | | | | | | | It is needed for fdread(1) in order to be able to recover from CRC errors in the data field of a floppy sector (by returning the sector data that failed CRC, rather than inventing dummy data). When closing the device, clear all transient device options. MFC after: 1 week Notes: svn path=/head/; revision=254937
* Do not use "Enable Implied Seek" on enhanced floppy controllers. ThisJoerg Wunsch2013-08-241-8/+3
| | | | | | | | | | | | | | | | | breaks the "2step" feature of the driver, e.g. in order to read 360 KiB media on a 1200 KiB drive. As the only potential advantage of implied (vs. explicit) seeks is to minimize the software effort, yet our driver always contained the logic needed for explicit seeks, simply dropping implied seeks is the best solution without introducing risks for new bugs. There is no performance penalty, reading a 1440 KiB medium takes exactly the same time with both, implied or explicit seeks. MFC after: 1 week Notes: svn path=/head/; revision=254809
* Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on ↵Sofian Brabez2013-01-301-1/+1
| | | | | | | | | | device_method_t arrays Reviewed by: cognet Approved by: cognet Notes: svn path=/head/; revision=246128
* - Don't pass geom and provider names as format strings.Jaakko Heinonen2012-11-201-2/+2
| | | | | | | | | | - Add __printflike() attributes. - Remove an extra argument for the g_new_geomf() call in swapongeom_ev(). Reviewed by: pjd Notes: svn path=/head/; revision=243333
* Replace `inline static' by `static inline'.Ed Schouten2011-12-131-2/+2
| | | | | | | | | If I interpret the C standard correctly, the storage specifier should be placed before the inline keyword. While at it, replace __inline by inline in the files affected. Notes: svn path=/head/; revision=228471
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.Ed Schouten2011-11-071-1/+1
| | | | | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static. Notes: svn path=/head/; revision=227309
* Remove duplicate header includesKevin Lo2011-06-281-2/+0
| | | | Notes: svn path=/head/; revision=223624
* Fix typos - remove duplicate "the".Rebecca Cran2011-02-211-1/+1
| | | | | | | | | PR: bin/154928 Submitted by: Eitan Adler <lists at eitanadler.com> MFC after: 3 days Notes: svn path=/head/; revision=218909
* Fix a regression from r200554, which broke fdc(4) attachment to acpi(4).Jung-uk Kim2010-05-301-1/+3
| | | | | | | | | | I removed too many lines and a wrong pointer was accidentally passed down. Tested by: Scott Allendorf (scott-allendorf at uiowa dot edu), kib MFC after: 3 days Notes: svn path=/head/; revision=208650
* Remove _FDE quirk handling as these quirks are automatically repairedJung-uk Kim2009-12-141-57/+4
| | | | | | | by ACPICA layer since ACPICA 20091214. Notes: svn path=/head/; revision=200554
* Make isa_dma functions MPSAFE by introducing its own private lock. TheseRoman Divacky2009-11-091-6/+0
| | | | | | | | | | | | | | | | | | | | | functions are selfcontained (ie. they touch only isa_dma.c static variables and hardware) so a private lock is sufficient to prevent races. This changes only i386/amd64 while there are also isa_dma functions for ia64/sparc64. Sparc64 are ones empty stubs and ia64 ones are unused as ia64 does not have isa (says marcel). This patch removes explicit locking of Giant from a few drivers (there are some that requires this but lack ones - this patch fixes this) and also removes the need for implicit locking of Giant from attach routines where it's provided by newbus. Approved by: ed (mentor, implicit) Reviewed by: jhb, attilio (glanced by) Tested by: Giovanni Trematerra <giovanni.trematerra gmail com> IA64 clue: marcel Notes: svn path=/head/; revision=199104
* fdc(4) module unload fixes:Jaakko Heinonen2009-11-031-3/+14
| | | | | | | | | | | | | - Tear down the interrupt handler before killing the worker thread. - Do geom withering as GEOM event to avoid acquiring the GEOM topology lock under Giant. PR: kern/104079 Reviewed by: joerg Approved by: trasz (mentor) Notes: svn path=/head/; revision=198857
* Don't ignore the return value of g_modevent() in fdc_modevent().Jaakko Heinonen2009-10-271-2/+1
| | | | | | | Approved by: trasz (mentor) Notes: svn path=/head/; revision=198520
* Orphaning provider with EXDEV seems weird; perhaps the author meantEdward Tomasz Napierala2009-10-101-1/+1
| | | | | | | ENXIO here? Notes: svn path=/head/; revision=197945
* With the fdc control device disappearing some 5 years ago, it is noJoerg Wunsch2009-06-241-4/+0
| | | | | | | | | | longer useful for the FD_STYPE and FD_SOPTS ioctls to insist on being issued on a writable file descriptor. Otherwise, there's no longer a chance to set the drive type or options when a read-only medium is present in the drive, as there is no way to obtain a writable fd then. Notes: svn path=/head/; revision=194891
* Import ACPICA 20090521.Jung-uk Kim2009-06-051-1/+2
| | | | Notes: svn path=/head/; revision=193530
* Eliminate an unused variable reported by coverityWarner Losh2008-11-231-4/+2
| | | | | | | Submitted by: Ganbold Notes: svn path=/head/; revision=185235
* - Revive fdc(4) per-device flag 0x10, which was removed in r1.284[1].Jung-uk Kim2008-11-151-63/+86
| | | | | | | | | | | | | | | | - If the flag is set and auto-select fails, assume disk is not present. - Set disk empty flag only when the floppy controller reset is needed. It fixes regression introduced in r1.311, which prevented it from ignoring errors. Now fdformat(1) and dd(1) with conv=noerror option can continue when read/write errors occur as they should. - Do not retry disk probing as it is extremely slow and pointless. - Move the disk probing code into a separate function. - Do not reset disk empty flag if write-protect check fails somehow. PR: kern/116538[1] Notes: svn path=/head/; revision=184976
* The wakeup() line from the rev. 1.319 is wrong and reintroducesKonstantin Belousov2008-01-111-2/+1
| | | | | | | | | | | | | a panic race on module unload. The wakeup() is internal to kproc_exit/kthread_exit. The correct fix is to fix the msleep() in detach to sleep on fdc->fdc_thread instead of &fdc->fdc_thread. Noted and reviewed by: jhb Pointy hat to: kib MFC after: 1 week Notes: svn path=/head/; revision=175230
* Fix unload of the fdc.ko:Konstantin Belousov2008-01-111-1/+8
| | | | | | | | | | | | Wakeup the thread doing the fdc_detach() when the fdc worker thread exits [1]. Write access to the write-protected floppy shall call device_unbusy() to pair the device_busy() in the fd_access() [2]. PR: 116537 [1], 116539 [2] MFC after: 1 week Notes: svn path=/head/; revision=175226
* Rename the kthread_xxx (e.g. kthread_create()) callsJulian Elischer2007-10-201-2/+2
| | | | | | | | | | | | | | to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first. I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls. Notes: svn path=/head/; revision=172836
* Always protect the kthread flags with the lock and close a race withJohn Baldwin2007-02-271-2/+1
| | | | | | | | | module unload and kthread_exit(). MFC after: 3 days Notes: svn path=/head/; revision=167083
* Use tsleep() rather than msleep() with a NULL mtx parameter.John Baldwin2007-02-231-9/+9
| | | | Notes: svn path=/head/; revision=166934
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-02-231-3/+14
| | | | | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@ Notes: svn path=/head/; revision=166901
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningRobert Watson2006-11-061-2/+4
| | | | | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net> Notes: svn path=/head/; revision=164033
* Fix style nits. No md5 changes in .o's. ;-)Jung-uk Kim2006-09-081-2/+2
| | | | Notes: svn path=/head/; revision=162165
* Restore Digital Outpur Register (DOR) for enhanced controller after reset.Jung-uk Kim2006-08-291-2/+2
| | | | Notes: svn path=/head/; revision=161714
* Assume floppy disk is not inserted when we have exhausted retries. ThisJung-uk Kim2006-07-121-0/+3
| | | | | | | | | | | | | significantly reduces booting time when there is broken floppy disk drive, controller, cable, BIOS, etc. When the floppy controller interface is correctly implemented, disk change signal (DSKCHG) is reflected in the Digital Input Register (DIR) at 0x3f7. However, there are many cases that the signal is unusable. Moreover, some BIOS does not reserve the port at all. In those cases, the register may not function. Notes: svn path=/head/; revision=160283
* Enhanced floppy controllers have Data Rate Select Register (DSR) at 0x3f4.Jung-uk Kim2006-07-061-8/+24
| | | | | | | | | | | | Use it to reset controller and to select data rate. According to Intel 80277AA datasheet, software reset behaves the same as DOR reset except that it is self clearing. National Semiconductor PC8477B datasheet says the same. As a side effect, we no longer use Configuration Control Register (CCR) at 0x3f7 for these controllers, which is often missing in modern hardware. Notes: svn path=/head/; revision=160137
* - Use callout_init_mtx() to initialize toffhandle callout using the fdc'sJohn Baldwin2006-02-231-9/+5
| | | | | | | | | | | | | | | | | | mutex. - Don't use callout_drain() to stop the toffhandle callout while holding the fdc mutex (this could deadlock) in functions called from softclock (callouts aren't allowed to do voluntary sleeps). Instead, use callout_stop(). Note that since we hold the associated mutex and are now using callout_init_mtx(), callout_stop() is just as effective as callout_drain(). (Though callout_drain() is still needed in detach to make sure softclock isn't contesting on our mutex before we destroy the mutex.) - Remove unused callout 'tohandle' from softc. MFC after: 1 week Notes: svn path=/head/; revision=155956
* Remove unused variable.Nate Lawson2006-02-211-2/+0
| | | | | | | | Coverity ID: 558 Found by: Coverity Prevent Notes: svn path=/head/; revision=155870
* Canonize the include of acpi.h.David E. O'Brien2005-09-111-1/+1
| | | | Notes: svn path=/head/; revision=150003
* FDOPT_NORETRY is an option, and must be compared with fd->options,Craig Rodrigues2005-08-301-1/+1
| | | | | | | | | | | not fd->flags. PR: kern/85481 Submitted by: Lev Levinson <llevinson at inbox dot ru> MFC after: 1 day Notes: svn path=/head/; revision=149650
* Eliminate unused argument in PCMCIA_CARD macro.Warner Losh2005-06-241-1/+1
| | | | | | | | | | | Provide a backwards compatible way to have the extra macro by defining PCCARD_API_LEVEL 5 before including pccarddevs for driver writers that want/need to have the same driver on 5 and 6 with pccard attachments. Approved by: re (dwhite) Notes: svn path=/head/; revision=147580
* If we fail a sanity check for the resources just allocated, make sureWarner Losh2005-03-151-1/+3
| | | | | | | | | | that we free that resource. All the other resources are freed in their own routine, but since we haven't saved a pointer to this one, it is leaked. This is the failure case that lead to the sio ports that weren't working, I think. Notes: svn path=/head/; revision=143618
* Only allocate 1 port for non-zero rids. Either we'll get the properWarner Losh2005-03-141-1/+1
| | | | | | | | length form the enumeration mechanism, or we're dealing with the FDCTL register, which is only 1 port long. Notes: svn path=/head/; revision=143602
* Fix a couple of problems with the probe code when used with pnpbiosWarner Losh2005-03-101-9/+23
| | | | | | | | | | | | | | | | | | | | | resources. When allocating 6 ports for a 4 port range isa code returns an error. I'm not sure yet why this is the case, but suspect it is just a non-regularity in how the resource allocation code works which should be corrected. Use 1 as the ports size in this case. However, in the hints case, we have to specify the length, so use 6 in that case. I believe that this is also acpi friendly. Also, complain when we can't allocate FDOUT register space. Right now we silently fail when we can't. This failure is referred to above. When there's no resource for FDCTL, go ahead and allocate one by hand. Many PNPBIOS tables don't list this resource, and our hints mechanism also doesn't cover that range. If we can't allocate it, whine, but fake up something. Before, we were always bogusly faking it and no one noticed the sham (save the original author who has now fixed his private shame). Notes: svn path=/head/; revision=143380
* Add missing ()Poul-Henning Kamp2005-02-281-3/+3
| | | | Notes: svn path=/head/; revision=142791
* Add missing va_end() in fdc_cmd.Pyun YongHyeon2005-02-281-2/+5
| | | | | | | | | 0 -> NULL in arguments of fdc_sense_int(). Reminded by: joerg Notes: svn path=/head/; revision=142750