Re: Alpha: virt_to_bus/GFP_DMA problem

Adrian Cox (apc@agelectronics.co.uk)
Fri, 10 Dec 1999 18:04:52 +0000


Richard Henderson wrote:
> > > handle = pci_map_single(pci_dev *dev, void *addr, long len, int flags)
> > > or
> > > handle = pci_map_sg(pci_dev *dev, struct scatterlist *sg, int flags)
>
> No, Jakub does in fact have the correct answer. On both Alpha
> and Sparc we have fairly sophisticated control over how bus
> addresses map back to memory addresses. Efficient use of that
> control, however, requires driver assistance.

To cover the greatest number of machines with efficient code, we need
two things:

1) Zones for ISA DMA, 32-bit PCI DMA, 64-bit PCI DMA. If we're going to
support all the broken PCI cards we also need zones for 24, 30, and 31
bit PCI DMA. This is ugly, but so are the cards that need it. (I have a
nightmare that right now somebody is building a 36-bit DMA engine, as
"nobody could possibly want to address more than 64GB".)

This allows us to safely allocate buffers visible to the DMA engines,
even on machines without map registers (or DVMA, or whatever else you
call it). On machines with small memory, or large memory and map
registers, we can of course collapse most of these zones together.

2) The function calls above to set up map registers. In the simple x86
case they can probably be inlined wrappers around virt_to_bus().

- Adrian Cox, AG Electronics

-
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/