PM: fix runtime accounting calculation error
Subsystems (4)
PATCH v2 1/1 PM: fix runtime accounting calculation error
From: venu byravarasu <[email protected]>
With delta type being int, its value is made zero
for all values of now > 0x80000000.
Hence fixing it.
---
changes since v1:
Removed max_num and its usage references.
..........
drivers/base/power/runtime.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/base/power/runtime.c +1 -4
@@ -30,13 +30,10 @@ static int rpm_suspend(struct device *dev, int rpmflags);void update_pm_runtime_accounting (struct device *dev) {unsigned long now = jiffies; -int delta; +unsigned long delta; delta = now - dev->power.accounting_timestamp; -if (delta <0 ) - delta =0 ; - dev->power.accounting_timestamp = now;if (dev->power.disable_depth >0 )
Signature · 1 line
1.7.1.1
Quoted 7 lines · On Friday, October 28, 2011, [email protected] wrote:
From: venu byravarasu <[email protected]>
With delta type being int, its value is made zero
for all values of now >0x80000000.
Hence fixing it.Signed-off-by venu byravarasu <[email protected]>
Thanks, looks good. I'll add it to the linux-pm tree's pm-fixes branch when I'm back home later this week.
Rafael
Quoted 28 lines
---
changes since v1:
Removedmax_numand its usage references.
..........drivers/base/power/runtime.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-)drivers/base/power/runtime.c +1
-4@@ -30,13 +30,10 @@ static int rpm_suspend(struct device *dev, int rpmflags);void update_pm_runtime_accounting (struct device *dev) {unsigned long now = jiffies; -int delta; +unsigned long delta; delta = now - dev->power.accounting_timestamp; -if (delta <0 ) - delta =0 ; - dev->power.accounting_timestamp = now;if (dev->power.disable_depth >0 )
Rafael J. Wysocki
AppliedQuoted 7 lines · On Friday, October 28, 2011, [email protected] wrote:
From: venu byravarasu <[email protected]>
With delta type being int, its value is made zero
for all values of now >0x80000000.
Hence fixing it.Signed-off-by venu byravarasu <[email protected]>
Applied to linux-pm/linux-next.
Thanks,
Rafael
Quoted 28 lines
---
changes since v1:
Removedmax_numand its usage references.
..........drivers/base/power/runtime.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-)drivers/base/power/runtime.c +1
-4@@ -30,13 +30,10 @@ static int rpm_suspend(struct device *dev, int rpmflags);void update_pm_runtime_accounting (struct device *dev) {unsigned long now = jiffies; -int delta; +unsigned long delta; delta = now - dev->power.accounting_timestamp; -if (delta <0 ) - delta =0 ; - dev->power.accounting_timestamp = now;if (dev->power.disable_depth >0 )
-----Original Message-----
Quoted 10 lines
From: Rafael J. Wysocki [mailto:[email protected]]
Sent: Thursday, November 03, 2011 5:49 AM
To: Venu Byravarasu
Cc: [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; Peter De Schrijver
Subject: Re: [PATCH v2] PM: fix runtime accounting calculation errorQuoted 2 lines · On Friday, October 28, 2011, [email protected] wrote:
From: venu byravarasu <[email protected]>
Quoted 7 lines
Quoted 5 lines
With delta type being int, its value is made zero
for all values of now >0x80000000.
Hence fixing it.Signed-off-by venu byravarasu <[email protected]>Applied to linux-pm/linux-next.
Thanks Rafael.
Venu