* [PATCH #upstream] libata: fix ata_set_max_sectors()
@ 2007-09-21 11:07 Tejun Heo
2007-09-26 2:27 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Tejun Heo @ 2007-09-21 11:07 UTC (permalink / raw)
To: Jeff Garzik, linux-ide
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>
---
This one fixes my dumb mistake.
drivers/ata/libata-core.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 2116f27..1056279 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -952,9 +952,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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-09-26 2:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-21 11:07 [PATCH #upstream] libata: fix ata_set_max_sectors() Tejun Heo
2007-09-26 2:27 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).