diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2006-03-22 10:52:40 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-03-22 19:55:40 -0500 |
commit | 09c7ad79dc62c499bb03d1ee92f838db2fc776c5 (patch) | |
tree | 70a17d139824c671f898c2cda7babeb1c7860636 | |
parent | 7c74ffd072fbe44b6039223982f2dc76840ac4f5 (diff) |
[PATCH] libata: Fix a drive detection problem
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>
-rw-r--r-- | drivers/scsi/libata-core.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 5d00bb721e23..477afb4a9255 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -2001,9 +2001,19 @@ static unsigned int ata_bus_softreset(struct ata_port *ap, | |||
2001 | * status is checked. Because waiting for "a while" before | 2001 | * status is checked. Because waiting for "a while" before |
2002 | * checking status is fine, post SRST, we perform this magic | 2002 | * checking status is fine, post SRST, we perform this magic |
2003 | * delay here as well. | 2003 | * delay here as well. |
2004 | * | ||
2005 | * Old drivers/ide uses the 2mS rule and then waits for ready | ||
2004 | */ | 2006 | */ |
2005 | msleep(150); | 2007 | msleep(150); |
2006 | 2008 | ||
2009 | |||
2010 | /* Before we perform post reset processing we want to see if | ||
2011 | the bus shows 0xFF because the odd clown forgets the D7 pulldown | ||
2012 | resistor */ | ||
2013 | |||
2014 | if (ata_check_status(ap) == 0xFF) | ||
2015 | return 1; /* Positive is failure for some reason */ | ||
2016 | |||
2007 | ata_bus_post_reset(ap, devmask); | 2017 | ata_bus_post_reset(ap, devmask); |
2008 | 2018 | ||
2009 | return 0; | 2019 | return 0; |