aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2015-10-15 11:02:06 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-10-27 23:33:04 -0400
commit51cda844892fded75d3ad07d0233e73572eba2f3 (patch)
tree911179ce9dd03df7dd86b24c5bd1aa9d70c80889 /drivers/base
parent88cfe5356a9b5cbc77e444b55c7e0d8ba4cc5ecb (diff)
PM / Domains: Don't measure ->start|stop() latency in system PM callbacks
Measure latency does by itself contribute to an increased latency, thus we should avoid it when it isn't needed. Genpd measures latencies in the system PM phase for the ->start|stop() callbacks and is thus affecting the system PM suspend/resume time. Moreover these latencies are validated only at runtime PM suspend/resume. To this reasoning, let's decide to leave these measurements out of the system PM phase. There should be plenty of occasions during runtime PM to perform these measurements anyway. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Lina Iyer <lina.iyer@linaro.org> Acked-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/domain.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 6e1bcdef7a79..a1c3ec4cc4fb 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -90,8 +90,12 @@ static struct generic_pm_domain *dev_to_genpd(struct device *dev)
90 return pd_to_genpd(dev->pm_domain); 90 return pd_to_genpd(dev->pm_domain);
91} 91}
92 92
93static int genpd_stop_dev(struct generic_pm_domain *genpd, struct device *dev) 93static int genpd_stop_dev(struct generic_pm_domain *genpd, struct device *dev,
94 bool timed)
94{ 95{
96 if (!timed)
97 return GENPD_DEV_CALLBACK(genpd, int, stop, dev);
98
95 return GENPD_DEV_TIMED_CALLBACK(genpd, int, stop, dev, 99 return GENPD_DEV_TIMED_CALLBACK(genpd, int, stop, dev,
96 stop_latency_ns, "stop"); 100 stop_latency_ns, "stop");
97} 101}
@@ -434,7 +438,7 @@ static int pm_genpd_runtime_suspend(struct device *dev)
434 if (ret) 438 if (ret)
435 return ret; 439 return ret;
436 440
437 ret = genpd_stop_dev(genpd, dev); 441 ret = genpd_stop_dev(genpd, dev, true);
438 if (ret) { 442 if (ret) {
439 genpd_restore_dev(genpd, dev, true); 443 genpd_restore_dev(genpd, dev, true);
440 return ret; 444 return ret;
@@ -779,7 +783,7 @@ static int pm_genpd_suspend_noirq(struct device *dev)
779 || (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev))) 783 || (dev->power.wakeup_path && genpd_dev_active_wakeup(genpd, dev)))
780 return 0; 784 return 0;
781 785
782 genpd_stop_dev(genpd, dev); 786 genpd_stop_dev(genpd, dev, false);
783 787
784 /* 788 /*
785 * Since all of the "noirq" callbacks are executed sequentially, it is 789 * Since all of the "noirq" callbacks are executed sequentially, it is
@@ -820,7 +824,7 @@ static int pm_genpd_resume_noirq(struct device *dev)
820 pm_genpd_sync_poweron(genpd, true); 824 pm_genpd_sync_poweron(genpd, true);
821 genpd->suspended_count--; 825 genpd->suspended_count--;
822 826
823 return genpd_start_dev(genpd, dev, true); 827 return genpd_start_dev(genpd, dev, false);
824} 828}
825 829
826/** 830/**
@@ -928,7 +932,7 @@ static int pm_genpd_freeze_noirq(struct device *dev)
928 if (IS_ERR(genpd)) 932 if (IS_ERR(genpd))
929 return -EINVAL; 933 return -EINVAL;
930 934
931 return genpd->suspend_power_off ? 0 : genpd_stop_dev(genpd, dev); 935 return genpd->suspend_power_off ? 0 : genpd_stop_dev(genpd, dev, false);
932} 936}
933 937
934/** 938/**
@@ -948,7 +952,8 @@ static int pm_genpd_thaw_noirq(struct device *dev)
948 if (IS_ERR(genpd)) 952 if (IS_ERR(genpd))
949 return -EINVAL; 953 return -EINVAL;
950 954
951 return genpd->suspend_power_off ? 0 : genpd_start_dev(genpd, dev, true); 955 return genpd->suspend_power_off ?
956 0 : genpd_start_dev(genpd, dev, false);
952} 957}
953 958
954/** 959/**
@@ -1042,7 +1047,7 @@ static int pm_genpd_restore_noirq(struct device *dev)
1042 1047
1043 pm_genpd_sync_poweron(genpd, true); 1048 pm_genpd_sync_poweron(genpd, true);
1044 1049
1045 return genpd_start_dev(genpd, dev, true); 1050 return genpd_start_dev(genpd, dev, false);
1046} 1051}
1047 1052
1048/** 1053/**