Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d7fbee050753e153622b5d41bc8bd1cb19cda9b9
Commit:     d7fbee050753e153622b5d41bc8bd1cb19cda9b9
Parent:     3f19859ee95a38c066a0420eb8a30c76ecd67a42
Author:     Tejun Heo <[EMAIL PROTECTED]>
AuthorDate: Sun Sep 2 23:24:48 2007 +0900
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Fri Oct 12 14:55:39 2007 -0400

    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 <[EMAIL PROTECTED]>
    Acked-by: Alan Cox <[EMAIL PROTECTED]>
    Cc: Edward Amsden <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 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 ea8c07b..2116f27 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,
        /* determine if device is ATA or ATAPI */
        class = ata_dev_classify(&tf);
 
-       if (class == ATA_DEV_UNKNOWN)
-               return ATA_DEV_NONE;
-       if ((class == ATA_DEV_ATA) && (ata_chk_status(ap) == 0))
-               return ATA_DEV_NONE;
+       if (class == ATA_DEV_UNKNOWN) {
+               /* If the device failed diagnostic, it's likely to
+                * have reported incorrect device signature too.
+                * Assume ATA device if the device seems present but
+                * device signature is invalid with diagnostic
+                * failure.
+                */
+               if (present && (dev->horkage & ATA_HORKAGE_DIAGNOSTIC))
+                       class = ATA_DEV_ATA;
+               else
+                       class = ATA_DEV_NONE;
+       } else if ((class == ATA_DEV_ATA) && (ata_chk_status(ap) == 0))
+               class = ATA_DEV_NONE;
+
        return class;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to