Re: [PATCH] ide-dma.c, ide.c, ide.h, kernel 2.4.24

From: Bartlomiej Zolnierkiewicz
Date: Fri Jan 23 2004 - 18:42:55 EST



On Friday 23 of January 2004 23:09, Glenn Wurster wrote:
> > > Brief Synopsis:
> > >
> > > IDE initialization on non-DMA controllers causes OOPS during boot
> > > due to dereference of null function pointers.
> >
> > Linus - I am ok with this but for 2.6 Bart needs to look at it I guess
>
> I tried out the 2.6.1 kernel quickly and it did not exhibit the same
> obvious problems oopsing with dma and the ide controller as the latest
> 2.4 kernels (on my hardware at least). It booted up nicely without a
> problem on unmodified source. Whether or not the problem occurs for
> other types of hardware I can't say.

Hi,

[ Sorry for delay. ]

Glenn, your patch hides potential problems - these functions shouldn't be
called if host doesn't support DMA. However there is one place when
->ide_dma_host_off() shouldn't be called unconditionally, here is a patch.
It is not pretty but at least consistent - we check hwif->ide_dma_check
to see if DMA is supported in other places too. Does it fix the problem?

Are you sure that it doesn't happen on 2.6.1? Maybe you've used a bit
different config (ie. compiled without DMA support)?

Cheers,
--bart

--- ide-iops.c.orig 2003-12-06 17:47:27.000000000 +0100
+++ ide-iops.c 2004-01-24 00:17:32.129567576 +0100
@@ -912,7 +912,8 @@
// ide_delay_50ms();

#if defined(CONFIG_BLK_DEV_IDEDMA) && !defined(CONFIG_DMA_NONPCI)
- hwif->ide_dma_host_off(drive);
+ if (hwif->ide_dma_check) /* check if host supports DMA */
+ hwif->ide_dma_host_off(drive);
#endif /* (CONFIG_BLK_DEV_IDEDMA) && !(CONFIG_DMA_NONPCI) */

/*

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/