sata_inic162x: disable LBA48 devices
authorTejun Heo <htejun@gmail.com>
Fri, 29 Jun 2007 02:33:08 +0000 (11:33 +0900)
committerJeff Garzik <jeff@garzik.org>
Mon, 2 Jul 2007 14:12:34 +0000 (10:12 -0400)
sata_inic162x can't do LBA48 properly yet and is likely to corrupt
data on drives larger than LBA28 limit.  Disable LBA48 devices during
device configuration.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/ata/sata_inic162x.c

index 2d80c9d95e9572fe6c4d3ba9ade3a9e735e05212..dc3bbce046766b871b2b7ad581d6efc2530d34d9 100644 (file)
@@ -496,6 +496,13 @@ static void inic_dev_config(struct ata_device *dev)
        /* inic can only handle upto LBA28 max sectors */
        if (dev->max_sectors > ATA_MAX_SECTORS)
                dev->max_sectors = ATA_MAX_SECTORS;
+
+       if (dev->n_sectors >= 1 << 28) {
+               ata_dev_printk(dev, KERN_ERR,
+       "ERROR: This driver doesn't support LBA48 yet and may cause\n"
+       "                data corruption on such devices.  Disabling.\n");
+               ata_dev_disable(dev);
+       }
 }
 
 static void init_port(struct ata_port *ap)