linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] ide: Allow disabling of UDMA for Compact Flash devices
@ 2006-04-17 23:11 James Ausmus
  2006-04-18  3:21 ` Mark Lord
  2006-04-18 11:14 ` Alan Cox
  0 siblings, 2 replies; 6+ messages in thread
From: James Ausmus @ 2006-04-17 23:11 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-kernel, linux-ide

Some IDE -> Compact Flash media adapters are not capable of supporting
UDMA, which can cause very slow boot times when the CF media itself
reports as capable of UDMA transfer speeds. Create Kconfig option to
turn off the UDMA capability bit when media is identified as Compact
Flash.

Signed-off-by: James Ausmus <james.ausmus@gmail.com>

---

diff -uprN -X linux-2.6.16.5/Documentation/dontdiff
linux-2.6.16.5.orig/drivers/ide/Kconfig
linux-2.6.16.5/drivers/ide/Kconfig
--- linux-2.6.16.5.orig/drivers/ide/Kconfig     2006-04-17
13:37:47.000000000 -0700
+++ linux-2.6.16.5/drivers/ide/Kconfig  2006-04-17 13:43:37.000000000 -0700
@@ -447,6 +447,18 @@ config IDEDMA_ONLYDISK

          Generally say N here.

+config IDE_COMPACT_FLASH_NO_UDMA
+       bool "Disable UDMA for Compact Flash Devices"
+       help
+         This turns off the UDMA capability flag bit for any IDE device
+         that identifies as Compact Flash - This is a workaround for
+         cheap Compact Flash -> IDE adapters that don't support UDMA
+         transfer speeds even if the CF card does.
+
+         Enable this if you are using a Compact Flash card as an IDE
+         device and you see re-occuring 0x41 DMA Timeout errors from
+         your IDE driver.
+
 config BLK_DEV_AEC62XX
        tristate "AEC62XX chipset support"
        help
