dma-mapping: treat dev->bus_dma_mask as a DMA limit
Using a mask to represent bus DMA constraints has a set of limitations. The biggest one being it can only hold a power of two (minus one). The DMA mapping code is already aware of this and treats dev->bus_dma_mask as a limit. This quirk is already used by some architectures although still rare. With the introduction of the Raspberry Pi 4 we've found a new contender for the use of bus DMA limits, as its PCIe bus can only address the lower 3GB of memory (of a total of 4GB). This is impossible to represent with a mask. To make things worse the device-tree code rounds non power of two bus DMA limits to the next power of two, which is unacceptable in this case. In the light of this, rename dev->bus_dma_mask to dev->bus_dma_limit all over the tree and treat it as such. Note that dev->bus_dma_limit should contain the higher accessible DMA address. Signed-off-by:Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Reviewed-by:
Robin Murphy <robin.murphy@arm.com> Signed-off-by:
Christoph Hellwig <hch@lst.de>
Showing
- arch/mips/pci/fixup-sb1250.c 8 additions, 8 deletionsarch/mips/pci/fixup-sb1250.c
- arch/powerpc/sysdev/fsl_pci.c 3 additions, 3 deletionsarch/powerpc/sysdev/fsl_pci.c
- arch/x86/kernel/pci-dma.c 1 addition, 1 deletionarch/x86/kernel/pci-dma.c
- arch/x86/mm/mem_encrypt.c 1 addition, 1 deletionarch/x86/mm/mem_encrypt.c
- arch/x86/pci/sta2x11-fixup.c 1 addition, 1 deletionarch/x86/pci/sta2x11-fixup.c
- drivers/acpi/arm64/iort.c 7 additions, 13 deletionsdrivers/acpi/arm64/iort.c
- drivers/ata/ahci.c 1 addition, 1 deletiondrivers/ata/ahci.c
- drivers/iommu/dma-iommu.c 1 addition, 2 deletionsdrivers/iommu/dma-iommu.c
- drivers/of/device.c 5 additions, 4 deletionsdrivers/of/device.c
- include/linux/device.h 3 additions, 3 deletionsinclude/linux/device.h
- include/linux/dma-direct.h 1 addition, 1 deletioninclude/linux/dma-direct.h
- include/linux/dma-mapping.h 1 addition, 1 deletioninclude/linux/dma-mapping.h
- kernel/dma/direct.c 13 additions, 14 deletionskernel/dma/direct.c
Loading
Please register or sign in to comment