Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

PM / Domains: Rename stop_ok to suspend_ok for the genpd governor

The genpd governor validates the latency constraints to find out whether
it's acceptable to runtime suspend a device. Earlier this validation was
made to know whether it was okay to invoke the ->stop() callback for the
device, hence the governor used the name "stop_ok" for the related
variables.

To clarify the code around this, let's rename these variables from
"stop_ok" to "suspend_ok".

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Ulf Hansson and committed by
Rafael J. Wysocki
9df3921e c3b46c73

+15 -15
+3 -3
drivers/base/power/domain.c
··· 382 382 static int pm_genpd_runtime_suspend(struct device *dev) 383 383 { 384 384 struct generic_pm_domain *genpd; 385 - bool (*stop_ok)(struct device *__dev); 385 + bool (*suspend_ok)(struct device *__dev); 386 386 struct gpd_timing_data *td = &dev_gpd_data(dev)->td; 387 387 bool runtime_pm = pm_runtime_enabled(dev); 388 388 ktime_t time_start; ··· 401 401 * runtime PM is disabled. Under these circumstances, we shall skip 402 402 * validating/measuring the PM QoS latency. 403 403 */ 404 - stop_ok = genpd->gov ? genpd->gov->stop_ok : NULL; 405 - if (runtime_pm && stop_ok && !stop_ok(dev)) 404 + suspend_ok = genpd->gov ? genpd->gov->suspend_ok : NULL; 405 + if (runtime_pm && suspend_ok && !suspend_ok(dev)) 406 406 return -EBUSY; 407 407 408 408 /* Measure suspend latency. */
+10 -10
drivers/base/power/domain_governor.c
··· 37 37 } 38 38 39 39 /** 40 - * default_stop_ok - Default PM domain governor routine for stopping devices. 40 + * default_suspend_ok - Default PM domain governor routine to suspend devices. 41 41 * @dev: Device to check. 42 42 */ 43 - static bool default_stop_ok(struct device *dev) 43 + static bool default_suspend_ok(struct device *dev) 44 44 { 45 45 struct gpd_timing_data *td = &dev_gpd_data(dev)->td; 46 46 unsigned long flags; ··· 51 51 spin_lock_irqsave(&dev->power.lock, flags); 52 52 53 53 if (!td->constraint_changed) { 54 - bool ret = td->cached_stop_ok; 54 + bool ret = td->cached_suspend_ok; 55 55 56 56 spin_unlock_irqrestore(&dev->power.lock, flags); 57 57 return ret; 58 58 } 59 59 td->constraint_changed = false; 60 - td->cached_stop_ok = false; 60 + td->cached_suspend_ok = false; 61 61 td->effective_constraint_ns = -1; 62 62 constraint_ns = __dev_pm_qos_read_value(dev); 63 63 ··· 83 83 return false; 84 84 } 85 85 td->effective_constraint_ns = constraint_ns; 86 - td->cached_stop_ok = constraint_ns >= 0; 86 + td->cached_suspend_ok = constraint_ns >= 0; 87 87 88 88 /* 89 89 * The children have been suspended already, so we don't need to take 90 - * their stop latencies into account here. 90 + * their suspend latencies into account here. 91 91 */ 92 - return td->cached_stop_ok; 92 + return td->cached_suspend_ok; 93 93 } 94 94 95 95 /** ··· 150 150 */ 151 151 td = &to_gpd_data(pdd)->td; 152 152 constraint_ns = td->effective_constraint_ns; 153 - /* default_stop_ok() need not be called before us. */ 153 + /* default_suspend_ok() need not be called before us. */ 154 154 if (constraint_ns < 0) { 155 155 constraint_ns = dev_pm_qos_read_value(pdd->dev); 156 156 constraint_ns *= NSEC_PER_USEC; ··· 227 227 } 228 228 229 229 struct dev_power_governor simple_qos_governor = { 230 - .stop_ok = default_stop_ok, 230 + .suspend_ok = default_suspend_ok, 231 231 .power_down_ok = default_power_down_ok, 232 232 }; 233 233 ··· 236 236 */ 237 237 struct dev_power_governor pm_domain_always_on_gov = { 238 238 .power_down_ok = always_on_power_down_ok, 239 - .stop_ok = default_stop_ok, 239 + .suspend_ok = default_suspend_ok, 240 240 };
+2 -2
include/linux/pm_domain.h
··· 28 28 29 29 struct dev_power_governor { 30 30 bool (*power_down_ok)(struct dev_pm_domain *domain); 31 - bool (*stop_ok)(struct device *dev); 31 + bool (*suspend_ok)(struct device *dev); 32 32 }; 33 33 34 34 struct gpd_dev_ops { ··· 94 94 s64 resume_latency_ns; 95 95 s64 effective_constraint_ns; 96 96 bool constraint_changed; 97 - bool cached_stop_ok; 97 + bool cached_suspend_ok; 98 98 }; 99 99 100 100 struct pm_domain_data {