summaryrefslogtreecommitdiffstats
path: root/sys/dev/ic/wdc.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Convert infinite sleeps to {m,t}sleep_nsec(9).mpi2019-12-311-2/+2
| | | | ok kn@
* Don't check if unsigned value is less than zeroians2019-07-031-5/+3
| | | | ok kn@
* Don't pull in <sys/file.h> just to get fcntl.hguenther2017-12-301-2/+2
| | | | ok deraadt@ krw@
* Prevent null pointer dereference when probing channelsmikeb2017-09-261-3/+3
| | | | | | | | | Account for the case when wdc is attached to the ISA bus and performs channel probing using a dummy structure that lacks the back pointer to the controller's softc. Bug reported and fix tested by Andrew Daugherity, thanks! OK phessler, jsg, krw, deraadt
* Introduce two quirks to prevent attaching ATA and ATAPI devicesmikeb2017-07-121-1/+10
| | | | | | | | | Hyper-V and Xen have varying support for detaching emulated IDE devices ranging from none on Hyper-V to only IDE disks but not CDROM (Xen). The quirk mechanism provides a way of enforcing the desired behavior. With suggestions and OK kettenis, tedu, mlarkin
* all pools have their ipl set via pool_setipl, so fold it into pool_init.dlg2016-09-151-4/+3
| | | | | | | | | | | | | | | | | | | | | | the ioff argument to pool_init() is unused and has been for many years, so this replaces it with an ipl argument. because the ipl will be set on init we no longer need pool_setipl. most of these changes have been done with coccinelle using the spatch below. cocci sucks at formatting code though, so i fixed that by hand. the manpage and subr_pool.c bits i did myself. ok tedu@ jmatthew@ @ipl@ expression pp; expression ipl; expression s, a, o, f, m, p; @@ -pool_init(pp, s, a, o, f, m, p); -pool_setipl(pp, ipl); +pool_init(pp, s, a, ipl, f, m, p);
* fairly simple sizes for free(); ok teduderaadt2015-08-281-2/+2
|
* The 80's called and want their interface back. Remove last fragments ofkrw2015-08-171-13/+11
| | | | | | | | | ST-506 support. Remove redundant 'precomp' variables/fields and rename remaining few to 'features' to be consistant with the rest of the code. Consensus that no ST-506 disks (requiring ISA cards, <120MB, usually rife with bad sectors that can't be worked around) are still running OpenBSD.
* In wdcintr, do not attempt to read the status register unless WDCF_IRQ_WAITmiod2015-03-091-10/+10
| | | | | | | is not set; this used to be the case but got broken in 1.113. Fixes pciide0 at pci0 dev 2 function 0 "Acard ATP865-R" rev 0x07: DMA on armish (I/O Data).
* correctly decrement the C_SCSIXFER reference count in wdc_xfer flagsdlg2014-09-291-2/+5
| | | | | | | | | | | | | | | if the ata stack xfer free path is called before teh scsi xfer free path. this fixes a leak. in the vast majority of uses (eg, filesystems mounted on cd(4) via atapiscsi(4)) the scsi xfer free is always done first. however, if you're doing ioctls (eg, cdio(1)), the scsi ref is held over to the ioctl completion path, so the ata xfer free happens first. problem found by patrick keshishian who did some excellent work debugging this and providing the right fix for it. ok jmatthew@
* remove uneeded proc.h includesjsg2014-09-141-2/+1
| | | | ok mpi@ kspillner@
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-3/+3
| | | | after discussions with beck deraadt kettenis.
* decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hderaadt2014-07-081-2/+1
| | | | | don't need to be married. ok guenther miod beck jsing kettenis
* treat C_SCSIXFER as a reference count and use it as a guard to pool_put.dlg2014-01-241-4/+18
| | | | | fixes cd panics where the free_xfer path is called after scsi_done calls xfer_put.
* dont piggyback on C_PRIVATEXFER because it must not touch splx.dlg2014-01-221-3/+4
| | | | | | | | | | | | because im using it while the system is up and running i need the xfer free path to take the right locks, which PRIVATEXFER doesnt. invent a new C_SCSIXFER flag that provides the safety needed. this fixes issues people have had installing from atapiscsi(4) cdrom devices. bug spelunking and tailq corruption identified by jsing@ ok jsing@
* move atapiscsi to iopools by making the entire ata layer use them too.dlg2014-01-181-4/+32
| | | | | | | | | | | | | | | this would have been difficult before because the ata completion paths try to be helfpul by freeing xfers on the adapters behalf, whch doesn't work in the new world scsi model where the layer that allocated the thing is responsible for freeing it, and expects to get it back and maybe use it again. however, deraadt@ added magic flags for hibernate that im now using to keep ata xfers for the scsi layers. committing this now so itll be tested. i cant think of a better time to handle fallout from diffs like this than hackathons. discussed with deraadt@
* take advantage of pool_setipl and PR_ZERO to avoid doing work thedlg2014-01-181-13/+7
| | | | | | subsystem provides for us now when dealing with the xfer pool. ok krw@
* Do not set the dying flag in wdc_wait_for_status, since there is atderaadt2011-06-101-4/+1
| | | | | | | | | | | least one chip sii3112 or sii314, owned by henning) that spuriously returns failure. This is only backing out one of the dying cases. As well, I have found one other case where attempts are made to advance IO even after obvious failure. I suspect that I should find that issue next. discussed with henning, kettenis, and matthew
* wdc.c doesn't use NATAPISCSI, so no point in including atapiscsi.h.matthew2011-05-251-3/+1
| | | | | It's the last file referencing atapiscsi.h too, so might as well get rid of the need-flags in files.atapiscsi.
* Move wdc_cd from ata/ata_wdc.c to ic/wdc.c so that you can compile amatthew2011-05-241-4/+6
| | | | | | | kernel without the former. Also, eliminate two dead stores in wdcattach(). ok dlg@
* Refactor queue allocation and initialization into a wdc_alloc_queue()matthew2011-05-091-13/+28
| | | | | | | | | | | function, and let attachment code calls this rather than malloc(9). This prevents re-initialization of the queue in shared queue chipsets. Also, add wdc_free_queue() as a complementary function. Earlier version (without wdc_free_queue()) tested by sthen@ and Amit Kulkarni on various pciide(4) chips. ok dlg@
* Initialize the wdc ata_drive_datas structs earlier in wdcattach() somatthew2011-05-091-3/+6
| | | | | | | | | that chip-specific drv_probe routines can assume they've already been initialized. Tested by sthen@ on i386, armish, and amd64, with both affected and non-affected pciide(4) chips. ok dlg@
* Eliminate a few unused wdc capability flags (WDC_CAPABILITY_HWLOCK,matthew2011-05-081-7/+1
| | | | | | WDC_CAPABILITY_ATA_NOSTREAM, and WDC_CAPABILITY_ATAPI_NOSTREAM). ok dlg@, jsg@, krw@
* keep an eye out for wdc registers returning 0xff. if they return 0xff,deraadt2011-04-181-18/+48
| | | | | | | | this probably means the controller is dead -- as in, a hot plug eject event. in that case, mark the driver dead and try harder to return -1 in the interrupt handler. tested by many ok dlg, miod did not object
* Change wdc_reset_channel() to take a `no wait' argument. Pass in turn thismiod2011-04-151-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | argument to wdcreset(), to have it skip waiting until active channels see their BUSY bit clear in the status register. Use this feature in the resume path, during the first reset operation. The first reset is supposed to only wake up the controller, and the disks don't come back until the second reset is issued, therefore waiting for them to report themselves as ready after the first reset, but before the second, is moot - and as a matter of fact some controllers, such as the AMD 754 and clones/offspring (e.g. Geode) keep the BUSY bit asserted after the first reset. Last, but not least, make sure wd@ata invokes wd_get_params() again before returning from the resume code, as we will still be using polled transfers for a short while. This causes the Lemote Yeelong to resume within less than one second, instead of the lousy 30 seconds wait between the two resets; and the wd_get_params() voodoo prevents it from getting spurious ide interrupts afterwards. wd_get_params() magic from dlg; rest of the work by yours truly after enough prodding by dlg@ and pirofti@, among others. ok deraadt@ dlg@
* wd_hibernate_io() is a standalone disk io writer which tries to notderaadt2011-04-051-1/+8
| | | | | | damage kernel memory very much while doing the job. It is not very pretty yet, but improving it will need some MI work. ok mlarkin jsg dlg
* Deep below wdc_ioc_ata_cmd() it is possible that some controller (present orderaadt2011-04-051-5/+3
| | | | | | future) will try to dma the command buffer to the disk in some way. Use dma_alloc() to get ahead of this potential failure path. ok dlg krw
* Get rid of physio(9) in wdc(4)'s ioctl(2) handler. Based on similarmatthew2010-09-211-208/+75
| | | | | | changes to the SCSI subsystem ioctl(2) handlers. ok dlg@; ok and tweaks krw@; no objections jsg@
* pcmcia/wdc_pcmcia.cderaadt2010-08-291-17/+1
|
* Manuel Bouyer rescinded clauses 3 and 4 of his license text.jsg2010-07-231-6/+1
|
* ansi. no binary changejsg2010-07-221-154/+59
|
* little annoying knfderaadt2009-11-231-2/+4
|
* Probe modes for SATA disks, makes CF behind SATA work and givesjsg2009-11-221-16/+1
| | | | | more speed to things like SSDs that do UDMA 6. Tested by many.
* Get rid of devact enum, substitute it with an int and coresponding defines.pirofti2009-10-131-2/+2
| | | | | | This is needed for the addition of further suspend/resume actions. Okay deraadt@, marco@.
* Unifdef __OpenBSD__, these defines don't help us to sync with NetBSDgrange2009-02-071-20/+2
| | | | | | anymore but make reading the code harder. ok sthen@ miod@ krw@
* Replace timeout_add(msecs * hz / 1000) with timeout_add_msec(msecs).grange2009-01-211-2/+2
| | | | | | No functional changes. ok krw@ miod@
* unify using WDCDEBUG.fgsch2008-07-021-5/+5
|
* wrap logging code around WDC_DEBUG. shrinks kernel by ~4k.fgsch2008-06-301-5/+6
| | | | jsg@ krw@ miod@ ok.
* More removal of clauses 3 and 4 from NetBSD licenses.ray2008-06-271-8/+1
| | | | OK deraadt@ and millert@
* More easy bzero() -> M_ZERO. Use 'p = malloc(sizeof(*p) ...'.krw2007-10-011-3/+2
|
* wdcrestart() is never usedderaadt2007-05-081-15/+1
|
* atapi_print() is never usedderaadt2007-05-081-13/+1
|
* During the drives detection only check the status register to be notgrange2007-04-161-3/+3
| | | | | | 0xff, this will allow to detect some certain microdrives plugged into soekris. Patch from Jochen <jochen@penguin-breeder.org> via PR 5340.
* In wdcprobe(), directly invoke wdc_do_reset() instead of using the resetmiod2006-05-221-2/+2
| | | | | reset function pointer, as this can cause a NULL pointer dereference on some systems.
* Revert last commit till a better method can be found.jsg2006-05-081-2/+2
| | | | At least one system (Ben Lovett's) had issues with the change.
* Default to Ultra DMA Mode 6 not 5 when we know we have a nativejsg2006-05-071-2/+2
| | | | | | SATA drive. ok grange@
* Provide a function pointer that allows for the wdc resetjsg2006-05-031-5/+7
| | | | | method to be changed as required. This will be required for dealing with several chips in pciide.
* Fix LBA48 access for ServerWorks SATA.kettenis2006-02-101-10/+20
| | | | ok grange@
* Don't fall back to fake geometry if ata_get_params() fails.uwe2005-11-091-1/+2
| | | | "looks sane" grange@; tested by niall@ krw@ jmc@ jolan@
* Zap return at the end of a void function. No binary change.grange2005-10-211-12/+2
|