Re: [patch] 2.3.39: Don't use bounce buffer when not needed (parport)

From: Matthew Wilcox (willy@thepuffingroup.com)
Date: Wed Jan 12 2000 - 18:55:10 EST


On Wed, Jan 12, 2000 at 12:56:27PM +0000, Tim Waugh wrote:
> This patch from Bert De Jonghe avoids a memcpy when it isn't needed.
> Since parport_pc.c is used by several architectures, should this be
> protected with #ifdef __i386__? I'm not sure if architectures like Sparc
> or Alpha have the same DMA limitation.

[...]

> + /* above 16 MB we use a bounce buffer as ISA-DMA is not possible */
> + if ((dma_addr + length) >= 0x1000000L) {
> + maxlen = PAGE_SIZE; /* sizeof(priv->dma_buf) */
> + dma_addr = virt_to_bus((volatile char *) priv->dma_buf);
> + }
> +

You can make this arch-independent by using ISA_DMA_THRESHOLD which is
defined in <asm/scatterlist.h>. This probably isn't a good place to keep
this definition, but it is there.

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



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:21 EST