[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)
commitd262c32a4bcc3e5fda0325a64e53c25fe1e999d7
treeaa09101b13dac2bca27c5bab878c72c9c9015505
parent031f2dcd7075e218e74dd7f942ad015cf82dffab
[POWERPC] Workaround for iommu page alignment

Commit 5d2efba64b231a1733c4048d1708d77e07f26426 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