From: Tony Lindgren Date: Thu, 16 Aug 2007 13:34:40 +0000 (-0700) Subject: musb_hdrc: Fix SRP locking X-Git-Tag: v2.6.23-omap1~167 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=4d86df502a0783bf35fbca9b5598e513c4f83d9a;p=linux-2.6-omap-h63xx.git musb_hdrc: Fix SRP locking Remove unnecessary locking left over from earlier code as it's done in musb_gadget_wakeup(). Also show debug information for unhandled wake events to allow debugging SRP. Signed-off-by: Tony Lindgren --- diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index fa15c5928d6..86a256a2353 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -1434,6 +1434,7 @@ static int musb_gadget_wakeup(struct usb_gadget *gadget) status = 0; goto done; default: + DBG(2, "Unhandled wake: %s\n", otg_state_string(musb)); goto done; } @@ -1931,7 +1932,7 @@ void musb_g_suspend(struct musb *musb) } } -/* Called during SRP. Caller must hold lock */ +/* Called during SRP */ void musb_g_wakeup(struct musb *musb) { musb_gadget_wakeup(&musb->g); diff --git a/drivers/usb/musb/plat_uds.c b/drivers/usb/musb/plat_uds.c index 8a2bb3eabbb..c6ca9ea9c84 100644 --- a/drivers/usb/musb/plat_uds.c +++ b/drivers/usb/musb/plat_uds.c @@ -1710,7 +1710,6 @@ musb_srp_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) { struct musb *musb=dev_to_musb(dev); - unsigned long flags; unsigned short srp; if (sscanf(buf, "%hu", &srp) != 1 @@ -1719,10 +1718,8 @@ musb_srp_store(struct device *dev, struct device_attribute *attr, return -EINVAL; } - spin_lock_irqsave(&musb->lock, flags); if (srp == 1) musb_g_wakeup(musb); - spin_unlock_irqrestore(&musb->lock, flags); return n; }