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>
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, lkml <linux-kernel@vger.kernel.org>,
	zhangfei <zhangfei.gao@linaro.org>,
	Guodong Xu <guodong.xu@linaro.org>,
	Amit Pundir <amit.pundir@linaro.org>
Subject: Re: Issue with i2c-designware-platdrv's suspend/runtime-suspend handling
Date: Tue, 31 Jan 2017 11:32:44 +0200	[thread overview]
Message-ID: <0c44fe3a-b6d7-c947-0137-be4d33e132d7@linux.intel.com> (raw)
In-Reply-To: <CALAqxLVzW6Di5GM6iXi7PUen2Dq0TZ=awXYXY74BUK02Nfwm0Q@mail.gmail.com>

On 01/31/2017 12:05 AM, John Stultz wrote:
> On Tue, Jan 24, 2017 at 2:03 PM, John Stultz <john.stultz@linaro.org> wrote:
>> Doing some further debugging, it seems the problem is that the device
>> is being runtime suspended, and then at suspend time, we're calling
>> the same logic, calling i2c_dw_plat_prepare_clk, which causes the clk
>> count warning.
>>
>> Removing the runtime pm ops:
>> -       SET_RUNTIME_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume, NULL)
>> +//     SET_RUNTIME_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume, NULL)
>>
>> seems to avoid the warning, but clearly isn't ideal. :)
>>
>> Should there be some logic keep track of the suspend state for the
>> dw_i2c_dev device so we don't try to suspend (or resume) it twice?  Or
>> is there something else I'm missing to keep this from happening?
>
> Ping? Any thoughts on how best to fix this?  I'm leaning towards
> adding a suspended state to the struct dw_i2c_dev. Any objections?
>
I wonder why device PM doesn't take care of this?

If i2c-designware is enumerated from ACPI then drivers/acpi/device_pm.c: 
acpi_subsys_suspend() resumes devices suspended at run time before 
system suspend so dw_i2c_plat_suspend() won't be called twice.

But still I think device PM should not attempt to suspend already 
suspended device?

-- 
Jarkko

      reply	other threads:[~2017-01-31  9:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-24 22:03 Issue with i2c-designware-platdrv's suspend/runtime-suspend handling John Stultz
2017-01-30 22:05 ` John Stultz
2017-01-31  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=0c44fe3a-b6d7-c947-0137-be4d33e132d7@linux.intel.com \
    --to=jarkko.nikula@linux.intel.com \
    --cc=amit.pundir@linaro.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=guodong.xu@linaro.org \
    --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 \
    --cc=zhangfei.gao@linaro.org \
    /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).