Re: ST310211A and HPA ( was Re: Bug#401035: linux-image-2.6-686 - another misbehaving Seagate )

2008-02-08 Thread Mikko Rapeli
On Thu, Feb 07, 2008 at 10:13:42PM +0100, Bart Champagne wrote:
 Backporting the fix for 2.6.23 to the Debian 2.6.18 kernel hasn't 
 succeeded yet, my C has gone very rusty it seems.
 In attachment a dmesg log for this drive. When/if I get a working 
 patch I'll let you know.

I think this should work for 2.6.18 (2.6.18.dfsg.1-17etch1) in Debian 
(I backported the patches once before). I don't have my buggy hardware 
to test with me now, but this should work. Fetch the latest
linux-source-2.6.18 package, extract the tar ball from
/usr/src/linux-source*, apply the patch and test :)

Backported HPA fix git commits b0244a00451c1ad64bf0a51f50679f7146786780 
and 7062cdc5edb3ba4b2eb906684cd19e103de1f920 to Debian's 2.6.18. 
Added ST310211A as reported by Bart Champagne.

diff -ru linux-source-2.6.18/drivers/ide/ide-disk.c 
linux-source-2.6.18-idehpa/drivers/ide/ide-disk.c
--- linux-source-2.6.18/drivers/ide/ide-disk.c  2006-09-20 06:42:06.0 
+0300
+++ linux-source-2.6.18-idehpa/drivers/ide/ide-disk.c   2008-02-08 
12:11:30.0 +0200
@@ -482,6 +482,17 @@
id-lba_capacity_2;
 }
 
+/*
+ * Some disks report total number of sectors instead of
+ * maximum sector address.  We list them here.
+ */
+static const struct drive_list_entry hpa_list[] = {
+   { ST340823A,  ALL },
+   { ST320413A,  ALL },
+   { ST310211A,  ALL },
+   { NULL, NULL }
+};
+
 static void idedisk_check_hpa(ide_drive_t *drive)
 {
unsigned long long capacity, set_max;
@@ -493,6 +504,15 @@
else
set_max = idedisk_read_native_max_address(drive);
 
+   if (ide_in_drive_list(drive-id, hpa_list)) {
+   /*
+* Since we are inclusive wrt to firmware revisions do this
+* extra check and apply the workaround only when needed.
+*/
+   if (set_max == capacity + 1)
+   set_max--;
+   }
+
if (set_max = capacity)
return;
 
diff -ru linux-source-2.6.18/drivers/ide/ide-iops.c 
linux-source-2.6.18-idehpa/drivers/ide/ide-iops.c
--- linux-source-2.6.18/drivers/ide/ide-iops.c  2006-09-20 06:42:06.0 
+0300
+++ linux-source-2.6.18-idehpa/drivers/ide/ide-iops.c   2008-02-08 
10:54:15.0 +0200
@@ -589,6 +589,8 @@
 
 EXPORT_SYMBOL(ide_wait_stat);
 
+EXPORT_SYMBOL_GPL(ide_in_drive_list);
+
 /*
  *  All hosts that use the 80c ribbon must use!
  *  The name is derived from upper byte of word 93 and the 80c ribbon.
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ST310211A and HPA ( was Re: Bug#401035: linux-image-2.6-686 - another misbehaving Seagate )

2008-02-06 Thread Mikko Rapeli
(cc'ing linux-ide)

On Mon, Feb 04, 2008 at 02:32:59AM +0100, Bart Champagne wrote:
 Just found another type of Seagate drives that shows this behaviour : 
 ST310211A
 Can this one be blacklisted as well ?

Yes, do you have a patch? And a dmesg dump of the drive in use with and 
without a patch?

If you do, please send them to upstream linux-ide@vger.kernel.org and hope
that the fix gets applied to Debian kernels too. Also, please test the
sata/pata driver with your drive and add a blacklist there too.

If you don't have a patch, here's one for 2.6.24 to go.

From 4a8b40c53d2e539bad3f93996f599d69a16af94b Mon Sep 17 00:00:00 2001
From: Mikko Rapeli [EMAIL PROTECTED]
Date: Wed, 6 Feb 2008 09:41:14 +0200
Subject: [PATCH] ST310211A has buggy HPA too.

Signed-off-by: Mikko Rapeli [EMAIL PROTECTED]
---
 drivers/ata/libata-core.c |1 +
 drivers/ide/ide-disk.c|1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 6380726..d08f869 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4169,6 +4169,7 @@ static const struct ata_blacklist_entry 
ata_device_blacklist [] = {
/* Devices which report 1 sector over size HPA */
{ ST340823A,  NULL,   ATA_HORKAGE_HPA_SIZE, },
{ ST320413A,  NULL,   ATA_HORKAGE_HPA_SIZE, },
+   { ST310211A,  NULL,   ATA_HORKAGE_HPA_SIZE, },
 
/* Devices which get the IVB wrong */
{ QUANTUM FIREBALLlct10 05, A03.0900, ATA_HORKAGE_IVB, },
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index b178190..a0f9940 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -462,6 +462,7 @@ static inline int idedisk_supports_lba48(const struct 
hd_driveid *id)
 static const struct drive_list_entry hpa_list[] = {
{ ST340823A,  NULL },
{ ST320413A,  NULL },
+   { ST310211A,  NULL },
{ NULL, NULL }
 };
 
-- 
1.4.4.4

-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html