Re: [Linux-ia64] Re: 64 Bits DMA Addresses for Alloc Consistent Interfaces.

From: Russell King <rmk_at_arm.linux.org.uk>
Date: 2003-05-17 04:18:04
On Fri, May 16, 2003 at 01:13:07PM -0500, James Bottomley wrote:
> Well, it applies to partially coherent machines too.  However, the point
> of the API is to make it so that the driver writer doesn't need to
> understand where the calls go,  So the API encapsulates all the platform
> quirks in a simple set of rules of thumb.
> 
> Thus:
> 
>     map region
>     
>     Use region in driver
>     
>     dma_sync ... DMA_OWNER_DEVICE  .. and direction
>     
>     device uses region (driver may not touch it)
>     
>     dma_sync ... DMA_OWNER_CPU .. and direction
>     
>     driver accesses region again (may repeat back to use region in
>     driver)
>     
>     unmap region

Isn't the common use (eg, net devices):

	buffer passed from lower levels

	map buffer

	(device owns buffer)

	device uses buffer

	unmap buffer

	(cpu owns buffer)

	free buffer

So, to use your example:

	(cpu owns region)

	map

	(device owns region)

	dma_sync...cpu

	(cpu owns region)

	dma_sync...device

	(device owns region)

	unmap

	(cpu owns region)

Your suggestion seems to add in two extra sync calls (and thus extra code
in the common case.)

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html
Received on Fri May 16 11:18:25 2003

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:14 EST