Skip to content

Commit

Permalink
[ARM] dma: correct dma_supported() implementation
Browse files Browse the repository at this point in the history
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 <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed Dec 13, 2008
1 parent 70d13e0 commit 1124d6d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/arm/include/asm/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1124d6d

Please sign in to comment.