From: Wolfram Sang <wsa@the-dreams.de>
To: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
linux-i2c@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH] i2c: designware: Prevent runtime suspend during adapter registration
Date: Fri, 12 Feb 2016 20:04:10 +0100 [thread overview]
Message-ID: <20160212190410.GK1520@katana> (raw)
In-Reply-To: <1455201363-3278-1-git-send-email-jarkko.nikula@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1559 bytes --]
On Thu, Feb 11, 2016 at 04:36:03PM +0200, Jarkko Nikula wrote:
> There can be unnecessary runtime suspend-resume cycle during
> i2c-designware-platdrv probe when it registers the I2C adapter device. This
> happens because i2c-designware-platdrv is set to initially active platform
> device in its probe function and is a parent of I2C adapter.
>
> In that case power.usage_count of i2c-designware device is zero and
> pm_runtime_get()/pm_runtime_put() cycle during probe could put it into
> runtime suspend. This happens when the i2c_register_adapter() calls the
> device_register():
>
> i2c_register_adapter
> device_register
> device_add
> bus_probe_device
> device_initial_probe
> __device_attach
> if (dev->parent) pm_runtime_get_sync(dev->parent)
> ...
> if (dev->parent) pm_runtime_put(dev->parent)
>
> After that the i2c_register_adapter() continues registering I2C slave
> devices. In case slave device probe does I2C transfers the parent will
> resume again and thus get a needless runtime suspend/resume cycle during
> adapter registration.
>
> Prevent this while retaining the runtime PM status of i2c-designware by
> only incrementing/decrementing device power usage count during I2C
> adapter registration. That makes sure there won't be spurious runtime PM
> status changes and lets the driver core to idle the device after probe
> finishes.
>
> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Applied to for-next, thanks!
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2016-02-12 19:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-11 14:36 [PATCH] i2c: designware: Prevent runtime suspend during adapter registration Jarkko Nikula
2016-02-11 14:47 ` Mika Westerberg
2016-02-12 19:04 ` Wolfram Sang [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=20160212190410.GK1520@katana \
--to=wsa@the-dreams.de \
--cc=andriy.shevchenko@linux.intel.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
/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).