]> git.baikalelectronics.ru Git - kernel.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)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 3 Aug 2017 09:31:17 +0000 (12:31 +0300)
commit711654e572fd5934f1a28a311cf76bba41be9f38
tree385ed06959f042069bf0f4f493a2c21b234f862e
parentfb61c03d3108b080b976f9346cddb195fe46de21
usb: gadget: udc: renesas_usb3: Fix usb_gadget_giveback_request() calling

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: 74cd6cb3d945 ("usb: gadget: renesas_usb3: add support for Renesas USB3.0 peripheral controller")
Cc: <stable@vger.kernel.org> # v4.5+
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/udc/renesas_usb3.c