linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PM/runtime: Fix 'jiffies' in comments after move to hrtimers
@ 2019-01-09 17:23 Ladislav Michl
  2019-01-09 22:03 ` Rafael J. Wysocki
  0 siblings, 1 reply; 5+ messages in thread
From: Ladislav Michl @ 2019-01-09 17:23 UTC (permalink / raw)
  To: linux-pm, linux-kernel, linux-arm-kernel, linux-omap, rjw,
	ulf.hansson, tony
  Cc: Vincent Guittot

PM-runtime now uses the hrtimers infrastructure for autosuspend, however
comments still reference 'jiffies'.

Fixes: 8234f6734c5d ("PM-runtime: Switch autosuspend over to using hrtimers")
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 drivers/base/power/runtime.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 70624695b6d5..096f7996d914 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -121,7 +121,7 @@ static void pm_runtime_cancel_pending(struct device *dev)
  * Compute the autosuspend-delay expiration time based on the device's
  * power.last_busy time.  If the delay has already expired or is disabled
  * (negative) or the power.use_autosuspend flag isn't set, return 0.
- * Otherwise return the expiration time in jiffies (adjusted to be nonzero).
+ * Otherwise return the expiration time in nanoseconds (adjusted to be nonzero).
  *
  * This function may be called either with or without dev->power.lock held.
  * Either way it can be racy, since power.last_busy may be updated at any time.
@@ -905,7 +905,7 @@ static enum hrtimer_restart  pm_suspend_timer_fn(struct hrtimer *timer)
 	spin_lock_irqsave(&dev->power.lock, flags);
 
 	expires = dev->power.timer_expires;
-	/* If 'expire' is after 'jiffies' we've been called too early. */
+	/* If 'timer_expires' after 'now' we've been called too early. */
 	if (expires > 0 && expires < ktime_to_ns(ktime_get())) {
 		dev->power.timer_expires = 0;
 		rpm_suspend(dev, dev->power.timer_autosuspends ?
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] PM/runtime: Fix 'jiffies' in comments after move to hrtimers
  2019-01-09 17:23 [PATCH] PM/runtime: Fix 'jiffies' in comments after move to hrtimers Ladislav Michl
@ 2019-01-09 22:03 ` Rafael J. Wysocki
  2019-01-09 23:19   ` [PATCH v2] " Ladislav Michl
  0 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2019-01-09 22:03 UTC (permalink / raw)
  To: Ladislav Michl
  Cc: Linux PM, Linux Kernel Mailing List, Linux ARM,
	Linux OMAP Mailing List, Rafael J. Wysocki, Ulf Hansson,
	Tony Lindgren, Vincent Guittot

On Wed, Jan 9, 2019 at 6:23 PM Ladislav Michl <ladis@linux-mips.org> wrote:
>
> PM-runtime now uses the hrtimers infrastructure for autosuspend, however
> comments still reference 'jiffies'.
>
> Fixes: 8234f6734c5d ("PM-runtime: Switch autosuspend over to using hrtimers")
> Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
> ---
>  drivers/base/power/runtime.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
> index 70624695b6d5..096f7996d914 100644
> --- a/drivers/base/power/runtime.c
> +++ b/drivers/base/power/runtime.c
> @@ -121,7 +121,7 @@ static void pm_runtime_cancel_pending(struct device *dev)
>   * Compute the autosuspend-delay expiration time based on the device's
>   * power.last_busy time.  If the delay has already expired or is disabled
>   * (negative) or the power.use_autosuspend flag isn't set, return 0.
> - * Otherwise return the expiration time in jiffies (adjusted to be nonzero).
> + * Otherwise return the expiration time in nanoseconds (adjusted to be nonzero).
>   *
>   * This function may be called either with or without dev->power.lock held.
>   * Either way it can be racy, since power.last_busy may be updated at any time.
> @@ -905,7 +905,7 @@ static enum hrtimer_restart  pm_suspend_timer_fn(struct hrtimer *timer)
>         spin_lock_irqsave(&dev->power.lock, flags);
>
>         expires = dev->power.timer_expires;
> -       /* If 'expire' is after 'jiffies' we've been called too early. */
> +       /* If 'timer_expires' after 'now' we've been called too early. */

I would say "If 'expires' is after the current time, we've been called
to early" here.

>         if (expires > 0 && expires < ktime_to_ns(ktime_get())) {
>                 dev->power.timer_expires = 0;
>                 rpm_suspend(dev, dev->power.timer_autosuspends ?
> --
> 2.20.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] PM/runtime: Fix 'jiffies' in comments after move to hrtimers
  2019-01-09 22:03 ` Rafael J. Wysocki
