Skip to content

Commit

Permalink
usb: core: remove local_irq_save() around ->complete() handler
Browse files Browse the repository at this point in the history
The core disabled interrupts before invocation the ->complete handler
because the handler might have expected that interrupts are disabled.

All handlers were audited and use proper locking now. With it, the core
code no longer needs to disable interrupts before invoking the
->complete handler.
Remove local_irq_save() statement before invoking the ->complete
handler.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Sebastian Andrzej Siewior authored and gregkh committed Sep 10, 2018
1 parent 3f3ff6e commit ed194d1
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions drivers/usb/core/hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1755,20 +1755,7 @@ static void __usb_hcd_giveback_urb(struct urb *urb)

/* pass ownership to the completion handler */
urb->status = status;

/*
* We disable local IRQs here avoid possible deadlock because
* drivers may call spin_lock() to hold lock which might be
* acquired in one hard interrupt handler.
*
* The local_irq_save()/local_irq_restore() around complete()
* will be removed if current USB drivers have been cleaned up
* and no one may trigger the above deadlock situation when
* running complete() in tasklet.
*/
local_irq_save(flags);
urb->complete(urb);
local_irq_restore(flags);

usb_anchor_resume_wakeups(anchor);
atomic_dec(&urb->use_count);
Expand Down

0 comments on commit ed194d1

Please sign in to comment.