From: Kim Kyuwon <chammoru@gmail.com>
To: linux-usb@vger.kernel.org
Cc: OMAP <linux-omap@vger.kernel.org>,
David Brownell <david-b@pacbell.net>,
me@felipebalbi.com, q1.kim@samsung.com,
Minkyu Kang <mk7.kang@samsung.com>
Subject: [PATCH 1/2] usb: musb: fix the possible panic while resuming
Date: Wed, 25 Feb 2009 20:53:00 +0900 [thread overview]
Message-ID: <4d34a0a70902250353i3c6e072bnd41af327bc77601b@mail.gmail.com> (raw)
From: Kim Kyuwon <chammoru@gmail.com>
While waking up, musb can cause a kernel panic. This patch is fixing
it by enabling the clock in the resume_early method.
Signed-off-by: Kim Kyuwon <chammoru@gmail.com>
---
drivers/usb/musb/musb_core.c | 21 +++++++--------------
1 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 2cc34fa..ae76ad7 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2141,16 +2141,13 @@ static int __devexit musb_remove(struct
platform_device *pdev)
#ifdef CONFIG_PM
-static int musb_suspend(struct platform_device *pdev, pm_message_t message)
+static int musb_suspend_late(struct platform_device *pdev, pm_message_t state)
{
- unsigned long flags;
- struct musb *musb = dev_to_musb(&pdev->dev);
+ struct musb *musb = dev_to_musb(&pdev->dev);
if (!musb->clock)
return 0;
- spin_lock_irqsave(&musb->lock, flags);
-
if (is_peripheral_active(musb)) {
/* FIXME force disconnect unless we know USB will wake
* the system up quickly enough to respond ...
@@ -2165,20 +2162,17 @@ static int musb_suspend(struct platform_device
*pdev, pm_message_t message)
musb->set_clock(musb->clock, 0);
else
clk_disable(musb->clock);
- spin_unlock_irqrestore(&musb->lock, flags);
+
return 0;
}
-static int musb_resume(struct platform_device *pdev)
+static int musb_resume_early(struct platform_device *pdev)
{
- unsigned long flags;
- struct musb *musb = dev_to_musb(&pdev->dev);
+ struct musb *musb = dev_to_musb(&pdev->dev);
if (!musb->clock)
return 0;
- spin_lock_irqsave(&musb->lock, flags);
-
if (musb->set_clock)
musb->set_clock(musb->clock, 1);
else
@@ -2188,7 +2182,6 @@ static int musb_resume(struct platform_device *pdev)
* unless for some reason the whole soc powered down and we're
* not treating that as a whole-system restart (e.g. swsusp)
*/
- spin_unlock_irqrestore(&musb->lock, flags);
return 0;
}
@@ -2205,8 +2198,8 @@ static struct platform_driver musb_driver = {
},
.remove = __devexit_p(musb_remove),
.shutdown = musb_shutdown,
- .suspend = musb_suspend,
- .resume = musb_resume,
+ .suspend_late = musb_suspend_late,
+ .resume_early = musb_resume_early,
};
/*-------------------------------------------------------------------------*/
--
1.5.2.5
--
Kyuwon
next reply other threads:[~2009-02-25 11:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-25 11:53 Kim Kyuwon [this message]
2009-02-26 0:13 ` [PATCH 1/2] usb: musb: fix the possible panic while resuming Felipe Balbi
2009-02-26 5:54 ` Kim Kyuwon
2009-02-26 6:37 ` Gadiyar, Anand
[not found] ` <5A47E75E594F054BAF48C5E4FC4B92AB02FAA91C14-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2009-02-26 6:57 ` Kim Kyuwon
[not found] ` <4d34a0a70902252257lc8b3a1duc6cbd6de2cbd2840-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-02-26 7:20 ` Gadiyar, Anand
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=4d34a0a70902250353i3c6e072bnd41af327bc77601b@mail.gmail.com \
--to=chammoru@gmail.com \
--cc=david-b@pacbell.net \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=me@felipebalbi.com \
--cc=mk7.kang@samsung.com \
--cc=q1.kim@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.