Re: dmapool (was: Re: Linux 2.6.3-rc2)

From: Roman Zippel
Date: Fri Feb 13 2004 - 16:31:56 EST


Hi,

On Tue, 10 Feb 2004, Greg KH wrote:

> How about dropping this into your arch if you can't use the
> include/asm-generic/dma-mapping.h file. Or I can add it as
> include/asm-generic/dma-mapping-broken.h and you can repoint your arch
> to use it. Which would be easier for you?

I don't think adding a dma-mapping-broken.h is correct either.
Some m68k scsi drivers are still badly broken, because they use some
archaic API and need an update to something sane.
I think the problem is that DMA-API.txt suggest there is separate API for
coherent/noncoherent (especially dma_alloc_coherent()/
dma_alloc_noncoherent()). DMA-mapping.txt is better here as it
distinguishes between consistent and streaming mappings.
m68k needs something similiar as arm, consistent allocations are mapped
noncachable into the kernel and dma_map* does the necessary cache flushes.
With that you would already get very far and would do the right thing for
most noncoherent archs. This would only would only leave us with some
special cases which had to be fixed to make a driver coherency aware.
So I would suggest to drop e.g. dma_alloc_noncoherent() (parisc seems to
be the only user and it's simply a kmalloc) and merge the rest of
DMA-API.txt with DMA-mapping.txt or make at least consistent with it and
maybe add a bit more information what the functions do in the coherent/
noncoherent case.

bye, Roman
-
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/