Ok this is a different approach to handling it - knowing it is an off by one so we can handle the drive if clipped Signed-off-by: Alan Cox <alan@xxxxxxxxxx> diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.23rc1-mm1/drivers/ata/libata-core.c linux-2.6.23rc1-mm1/drivers/ata/libata-core.c --- linux.vanilla-2.6.23rc1-mm1/drivers/ata/libata-core.c 2007-07-26 15:02:57.000000000 +0100 +++ linux-2.6.23rc1-mm1/drivers/ata/libata-core.c 2007-08-08 13:38:39.257549616 +0100 @@ -988,6 +992,10 @@ else hpa_sectors = ata_read_native_max_address(dev); + /* Reports one sector too many */ + if (hpa_sectors && (dev->horkage & ATA_HORKAGE_HPA_SIZE)) + hpa_sectors--; + if (hpa_sectors > sectors) { ata_dev_printk(dev, KERN_INFO, "Host Protected Area detected:\n" @@ -3858,6 +3926,9 @@ /* Devices with NCQ limits */ + /* Devices which report 1 sector over size HPA */ + { "ST340823A", NULL, ATA_HORKAGE_HPA_SIZE, }, + /* End Marker */ { } }; diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.23rc1-mm1/include/linux/libata.h linux-2.6.23rc1-mm1/include/linux/libata.h --- linux.vanilla-2.6.23rc1-mm1/include/linux/libata.h 2007-07-26 15:02:58.000000000 +0100 +++ linux-2.6.23rc1-mm1/include/linux/libata.h 2007-08-08 13:38:09.000000000 +0100 @@ -314,6 +314,7 @@ ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */ ATA_HORKAGE_MAX_SEC_128 = (1 << 3), /* Limit max sects to 128 */ ATA_HORKAGE_ALPM = (1 << 4), /* ALPM problems */ + ATA_HORKAGE_HPA_SIZE = (1 << 5), /* Reports native size off by one */ }; enum hsm_task_states { - To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html