powerpc/64: Honor swiotlb limit in coherent allocations
authorScott Wood <scottwood@freescale.com>
Fri, 8 Aug 2014 23:40:43 +0000 (18:40 -0500)
committerScott Wood <scottwood@freescale.com>
Wed, 3 Sep 2014 22:58:22 +0000 (17:58 -0500)
commit6397fc3fb05e73062b9790cfe2760e209ebd7b95
tree8ea6610042dae6bac8f507fecada7a0bcb22ef48
parent1c98025c6c95bc057a25e2c6596de23288c68160
powerpc/64: Honor swiotlb limit in coherent allocations

FSL PCI cannot directly address the whole lower 4 GiB due to
conflicts with PCICSRBAR and outbound windows, and thus
max_direct_dma_addr is less than 4GiB.  Honor that limit in
dma_direct_alloc_coherent().

Note that setting the DMA mask to 31 bits is not an option, since many
PCI drivers would fail if we reject 32-bit DMA in dma_supported(), and
we have no control over the setting of coherent_dma_mask if
dma_supported() returns true.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Cc: Shaohui Xie <Shaohui.Xie@freescale.com>
arch/powerpc/kernel/dma.c