]> err.no Git - linux-2.6/commitdiff
[PATCH] libata: Fix HPA handling regression
authorAlan Cox <alan@redhat.com>
Sat, 29 Sep 2007 08:06:48 +0000 (04:06 -0400)
committerJeff Garzik <jeff@garzik.org>
Fri, 12 Oct 2007 18:55:43 +0000 (14:55 -0400)
Restore the support for handling drives that report one sector too many
(ie SCSI not ATA style). This worked before the HPA update but was
removed in that process.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/ata/libata-core.c
include/linux/libata.h

index d2880b013c88391cc609b1f8b5cf9ee597230f73..eb9709864a21abd009c23fa81fc52ed5bccb0618 100644 (file)
@@ -915,7 +915,8 @@ static int ata_read_native_max_address(struct ata_device *dev, u64 *max_sectors)
                *max_sectors = ata_tf_to_lba48(&tf);
        else
                *max_sectors = ata_tf_to_lba(&tf);
-
+        if (dev->horkage & ATA_HORKAGE_HPA_SIZE)
+               (*max_sectors)--;
        return 0;
 }
 
@@ -3905,6 +3906,10 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
        { "WDC WD2500JD-00HBB0", "WD-WMAL71490727", ATA_HORKAGE_BROKEN_HPA },
        { "MAXTOR 6L080L4",     "A93.0500",     ATA_HORKAGE_BROKEN_HPA },
 
+       /* Devices which report 1 sector over size HPA */
+       { "ST340823A",          NULL,           ATA_HORKAGE_HPA_SIZE, },
+       { "ST320413A",          NULL,           ATA_HORKAGE_HPA_SIZE, },
+
        /* End Marker */
        { }
 };
index cd9c2a28136a407dfe77ecce0967141954c96151..f9ed198e4fcda383b380c002bf721aee2c059667 100644 (file)
@@ -330,6 +330,7 @@ enum {
        ATA_HORKAGE_MAX_SEC_128 = (1 << 3),     /* Limit max sects to 128 */
        ATA_HORKAGE_BROKEN_HPA  = (1 << 4),     /* Broken HPA */
        ATA_HORKAGE_SKIP_PM     = (1 << 5),     /* Skip PM operations */
+       ATA_HORKAGE_HPA_SIZE    = (1 << 6),     /* native size off by one */
 };
 
 enum hsm_task_states {