Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: loongson: remove loongson_dma_supported

swiotlb_dma_supported will always return true for a mask large enough to
cover the DMA addresses for all physical memory, which is the right
thing to do for swiotlb based dma ops. This function returned false
if the mask was bigger than a firmware set dma_mask_bits that apparently
can be either 32 or 64, and which seems completely buggys if it actually
is not 64, as the false return negates the whole point of swiotlb.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Patchwork: https://patchwork.linux-mips.org/patch/19533/
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: David Daney <david.daney@cavium.com>
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: Tom Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Huacai Chen <chenhc@lemote.com>
Cc: iommu@lists.linux-foundation.org
Cc: linux-mips@linux-mips.org

authored by

Christoph Hellwig and committed by
Paul Burton
e799de3e 97f9f976

+1 -8
+1 -8
arch/mips/loongson64/common/dma-swiotlb.c
··· 56 56 mb(); 57 57 } 58 58 59 - static int loongson_dma_supported(struct device *dev, u64 mask) 60 - { 61 - if (mask > DMA_BIT_MASK(loongson_sysconf.dma_mask_bits)) 62 - return 0; 63 - return swiotlb_dma_supported(dev, mask); 64 - } 65 - 66 59 dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr) 67 60 { 68 61 long nid; ··· 92 99 .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu, 93 100 .sync_sg_for_device = loongson_dma_sync_sg_for_device, 94 101 .mapping_error = swiotlb_dma_mapping_error, 95 - .dma_supported = loongson_dma_supported, 102 + .dma_supported = swiotlb_dma_supported, 96 103 }; 97 104 98 105 void __init plat_swiotlb_setup(void)