]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: gadget: udc: renesas_usb3: Fix usb_gadget_giveback_request() calling
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Wed, 2 Aug 2017 12:06:35 +0000 (21:06 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Aug 2017 20:46:58 +0000 (13:46 -0700)
commitf5324020bcef034f832291bacd0d214d02f27919
tree08a09f0d6f0de7fe68d8fb430b02613a7f8c8341
parent7926348676f575024cb7d7e302b6584331208f01
usb: gadget: udc: renesas_usb3: Fix usb_gadget_giveback_request() calling

commit aca5b9ebd096039657417c321a9252c696b359c2 upstream.

According to the gadget.h, a "complete" function will always be called
with interrupts disabled. However, sometimes usb3_request_done() function
is called with interrupts enabled. So, this function should be held
by spin_lock_irqsave() to disable interruption. Also, this driver has
to call spin_unlock() to avoid spinlock recursion by this driver before
calling usb_gadget_giveback_request().

Reported-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Tested-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Fixes: 746bfe63bba3 ("usb: gadget: renesas_usb3: add support for Renesas USB3.0 peripheral controller")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/renesas_usb3.c