Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1669256 > unrolled thread

[PATCH 4.11 45/78] usb: gadget: udc: renesas_usb3: fix deadlock by spinlock

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2017-06-19 17:30 +0200
Last post2017-06-19 17:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.11 45/78] usb: gadget: udc: renesas_usb3: fix deadlock by spinlock Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-19 17:30 +0200

#1669256 — [PATCH 4.11 45/78] usb: gadget: udc: renesas_usb3: fix deadlock by spinlock

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-06-19 17:30 +0200
Subject[PATCH 4.11 45/78] usb: gadget: udc: renesas_usb3: fix deadlock by spinlock
Message-ID<tU6MQ-4pB-57@gated-at.bofh.it>
4.11-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

commit 067d6fdc558d2c43f0bfdc7af99630dd5eb08dc5 upstream.

This patch fixes an issue that this driver is possible to cause
deadlock by double-spinclocked in renesas_usb3_stop_controller().
So, this patch removes spinlock API calling in renesas_usb3_stop().
(In other words, the previous code had a redundant lock.)

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 |    3 ---
 1 file changed, 3 deletions(-)

--- a/drivers/usb/gadget/udc/renesas_usb3.c
+++ b/drivers/usb/gadget/udc/renesas_usb3.c
@@ -1718,14 +1718,11 @@ static int renesas_usb3_start(struct usb
 static int renesas_usb3_stop(struct usb_gadget *gadget)
 {
 	struct renesas_usb3 *usb3 = gadget_to_renesas_usb3(gadget);
-	unsigned long flags;
 
-	spin_lock_irqsave(&usb3->lock, flags);
 	usb3->softconnect = false;
 	usb3->gadget.speed = USB_SPEED_UNKNOWN;
 	usb3->driver = NULL;
 	renesas_usb3_stop_controller(usb3);
-	spin_unlock_irqrestore(&usb3->lock, flags);
 
 	pm_runtime_put(usb3_to_dev(usb3));
 	pm_runtime_disable(usb3_to_dev(usb3));

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web