]> git.baikalelectronics.ru Git - kernel.git/commit
dma_free_coherent() needs irqs enabled (sigh)
authorDavid Brownell <david-b@pacbell.net>
Fri, 10 Aug 2007 20:10:27 +0000 (13:10 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 12 Oct 2007 22:03:15 +0000 (15:03 -0700)
commit09e423670159271dd84b651b562958bc7247e415
treec0934ff01f7c7a18ec5f86896735286f413cd06e
parent307d3f660facba1b06d68f8366f15a5e3e01e448
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 <dbrownell@users.sourceforge.net>
Cc: David Miller <davem@davemloft.net>
Acked-by: Russell King <rmk@arm.linux.org.uk>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Documentation/DMA-API.txt
arch/x86/kernel/pci-dma_32.c
arch/x86/kernel/pci-dma_64.c
lib/swiotlb.c