linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Workaround bogus CF cards
@ 2003-05-04 10:14 Benjamin Herrenschmidt
  2003-05-04 16:08 ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2003-05-04 10:14 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: Alan Cox, linux-kernel mailing list

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);
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Workaround bogus CF cards
  2003-05-04 10:14 [PATCH] Workaround bogus CF cards Benjamin Herrenschmidt
@ 2003-05-04 16:08 ` Alan Cox
  2003-05-04 17:10   ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Cox @ 2003-05-04 16:08 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Bartlomiej Zolnierkiewicz, Linux Kernel Mailing List

On Sul, 2003-05-04 at 11:14, Benjamin Herrenschmidt wrote:
> Hi !
> 
> I had a problem with an "APACER" Compact Flash card. It seems that
> beast is allergic to WIN_READ_NATIVE_MAX.

Thats probably a drive->flash check you need looking at the docs I have
I don't see where any CF supports READ_NATIVE_MAX (of course it shouldnt
die either)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Workaround bogus CF cards
  2003-05-04 16:08 ` Alan Cox
@ 2003-05-04 17:10   ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2003-05-04 17:10 UTC (permalink / raw)
  To: Alan Cox; +Cc: Bartlomiej Zolnierkiewicz, Linux Kernel Mailing List

On Sun, 2003-05-04 at 18:08, Alan Cox wrote:
> On Sul, 2003-05-04 at 11:14, Benjamin Herrenschmidt wrote:
> > Hi !
> > 
> > I had a problem with an "APACER" Compact Flash card. It seems that
> > beast is allergic to WIN_READ_NATIVE_MAX.
> 
> Thats probably a drive->flash check you need looking at the docs I have
> I don't see where any CF supports READ_NATIVE_MAX (of course it shouldnt
> die either)

It doesn't really die in fact, I was wrong here, but behaves a bit
strangely. I get an interrupt timeout, and a drive not ready for
command on the next command, that takes several seconds but it _seems_
it recovers.

Still, it's quite bad, so a workaround is welcome.

Ben.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-05-04 18:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-04 10:14 [PATCH] Workaround bogus CF cards Benjamin Herrenschmidt
2003-05-04 16:08 ` Alan Cox
2003-05-04 17:10   ` Benjamin Herrenschmidt

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).