aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAisheng Dong <aisheng.dong@nxp.com>2019-03-06 08:25:15 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-03-11 06:26:45 -0400
commit0cec68a97787db1ca5772f5939ec4db22de78d65 (patch)
tree8ee152d6b1829d4540aca70f656739de6b3cca97
parent46b7fe94995fd166786a301dbba919046e70e702 (diff)
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>
-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)
457 457
458 time_start = ktime_get(); 458 time_start = ktime_get();
459 ret = genpd->power_off(genpd); 459 ret = genpd->power_off(genpd);
460 if (ret == -EBUSY) 460 if (ret)
461 return ret; 461 return ret;
462 462
463 elapsed_ns = ktime_to_ns(ktime_sub(ktime_get(), time_start)); 463 elapsed_ns = ktime_to_ns(ktime_sub(ktime_get(), time_start));
464 if (elapsed_ns <= genpd->states[state_idx].power_off_latency_ns) 464 if (elapsed_ns <= genpd->states[state_idx].power_off_latency_ns)
465 return ret; 465 return 0;
466 466
467 genpd->states[state_idx].power_off_latency_ns = elapsed_ns; 467 genpd->states[state_idx].power_off_latency_ns = elapsed_ns;
468 genpd->max_off_time_changed = true; 468 genpd->max_off_time_changed = true;
469 pr_debug("%s: Power-%s latency exceeded, new value %lld ns\n", 469 pr_debug("%s: Power-%s latency exceeded, new value %lld ns\n",
470 genpd->name, "off", elapsed_ns); 470 genpd->name, "off", elapsed_ns);
471 471
472 return ret; 472 return 0;
473} 473}
474 474
475/** 475/**