mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
dma_free_coherent() needs irqs enabled (sigh)
On at least ARM (and I'm told MIPS too) dma_free_coherent() has a newish call context requirement: unlike its dma_alloc_coherent() sibling, it may not be called with IRQs disabled. (This was new behavior on ARM as of late 2005, caused by ARM SMP updates.) This little surprise can be annoyingly driver-visible. Since it looks like that restriction won't be removed, this patch changes the definition of the API to include that requirement. Also, to help catch nonportable drivers, it updates the x86 and swiotlb versions to include the relevant warnings. (I already observed that it trips on the bus_reset_tasklet of the new firewire_ohci driver.) Signed-off-by: David Brownell <[email protected]> Cc: David Miller <[email protected]> Acked-by: Russell King <[email protected]> Cc: Andi Kleen <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
fa007d8beb
commit
aa24886e37
4 changed files with 7 additions and 1 deletions
|
|
@ -497,6 +497,7 @@ void
|
|||
swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr,
|
||||
dma_addr_t dma_handle)
|
||||
{
|
||||
WARN_ON(irqs_disabled());
|
||||
if (!(vaddr >= (void *)io_tlb_start
|
||||
&& vaddr < (void *)io_tlb_end))
|
||||
free_pages((unsigned long) vaddr, get_order(size));
|
||||
|
|
|
|||
Loading…
Reference in a new issue