WARN_ON(irqs_disabled()) in dma_free_attrs?

Christoph Hellwig hch at lst.de
Fri Mar 2 21:47:46 UTC 2018


On Fri, Mar 02, 2018 at 07:55:48PM +0000, Robin Murphy wrote:
> On the other hand, HCD_LOCAL_MEM implies a per-device coherent pool. Since 
> those bypass the arch-specific code, then depending on how unlikely we 
> think it is for devices covered by a single driver to exist both with and 
> without their own memory then it *might* also be reasonable to make the 
> change below. Christoph, what do you reckon?

For the case where the coherent pool really is per-device this looks
technically ok.  But it would also cover cases like arm nommu where
we have a single global nommu pool and we wouldn't warn for a driver
that frees with irqs disabled.

That being said I think allowing coherent frees from irqs disabled
context is a very bad idea to do in general, so if we can at all I'd
rather fix the driver than lifting any restrictions.


More information about the iommu mailing list