linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: John Stultz <john.stultz@linaro.org>,
	lkml <linux-kernel@vger.kernel.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Wolfram Sang <wsa@the-dreams.de>,
	linux-i2c@vger.kernel.org
Subject: Re: [PATCH] i2c: designwear: Fix clk warning on suspend/resume
Date: Mon, 6 Feb 2017 11:32:46 +0200	[thread overview]
Message-ID: <c2af06f5-292f-a8f3-3baa-d239d4035bb3@linux.intel.com> (raw)
In-Reply-To: <1486162893-12313-1-git-send-email-john.stultz@linaro.org>

Hi

On 04.02.2017 01:01, 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.
>
> Thus this patch adds suspend state tracking to avoid runtime pm and
> suspend causing double suspend calls on i2c-designware-platdrv.
>
> Feedback would be greatly appreciated!
>
> 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
> Signed-off-by: John Stultz <john.stultz@linaro.org>
> ---
>  drivers/i2c/busses/i2c-designware-core.h    | 1 +
>  drivers/i2c/busses/i2c-designware-platdrv.c | 9 +++++++++
>  2 files changed, 10 insertions(+)
>
...
> @@ -340,8 +340,12 @@ static int dw_i2c_plat_suspend(struct device *dev)
>  	struct platform_device *pdev = to_platform_device(dev);
>  	struct dw_i2c_dev *i_dev = platform_get_drvdata(pdev);
>
> +	if (i_dev->suspended)
> +		return 0;
> +
>  	i2c_dw_disable(i_dev);
>  	i2c_dw_plat_prepare_clk(i_dev, false);
> +	i_dev->suspended = true;
>
This feels a band-aid fix. At quick look some drivers appear to use 
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, 
pm_runtime_force_resume) in their dev_pm_ops.

Could you try does it help in your case and I'll check our platforms.

-- 
Jarkko

      reply	other threads:[~2017-02-06  9:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-03 23:01 [PATCH] i2c: designwear: Fix clk warning on suspend/resume John Stultz
2017-02-06  9:32 ` Jarkko Nikula [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c2af06f5-292f-a8f3-3baa-d239d4035bb3@linux.intel.com \
    --to=jarkko.nikula@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).