From: Russell King Date: Mon, 20 Oct 2008 10:18:40 +0000 (+0100) Subject: [ARM] dma: correct dma_supported() implementation X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=1124d6d21f80ec10cc962e2961c21a8dd1e0ca6a;p=deliverable%2Flinux.git [ARM] dma: correct dma_supported() implementation dma_supported() is supposed to indicate whether the system can support the DMA mask it was passed, which depends on the maximal address which can be returned for DMA allocations. If the mask is smaller than that, we are unable to guarantee that the driver can reliably obtain suitable memory. Signed-off-by: Russell King --- diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h index 4ed149cbb32a..22cb14ec3438 100644 --- a/arch/arm/include/asm/dma-mapping.h +++ b/arch/arm/include/asm/dma-mapping.h @@ -69,7 +69,9 @@ extern void dma_cache_maint(const void *kaddr, size_t size, int rw); */ static inline int dma_supported(struct device *dev, u64 mask) { - return dev->dma_mask && *dev->dma_mask != 0; + if (mask < ISA_DMA_THRESHOLD) + return 0; + return 1; } static inline int dma_set_mask(struct device *dev, u64 dma_mask)