aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/dma-mapping.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-04-29 09:04:53 -0500
committerChristoph Hellwig <hch@lst.de>2019-06-25 07:54:06 +0200
commitab746573c4055ae1fa226715502fb9bb9be29a79 (patch)
treec632b822c9c6442541f6c9a4a0779347d377bb13 /arch/arm/mm/dma-mapping.c
parentdma-mapping: truncate dma masks to what dma_addr_t can hold (diff)
downloadlinux-dev-ab746573c4055ae1fa226715502fb9bb9be29a79.tar.xz
linux-dev-ab746573c4055ae1fa226715502fb9bb9be29a79.zip
ARM: dma-mapping: allow larger DMA mask than supported
Since the Linux 5.1 merge window we allow drivers to just set the largest DMA mask they support instead of falling back to smaller ones. But I forgot to remove a check that prohibits this behavior in the arm DMA code, as it is rather hidden. There is not reason for this check as the code will do the right thing for a "too large" DMA mask, so just remove it. Fixes: 9eb9e96e97b3 ("Documentation/DMA-API-HOWTO: update dma_mask sections") Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'arch/arm/mm/dma-mapping.c')
-rw-r--r--arch/arm/mm/dma-mapping.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 0a75058c11f3..bdf0d236aaee 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -219,25 +219,7 @@ EXPORT_SYMBOL(arm_coherent_dma_ops);
static int __dma_supported(struct device *dev, u64 mask, bool warn)
{
- unsigned long max_dma_pfn;
-
- /*
- * If the mask allows for more memory than we can address,
- * and we actually have that much memory, then we must
- * indicate that DMA to this device is not supported.
- */
- if (sizeof(mask) != sizeof(dma_addr_t) &&
- mask > (dma_addr_t)~0 &&
- dma_to_pfn(dev, ~0) < max_pfn - 1) {
- if (warn) {
- dev_warn(dev, "Coherent DMA mask %#llx is larger than dma_addr_t allows\n",
- mask);
- dev_warn(dev, "Driver did not use or check the return value from dma_set_coherent_mask()?\n");
- }
- return 0;
- }
-
- max_dma_pfn = min(max_pfn, arm_dma_pfn_limit);
+ unsigned long max_dma_pfn = min(max_pfn, arm_dma_pfn_limit);
/*
* Translate the device's DMA mask to a PFN limit. This