From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Linux-pm mailing list <linux-pm@lists.linux-foundation.org>
Subject: Re: [PATCH 2/7] PM: move code in power/runtime.c
Date: Sat, 25 Sep 2010 23:44:18 +0200 [thread overview]
Message-ID: <201009252344.18881.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1009241635160.1287-100000@iolanthe.rowland.org>
On Friday, September 24, 2010, Alan Stern wrote:
> This patch (as1421) moves the PM runtime accounting subroutines up to
> the beginning of runtime.c, taking them out of the middle of the
> functions that do the actual work. No operational changes.
>
> Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Appled to suspend-2.6/linux-next.
Thanks,
Rafael
> ---
>
> Index: usb-2.6/drivers/base/power/runtime.c
> ===================================================================
> --- usb-2.6.orig/drivers/base/power/runtime.c
> +++ usb-2.6/drivers/base/power/runtime.c
> @@ -15,6 +15,44 @@ static int __pm_request_idle(struct devi
> static int __pm_request_resume(struct device *dev);
>
> /**
> + * update_pm_runtime_accounting - Update the time accounting of power states
> + * @dev: Device to update the accounting for
> + *
> + * In order to be able to have time accounting of the various power states
> + * (as used by programs such as PowerTOP to show the effectiveness of runtime
> + * PM), we need to track the time spent in each state.
> + * update_pm_runtime_accounting must be called each time before the
> + * runtime_status field is updated, to account the time in the old state
> + * correctly.
> + */
> +void update_pm_runtime_accounting(struct device *dev)
> +{
> + unsigned long now = jiffies;
> + int delta;
> +
> + delta = now - dev->power.accounting_timestamp;
> +
> + if (delta < 0)
> + delta = 0;
> +
> + dev->power.accounting_timestamp = now;
> +
> + if (dev->power.disable_depth > 0)
> + return;
> +
> + if (dev->power.runtime_status == RPM_SUSPENDED)
> + dev->power.suspended_jiffies += delta;
> + else
> + dev->power.active_jiffies += delta;
> +}
> +
> +static void __update_runtime_status(struct device *dev, enum rpm_status status)
> +{
> + update_pm_runtime_accounting(dev);
> + dev->power.runtime_status = status;
> +}
> +
> +/**
> * pm_runtime_deactivate_timer - Deactivate given device's suspend timer.
> * @dev: Device to handle.
> */
> @@ -123,45 +161,6 @@ int pm_runtime_idle(struct device *dev)
> }
> EXPORT_SYMBOL_GPL(pm_runtime_idle);
>
> -
> -/**
> - * update_pm_runtime_accounting - Update the time accounting of power states
> - * @dev: Device to update the accounting for
> - *
> - * In order to be able to have time accounting of the various power states
> - * (as used by programs such as PowerTOP to show the effectiveness of runtime
> - * PM), we need to track the time spent in each state.
> - * update_pm_runtime_accounting must be called each time before the
> - * runtime_status field is updated, to account the time in the old state
> - * correctly.
> - */
> -void update_pm_runtime_accounting(struct device *dev)
> -{
> - unsigned long now = jiffies;
> - int delta;
> -
> - delta = now - dev->power.accounting_timestamp;
> -
> - if (delta < 0)
> - delta = 0;
> -
> - dev->power.accounting_timestamp = now;
> -
> - if (dev->power.disable_depth > 0)
> - return;
> -
> - if (dev->power.runtime_status == RPM_SUSPENDED)
> - dev->power.suspended_jiffies += delta;
> - else
> - dev->power.active_jiffies += delta;
> -}
> -
> -static void __update_runtime_status(struct device *dev, enum rpm_status status)
> -{
> - update_pm_runtime_accounting(dev);
> - dev->power.runtime_status = status;
> -}
> -
> /**
> * __pm_runtime_suspend - Carry out run-time suspend of given device.
> * @dev: Device to suspend.
>
>
>
prev parent reply other threads:[~2010-09-25 21:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-24 20:38 [PATCH 2/7] PM: move code in power/runtime.c Alan Stern
2010-09-25 21:44 ` Rafael J. Wysocki [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=201009252344.18881.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=linux-pm@lists.linux-foundation.org \
--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