diff -uprN -X linux-2.6.16.5/Documentation/dontdiff
linux-2.6.16.5.orig/drivers/ide/ide-probe.c
linux-2.6.16.5/drivers/ide/ide-probe.c
--- linux-2.6.16.5.orig/drivers/ide/ide-probe.c 2006-04-17
13:37:48.000000000 -0700
+++ linux-2.6.16.5/drivers/ide/ide-probe.c      2006-04-17
13:44:45.000000000 -0700
@@ -248,6 +248,11 @@ static inline void do_identify (ide_driv
        if ((id->config != 0x848a) && (id->config & (1<<7)))
                drive->removable = 1;

+#if defined(CONFIG_IDE_COMPACT_FLASH_NO_UDMA)
+       if (id->config == 0x848a)
+               id->capability &= ~1;
+#endif
+
        drive->media = ide_disk;
        printk("%s DISK drive\n", (id->config == 0x848a) ? "CFA" : "ATA" );
        QUIRK_LIST(drive);

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

* Re: [PATCH 1/1] ide: Allow disabling of UDMA for Compact Flash devices
  2006-04-17 23:11 [PATCH 1/1] ide: Allow disabling of UDMA for Compact Flash devices James Ausmus
@ 2006-04-18  3:21 ` Mark Lord
  2006-04-18 11:14 ` Alan Cox
  1 sibling, 0 replies; 6+ messages in thread
From: Mark Lord @ 2006-04-18  3:21 UTC (permalink / raw)
  To: James Ausmus; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel, linux-ide

James Ausmus wrote:
>..
> +config IDE_COMPACT_FLASH_NO_UDMA
> +       bool "Disable UDMA for Compact Flash Devices"
> +       help
> +         This turns off the UDMA capability flag bit for any IDE device
> +         that identifies as Compact Flash - This is a workaround for
> +         cheap Compact Flash -> IDE adapters that don't support UDMA
> +         transfer speeds even if the CF card does.

I dunno.  This might be better done as a module/boot option
than as a rebuild-your-kernel configuration choice.

??

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

* Re: [PATCH 1/1] ide: Allow disabling of UDMA for Compact Flash devices
  2006-04-17 23:11 [PATCH 1/1] ide: Allow disabling of UDMA for Compact Flash devices James Ausmus
  2006-04-18  3:21 ` Mark Lord
@ 2006-04-18 11:14 ` Alan Cox
  2006-04-18 11:34   ` Andreas Mohr
  1 sibling, 1 reply; 6+ messages in thread
From: Alan Cox @ 2006-04-18 11:14 UTC (permalink / raw)
  To: James Ausmus; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel, linux-ide

On Llu, 2006-04-17 at 16:11 -0700, James Ausmus wrote:
> Some IDE -> Compact Flash media adapters are not capable of supporting
> UDMA, which can cause very slow boot times when the CF media itself
> reports as capable of UDMA transfer speeds. Create Kconfig option to
> turn off the UDMA capability bit when media is identified as Compact
> Flash.

This would be far better if it was a boot time option than a kernel
configuration or set using sysfs/procfs controls as users will not want
to recompile their kernel in such cases.


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

* Re: [PATCH 1/1] ide: Allow disabling of UDMA for Compact Flash devices
  2006-04-18 11:14 ` Alan Cox
@ 2006-04-18 11:34   ` Andreas Mohr
  2006-04-18 11:52     ` Alan Cox
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Mohr @ 2006-04-18 11:34 UTC (permalink / raw)
  To: Alan Cox; +Cc: James Ausmus, Bartlomiej Zolnierkiewicz, linux-kernel, linux-ide

Hi,

On Tue, Apr 18, 2006 at 12:14:18PM +0100, Alan Cox wrote:
> On Llu, 2006-04-17 at 16:11 -0700, James Ausmus wrote:
> > Some IDE -> Compact Flash media adapters are not capable of supporting
> > UDMA, which can cause very slow boot times when the CF media itself
> > reports as capable of UDMA transfer speeds. Create Kconfig option to
> > turn off the UDMA capability bit when media is identified as Compact
> > Flash.
> 
> This would be far better if it was a boot time option than a kernel
> configuration or set using sysfs/procfs controls as users will not want
> to recompile their kernel in such cases.

Count me in.
However, while this is much better than a compile-time setting, it's still
not fully satisfying since many users won't realize that they're hitting this
problem and thus won't search for and find this obscure boot parameter.
Is there any way at all to get this condition detected automatically?
I think one should try hard to find a way to detect it, if at all possible.

Andreas Mohr

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

* Re: [PATCH 1/1] ide: Allow disabling of UDMA for Compact Flash devices
  2006-04-18 11:34   ` Andreas Mohr
@ 2006-04-18 11:52     ` Alan Cox
  2006-04-18 16:32       ` James Ausmus
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Cox @ 2006-04-18 11:52 UTC (permalink / raw)
  To: Andreas Mohr
  Cc: James Ausmus, Bartlomiej Zolnierkiewicz, linux-kernel, linux-ide

On Maw, 2006-04-18 at 13:34 +0200, Andreas Mohr wrote:
> However, while this is much better than a compile-time setting, it's still
> not fully satisfying since many users won't realize that they're hitting this
> problem and thus won't search for and find this obscure boot parameter.
> Is there any way at all to get this condition detected automatically?

Not that I can think off immediately. The controller and the drive both
report the modes they support. If that is wrong then we either need to
be able to identify the specific device (as libata does with the Palmax
systems) or try it and see (which we indeed do but takes time to error
out).

For PCMCIA CF adapters we are ok because they are ISA bus so PIO 0
cycles are all that are supported. For other controllers it will depend
whether the CF adapter is integrated into a PCI card with unique
subvendor/dev identifiers which can be blacklisted, or a motherboard
with DMI entries that can be used.

If it's just some poorly engineered 'shove a cable in one end and a CF
card the other' device which is therefore not directly detectable I
think you lose.

Alan


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

* Re: [PATCH 1/1] ide: Allow disabling of UDMA for Compact Flash devices
  2006-04-18 11:52     ` Alan Cox
@ 2006-04-18 16:32       ` James Ausmus
  0 siblings, 0 replies; 6+ messages in thread
From: James Ausmus @ 2006-04-18 16:32 UTC (permalink / raw)
  To: Alan Cox; +Cc: Andreas Mohr, Bartlomiej Zolnierkiewicz, linux-kernel, linux-ide

On 4/18/06, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> On Maw, 2006-04-18 at 13:34 +0200, Andreas Mohr wrote:
> > However, while this is much better than a compile-time setting, it's still
> > not fully satisfying since many users won't realize that they're hitting this
> > problem and thus won't search for and find this obscure boot parameter.
> > Is there any way at all to get this condition detected automatically?
>
> Not that I can think off immediately. The controller and the drive both
> report the modes they support. If that is wrong then we either need to
> be able to identify the specific device (as libata does with the Palmax
> systems) or try it and see (which we indeed do but takes time to error
> out).
>
> For PCMCIA CF adapters we are ok because they are ISA bus so PIO 0
> cycles are all that are supported. For other controllers it will depend
> whether the CF adapter is integrated into a PCI card with unique
> subvendor/dev identifiers which can be blacklisted, or a motherboard
> with DMI entries that can be used.
>
> If it's just some poorly engineered 'shove a cable in one end and a CF
> card the other' device which is therefore not directly detectable I
> think you lose.
>

This is exactly the situation that I have with 2 separate "dumb" (just
physical interfaces, essentially - not at all detectable) IDE->CF
adapters - both the IDE controller and the CF media support several
UDMA modes, so the IDE driver throws the CF device into UDMA mode on
bootup. However, as the physical interface between the IDE cable and
the CF socket is poorly engineered, it cannot handle the higher
speeds, causing the timeout errors. For some people, this can just be
fixed with an ide=nodma boot option, but as I also have a (quite
large) rotating media device on the controller, this is not an option,
as, if a fsck is performed on a boot, the boot-up time is upwards of
30 minutes.

I would be happy to look into making this a boot option - but my
project schedule won't allow for the kind of time for me to figure out
how to do that :), so this is just a quick hack that works for my
situation.

-James



> Alan
>
>

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

end of thread, other threads:[~2006-04-18 16:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-17 23:11 [PATCH 1/1] ide: Allow disabling of UDMA for Compact Flash devices James Ausmus
2006-04-18  3:21 ` Mark Lord
2006-04-18 11:14 ` Alan Cox
2006-04-18 11:34   ` Andreas Mohr
2006-04-18 11:52     ` Alan Cox
2006-04-18 16:32       ` James Ausmus

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