From: Tejun Heo Date: Fri, 21 Sep 2007 11:07:14 +0000 (+0900) Subject: libata: fix ata_set_max_sectors() X-Git-Tag: v2.6.24-rc1~1391^2~44 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e582ba4ef6264dd8cb73250ebff767d0624d684;p=linux-2.6 libata: fix ata_set_max_sectors() In ata_set_max_sectors(), the highest nibble in LBA28 mode was missing. This made drives sized between 8G and 128G with HPA turned on to be resized to under 8G. Fix it. Signed-off-by: Tejun Heo Signed-off-by: Jeff Garzik --- diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 8b08e7bdd2..fd4563daac 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -950,9 +950,12 @@ static int ata_set_max_sectors(struct ata_device *dev, u64 new_sectors) tf.hob_lbal = (new_sectors >> 24) & 0xff; tf.hob_lbam = (new_sectors >> 32) & 0xff; tf.hob_lbah = (new_sectors >> 40) & 0xff; - } else + } else { tf.command = ATA_CMD_SET_MAX; + tf.device |= (new_sectors >> 24) & 0xf; + } + tf.protocol |= ATA_PROT_NODATA; tf.device |= ATA_LBA;