From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Linux PM list <linux-pm@vger.kernel.org>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alan Stern <stern@rowland.harvard.edu>,
Bjorn Helgaas <bhelgaas@google.com>,
Linux PCI <linux-pci@vger.kernel.org>,
Kevin Hilman <khilman@linaro.org>
Subject: Re: [PATCH RFC] PM / Runtime: Rework the "runtime idle" helper routine
Date: Wed, 29 May 2013 11:29:59 +0300 [thread overview]
Message-ID: <20130529082959.GW11878@intel.com> (raw)
In-Reply-To: <1463685.qFyr66vqF2@vostro.rjw.lan>
On Wed, May 29, 2013 at 01:29:06AM +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> The "runtime idle" helper routine, rpm_idle(), currently ignores
> return values from .runtime_idle() callbacks executed by it.
>
> However, it turns out that many subsystems use the generic idle
> callback routine pm_generic_runtime_idle() which checks the return
> value of the driver's callback and executes pm_runtime_suspend() for
> the device unless that value is different from 0. If that logic is
> moved to rpm_idle() instead, pm_generic_runtime_idle() can be dropped
> and its users will not need any .runtime_idle() callbacks any more.
>
> Moreover, the PCI subsystem's .runtime_idle() routine,
> pci_pm_runtime_idle(), works in analogy with the generic one and if
> rpm_idle() calls rpm_suspend() after 0 has been returned by the
> .runtime_idle() callback executed by it, that routine will not be
> necessary any more and may be dropped.
>
> To reduce overall code duplication make the changes described above.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>
> The patch doesn't break compilation for me, but it hasn't been tested
> otherwise. It applies on top of the linux-pm.git tree's linux-next branch.
>
> Thanks,
> Rafael
>
> ---
> Documentation/power/runtime_pm.txt | 5 -----
> arch/arm/mach-omap2/omap_device.c | 7 +------
> drivers/acpi/device_pm.c | 1 -
> drivers/amba/bus.c | 2 +-
> drivers/base/platform.c | 1 -
> drivers/base/power/domain.c | 1 -
> drivers/base/power/generic_ops.c | 23 -----------------------
> drivers/base/power/runtime.c | 12 +++++-------
> drivers/i2c/i2c-core.c | 2 +-
i2c-core runtime PM idle still works with this patch :-)
You can add my
Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
for the i2c parts if you like.
> drivers/mmc/core/sdio_bus.c | 2 +-
> drivers/pci/pci-driver.c | 27 ---------------------------
> drivers/spi/spi.c | 2 +-
> drivers/usb/core/port.c | 1 -
> include/linux/pm_runtime.h | 2 --
> 14 files changed, 10 insertions(+), 78 deletions(-)
next prev parent reply other threads:[~2013-05-29 8:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-28 23:29 [PATCH RFC] PM / Runtime: Rework the "runtime idle" helper routine Rafael J. Wysocki
2013-05-29 8:29 ` Mika Westerberg [this message]
2013-05-29 14:51 ` Alan Stern
2013-05-29 22:18 ` Rafael J. Wysocki
2013-05-30 1:05 ` Aaron Lu
2013-05-30 17:08 ` Alan Stern
2013-05-30 19:55 ` Rafael J. Wysocki
2013-05-30 20:13 ` Alan Stern
2013-06-02 21:50 ` [PATCH 0/2] PM / Runtime: Rework the "runtime idle" helper routine (was: Re: [PATCH RFC] PM / Runtime: Rework the "runtime idle" helper routine) Rafael J. Wysocki
2013-06-02 21:52 ` [PATCH 1/2, v2] PM / Runtime: Rework the "runtime idle" helper routine Rafael J. Wysocki
2013-06-04 5:14 ` Aaron Lu
2013-06-04 7:15 ` Lan Tianyu
2013-06-02 21:53 ` [PATCH 2/2] PM / Runtime: Update .runtime_idle() callback documentation Rafael J. Wysocki
2013-05-31 19:55 ` [PATCH RFC] PM / Runtime: Rework the "runtime idle" helper routine Kevin Hilman
2013-06-02 19:44 ` Ulf Hansson
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=20130529082959.GW11878@intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=khilman@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@sisk.pl \
--cc=stern@rowland.harvard.edu \
/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).