On Tue, Feb 01, 2000 at 11:35:03PM -0800, Leo Dagum wrote:
> Proposal
> --------
> The issues above could be addressed fairly easily. First of all, there's
> no need for pci_alloc_consistent() to allocate the memory. Instead let
> the driver allocate the memory.
The Sparc people won't like the driver doing allocations itself, neither
would I when considering the various other MIPS DMA implementations.
If you only want to separate the allocaton of memory from the
pci_alloc_consistent() but still do the actual allocations in the layer of
pci_*(), no problem with that. We just want to keep the actual allocation
outside of the drivers. Look at the drivers that have been hacked to
work on MIPS machines and you'll see why ...
The interface tries to hide issues like cache coherency outside the driver.
These matter when allocating matter just like obfuscating things like cache
line size etc., from which pool DMA memory gets allocated etc. We don't
want driver writers to deal with these; most of them don't have the
slightest clue of what these terms mean, believe me :-(
As for flags, getting PCIIO_DMA_{CMD,DATA} would be useful as without hints
like that we will not be able to use prefetching and write gathhering on the
Origin. Another flag that DaveM and Co. already seem to have agreed on are
r/w flags which are needed for some hardware.
Ralf
|