]> git.baikalelectronics.ru Git - kernel.git/commit
[POWERPC] Workaround for iommu page alignment
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 7 Jan 2008 23:34:22 +0000 (10:34 +1100)
committerPaul Mackerras <paulus@samba.org>
Tue, 15 Jan 2008 04:39:59 +0000 (15:39 +1100)
commitf07e188e929422066793e3c878ac7bc2663bd28f
treeaa09101b13dac2bca27c5bab878c72c9c9015505
parent3e6134888d8a31909ba306f8403e1bad08e3735d
[POWERPC] Workaround for iommu page alignment

Commit c4501989574eccfacf5ab21abc21b6df9b623456 changed our iommu code
so that it always uses an iommu page size of 4kB.  That means with our
current code, drivers may do a dma_map_sg() of a 64kB page and obtain
a dma_addr_t that is only 4k aligned.

This works fine in most cases except for some infiniband HW it seems,
where they tell the HW about the page size and it ignores the low bits
of the DMA address.

This works around it by making our IOMMU code enforce a PAGE_SIZE alignment
for mappings of objects that are page aligned in the first place and whose
size is larger or equal to a page.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/iommu.c