i2c: designwear: Fix clk warning on suspend/resume
Subsystems (3)
PATCH v2 1/1 i2c: designwear: Fix clk warning on suspend/resume
On my HiKey board, I'm seeing clk warnings on suspend/resume, which seem to be caused by runtime pm suspending the device, then the same suspend hook being called again on suspend time.
This patch fixes this by setting the SYSTEM_SLEEP_PM_OPS to using pm_runtime_force_suspend and pm_runtime_force_resume.
---
v2: Switch to suggested fix by Jarkko.
drivers/i2c/busses/i2c-designware-platdrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-designware-platdrv.c +1 -1
@@ -362,7 +362,7 @@ static int dw_i2c_plat_resume(struct device *dev)static const struct dev_pm_ops dw_i2c_dev_pm_ops = { .prepare = dw_i2c_plat_prepare, .complete = dw_i2c_plat_complete, - SET_SYSTEM_SLEEP_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume) + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)SET_RUNTIME_PM_OPS (dw_i2c_plat_suspend, dw_i2c_plat_resume,NULL ) };
Signature · 1 line
2.7.4
Quoted 25 lines · John Stultz
On my HiKey board, I'm seeing clk warnings on suspend/resume, which seem to be caused by runtime pm suspending the device, then the same suspend hook being called again on suspend time.
This patch fixes this by setting the
SYSTEM_SLEEP_PM_OPSto usingpm_runtime_force_suspendandpm_runtime_force_resume.Cc Jarkko Nikula <[email protected]>Cc Andy Shevchenko <[email protected]>Cc Mika Westerberg <[email protected]>Cc Wolfram Sang <[email protected]>Suggested-by Jarkko Nikula <[email protected]>Signed-off-by John Stultz <[email protected]>---
v2: Switch to suggested fix by Jarkko.drivers/i2c/busses/i2c-designware-platdrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/i2c/busses/i2c-designware-platdrv.c +0
-0
drivers/i2c/busses/i2c-designware-platdrv.c static int dw_i2c_plat_resume(struct device *dev) · line 367
Quoted 7 lines
drivers/i2c/busses/i2c-designware-platdrv.c +1
-1@@ -362,7 +362,7 @@ static int dw_i2c_plat_resume(struct device *dev)static const struct dev_pm_ops dw_i2c_dev_pm_ops = { .prepare = dw_i2c_plat_prepare, .complete = dw_i2c_plat_complete, - SET_SYSTEM_SLEEP_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume) + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)SET_RUNTIME_PM_OPS (dw_i2c_plat_suspend, dw_i2c_plat_resume,NULL ) };
We need to hold this a bit. I've been debugging this on our platforms but haven't figured out yet how to fix a regression it is causing with drivers/acpi/acpi_lpss.c :-(
With this change in i2c-designware-platdrv.c the suspend path in acpi_lpss.c changes. First it saves its the register context in acpi_lpss_runtime_suspend() and powers down. Then the device which is now off will save again the register context (now reads full of 0xff...) in acpi_lpss_suspend_late() and restores wrong context (0xff...) when resuming.
Signature · 1 line
Jarkko
Quoted 42 lines · Jarkko Nikula
Quoted 27 lines · John Stultz
On my HiKey board, I'm seeing clk warnings on suspend/resume, which seem to be caused by runtime pm suspending the device, then the same suspend hook being called again on suspend time.
This patch fixes this by setting the
SYSTEM_SLEEP_PM_OPSto usingpm_runtime_force_suspendandpm_runtime_force_resume.Cc Jarkko Nikula <[email protected]>Cc Andy Shevchenko <[email protected]>Cc Mika Westerberg <[email protected]>Cc Wolfram Sang <[email protected]>Suggested-by Jarkko Nikula <[email protected]>Signed-off-by John Stultz <[email protected]>---
v2: Switch to suggested fix by Jarkko.drivers/i2c/busses/i2c-designware-platdrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/i2c/busses/i2c-designware-platdrv.c +0
-0drivers/i2c/busses/i2c-designware-platdrv.c static int dw_i2c_plat_resume(struct device *dev) · line 368
Quoted 8 lines
drivers/i2c/busses/i2c-designware-platdrv.c +1
-1@@ -362,7 +362,7 @@ static int dw_i2c_plat_resume(struct device *dev)static const struct dev_pm_ops dw_i2c_dev_pm_ops = { .prepare = dw_i2c_plat_prepare, .complete = dw_i2c_plat_complete, - SET_SYSTEM_SLEEP_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume) + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)SET_RUNTIME_PM_OPS (dw_i2c_plat_suspend, dw_i2c_plat_resume,NULL ) };We need to hold this a bit. I've been debugging this on our platforms but haven't figured out yet how to fix a regression it is causing with
drivers/acpi/acpi_lpss.c:-(
Quoted 5 lines
With this change in
i2c-designware-platdrv.cthe suspend path inacpi_lpss.cchanges. First it saves its the register context inacpi_lpss_runtime_suspend()and powers down. Then the device which is now off will save again the register context (now reads full of0xff...) inacpi_lpss_suspend_late()and restores wrong context (0xff...) when resuming.
Hey,
Just wanted to follow up to see if any progress was made on this
issue? Anything you need from me?
thanks
-john