Skip to content

Commit d30a6b8

Browse files
tndavedavem330
authored andcommitted
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>
1 parent f08978b commit d30a6b8

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

arch/sparc/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ config ARCH_ATU
9393
bool
9494
default y if SPARC64
9595

96+
config ARCH_DMA_ADDR_T_64BIT
97+
bool
98+
default y if ARCH_ATU
99+
96100
config IOMMU_HELPER
97101
bool
98102
default y if SPARC64

arch/sparc/kernel/iommu.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,8 +760,12 @@ int dma_supported(struct device *dev, u64 device_mask)
760760
struct iommu *iommu = dev->archdata.iommu;
761761
u64 dma_addr_mask = iommu->dma_addr_mask;
762762

763-
if (device_mask >= (1UL << 32UL))
764-
return 0;
763+
if (device_mask > DMA_BIT_MASK(32)) {
764+
if (iommu->atu)
765+
dma_addr_mask = iommu->atu->dma_addr_mask;
766+
else
767+
return 0;
768+
}
765769

766770
if ((device_mask & dma_addr_mask) == dma_addr_mask)
767771
return 1;

0 commit comments

Comments
 (0)