Skip to content

Commit 7d0b494

Browse files
vsyrjalagregkh
authored andcommitted
dma-debug: avoid spinlock recursion when disabling dma-debug
commit 3017cd63f26fc655d56875aaf497153ba60e9edf upstream. With netconsole (at least) the pr_err("... disablingn") call can recurse back into the dma-debug code, where it'll try to grab free_entries_lock again. Avoid the problem by doing the printk after dropping the lock. Link: http://lkml.kernel.org/r/1463678421-18683-1-git-send-email-ville.syrjala@linux.intel.com Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 98c2845 commit 7d0b494

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/dma-debug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,9 +657,9 @@ static struct dma_debug_entry *dma_entry_alloc(void)
657657
spin_lock_irqsave(&free_entries_lock, flags);
658658

659659
if (list_empty(&free_entries)) {
660-
pr_err("DMA-API: debugging out of memory - disabling\n");
661660
global_disable = true;
662661
spin_unlock_irqrestore(&free_entries_lock, flags);
662+
pr_err("DMA-API: debugging out of memory - disabling\n");
663663
return NULL;
664664
}
665665

0 commit comments

Comments
 (0)