]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ata: fix wrong WARN_ON_ONCE
authorChristian Borntraeger <borntraeger@de.ibm.com>
Tue, 13 Jan 2009 09:38:36 +0000 (10:38 +0100)
committerJeff Garzik <jgarzik@redhat.com>
Tue, 13 Jan 2009 15:34:59 +0000 (10:34 -0500)
This patch fixes a wrong WARN_ON that was triggered by 32bit PIO support:
WARNING: at drivers/ata/libata-sff.c:1017 ata_sff_hsm_move+0x45e/0x750()

__atapi_pio_bytes simply doesnt know enough to decide if there is a bug.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/libata-sff.c

index 0eae9b4535564ce8a64be5428faf9382683cf985..5a4aad123c4259236677470a202f0d46ca279766 100644 (file)
@@ -1013,9 +1013,12 @@ next_sg:
                qc->cursg_ofs = 0;
        }
 
-       /* consumed can be larger than count only for the last transfer */
-       WARN_ON_ONCE(qc->cursg && count != consumed);
-
+       /*
+        * There used to be a  WARN_ON_ONCE(qc->cursg && count != consumed);
+        * Unfortunately __atapi_pio_bytes doesn't know enough to do the WARN
+        * check correctly as it doesn't know if it is the last request being
+        * made. Somebody should implement a proper sanity check.
+        */
        if (bytes)
                goto next_sg;
        return 0;