* [PATCH v2] i2c: designwear: Fix clk warning on suspend/resume
@ 2017-02-14 4:05 John Stultz
2017-02-14 15:30 ` Jarkko Nikula
0 siblings, 1 reply; 3+ messages in thread
From: John Stultz @ 2017-02-14 4:05 UTC (permalink / raw)
To: lkml
Cc: John Stultz, Jarkko Nikula, Andy Shevchenko, Mika Westerberg,
Wolfram Sang, linux-i2c
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.
Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: linux-i2c@vger.kernel.org
Suggested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
---
v2: Switch to suggested fix by Jarkko.
drivers/i2c/busses/i2c-designware-platdrv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 6ce4313..09f27ec 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -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)
};
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] i2c: designwear: Fix clk warning on suspend/resume
2017-02-14 4:05 [PATCH v2] i2c: designwear: Fix clk warning on suspend/resume John Stultz
@ 2017-02-14 15:30 ` Jarkko Nikula
2017-03-02 23:39 ` John Stultz
0 siblings, 1 reply; 3+ messages in thread
From: Jarkko Nikula @ 2017-02-14 15:30 UTC (permalink / raw)
To: John Stultz, lkml
Cc: Andy Shevchenko, Mika Westerberg, Wolfram Sang, linux-i2c
On 14.02.2017 06:05, John Stultz wrote:
> 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.
>
> Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> Cc: Wolfram Sang <wsa@the-dreams.de>
> Cc: linux-i2c@vger.kernel.org
> Suggested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> Signed-off-by: John Stultz <john.stultz@linaro.org>
> ---
> v2: Switch to suggested fix by Jarkko.
>
> drivers/i2c/busses/i2c-designware-platdrv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
> index 6ce4313..09f27ec 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -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.
--
Jarkko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] i2c: designwear: Fix clk warning on suspend/resume
2017-02-14 15:30 ` Jarkko Nikula
@ 2017-03-02 23:39 ` John Stultz
0 siblings, 0 replies; 3+ messages in thread
From: John Stultz @ 2017-03-02 23:39 UTC (permalink / raw)
To: Jarkko Nikula
Cc: lkml, Andy Shevchenko, Mika Westerberg, Wolfram Sang, linux-i2c
On Tue, Feb 14, 2017 at 7:30 AM, Jarkko Nikula
<jarkko.nikula@linux.intel.com> wrote:
> On 14.02.2017 06:05, John Stultz wrote:
>>
>> 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.
>>
>> Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>
>> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
>> Cc: Wolfram Sang <wsa@the-dreams.de>
>> Cc: linux-i2c@vger.kernel.org
>> Suggested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
>> Signed-off-by: John Stultz <john.stultz@linaro.org>
>> ---
>> v2: Switch to suggested fix by Jarkko.
>>
>> drivers/i2c/busses/i2c-designware-platdrv.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c
>> b/drivers/i2c/busses/i2c-designware-platdrv.c
>> index 6ce4313..09f27ec 100644
>> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
>> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
>> @@ -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.
Hey,
Just wanted to follow up to see if any progress was made on this
issue? Anything you need from me?
thanks
-john
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-03-03 1:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-14 4:05 [PATCH v2] i2c: designwear: Fix clk warning on suspend/resume John Stultz
2017-02-14 15:30 ` Jarkko Nikula
2017-03-02 23:39 ` John Stultz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.