summaryrefslogtreecommitdiffstats
path: root/drivers/base/power/sysfs.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-02-01 11:53:35 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-02-01 11:53:35 +0100
commit1cc9c59569e0ec69e9beadfe6ba8b2b7b22d57f0 (patch)
treec320e74151142a12ec427ededd2ac2fe18ce5a97 /drivers/base/power/sysfs.c
parentPM-runtime: Fix deadlock with ktime_get() (diff)
parentPM-runtime: Replace jiffies-based accounting with ktime-based accounting (diff)
downloadlinux-1cc9c59569e0ec69e9beadfe6ba8b2b7b22d57f0.tar.xz
linux-1cc9c59569e0ec69e9beadfe6ba8b2b7b22d57f0.zip
Merge back earlier PM core material for v5.1.
Diffstat (limited to 'drivers/base/power/sysfs.c')
-rw-r--r--drivers/base/power/sysfs.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c
index d713738ce796..96c8a227610a 100644
--- a/drivers/base/power/sysfs.c
+++ b/drivers/base/power/sysfs.c
@@ -125,9 +125,12 @@ static ssize_t runtime_active_time_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
int ret;
+ u64 tmp;
spin_lock_irq(&dev->power.lock);
update_pm_runtime_accounting(dev);
- ret = sprintf(buf, "%i\n", jiffies_to_msecs(dev->power.active_jiffies));
+ tmp = dev->power.active_time;
+ do_div(tmp, NSEC_PER_MSEC);
+ ret = sprintf(buf, "%llu\n", tmp);
spin_unlock_irq(&dev->power.lock);
return ret;
}
@@ -138,10 +141,12 @@ static ssize_t runtime_suspended_time_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
int ret;
+ u64 tmp;
spin_lock_irq(&dev->power.lock);
update_pm_runtime_accounting(dev);
- ret = sprintf(buf, "%i\n",
- jiffies_to_msecs(dev->power.suspended_jiffies));
+ tmp = dev->power.suspended_time;
+ do_div(tmp, NSEC_PER_MSEC);
+ ret = sprintf(buf, "%llu\n", tmp);
spin_unlock_irq(&dev->power.lock);
return ret;
}