From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754538AbdBNPbD (ORCPT ); Tue, 14 Feb 2017 10:31:03 -0500 Received: from mga07.intel.com ([134.134.136.100]:51987 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752573AbdBNPai (ORCPT ); Tue, 14 Feb 2017 10:30:38 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,161,1484035200"; d="scan'208";a="1094664077" Subject: Re: [PATCH v2] i2c: designwear: Fix clk warning on suspend/resume To: John Stultz , lkml References: <1487045142-1434-1-git-send-email-john.stultz@linaro.org> Cc: Andy Shevchenko , Mika Westerberg , Wolfram Sang , linux-i2c@vger.kernel.org From: Jarkko Nikula Message-ID: Date: Tue, 14 Feb 2017 17:30:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 MIME-Version: 1.0 In-Reply-To: <1487045142-1434-1-git-send-email-john.stultz@linaro.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Cc: Andy Shevchenko > Cc: Mika Westerberg > Cc: Wolfram Sang > Cc: linux-i2c@vger.kernel.org > Suggested-by: Jarkko Nikula > Signed-off-by: John Stultz > --- > 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