diff options
author | Kim Kyuwon <q1.kim@samsung.com> | 2009-03-26 21:56:51 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-04-17 13:50:26 -0400 |
commit | 0ec8fd70fbd7327e1bf747c4a2f6b67efdf16618 (patch) | |
tree | 5eff626ce5bd4b0975515fb12f69521910ea69d2 /drivers/usb | |
parent | 6b6e97107f12f3a9f7b5b43a6c3b94409240bcff (diff) |
USB: musb: fix possible panic while resuming
During driver resume processing, musb could cause a kernel panic.
Fix by enabling the clock earlier, with the resume_early method.
Signed-off-by: Kim Kyuwon <q1.kim@samsung.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/musb/musb_core.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 338cd1611ab3..0112353ec97d 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -2170,26 +2170,22 @@ static int musb_suspend(struct platform_device *pdev, pm_message_t message) | |||
2170 | return 0; | 2170 | return 0; |
2171 | } | 2171 | } |
2172 | 2172 | ||
2173 | static int musb_resume(struct platform_device *pdev) | 2173 | static int musb_resume_early(struct platform_device *pdev) |
2174 | { | 2174 | { |
2175 | unsigned long flags; | ||
2176 | struct musb *musb = dev_to_musb(&pdev->dev); | 2175 | struct musb *musb = dev_to_musb(&pdev->dev); |
2177 | 2176 | ||
2178 | if (!musb->clock) | 2177 | if (!musb->clock) |
2179 | return 0; | 2178 | return 0; |
2180 | 2179 | ||
2181 | spin_lock_irqsave(&musb->lock, flags); | ||
2182 | |||
2183 | if (musb->set_clock) | 2180 | if (musb->set_clock) |
2184 | musb->set_clock(musb->clock, 1); | 2181 | musb->set_clock(musb->clock, 1); |
2185 | else | 2182 | else |
2186 | clk_enable(musb->clock); | 2183 | clk_enable(musb->clock); |
2187 | 2184 | ||
2188 | /* for static cmos like DaVinci, register values were preserved | 2185 | /* for static cmos like DaVinci, register values were preserved |
2189 | * unless for some reason the whole soc powered down and we're | 2186 | * unless for some reason the whole soc powered down or the USB |
2190 | * not treating that as a whole-system restart (e.g. swsusp) | 2187 | * module got reset through the PSC (vs just being disabled). |
2191 | */ | 2188 | */ |
2192 | spin_unlock_irqrestore(&musb->lock, flags); | ||
2193 | return 0; | 2189 | return 0; |
2194 | } | 2190 | } |
2195 | 2191 | ||
@@ -2207,7 +2203,7 @@ static struct platform_driver musb_driver = { | |||
2207 | .remove = __devexit_p(musb_remove), | 2203 | .remove = __devexit_p(musb_remove), |
2208 | .shutdown = musb_shutdown, | 2204 | .shutdown = musb_shutdown, |
2209 | .suspend = musb_suspend, | 2205 | .suspend = musb_suspend, |
2210 | .resume = musb_resume, | 2206 | .resume_early = musb_resume_early, |
2211 | }; | 2207 | }; |
2212 | 2208 | ||
2213 | /*-------------------------------------------------------------------------*/ | 2209 | /*-------------------------------------------------------------------------*/ |