phy: omap-usb2: Prevent unbalanced clock disable on system suspend/resume
If the PHY was not initialized before system suspend/resume then we try to disable clocks from omap_usb2_suspend() for not yet enabled clocks causing a warning as shown. During system suspend, the pm_runtime_put() call from phy->power_off() will not result in a runtime suspend callback for the omap usb2 phy. So we need to explicitly turn off the USB clocks in suspend. And turn them back on on resume if device was not runtime suspended. [ 41.920002] WARNING: CPU: 1 PID: 3390 at drivers/clk/clk.c:885 clk_disable+0x18/0x24() [ 41.920020] Modules linked in: btwilink bluetooth 6lowpan_iphc m25p80 omap_remoteproc [ 41.920028] CPU: 1 PID: 3390 Comm: rtcwake Not tainted 3.14.19-02011-g3ece3ca #641 [ 41.920047] [<c0016090>] (unwind_backtrace) from [<c0012060>] (show_stack+0x10/0x14) [ 41.920059] [<c0012060>] (show_stack) from [<c062a314>] (dump_stack+0x78/0x94) [ 41.920071] [<c062a314>] (dump_stack) from [<c0043bc4>] (warn_slowpath_common+0x6c/0x90) [ 41.920081] [<c0043bc4>] (warn_slowpath_common) from [<c0043c04>] (warn_slowpath_null+0x1c/0x24) [ 41.920091] [<c0043c04>] (warn_slowpath_null) from [<c0530fc4>] (clk_disable+0x18/0x24) [ 41.920103] [<c0530fc4>] (clk_disable) from [<c0310f28>] (omap_usb2_suspend+0x3c/0x54) [ 41.920113] [<c0310f28>] (omap_usb2_suspend) from [<c03e5570>] (platform_pm_suspend+0x2c/0x54) [ 41.920125] [<c03e5570>] (platform_pm_suspend) from [<c03ea654>] (dpm_run_callback+0x34/0x70) [ 41.920133] [<c03ea654>] (dpm_run_callback) from [<c03eaa04>] (__device_suspend+0x10c/0x2f4) [ 41.920142] [<c03eaa04>] (__device_suspend) from [<c03ebf90>] (dpm_suspend+0x5c/0x21c) [ 41.920151] [<c03ebf90>] (dpm_suspend) from [<c008e884>] (suspend_devices_and_enter+0x9c/0x3c0) [ 41.920159] [<c008e884>] (suspend_devices_and_enter) from [<c008edb8>] (pm_suspend+0x210/0x24c) [ 41.920166] [<c008edb8>] (pm_suspend) from [<c008d9f8>] (state_store+0x68/0xb8) [ 41.920175] [<c008d9f8>] (state_store) from [<c02ee64c>] (kobj_attr_store+0x14/0x20) [ 41.920186] [<c02ee64c>] (kobj_attr_store) from [<c0188ad0>] (sysfs_kf_write+0x4c/0x50) [ 41.920195] [<c0188ad0>] (sysfs_kf_write) from [<c018c0cc>] (kernfs_fop_write+0xb4/0x150) [ 41.920206] [<c018c0cc>] (kernfs_fop_write) from [<c0125200>] (vfs_write+0xa8/0x180) [ 41.920215] [<c0125200>] (vfs_write) from [<c01255c0>] (SyS_write+0x40/0x8c) [ 41.920225] [<c01255c0>] (SyS_write) from [<c000e580>] (ret_fast_syscall+0x0/0x48) Reported-by:Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by:
Roger Quadros <rogerq@ti.com> Signed-off-by:
Sekhar Nori <nsekhar@ti.com>
Loading
Please sign in to comment