diff options
author | Tejun Heo <htejun@gmail.com> | 2007-09-02 10:24:48 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-10-12 14:55:39 -0400 |
commit | d7fbee050753e153622b5d41bc8bd1cb19cda9b9 (patch) | |
tree | 962b543b95bdea7e2b6f9393b64250396640a616 /drivers/ata | |
parent | 3f19859ee95a38c066a0420eb8a30c76ecd67a42 (diff) |
libata: assume ATA_DEV_ATA on diagnostic failure
Certain device which reports diagnostic failure also reports invalid
device signature. Assume ATA_DEV_ATA on diagnostic failure if reset
indicates device presence.
This is fix for bugzilla bug 8784.
http://bugzilla.kernel.org/show_bug.cgi?id=8784
Signed-off-by: Tejun Heo <htejun@gmail.com>
Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Edward Amsden <amsden_linux@earthlink.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/libata-core.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index ea8c07b04f29..2116f2794580 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -751,10 +751,20 @@ unsigned int ata_dev_try_classify(struct ata_device *dev, int present, | |||
751 | /* determine if device is ATA or ATAPI */ | 751 | /* determine if device is ATA or ATAPI */ |
752 | class = ata_dev_classify(&tf); | 752 | class = ata_dev_classify(&tf); |
753 | 753 | ||
754 | if (class == ATA_DEV_UNKNOWN) | 754 | if (class == ATA_DEV_UNKNOWN) { |
755 | return ATA_DEV_NONE; | 755 | /* If the device failed diagnostic, it's likely to |
756 | if ((class == ATA_DEV_ATA) && (ata_chk_status(ap) == 0)) | 756 | * have reported incorrect device signature too. |
757 | return ATA_DEV_NONE; | 757 | * Assume ATA device if the device seems present but |
758 | * device signature is invalid with diagnostic | ||
759 | * failure. | ||
760 | */ | ||
761 | if (present && (dev->horkage & ATA_HORKAGE_DIAGNOSTIC)) | ||
762 | class = ATA_DEV_ATA; | ||
763 | else | ||
764 | class = ATA_DEV_NONE; | ||
765 | } else if ((class == ATA_DEV_ATA) && (ata_chk_status(ap) == 0)) | ||
766 | class = ATA_DEV_NONE; | ||
767 | |||
758 | return class; | 768 | return class; |
759 | } | 769 | } |
760 | 770 | ||