@ 2019-01-09 23:19   ` Ladislav Michl
  2019-01-10 18:57     ` Vincent Guittot
  2019-01-11 10:40     ` Rafael J. Wysocki
  0 siblings, 2 replies; 5+ messages in thread
From: Ladislav Michl @ 2019-01-09 23:19 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux PM, Linux Kernel Mailing List, Linux ARM,
	Linux OMAP Mailing List, Rafael J. Wysocki, Ulf Hansson,
	Tony Lindgren, Vincent Guittot

PM-runtime now uses the hrtimers infrastructure for autosuspend, however
comments still reference 'jiffies'.

Fixes: 8234f6734c5d ("PM-runtime: Switch autosuspend over to using hrtimers")
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 Changes:
 -v2: Reword comment accoring to Rafael's suggestion

 drivers/base/power/runtime.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 70624695b6d5..a282e74d1a16 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -121,7 +121,7 @@ static void pm_runtime_cancel_pending(struct device *dev)
  * Compute the autosuspend-delay expiration time based on the device's
  * power.last_busy time.  If the delay has already expired or is disabled
  * (negative) or the power.use_autosuspend flag isn't set, return 0.
- * Otherwise return the expiration time in jiffies (adjusted to be nonzero).
+ * Otherwise return the expiration time in nanoseconds (adjusted to be nonzero).
  *
  * This function may be called either with or without dev->power.lock held.
  * Either way it can be racy, since power.last_busy may be updated at any time.
@@ -905,7 +905,10 @@ static enum hrtimer_restart  pm_suspend_timer_fn(struct hrtimer *timer)
 	spin_lock_irqsave(&dev->power.lock, flags);
 
 	expires = dev->power.timer_expires;
-	/* If 'expire' is after 'jiffies' we've been called too early. */
+	/*
+	 * If 'expires' is after the current time, we've been called
+	 * too early.
+	 */
 	if (expires > 0 && expires < ktime_to_ns(ktime_get())) {
 		dev->power.timer_expires = 0;
 		rpm_suspend(dev, dev->power.timer_autosuspends ?
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] PM/runtime: Fix 'jiffies' in comments after move to hrtimers
  2019-01-09 23:19   ` [PATCH v2] " Ladislav Michl
@ 2019-01-10 18:57     ` Vincent Guittot
  2019-01-11 10:40     ` Rafael J. Wysocki
  1 sibling, 0 replies; 5+ messages in thread
From: Vincent Guittot @ 2019-01-10 18:57 UTC (permalink / raw)
  To: Ladislav Michl
  Cc: Rafael J. Wysocki, Linux PM, Linux Kernel Mailing List,
	Linux ARM, Linux OMAP Mailing List, Rafael J. Wysocki,
	Ulf Hansson, Tony Lindgren

On Thu, 10 Jan 2019 at 00:19, Ladislav Michl <ladis@linux-mips.org> wrote:
>
> PM-runtime now uses the hrtimers infrastructure for autosuspend, however
> comments still reference 'jiffies'.
>
> Fixes: 8234f6734c5d ("PM-runtime: Switch autosuspend over to using hrtimers")
> Signed-off-by: Ladislav Michl <ladis@linux-mips.org>

Acked-by: Vincent Guittot <vincent.guittot@linaro.org>

