Home Home > GIT Browse > openSUSE-12.1
summaryrefslogtreecommitdiff
blob: 795425fa0b18800ebf5368c51862986a577af2fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From: Tejun Heo <teheo@suse.de>
Subject: [PATCH] libata: fix ata_set_max_sectors()
References: 325552
Patch-Mainline: will be submitted after verified

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 <teheo@suse.de>
---
 drivers/ata/libata-core.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: linux-2.6.22/drivers/ata/libata-core.c
===================================================================
--- linux-2.6.22.orig/drivers/ata/libata-core.c
+++ linux-2.6.22/drivers/ata/libata-core.c
@@ -975,9 +975,12 @@ static int ata_set_max_sectors(struct at
 		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;