Commit Graph

18 Commits

Author SHA1 Message Date
mycroft f9d629fb93 Fix more probe delay and/or failure problems:
1) Don't wait for DRQ on an IDENTIFY command -- if it's not set when we see
   BSY clear, abort the command and ignore the drive.  (Do this by testing
   for DRQ in the read/write cases in __wdccommand_intr().)
2) Don't wait for DRQ to deassert when we finish an IDENTIFY (or any other
   non-block command that reads data) -- we don't do this for block I/O, and
   empirically it doesn't clear on my CF cards at all, causing a pointless 1s
   delay.
3) Add comments to some of the delay()s, and add missing ones in wdcreset()
   and the WDCC_RECAL in the so-called "pre-ATA" probe.
4) Slightly simplify the reset sequence -- we were doing an extra I/O.
5) Modify the register writability test to make sure that registers are not
   overlapped -- this can happen in some weird cases with a missing device 1.
6) Check the error register value after the reset -- if it's not 01h or 81h,
   as appropriate (see ATA spec), punt.
Tested with a number of ATA-only, ATAPI-only, mixed ATA-ATAPI, CF, and IDE
disk configurations.

Also remove the SINGLE_DRIVE nonsense again.
2003-09-23 09:19:22 +00:00
bouyer a1f27a3f79 Bump WDCC_IDENTIFY timeout to 3 seconds, as required by some drives.
Reported by Karl Janmar <karlj@mdstud.chalmers.se> on tech-kern.
2003-01-27 21:27:52 +00:00
bouyer 10b49b13b9 In wdc_exec_command(), for data commands, read the status register after
the data transfer. This is mandatory for data out commands (although none are
used for now), and not forbiddend for data in commands. Also record if we
did transfers any data.
May solve kern/16159 by making the probe more robust in face of fake identify.
2002-04-09 21:17:53 +00:00
bouyer bfc80822c7 Update my copyrigth. 2001-12-03 00:20:22 +00:00
bouyer 4ca5497111 Allow wd to attach to something else than wdc/pciide (like USB<->ATA bridges):
- move some functions from ata.c to ata_wdc.c or wdc.c.
- add callbacks to struct ata_bustype so that wd.c doesn't call directly
  functions from the lower level driver.
2001-12-03 00:11:15 +00:00
lukem f61cbe7489 add RCSID 2001-11-13 12:51:12 +00:00
bouyer 2b86c61a31 - sync my copyrigth
- Add usefull message for obsolete error code (part of fix for kern/9856).
2000-05-15 08:31:33 +00:00
enami b1f85ee905 Don't put leading space, otherwise diskerr() prints unnecessary space
like this:
wd0h:  aborted command reading fsbn 650256 of 650256-650271 (wd0 bn 839056; cn 888 tn 13 sn 17), retrying
2000-01-25 09:33:12 +00:00
bouyer 638e1a6958 Improve the downgrade logic:
- If UDMA 2 is failing try UDMA 1 first, it helps in some cases
- downgrade if we get an error in the first 4000 xfers, or if we get
  4 errors in 4000 xfers if the first 4000 went without troubles.

While I'm there commit a local change I have since some time to get my CD
probed: issue a "blanck" IDENTIFY before the one used to detect slave ghosts,
with my drive the first IDENTIFY following a controller reset fails with an
aborted command ...
2000-01-17 00:01:00 +00:00
bouyer 8f56b89950 More WDCDEBUG_PRINT. 1999-11-26 12:39:43 +00:00
bouyer 94d00cdb29 Bump timeout to 10s only for ATAPI devices, 1s is fine for IDE drives once
they are ready.
1999-04-15 09:41:09 +00:00
jonathan 380d12dfbd Complete bugfix in rev 1.3: increase read-parameter-block timeout to 10s
(as used for the hardware for which rev 1.3 was made.)
1999-04-14 22:23:15 +00:00
bouyer a6365676fa Add a new disk flag: DRIVE_OLD for pre-ATA disks. probe routine will now set
DRIVE_OLD, DRIVE_ATA or DRIVE_ATAPI based on register signatures.
The attach routine will issue a IDENTIFY command for ATA/ATAPI disk,
to detect flase matches by the probe routine.
probe/attach should now be fully compliant with ata-4/ata-5. As a side
effect, ATAPI drives which improperly use ATA register signatures should now
be attached as ATAPI.
1999-03-10 13:11:43 +00:00
hubertf ed418e30a2 Only define WDCDEBUG if not already define (e.g. by kernel option) 1999-02-21 00:52:04 +00:00
bouyer 1e0e78854a There's no ATA draft where it is required for the drive to set DRDY | DSC when
the disk is ready to transfer data, and in ATA-5 the DSC has been obsoleted.
So only wait for DRQ to transfer data. This can be made conditional on the
ATA version if it's proven to break with some drives (worked with all the
drives I have access to).
While I'm there correct a few typos.
1999-02-08 15:22:28 +00:00
bouyer a1471db64a move wd.c:print_wderror() to ata.c:ata_perror().
In wdc_probe_caps() add code to guess the ATA revision supported (if
ATA4 if Ultra-DMA, ATA2 if PIO mode > 2). We can't rely on param.atap_ata_major
here, at last one Ultra-DMA drive claims to support only ATA-3.
Use the ATA version in ata_perror(), and to try a flush cache command
in a shutdown hook for IDE drives.
1999-01-18 20:06:24 +00:00
bouyer d74652866f For ATAPI IDENTiFY, poll only for DRQ, some devices don't assert DRDY at this
point.
1998-11-16 11:25:41 +00:00
bouyer 19fddaeeb5 Merge bouyer-ide 1998-10-12 16:09:10 +00:00