alistair23-linux/arch/arm/common
Marek Szyprowski a227fb92a0 ARM: dma-mapping: remove offset parameter to prepare for generic dma_ops
This patch removes the need for the offset parameter in dma bounce
functions. This is required to let dma-mapping framework on ARM
architecture to use common, generic dma_map_ops based dma-mapping
helpers.

Background and more detailed explaination:

dma_*_range_* functions are available from the early days of the dma
mapping api. They are the correct way of doing a partial syncs on the
buffer (usually used by the network device drivers). This patch changes
only the internal implementation of the dma bounce functions to let
them tunnel through dma_map_ops structure. The driver api stays
unchanged, so driver are obliged to call dma_*_range_* functions to
keep code clean and easy to understand.

The only drawback from this patch is reduced detection of the dma api
abuse. Let us consider the following code:

dma_addr = dma_map_single(dev, ptr, 64, DMA_TO_DEVICE);
dma_sync_single_range_for_cpu(dev, dma_addr+16, 0, 32, DMA_TO_DEVICE);

Without the patch such code fails, because dma bounce code is unable
to find the bounce buffer for the given dma_address. After the patch
the above sync call will be equivalent to:

dma_sync_single_range_for_cpu(dev, dma_addr, 16, 32, DMA_TO_DEVICE);

which succeeds.

I don't consider this as a real problem, because DMA API abuse should be
caught by debug_dma_* function family. This patch lets us to simplify
the internal low-level implementation without chaning the driver visible
API.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Tested-By: Subash Patel <subash.ramaswamy@linaro.org>
2012-05-21 15:06:13 +02:00
..
dmabounce.c ARM: dma-mapping: remove offset parameter to prepare for generic dma_ops 2012-05-21 15:06:13 +02:00
gic.c Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2012-03-29 16:53:48 -07:00
icst.c
it8152.c Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci 2012-03-23 14:02:12 -07:00
Kconfig Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2012-03-29 15:34:57 -07:00
locomo.c arm: Fold irq_set_chip/irq_set_handler 2011-03-29 14:47:58 +02:00
Makefile Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2012-03-29 15:34:57 -07:00
sa1111.c ARM: sa1111: use dev_err() rather than printk() 2012-03-24 11:30:12 +00:00
scoop.c arm: Add export.h to ARM specific files as required. 2011-10-31 19:30:50 -04:00
sharpsl_param.c
timer-sp.c ARM: timer-sp: add sched_clock support 2012-02-09 22:42:55 -06:00
uengine.c
via82c505.c Disintegrate asm/system.h for ARM 2012-03-28 18:30:01 +01:00
vic.c ARM: 7377/1: vic: re-read status register before dispatching each IRQ handler 2012-04-10 09:27:42 +01:00