public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@mvista.com>
To: linux-omap-open-source@linux.omap.com
Subject: [PATCH 1/2] ARM: OMAP: MUSB: dont exit with spinlock held
Date: Thu, 30 Aug 2007 19:54:00 -0700	[thread overview]
Message-ID: <20070831025811.557377351@mvista.com> (raw)
In-Reply-To: 20070831025359.663866890@mvista.com

[-- Attachment #1: musb-locking-vbus-store.patch --]
[-- Type: text/plain, Size: 974 bytes --]

Signed-off-by: Kevin Hilman <khilman@mvista.com>

---
 drivers/usb/musb/musb_core.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: dev/drivers/usb/musb/musb_core.c
===================================================================
--- dev.orig/drivers/usb/musb/musb_core.c
+++ dev/drivers/usb/musb/musb_core.c
@@ -1682,19 +1682,22 @@ musb_vbus_store(struct device *dev, stru
 	struct musb	*musb = dev_to_musb(dev);
 	unsigned long	flags;
 	unsigned long	val;
+	ssize_t retval = n;
 
 	spin_lock_irqsave(&musb->lock, flags);
 	if (sscanf(buf, "%lu", &val) < 1) {
 		printk(KERN_ERR "Invalid VBUS timeout ms value\n");
-		return -EINVAL;
+		retval = -EINVAL;
+		goto out;
 	}
 	musb->a_wait_bcon = val;
 	if (musb->xceiv.state == OTG_STATE_A_WAIT_BCON)
 		musb->is_active = 0;
 	musb_platform_try_idle(musb, jiffies + msecs_to_jiffies(val));
+out:
 	spin_unlock_irqrestore(&musb->lock, flags);
 
-	return n;
+	return retval;
 }
 
 static ssize_t

--

  reply	other threads:[~2007-08-31  2:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-31  2:53 [PATCH 0/2] MUSB: tracking down locking bugs Kevin Hilman
2007-08-31  2:54 ` Kevin Hilman [this message]
2007-08-31  5:47   ` [PATCH 1/2] ARM: OMAP: MUSB: dont exit with spinlock held David Brownell
2007-08-31  5:51     ` Kevin Hilman
2007-08-31  2:54 ` [PATCH 2/2] ARM: OMAP: MUSB: BUG on potential deadlocks Kevin Hilman
2007-08-31  6:05   ` David Brownell
2007-08-31 16:18     ` Kevin Hilman
2007-08-31 17:49       ` David Brownell
2007-08-31 18:41         ` Kevin Hilman
2007-08-31 20:10           ` David Brownell
2007-08-31  5:48 ` [PATCH 0/2] MUSB: tracking down locking bugs David Brownell
2007-08-31  6:04   ` Kevin Hilman
2007-08-31  6:38     ` David Brownell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070831025811.557377351@mvista.com \
    --to=khilman@mvista.com \
    --cc=linux-omap-open-source@linux.omap.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox