summaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel
diff options
context:
space:
mode:
authorTushar Dave <tushar.n.dave@oracle.com>2016-10-28 19:12:45 +0200
committerDavid S. Miller <davem@davemloft.net>2016-11-18 20:17:00 +0100
commitd30a6b84df00128e03588564925dc828a53e6865 (patch)
tree9aa3298173c5cc35683d8e01259e856e1ae84921 /arch/sparc/kernel
parentsparc64: Enable sun4v dma ops to use IOMMU v2 APIs (diff)
downloadlinux-d30a6b84df00128e03588564925dc828a53e6865.tar.xz
linux-d30a6b84df00128e03588564925dc828a53e6865.zip
sparc64: Enable 64-bit DMA
ATU 64bit addressing allows PCIe devices with 64bit DMA capabilities to use ATU for 64bit DMA. Signed-off-by: Tushar Dave <tushar.n.dave@oracle.com> Reviewed-by: chris hyser <chris.hyser@oracle.com> Acked-by: Sowmini Varadhan <sowmini.varadhan@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r--arch/sparc/kernel/iommu.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c
index 5c615abff030..852a3291db96 100644
--- a/arch/sparc/kernel/iommu.c
+++ b/arch/sparc/kernel/iommu.c
@@ -760,8 +760,12 @@ int dma_supported(struct device *dev, u64 device_mask)
struct iommu *iommu = dev->archdata.iommu;
u64 dma_addr_mask = iommu->dma_addr_mask;
- if (device_mask >= (1UL << 32UL))
- return 0;
+ if (device_mask > DMA_BIT_MASK(32)) {
+ if (iommu->atu)
+ dma_addr_mask = iommu->atu->dma_addr_mask;
+ else
+ return 0;
+ }
if ((device_mask & dma_addr_mask) == dma_addr_mask)
return 1;