]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 15 Nov 2008 19:33:05 +0000 (11:33 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 15 Nov 2008 19:33:05 +0000 (11:33 -0800)
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  libata: improve phantom device detection

drivers/ata/libata-sff.c

index 4b47394863279606dc7427d79789bdc8c8485d99..9033d164c4ece13f876777fd7fbb549e4c27456b 100644 (file)
@@ -1227,10 +1227,19 @@ fsm_start:
                        /* ATA PIO protocol */
                        if (unlikely((status & ATA_DRQ) == 0)) {
                                /* handle BSY=0, DRQ=0 as error */
-                               if (likely(status & (ATA_ERR | ATA_DF)))
+                               if (likely(status & (ATA_ERR | ATA_DF))) {
                                        /* device stops HSM for abort/error */
                                        qc->err_mask |= AC_ERR_DEV;
-                               else {
+
+                                       /* If diagnostic failed and this is
+                                        * IDENTIFY, it's likely a phantom
+                                        * device.  Mark hint.
+                                        */
+                                       if (qc->dev->horkage &
+                                           ATA_HORKAGE_DIAGNOSTIC)
+                                               qc->err_mask |=
+                                                       AC_ERR_NODEV_HINT;
+                               } else {
                                        /* HSM violation. Let EH handle this.
                                         * Phantom devices also trigger this
                                         * condition.  Mark hint.