diff options
author | Tejun Heo <htejun@gmail.com> | 2007-09-21 07:07:14 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-10-12 14:55:42 -0400 |
commit | 1e582ba4ef6264dd8cb73250ebff767d0624d684 (patch) | |
tree | 50c904091b297c15b4f9987a9c8a1cc7039f0f97 | |
parent | 7d77b247088fb360aa74bfdd9e19bce1e1987668 (diff) |
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 <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/ata/libata-core.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 8b08e7bdd24d..fd4563daacd1 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) | |||
950 | tf.hob_lbal = (new_sectors >> 24) & 0xff; | 950 | tf.hob_lbal = (new_sectors >> 24) & 0xff; |
951 | tf.hob_lbam = (new_sectors >> 32) & 0xff; | 951 | tf.hob_lbam = (new_sectors >> 32) & 0xff; |
952 | tf.hob_lbah = (new_sectors >> 40) & 0xff; | 952 | tf.hob_lbah = (new_sectors >> 40) & 0xff; |
953 | } else | 953 | } else { |
954 | tf.command = ATA_CMD_SET_MAX; | 954 | tf.command = ATA_CMD_SET_MAX; |
955 | 955 | ||
956 | tf.device |= (new_sectors >> 24) & 0xf; | ||
957 | } | ||
958 | |||
956 | tf.protocol |= ATA_PROT_NODATA; | 959 | tf.protocol |= ATA_PROT_NODATA; |
957 | tf.device |= ATA_LBA; | 960 | tf.device |= ATA_LBA; |
958 | 961 | ||