• Grazvydas Ignotas's avatar
    usb: musb: fix some runtime_pm issues · c04352a5
    Grazvydas Ignotas authored
    When runtime_pm was originally added, it was done in rather confusing
    way: omap2430_musb_init() (called from musb_init_controller) would do
    runtime_pm_get_sync() and musb_init_controller() itself would do
    runtime_pm_put to balance it out. This is not only confusing but also
    wrong if non-omap2430 glue layer is used.
    
    This confusion resulted in commit 772aed45 "usb: musb: fix
    pm_runtime mismatch", that removed runtime_pm_put() from
    musb_init_controller as that looked unbalanced, and also happened to
    fix unrelated isp1704_charger crash. However this broke runtime PM
    functionality (musb is now always powered, even without gadget active).
    
    Avoid these confusing runtime pm dependences by making
    musb_init_controller() and omap2430_musb_init() do their own runtime
    get/put pairs; also cover error paths. Remove unneeded runtime_pm_put
    in omap2430_remove too. isp1704_charger crash that motivated
    772aed45 will be fixed by following patch.
    
    Cc: Felipe Contreras <felipe.contreras@gmail.com>
    Signed-off-by: default avatarGrazvydas Ignotas <notasas@gmail.com>
    Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
    c04352a5
musb_core.c 66.6 KB