On Thu, Mar 30, 2017 at 5:04 AM, Jarkko Nikula <jarkko.nikula@xxxxxxxxxxxxxxx> wrote: > There is possibility to enter dw_i2c_plat_suspend() callback twice > during system suspend under certain cases which is causing here warnings > from clk_core_disable() and clk_core_unprepare() as well as accessing the > registers that can be power gated. > > Commit 8503ff166504 ("i2c: designware: Avoid unnecessary resuming during > system suspend") implemented a prepare callback that checks for runtime > suspended device which allow PM core to set direct_complete flag and > skip system suspend and resume callbacks. > > However it can still happen if nothing resumes the device prior system > syspend (e.g. acpi_subsys_suspend()) and there is a slave device which > unsets the direct_complete flag of the parent in __device_suspend() thus > causing PM code to not skip the system suspend/resume callbacks. > > Avoid this by checking runtime status in suspend and resume callbacks > and return directly if device is runtime suspended. This affects only > system suspend/resume since during runtime suspend/resume runtime status > is suspending (not suspended) or resuming. > > Signed-off-by: Jarkko Nikula <jarkko.nikula@xxxxxxxxxxxxxxx> This works for me on my HiKey board! Tested-by: John Stultz <john.stultz@xxxxxxxxxx> thanks -john -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html