summaryrefslogtreecommitdiff
path: root/sys/dev/ic/wdc.c
AgeCommit message (Collapse)Author
2011-06-10Do not set the dying flag in wdc_wait_for_status, since there is atTheo de Raadt
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
2011-05-25wdc.c doesn't use NATAPISCSI, so no point in including atapiscsi.h.Matthew Dempsky
It's the last file referencing atapiscsi.h too, so might as well get rid of the need-flags in files.atapiscsi.
2011-05-24Move wdc_cd from ata/ata_wdc.c to ic/wdc.c so that you can compile aMatthew Dempsky
kernel without the former. Also, eliminate two dead stores in wdcattach(). ok dlg@
2011-05-09Refactor queue allocation and initialization into a wdc_alloc_queue()Matthew Dempsky
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@
2011-05-09Initialize the wdc ata_drive_datas structs earlier in wdcattach() soMatthew Dempsky
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@
2011-05-08Eliminate a few unused wdc capability flags (WDC_CAPABILITY_HWLOCK,Matthew Dempsky
WDC_CAPABILITY_ATA_NOSTREAM, and WDC_CAPABILITY_ATAPI_NOSTREAM). ok dlg@, jsg@, krw@
2011-04-18keep an eye out for wdc registers returning 0xff. if they return 0xff,Theo de Raadt
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
2011-04-15Change wdc_reset_channel() to take a `no wait' argument. Pass in turn thisMiod Vallat
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@
2011-04-05wd_hibernate_io() is a standalone disk io writer which tries to notTheo de Raadt
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
2011-04-05Deep below wdc_ioc_ata_cmd() it is possible that some controller (present orTheo de Raadt
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
2010-09-21Get rid of physio(9) in wdc(4)'s ioctl(2) handler. Based on similarMatthew Dempsky
changes to the SCSI subsystem ioctl(2) handlers. ok dlg@; ok and tweaks krw@; no objections jsg@
2010-08-29pcmcia/wdc_pcmcia.cTheo de Raadt
2010-07-23Manuel Bouyer rescinded clauses 3 and 4 of his license text.Jonathan Gray
2010-07-22ansi. no binary changeJonathan Gray
2009-11-23little annoying knfTheo de Raadt
2009-11-22Probe modes for SATA disks, makes CF behind SATA work and givesJonathan Gray
more speed to things like SSDs that do UDMA 6. Tested by many.
2009-10-13Get rid of devact enum, substitute it with an int and coresponding defines.Paul Irofti
This is needed for the addition of further suspend/resume actions. Okay deraadt@, marco@.
2009-02-07Unifdef __OpenBSD__, these defines don't help us to sync with NetBSDAlexander Yurchenko
anymore but make reading the code harder. ok sthen@ miod@ krw@
2009-01-21Replace timeout_add(msecs * hz / 1000) with timeout_add_msec(msecs).Alexander Yurchenko
No functional changes. ok krw@ miod@
2008-07-02unify using WDCDEBUG.Federico G. Schwindt
2008-06-30wrap logging code around WDC_DEBUG. shrinks kernel by ~4k.Federico G. Schwindt
jsg@ krw@ miod@ ok.
2008-06-27More removal of clauses 3 and 4 from NetBSD licenses.Ray Lai
OK deraadt@ and millert@
2007-10-01More easy bzero() -> M_ZERO. Use 'p = malloc(sizeof(*p) ...'.Kenneth R Westerback
2007-05-08wdcrestart() is never usedTheo de Raadt
2007-05-08atapi_print() is never usedTheo de Raadt
2007-04-16During the drives detection only check the status register to be notAlexander Yurchenko
0xff, this will allow to detect some certain microdrives plugged into soekris. Patch from Jochen <jochen@penguin-breeder.org> via PR 5340.
2006-05-22In wdcprobe(), directly invoke wdc_do_reset() instead of using the resetMiod Vallat
reset function pointer, as this can cause a NULL pointer dereference on some systems.
2006-05-08Revert last commit till a better method can be found.Jonathan Gray
At least one system (Ben Lovett's) had issues with the change.
2006-05-07Default to Ultra DMA Mode 6 not 5 when we know we have a nativeJonathan Gray
SATA drive. ok grange@
2006-05-03Provide a function pointer that allows for the wdc resetJonathan Gray
method to be changed as required. This will be required for dealing with several chips in pciide.
2006-02-10Fix LBA48 access for ServerWorks SATA.Mark Kettenis
ok grange@
2005-11-09Don't fall back to fake geometry if ata_get_params() fails.Uwe Stuehler
"looks sane" grange@; tested by niall@ krw@ jmc@ jolan@
2005-10-21Zap return at the end of a void function. No binary change.Alexander Yurchenko
2004-10-17Add a callback drv_probe() to allow underlying ata controller driverAlexander Yurchenko
to probe for drives in its own way. It's a no-op for now but will be needed for native sata support.
2004-10-17Move declaration of default _vtbl members (wdc_default_*) toAlexander Yurchenko
wdcvar.h.
2004-09-15Better debug printfs: missing \n and show xfer flags inAlexander Yurchenko
wdc_exec_xfer().
2004-02-19wdc logs fixes from costa@:Alexander Yurchenko
1) wdc_get_log is at splbio() to prevent interrupt handlers from updating the log 2) work hard to ensure that wdc_tail and wdc_head are between 0 and wdc_log_cap, even if wdc_log or wdc_get_log is run concurrently against itself. With this patch, running concurrent wdc_log's may corrupt the log, but it should not cause any panics. 3) Make sure the buffer always starts on a record boundary. Otherwise said, wdc_tail should always be on a record boundary.
2004-01-23Use %b to display status register, this will make bug reports moreAlexander Yurchenko
informative. Also convert WDCS_BITS string to caps.
2003-12-16Pass gcc -Wsign-compare; ok grange@Todd C. Miller
2003-11-19Sync with NetBSD probe code: deal with non-pullups ide bus whenAlexander Yurchenko
testing status register and a better comments on probe logic. Tested on i386, sparc64 and macppc by me, jmc@, matthieu@, sturm@ and drahn@. ok costa@
2003-11-17Various cleanups, knf, better debug messages.Alexander Yurchenko
2003-11-17Don't wait for DRQ after issuing IDENTIFY command; instead check for DRQAlexander Yurchenko
asserted after BSY is cleared in data read codepath. Solves delays in probe. The first version of this diff was done by costa@ a long time ago but had some issues. This one is a partial sync with NetBSD. ok costa@
2003-11-13One byte can't hold a value > 255.Alexander Yurchenko
Spotted by Mr. GCC3.
2003-11-05Back wdc reset change, now in more careful variant.Alexander Yurchenko
Tested on matthieu's U5.
2003-10-31Back all the changes except the wdc reset part, this will come later.Alexander Yurchenko
Tested on matthieu's U5.
2003-10-29Revert to 1.70 for now which is the last working version on my u5.Matthieu Herrb
ok deraadt@
2003-10-27Skip ATA modes detection for SATA drives, it's useless and someAlexander Yurchenko
SATA drives really don't like it. Add a delay between drive reset and issuing IDENTIFY command, some drives need it (from NetBSD). This fixes problems with SATA drives reported by Jonathon Fletcher <jonathon.fletcher@pobox.com>. He also provided access to the test machine.
2003-10-26Print error registers values in debug message after reset too.Alexander Yurchenko
2003-10-26Device reset improvements:Alexander Yurchenko
- put the reset protocol itself in the separate function __wdcdo_reset() so we don't need anymore to keep in sync two reset code paths; - change the reset protocol to something like FreeBSD and NetBSD do, this fixes slave ATA drive detect with weird ATAPI master (reported by fgsch@); Discussed with costa@. Tested by me, fgsch@, millert@, canacar@.
2003-10-21typos from Tom Cosgrove;Jason McIntyre
Tom: I did not commit a couple of your changes. i did not include some punctuation fixes (full stops, etc.) mnemorable -> mnemonic: i decided memorable was probably better instrunctions -> instruction: i kept the plural