[RFC] change the dma_unmap_single for arm
Russell King - ARM Linux
linux at arm.linux.org.uk
Wed Oct 27 12:43:55 EDT 2010
On Wed, Oct 27, 2010 at 04:01:37PM +0200, saeed bishara wrote:
> latest versions invalidates the buffer in order to overcome the
> speculative prefetch. however, in some cases, specially network, the
> data that DMAed can be much less that the buffer size, so it would be
> more efficient - and correct for arm case - to use the received bytes
> count rather than the buffer size. however, the linux API restricts
> the size to be the same as the one passed to the dma_map_single -
> which is the buffer size.
> the simplest solution that I can think of is to change the API
> restriction, and make the drivers pass the received bytes count
> instead of buffer size, the kernel also will provide a function to the
> drivers to permit using this hack.
The reason this isn't done is because some platforms have IOMMUs
which have to be programmed (or deprogrammed) appropriately. For
this, it is important that the parameters are the same as the
original map request.
Relaxing this restriction makes the API much more complex, and will
probably cause additional pain to debug where people 'forget' to
use the right buffer size(s).
More information about the linux-arm-kernel