summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJassi Brar <jaswinder.singh@linaro.org>2011-04-13 11:46:41 +0100
committerNicolas Pitre <nicolas.pitre@linaro.org>2011-04-14 13:46:17 -0400
commit5b612fcb26b784180ef9add46a37007a917b3461 (patch)
tree09682c82a8c2bdddeb0299ddd24fc3da3a884699 /drivers
parent532e4cace52775dcd4fb787b825d998783cddf98 (diff)
MUSB: shutdown: Make sure block is awake before doing shutdown
Without this an OOPS can be seen at shutdown because the peripheral unit is unclocked, leading to an "imprecise external abort" Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org> Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/musb/musb_core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 630ae7f3cd4..a6d3f2ffe81 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1030,6 +1030,8 @@ static void musb_shutdown(struct platform_device *pdev)
struct musb *musb = dev_to_musb(&pdev->dev);
unsigned long flags;
+ pm_runtime_get_sync(musb->controller);
+
spin_lock_irqsave(&musb->lock, flags);
musb_platform_disable(musb);
musb_generic_disable(musb);
@@ -1040,6 +1042,8 @@ static void musb_shutdown(struct platform_device *pdev)
musb_writeb(musb->mregs, MUSB_DEVCTL, 0);
musb_platform_exit(musb);
+ pm_runtime_put(musb->controller);
+
/* FIXME power down */
}
@@ -2197,11 +2201,9 @@ static int __exit musb_remove(struct platform_device *pdev)
* - Peripheral mode: peripheral is deactivated (or never-activated)
* - OTG mode: both roles are deactivated (or never-activated)
*/
- pm_runtime_get_sync(musb->controller);
musb_exit_debugfs(musb);
musb_shutdown(pdev);
- pm_runtime_put(musb->controller);
musb_free(musb);
iounmap(ctrl_base);
device_init_wakeup(&pdev->dev, 0);