Skip to contentSkip to conversation

sata_inic162x: disable LBA48 devices

PATCH Applied Tejun Heo 2 participants 2 messages Jun 29, 2007 – Jul 2, 2007 libata

lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/1 sata_inic162x: disable LBA48 devices

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.

---
 drivers/ata/sata_inic162x.c |    7 +++++++
 1 file changed, 7 insertions(+)
drivers/ata/sata_inic162x.c +7 -0
Index: work/drivers/ata/sata_inic162x.c
===================================================================
@@ -496,6 +496,13 @@ static void inic_dev_config(struct ata_d
 	/* 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)
Applied
#1 lore raw
Quoted 14 lines · Tejun Heo

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.

---
 drivers/ata/sata_inic162x.c |    7 +++++++
 1 file changed, 7 insertions(+)

Index: work/drivers/ata/sata_inic162x.c
===================================================================

drivers/ata/sata_inic162x.c static void inic_dev_config(struct ata_d · line 505

Quoted 10 lines
drivers/ata/sata_inic162x.c +7 -0
@@ -496,6 +496,13 @@ static void inic_dev_config(struct ata_d
 	/* 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);
+	}

applied