[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 <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
Russell King 2008-10-20 11:18:40 +01:00 коммит произвёл Russell King
Родитель 70d13e083c
Коммит 1124d6d21f
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -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)