Skip to contentSkip to conversation

ARM: OMAP: musb_vbus_store(): dont exit with spinlock held

PATCH In review Kevin Hilman 3 participants 3 messages Aug 31, 2007 – Sep 17, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: OMAP: musb_vbus_store(): dont exit with spinlock held

---
 drivers/usb/musb/musb_core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/musb/musb_core.c +2 -1
Index: dev/drivers/usb/musb/musb_core.c
===================================================================
@@ -1683,11 +1683,12 @@ musb_vbus_store(struct device *dev, stru
 	unsigned long	flags;
 	unsigned long	val;
 
-	spin_lock_irqsave(&musb->lock, flags);
 	if (sscanf(buf, "%lu", &val) < 1) {
 		printk(KERN_ERR "Invalid VBUS timeout ms value\n");
 		return -EINVAL;
 	}
+
+	spin_lock_irqsave(&musb->lock, flags);
 	musb->a_wait_bcon = val;
 	if (musb->xceiv.state == OTG_STATE_A_WAIT_BCON)
 		musb->is_active = 0;

--

#1 lore raw
Quoted 7 lines

From linux-omap-open-source-bounces+david-b=pacbell.net@linux.omap.com Fri Aug 31 16:33:11 2007
Date: Fri, 31 Aug 2007 16:29:22 -0700
From: Kevin Hilman <[email protected]>
To: [email protected]
Subject: [PATCH] ARM: OMAP: musb_vbus_store(): dont exit with spinlock held

Ack.

Quoted 22 lines
---
 drivers/usb/musb/musb_core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: dev/drivers/usb/musb/musb_core.c
===================================================================

drivers/usb/musb/musb_core.c +2 -1
@@ -1683,11 +1683,12 @@ musb_vbus_store(struct device *dev, stru
 	unsigned long	flags;
 	unsigned long	val;
 
-	spin_lock_irqsave(&musb->lock, flags);
 	if (sscanf(buf, "%lu", &val) < 1) {
 		printk(KERN_ERR "Invalid VBUS timeout ms value\n");
 		return -EINVAL;
 	}
+
+	spin_lock_irqsave(&musb->lock, flags);
 	musb->a_wait_bcon = val;
 	if (musb->xceiv.state == OTG_STATE_A_WAIT_BCON)
 		musb->is_active = 0;
#2 lore raw
Quoted 22 lines · David Brownell
Quoted 7 lines

From linux-omap-open-source-bounces+david-b=pacbell.net@linux.omap.com Fri Aug 31 16:33:11 2007
Date: Fri, 31 Aug 2007 16:29:22 -0700
From: Kevin Hilman <[email protected]>
To: [email protected]
Subject: [PATCH] ARM: OMAP: musb_vbus_store(): dont exit with spinlock held

Ack.

Quoted 12 lines
---
 drivers/usb/musb/musb_core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: dev/drivers/usb/musb/musb_core.c
===================================================================

drivers/usb/musb/musb_core.c +0 -0
@@ -1683,11 +1683,12 @@ musb_vbus_store(struct device *dev, stru
 	unsigned long	flags;
 	unsigned long	val;
 
Quoted 10 lines

drivers/usb/musb/musb_core.c musb_vbus_store(struct device *dev, stru · line 1694

Quoted 10 lines
drivers/usb/musb/musb_core.c +2 -1
-	spin_lock_irqsave(&musb->lock, flags);
 	if (sscanf(buf, "%lu", &val) < 1) {
 		printk(KERN_ERR "Invalid VBUS timeout ms value\n");
 		return -EINVAL;
 	}
+
+	spin_lock_irqsave(&musb->lock, flags);
 	musb->a_wait_bcon = val;
 	if (musb->xceiv.state == OTG_STATE_A_WAIT_BCON)
 		musb->is_active = 0;

This too, sorry for the delay I guess I forgot to push these earlier.

Tony