HACK: i2c: designware: Do nothing in system suspend/resume when RT suspended
Original thread: https://www.spinics.net/lists/linux-i2c/msg29413.html 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 8503ff16 ("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@linux.intel.com> Signed-off-by:
John Stultz <john.stultz@linaro.org> Signed-off-by:
Amit Pundir <amit.pundir@linaro.org>
Loading
Please sign in to comment