[PATCH] usb: core: remove local_irq_save/restore around urb->complete

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



local_irq_save() disables irq completely on non-SMP which causes the
hard interrupt handler unable to serve interrupts, which loses the
benefit that the giveback tasklet brings in usb_hcd_giveback_urb().

One example of the issues caused by this disabling local irq is that
urb->complete in uvc driver takes about 1ms, which holds the host
controller to receive packets for so long that causes webcam drops data.

I don't see any callers of usb_hcd_giveback_urb() holding a spin_lock,
so it is safe to remove this local_irq_save/restore() around
urb->complete.

Signed-off-by: Bin Liu <b-liu@xxxxxx>
---
 drivers/usb/core/hcd.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 479e223..ae093f2 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1751,20 +1751,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);
 	if (unlikely(atomic_read(&urb->reject)))
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux