summaryrefslogtreecommitdiff
path: root/arch/mips/loongson64
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-06-15 13:08:35 +0200
committerPaul Burton <paul.burton@mips.com>2018-06-24 09:26:02 -0700
commite799de3efb9d6e0df5740eed901b89a6e533eaef (patch)
tree1fb04f672be1265099db699ba314d0a70f41ff69 /arch/mips/loongson64
parent97f9f9763a7a431e04f0ffd4e62d0d288a59f908 (diff)
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
Diffstat (limited to 'arch/mips/loongson64')
-rw-r--r--arch/mips/loongson64/common/dma-swiotlb.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/arch/mips/loongson64/common/dma-swiotlb.c b/arch/mips/loongson64/common/dma-swiotlb.c
index 6a739f8ae110..a5e50f2ec301 100644
--- a/arch/mips/loongson64/common/dma-swiotlb.c
+++ b/arch/mips/loongson64/common/dma-swiotlb.c
@@ -56,13 +56,6 @@ static void loongson_dma_sync_sg_for_device(struct device *dev,
mb();
}
-static int loongson_dma_supported(struct device *dev, u64 mask)
-{
- if (mask > DMA_BIT_MASK(loongson_sysconf.dma_mask_bits))
- return 0;
- return swiotlb_dma_supported(dev, mask);
-}
-
dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr)
{
long nid;
@@ -99,7 +92,7 @@ static const struct dma_map_ops loongson_dma_map_ops = {
.sync_sg_for_cpu = swiotlb_sync_sg_for_cpu,
.sync_sg_for_device = loongson_dma_sync_sg_for_device,
.mapping_error = swiotlb_dma_mapping_error,
- .dma_supported = loongson_dma_supported,
+ .dma_supported = swiotlb_dma_supported,
};
void __init plat_swiotlb_setup(void)