Skip to content

Commit

Permalink
dma-debug: avoid spinlock recursion when disabling dma-debug
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Ville Syrjälä <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
vsyrjala authored and torvalds committed May 26, 2016
1 parent 7ef949d commit 3017cd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dma-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,9 +657,9 @@ static struct dma_debug_entry *dma_entry_alloc(void)
spin_lock_irqsave(&free_entries_lock, flags);

if (list_empty(&free_entries)) {
pr_err("DMA-API: debugging out of memory - disabling\n");
global_disable = true;
spin_unlock_irqrestore(&free_entries_lock, flags);
pr_err("DMA-API: debugging out of memory - disabling\n");
return NULL;
}

Expand Down

0 comments on commit 3017cd6

Please sign in to comment.