]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sparc64: Enable 64-bit DMA
authorTushar Dave <tushar.n.dave@oracle.com>
Fri, 6 May 2016 23:51:04 +0000 (16:51 -0700)
committerAllen Pais <allen.pais@oracle.com>
Tue, 11 Jul 2017 07:36:50 +0000 (13:06 +0530)
ATU 64bit addressing allows PCIe devices with 64bit DMA capabilities
to use ATU for 64bit DMA.

Orabug: 23239179

Reviewed-by: chris hyser <chris.hyser@oracle.com>
Signed-off-by: Tushar Dave <tushar.n.dave@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
arch/sparc/Kconfig
arch/sparc/kernel/iommu.c

index 0f3ee99317c89f9d654a498508322b5e1ca8bffb..6d8defe19062353e26bd1a5de7e69f206ee0d7e1 100644 (file)
@@ -101,6 +101,10 @@ config ARCH_ATU
        bool
        default y if SPARC64
 
+config ARCH_DMA_ADDR_T_64BIT
+       bool
+       default y if ARCH_ATU
+
 config IOMMU_HELPER
        bool
        default y if SPARC64
index 37686828c3d9818a9decfe1b6a396e20161e3d43..3c752f454e79ca0e02b728f78ac06ef8174438ca 100644 (file)
@@ -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;