Re: [RFC] generic device DMA implementation

Miles Bader (miles@lsi.nec.co.jp)
06 Dec 2002 11:23:01 +0900


David Gibson <david@gibson.dropbear.id.au> writes:
> > * pci_map_single allocates a `shadow area' of consistent memory and
> > pci_unmap_single deallocates it
>
> That's a little misleading: all your memory is consistent, the point
> is that it is a shadow area of PCI-mappable memory.

Well I suppose that's true if you're using the term in a cache-related
sense (which I gather is the convention).

OTOH, if you think about it from the view point of the PCI framework,
the terminology actually does make sense even in this odd case --
`consistent' memory is indeed consistent (both CPU and device see a
single image), but other memory used to communicate with the driver is
`inconsistent' (CPU and device see different things until a sync
operation is done).

> The issue is that there are other constraints for DMAable memory and
> you want drivers to be able to easily mallocate with those
> constraints.
>
> Actually, it occurs to me that PC ISA DMA is in a similar situation -
> there is a constraint on DMAable memory (sufficiently low physical
> address) which has nothing to do with consistency.

Indeed. What I'm doing is basically bounce-buffers.

-Miles

-- 
`The suburb is an obsolete and contradictory form of human settlement'
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/