Skip to contentSkip to conversation

PM/runtime: Fix 'jiffies' in comments after move to hrtimers

PATCH Superseded Ladislav Michl 4 participants 5 messages Jan 9, 2019 – Jan 11, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PM/runtime: Fix 'jiffies' in comments after move to hrtimers

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

Fixes 8234f6734c5d ("PM-runtime: Switch autosuspend over to using hrtimers")
---
 drivers/base/power/runtime.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/base/power/runtime.c +2 -2
index 70624695b6d5..096f7996d914 100644
@@ -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 ?
Signature · 1 line
2.20.1
#1 lore raw
Quoted 24 lines · Ladislav Michl

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

Fixes 8234f6734c5d ("PM-runtime: Switch autosuspend over to using hrtimers")
---
 drivers/base/power/runtime.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/base/power/runtime.c +1 -1
index 70624695b6d5..096f7996d914 100644
@@ -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.

drivers/base/power/runtime.c static enum hrtimer_restart pm_suspend_timer_fn(struct hrtimer *timer) · line 908

Quoted 5 lines
drivers/base/power/runtime.c +1 -1
@@ -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.

Quoted 5 lines
drivers/base/power/runtime.c +0 -1
        if (expires > 0 && expires < ktime_to_ns(ktime_get())) {
                dev->power.timer_expires = 0;
                rpm_suspend(dev, dev->power.timer_autosuspends ?
--

2.20.1

#2 lore raw

PATCH v2 1/1 PM/runtime: Fix 'jiffies' in comments after move to hrtimers

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

Fixes 8234f6734c5d ("PM-runtime: Switch autosuspend over to using hrtimers")

---
Changes:
-v2: Reword comment accoring to Rafael's suggestion

 drivers/base/power/runtime.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/base/power/runtime.c +5 -2
index 70624695b6d5..a282e74d1a16 100644
@@ -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 ?
Signature · 1 line
2.20.1
Acked-by on v2 1/1
#3 lore raw
Quoted 6 lines · Ladislav Michl

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

Fixes 8234f6734c5d ("PM-runtime: Switch autosuspend over to using hrtimers")
Quoted 35 lines

---
Changes:
-v2: Reword comment accoring to Rafael's suggestion

 drivers/base/power/runtime.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/base/power/runtime.c +5 -3
index 70624695b6d5..a282e74d1a16 100644
@@ -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

#4 lore raw
In reply to Ladislav Michl
Quoted 28 lines · CET Ladislav Michl

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

Fixes 8234f6734c5d ("PM-runtime: Switch autosuspend over to using hrtimers")

---
Changes:
-v2: Reword comment accoring to Rafael's suggestion

 drivers/base/power/runtime.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/base/power/runtime.c +1 -1
index 70624695b6d5..a282e74d1a16 100644
@@ -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);

drivers/base/power/runtime.c static enum hrtimer_restart pm_suspend_timer_fn(struct hrtimer *timer) · line 914

Quoted 10 lines
drivers/base/power/runtime.c +4 -1
 
 	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!