summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAisheng Dong <aisheng.dong@nxp.com>2019-03-06 16:25:15 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-03-11 13:26:45 +0300
commit0cec68a97787db1ca5772f5939ec4db22de78d65 (patch)
tree8ee152d6b1829d4540aca70f656739de6b3cca97 /drivers
parent46b7fe94995fd166786a301dbba919046e70e702 (diff)
downloadlinux-0cec68a97787db1ca5772f5939ec4db22de78d65.tar.xz
PM / Domains: Return early for all errors in _genpd_power_off()
It is strange to only return early for -EBUSY state and left other errors to be still measured execution time. As for error cases, the elapsed_ns computed actually is not quite accurate and meaningful for governor to use. So let's simply return for all error cases. Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/power/domain.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 394f9daa3983..f01257607bf7 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -457,19 +457,19 @@ static int _genpd_power_off(struct generic_pm_domain *genpd, bool timed)
time_start = ktime_get();
ret = genpd->power_off(genpd);
- if (ret == -EBUSY)
+ if (ret)
return ret;
elapsed_ns = ktime_to_ns(ktime_sub(ktime_get(), time_start));
if (elapsed_ns <= genpd->states[state_idx].power_off_latency_ns)
- return ret;
+ return 0;
genpd->states[state_idx].power_off_latency_ns = elapsed_ns;
genpd->max_off_time_changed = true;
pr_debug("%s: Power-%s latency exceeded, new value %lld ns\n",
genpd->name, "off", elapsed_ns);
- return ret;
+ return 0;
}
/**