From: Wolfram Sang <wsa@the-dreams.de>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
linux-i2c@vger.kernel.org,
Jarkko Nikula <jarkko.nikula@linux.intel.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Jisheng Zhang <jszhang@marvell.com>,
John Stultz <john.stultz@linaro.org>,
Guodong Xu <guodong.xu@linaro.org>,
Sumit Semwal <sumit.semwal@linaro.org>,
Haojian Zhuang <haojian.zhuang@linaro.org>,
linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org,
"# v4 . 4+" <stable@vger.kernel.org>
Subject: Re: [PATCH] i2c: designware: Fix system suspend
Date: Mon, 14 Aug 2017 21:04:40 +0200 [thread overview]
Message-ID: <20170814190440.jaznldtdpr7trvz4@ninjato> (raw)
In-Reply-To: <1776600.GWYGTRKWSN@aspire.rjw.lan>
[-- Attachment #1: Type: text/plain, Size: 2393 bytes --]
On Wed, Aug 09, 2017 at 10:43:22PM +0200, Rafael J. Wysocki wrote:
> On Wednesday, August 9, 2017 3:28:22 PM CEST Ulf Hansson wrote:
> > The commit 8503ff166504 ("i2c: designware: Avoid unnecessary resuming
> > during system suspend"), may suggest to the PM core to try out the so
> > called direct_complete path for system sleep. In this path, the PM core
> > treats a runtime suspended device as it's already in a proper low power
> > state for system sleep, which makes it skip calling the system sleep
> > callbacks for the device, except for the ->prepare() and the ->complete()
> > callbacks.
> >
> > However, the PM core may unset the direct_complete flag for a parent
> > device, in case its child device are being system suspended before. In this
> > scenario, the PM core invokes the system sleep callbacks, no matter if the
> > device is runtime suspended or not.
> >
> > Particularly in cases of an existing i2c slave device, the above path is
> > triggered, which breaks the assumption that the i2c device is always
> > runtime resumed whenever the dw_i2c_plat_suspend() is being called.
> >
> > More precisely, dw_i2c_plat_suspend() calls clk_core_disable() and
> > clk_core_unprepare(), for an already disabled/unprepared clock, leading to
> > a splat in the log about clocks calls being wrongly balanced and breaking
> > system sleep.
> >
> > To still allow the direct_complete path in cases when it's possible, but
> > also to keep the fix simple, let's runtime resume the i2c device in the
> > ->suspend() callback, before continuing to put the device into low power
> > state.
> >
> > Note, in cases when the i2c device is attached to the ACPI PM domain, this
> > problem doesn't occur, because ACPI's ->suspend() callback, assigned to
> > acpi_subsys_suspend(), already calls pm_runtime_resume() for the device.
> >
> > It should also be noted that this change does not fix commit 8503ff166504
> > ("i2c: designware: Avoid unnecessary resuming during system suspend").
> > Because for the non-ACPI case, the system sleep support was already broken
> > prior that point.
> >
> > Cc: <stable@vger.kernel.org> # v4.4+
> > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
>
> Looks OK to me.
I read this as Acked-by. If so, using the real "Acked-by" tag would be
helpful because patchwork collects them automatically.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-08-14 19:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-09 13:28 [PATCH] i2c: designware: Fix system suspend Ulf Hansson
2017-08-09 20:43 ` Rafael J. Wysocki
2017-08-14 19:04 ` Wolfram Sang [this message]
2017-08-09 20:55 ` John Stultz
2017-08-10 10:25 ` Jarkko Nikula
2017-08-10 10:31 ` Mika Westerberg
2017-08-14 19:07 ` Wolfram Sang
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=20170814190440.jaznldtdpr7trvz4@ninjato \
--to=wsa@the-dreams.de \
--cc=andriy.shevchenko@linux.intel.com \
--cc=guodong.xu@linaro.org \
--cc=haojian.zhuang@linaro.org \
--cc=jarkko.nikula@linux.intel.com \
--cc=john.stultz@linaro.org \
--cc=jszhang@marvell.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=rjw@rjwysocki.net \
--cc=stable@vger.kernel.org \
--cc=sumit.semwal@linaro.org \
--cc=ulf.hansson@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