linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6 v2] usb/gadget/pch_udc: Fix disconnect issue
@ 2012-01-12  2:27 Tomoya MORINAGA
  2012-01-12  2:27 ` [PATCH 2/6 v2] usb/gadget/pch_udc: Fix wrong return value Tomoya MORINAGA
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Tomoya MORINAGA @ 2012-01-12  2:27 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-kernel
  Cc: qi.wang, yong.y.wang, joel.clark, kok.howg.ewe, Tomoya MORINAGA

ISSUE:
When the driver notifies a gadget of a disconnect event, a system rarely freezes.

CAUSE:
When the driver calls dev->driver->disconnect(), it is not calling spinlock().

Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>
---
V2: Divide into 6 patches
---
 drivers/usb/gadget/pch_udc.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/pch_udc.c b/drivers/usb/gadget/pch_udc.c
index f222659..a4f8b08 100644
--- a/drivers/usb/gadget/pch_udc.c
+++ b/drivers/usb/gadget/pch_udc.c
@@ -2340,8 +2340,11 @@ static void pch_udc_svc_ur_interrupt(struct pch_udc_dev *dev)
 		/* Complete request queue */
 		empty_req_queue(ep);
 	}
-	if (dev->driver && dev->driver->disconnect)
+	if (dev->driver && dev->driver->disconnect) {
+		spin_unlock(&dev->lock);
 		dev->driver->disconnect(&dev->gadget);
+		spin_lock(&dev->lock);
+	}
 }
 
 /**
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-01-24  9:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-12  2:27 [PATCH 1/6 v2] usb/gadget/pch_udc: Fix disconnect issue Tomoya MORINAGA
2012-01-12  2:27 ` [PATCH 2/6 v2] usb/gadget/pch_udc: Fix wrong return value Tomoya MORINAGA
2012-01-12  2:27 ` [PATCH 3/6 v2] usb/gadget/pch_udc: Fix USB suspend issue Tomoya MORINAGA
2012-01-12  2:27 ` [PATCH 4/6 v2] usb/gadget/pch_udc: Fix usb/gadget/pch_udc: Fix ether gadget connect/disconnect issue Tomoya MORINAGA
2012-01-12  2:27 ` [PATCH 5/6 v2] usb/gadget/pch_udc: Reduce redundant interrupt Tomoya MORINAGA
2012-01-12  2:27 ` [PATCH 6/6 v2] usb/gadget/pch_udc: Add debug message Tomoya MORINAGA
2012-01-12 12:12 ` [PATCH 1/6 v2] usb/gadget/pch_udc: Fix disconnect issue Sergei Shtylyov
2012-01-13  4:12   ` Tomoya MORINAGA
2012-01-24  9:39 ` Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).