Skip to content

Commit

Permalink
[PATCH] libata: Fix a drive detection problem
Browse files Browse the repository at this point in the history
The current code follows the spec but uses an overlong delay. This would
be great if the hardware did. Several vendors however forget the D7
pulldown. Fortunately 0xFF isnt a sane reset state so we can use it to
skip detection as is done in drivers/ide. (ie this is a tested solution
over a long time)

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Alan Cox authored and Jeff Garzik committed Mar 23, 2006
1 parent 7c74ffd commit 09c7ad7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2001,9 +2001,19 @@ static unsigned int ata_bus_softreset(struct ata_port *ap,
* status is checked. Because waiting for "a while" before
* checking status is fine, post SRST, we perform this magic
* delay here as well.
*
* Old drivers/ide uses the 2mS rule and then waits for ready
*/
msleep(150);


/* Before we perform post reset processing we want to see if
the bus shows 0xFF because the odd clown forgets the D7 pulldown
resistor */

if (ata_check_status(ap) == 0xFF)
return 1; /* Positive is failure for some reason */

ata_bus_post_reset(ap, devmask);

return 0;
Expand Down

0 comments on commit 09c7ad7

Please sign in to comment.