summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRobin Murphy <Robin.Murphy@arm.com>2015-09-17 17:42:16 +0100
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:15:24 -0700
commitaeae109c4a8e194415c765e3edbcfc742004cf39 (patch)
treeb3a696211cba7b3b8702089522e4d9bdbbd43d2f /include/linux
parentfc1e02aa45c76013ac05c04a24efbc569fa27203 (diff)
iommu/io-pgtable-arm: Don't use dma_to_phys()
In checking whether DMA addresses differ from physical addresses, using dma_to_phys() is actually the wrong thing to do, since it may hide any DMA offset, which is precisely one of the things we are checking for. Simply casting between the two address types, whilst ugly, is in fact the appropriate course of action. Further care (and ugliness) is also necessary in the comparison to avoid truncation if phys_addr_t and dma_addr_t differ in size. We can also reject any device with a fixed DMA offset up-front at page table creation, leaving the allocation-time check for the more subtle cases like bounce buffering due to an incorrect DMA mask. Furthermore, we can then fix the hackish KConfig dependency so that architectures without a dma_to_phys() implementation may still COMPILE_TEST (or even use!) the code. The true dependency is on the DMA API, so use the appropriate symbol for that. Change-Id: I2f7087d43e2d8f16ea36f8e10530d0c4811a4fcd Signed-off-by: Robin Murphy <robin.murphy@arm.com> [will: folded in selftest fix from Yong Wu] Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions