aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2015-12-08 00:23:15 -0500
committerFelipe Balbi <balbi@ti.com>2015-12-08 09:41:09 -0500
commit4d05591094979d24a0e728f246589963c40102e9 (patch)
tree92228da51cff433b569da9e8faafa7f7589c8b49
parent928c75fbeb6b62edbdff7c52ee1e9a3591faee4f (diff)
usb: musb: core: Fix pm runtime for deferred probe
If musb_init_controller fails at musb_platform_init, we have already called pm_runtime_irq_safe for musb and that causes the pm runtime count to be enabled for parent before the parent has completed initialization. This causes pm to stop working as on unload nothing gets idled. This issue can be reproduced at least with: # modprobe omap2430 HS USB OTG: no transceiver configured musb-hdrc musb-hdrc.0.auto: musb_init_controller failed with status -517 # modprobe phy-twl4030-usb # rmmod omap2430 And after the steps above omap2430 will block deeper idle states on omap3. To fix this, let's not enable pm runtime until we need to and the parent has been initialized. Note that this does not fix the issue of PM being broken for musb during runtime. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--drivers/usb/musb/musb_core.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 18cfc0a361cb..3c07ffd392cf 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2017,7 +2017,6 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
2017 /* We need musb_read/write functions initialized for PM */ 2017 /* We need musb_read/write functions initialized for PM */
2018 pm_runtime_use_autosuspend(musb->controller); 2018 pm_runtime_use_autosuspend(musb->controller);
2019 pm_runtime_set_autosuspend_delay(musb->controller, 200); 2019 pm_runtime_set_autosuspend_delay(musb->controller, 200);
2020 pm_runtime_irq_safe(musb->controller);
2021 pm_runtime_enable(musb->controller); 2020 pm_runtime_enable(musb->controller);
2022 2021
2023 /* The musb_platform_init() call: 2022 /* The musb_platform_init() call:
@@ -2218,6 +2217,12 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
2218 2217
2219 pm_runtime_put(musb->controller); 2218 pm_runtime_put(musb->controller);
2220 2219
2220 /*
2221 * For why this is currently needed, see commit 3e43a0725637
2222 * ("usb: musb: core: add pm_runtime_irq_safe()")
2223 */
2224 pm_runtime_irq_safe(musb->controller);
2225
2221 return 0; 2226 return 0;
2222 2227
2223fail5: 2228fail5: