[PATCH] Workaround bogus CF cards

From: Benjamin Herrenschmidt (benh@kernel.crashing.org)
Date: Sun May 04 2003 - 05:14:37 EST


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/



This archive was generated by hypermail 2b29 : Wed May 07 2003 - 22:00:19 EST