diff options
Diffstat (limited to 'include/linux/dma-mapping.h')
| -rw-r--r-- | include/linux/dma-mapping.h | 9 | 
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index f9cc309507d9..1db6a6b46d0d 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -538,10 +538,17 @@ static inline void dma_free_attrs(struct device *dev, size_t size,  	const struct dma_map_ops *ops = get_dma_ops(dev);  	BUG_ON(!ops); -	WARN_ON(irqs_disabled());  	if (dma_release_from_dev_coherent(dev, get_order(size), cpu_addr))  		return; +	/* +	 * On non-coherent platforms which implement DMA-coherent buffers via +	 * non-cacheable remaps, ops->free() may call vunmap(). Thus getting +	 * this far in IRQ context is a) at risk of a BUG_ON() or trying to +	 * sleep on some machines, and b) an indication that the driver is +	 * probably misusing the coherent API anyway. +	 */ +	WARN_ON(irqs_disabled());  	if (!ops->free || !cpu_addr)  		return;  |