> ---
>  Changes:
>  -v2: Reword comment accoring to Rafael's suggestion
>
>  drivers/base/power/runtime.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
> index 70624695b6d5..a282e74d1a16 100644
> --- a/drivers/base/power/runtime.c
> +++ b/drivers/base/power/runtime.c
> @@ -121,7 +121,7 @@ static void pm_runtime_cancel_pending(struct device *dev)
>   * Compute the autosuspend-delay expiration time based on the device's
>   * power.last_busy time.  If the delay has already expired or is disabled
>   * (negative) or the power.use_autosuspend flag isn't set, return 0.
> - * Otherwise return the expiration time in jiffies (adjusted to be nonzero).
> + * Otherwise return the expiration time in nanoseconds (adjusted to be nonzero).
>   *
>   * This function may be called either with or without dev->power.lock held.
>   * Either way it can be racy, since power.last_busy may be updated at any time.
> @@ -905,7 +905,10 @@ static enum hrtimer_restart  pm_suspend_timer_fn(struct hrtimer *timer)
>         spin_lock_irqsave(&dev->power.lock, flags);
>
>         expires = dev->power.timer_expires;
> -       /* If 'expire' is after 'jiffies' we've been called too early. */
> +       /*
> +        * If 'expires' is after the current time, we've been called
> +        * too early.
> +        */
>         if (expires > 0 && expires < ktime_to_ns(ktime_get())) {
>                 dev->power.timer_expires = 0;
>                 rpm_suspend(dev, dev->power.timer_autosuspends ?
> --
> 2.20.1
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] PM/runtime: Fix 'jiffies' in comments after move to hrtimers
  2019-01-09 23:19   ` [PATCH v2] " Ladislav Michl
  2019-01-10 18:57     ` Vincent Guittot
@ 2019-01-11 10:40     ` Rafael J. Wysocki
  1 sibling, 0 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2019-01-11 10:40 UTC (permalink / raw)
  To: Ladislav Michl
  Cc: Rafael J. Wysocki, Linux PM, Linux Kernel Mailing List,
	Linux ARM, Linux OMAP Mailing List, Ulf Hansson, Tony Lindgren,
	Vincent Guittot

On Thursday, January 10, 2019 12:19:44 AM CET Ladislav Michl wrote:
> PM-runtime now uses the hrtimers infrastructure for autosuspend, however
> comments still reference 'jiffies'.
> 
> Fixes: 8234f6734c5d ("PM-runtime: Switch autosuspend over to using hrtimers")
> Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
> ---
>  Changes:
>  -v2: Reword comment accoring to Rafael's suggestion
> 
>  drivers/base/power/runtime.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
> index 70624695b6d5..a282e74d1a16 100644
> --- a/drivers/base/power/runtime.c
> +++ b/drivers/base/power/runtime.c
> @@ -121,7 +121,7 @@ static void pm_runtime_cancel_pending(struct device *dev)
>   * Compute the autosuspend-delay expiration time based on the device's
>   * power.last_busy time.  If the delay has already expired or is disabled
>   * (negative) or the power.use_autosuspend flag isn't set, return 0.
> - * Otherwise return the expiration time in jiffies (adjusted to be nonzero).
> + * Otherwise return the expiration time in nanoseconds (adjusted to be nonzero).
>   *
>   * This function may be called either with or without dev->power.lock held.
>   * Either way it can be racy, since power.last_busy may be updated at any time.
> @@ -905,7 +905,10 @@ static enum hrtimer_restart  pm_suspend_timer_fn(struct hrtimer *timer)
>  	spin_lock_irqsave(&dev->power.lock, flags);
>  
>  	expires = dev->power.timer_expires;
> -	/* If 'expire' is after 'jiffies' we've been called too early. */
> +	/*
> +	 * If 'expires' is after the current time, we've been called
> +	 * too early.
> +	 */
>  	if (expires > 0 && expires < ktime_to_ns(ktime_get())) {
>  		dev->power.timer_expires = 0;
>  		rpm_suspend(dev, dev->power.timer_autosuspends ?
> 

Applied, thanks!



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-01-11 10:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-09 17:23 [PATCH] PM/runtime: Fix 'jiffies' in comments after move to hrtimers Ladislav Michl
2019-01-09 22:03 ` Rafael J. Wysocki
2019-01-09 23:19   ` [PATCH v2] " Ladislav Michl
2019-01-10 18:57     ` Vincent Guittot
2019-01-11 10:40     ` Rafael J. Wysocki

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).