Skip to content

Commit

Permalink
libata: fix ata_set_max_sectors()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Oct 12, 2007
1 parent 7d77b24 commit 1e582ba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 1e582ba

Please sign in to comment.