lkml.org 
[lkml]   [2003]   [May]   [4]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] Workaround bogus CF cards
FromBenjamin Herrenschmidt <>
Date04 May 2003 12:14:37 +0200
Hi !

I had a problem with an "APACER" Compact Flash card. It seems that
beast is allergic to WIN_READ_NATIVE_MAX.

I hacked this workaround that appear to work fine

--- a/drivers/ide/ide-disk.c	Sun May  4 12:11:52 2003
+++ b/drivers/ide/ide-disk.c	Sun May  4 12:11:52 2003
@@ -1160,12 +1160,16 @@
 {
 	struct hd_driveid *id = drive->id;
 	unsigned long capacity = drive->cyl * drive->head * drive->sect;
-	unsigned long set_max = idedisk_read_native_max_address(drive);
+	unsigned long set_max = 0;
 	unsigned long long capacity_2 = capacity;
 	unsigned long long set_max_ext;
 
 	drive->capacity48 = 0;
 	drive->select.b.lba = 0;
+
+	/* That stupid compact flash doesn't like the command */
+	if (strncmp(drive->id->model, "APACER_CF_", 10) != 0)
+		set_max = idedisk_read_native_max_address(drive);
 
 	(void) idedisk_supports_host_protected_area(drive);
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:35    [from the cache]
©2003-2008