]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: Update remaining dma_mapping_ops to use map/unmap_page
authorMark Nelson <markn@au1.ibm.com>
Mon, 27 Oct 2008 20:38:08 +0000 (20:38 +0000)
committerPaul Mackerras <paulus@samba.org>
Fri, 31 Oct 2008 05:13:48 +0000 (16:13 +1100)
commitdc70c1e9d0299d1302856074bd85ca6ffc05b09c
treebff17e54e92bfeea78f8a86181963db7de9a5549
parent3698c4755e82dacba1b0a7af51bd4056d53beb27
powerpc: Update remaining dma_mapping_ops to use map/unmap_page

After the merge of the 32 and 64bit DMA code, dma_direct_ops lost
their map/unmap_single() functions but gained map/unmap_page().  This
caused a problem for Cell because Cell's dma_iommu_fixed_ops called
the dma_direct_ops if the fixed linear mapping was to be used or the
iommu ops if the dynamic window was to be used.  So in order to fix
this problem we need to update the 64bit DMA code to use
map/unmap_page.

First, we update the generic IOMMU code so that iommu_map_single()
becomes iommu_map_page() and iommu_unmap_single() becomes
iommu_unmap_page().  Then we propagate these changes up through all
the callers of these two functions and in the process update all the
dma_mapping_ops so that they have map/unmap_page rahter than
map/unmap_single.  We can do this because on 64bit there is no HIGHMEM
memory so map/unmap_page ends up performing exactly the same function
as map/unmap_single, just taking different arguments.

This has no affect on drivers because the dma_map_single_attrs() just
ends up calling the map_page() function of the appropriate
dma_mapping_ops and similarly the dma_unmap_single_attrs() calls
unmap_page().

This fixes an oops on Cell blades, which oops on boot without this
because they call dma_direct_ops.map_single, which is NULL.

Signed-off-by: Mark Nelson <markn@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/include/asm/iommu.h
arch/powerpc/kernel/dma-iommu.c
arch/powerpc/kernel/ibmebus.c
arch/powerpc/kernel/iommu.c
arch/powerpc/kernel/vio.c
arch/powerpc/platforms/cell/iommu.c
arch/powerpc/platforms/iseries/iommu.c
arch/powerpc/platforms/ps3/system-bus.c