diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-14 16:12:24 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-14 16:12:24 -0400 |
| commit | b018fc9800557bd14a40d69501e19c340eb2c521 (patch) | |
| tree | 541109645e83725699d2b091a1c6c4816fdc6649 /drivers/base | |
| parent | c07b3682cd12a017f976ec63bbd4758dc4c5100e (diff) | |
| parent | 7425ecd5e3e8c9d84f399a102282a23a90a19278 (diff) | |
Merge tag 'pm-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management updates from Rafael Wysocki:
"These add a new framework for CPU idle time injection, to be used by
all of the idle injection code in the kernel in the future, fix some
issues and add a number of relatively small extensions in multiple
places.
Specifics:
- Add a new framework for CPU idle time injection (Daniel Lezcano).
- Add AVS support to the armada-37xx cpufreq driver (Gregory
CLEMENT).
- Add support for current CPU frequency reporting to the ACPI CPPC
cpufreq driver (George Cherian).
- Rework the cooling device registration in the imx6q/thermal driver
(Bastian Stender).
- Make the pcc-cpufreq driver refuse to work with dynamic scaling
governors on systems with many CPUs to avoid scalability issues
with it (Rafael Wysocki).
- Fix the intel_pstate driver to report different maximum CPU
frequencies on systems where they really are different and to
ignore the turbo active ratio if hardware-managend P-states (HWP)
are in use; make it use the match_string() helper (Xie Yisheng,
Srinivas Pandruvada).
- Fix a minor deferred probe issue in the qcom-kryo cpufreq driver
(Niklas Cassel).
- Add a tracepoint for the tracking of frequency limits changes (from
Andriod) to the cpufreq core (Ruchi Kandoi).
- Fix a circular lock dependency between CPU hotplug and sysfs
locking in the cpufreq core reported by lockdep (Waiman Long).
- Avoid excessive error reports on driver registration failures in
the ARM cpuidle driver (Sudeep Holla).
- Add a new device links flag to the driver core to make links go
away automatically on supplier driver removal (Vivek Gautam).
- Eliminate potential race condition between system-wide power
management transitions and system shutdown (Pingfan Liu).
- Add a quirk to save NVS memory on system suspend for the ASUS 1025C
laptop (Willy Tarreau).
- Make more systems use suspend-to-idle (instead of ACPI S3) by
default (Tristian Celestin).
- Get rid of stack VLA usage in the low-level hibernation code on
64-bit x86 (Kees Cook).
- Fix error handling in the hibernation core and mark an expected
fall-through switch in it (Chengguang Xu, Gustavo Silva).
- Extend the generic power domains (genpd) framework to support
attaching a device to a power domain by name (Ulf Hansson).
- Fix device reference counting and user limits initialization in the
devfreq core (Arvind Yadav, Matthias Kaehlcke).
- Fix a few issues in the rk3399_dmc devfreq driver and improve its
documentation (Enric Balletbo i Serra, Lin Huang, Nick Milner).
- Drop a redundant error message from the exynos-ppmu devfreq driver
(Markus Elfring)"
* tag 'pm-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (35 commits)
PM / reboot: Eliminate race between reboot and suspend
PM / hibernate: Mark expected switch fall-through
cpufreq: intel_pstate: Ignore turbo active ratio in HWP
cpufreq: Fix a circular lock dependency problem
cpu/hotplug: Add a cpus_read_trylock() function
x86/power/hibernate_64: Remove VLA usage
cpufreq: trace frequency limits change
cpufreq: intel_pstate: Show different max frequency with turbo 3 and HWP
cpufreq: pcc-cpufreq: Disable dynamic scaling on many-CPU systems
cpufreq: qcom-kryo: Silently error out on EPROBE_DEFER
cpufreq / CPPC: Add cpuinfo_cur_freq support for CPPC
cpufreq: armada-37xx: Add AVS support
dt-bindings: marvell: Add documentation for the Armada 3700 AVS binding
PM / devfreq: rk3399_dmc: Fix duplicated opp table on reload.
PM / devfreq: Init user limits from OPP limits, not viceversa
PM / devfreq: rk3399_dmc: fix spelling mistakes.
PM / devfreq: rk3399_dmc: do not print error when get supply and clk defer.
dt-bindings: devfreq: rk3399_dmc: move interrupts to be optional.
PM / devfreq: rk3399_dmc: remove wait for dcf irq event.
dt-bindings: clock: add rk3399 DDR3 standard speed bins.
...
Diffstat (limited to 'drivers/base')
| -rw-r--r-- | drivers/base/core.c | 25 | ||||
| -rw-r--r-- | drivers/base/power/common.c | 17 | ||||
| -rw-r--r-- | drivers/base/power/domain.c | 24 |
3 files changed, 59 insertions, 7 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index 2ab316d85651..9d3c15d4dde8 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
| @@ -178,10 +178,10 @@ void device_pm_move_to_tail(struct device *dev) | |||
| 178 | * of the link. If DL_FLAG_PM_RUNTIME is not set, DL_FLAG_RPM_ACTIVE will be | 178 | * of the link. If DL_FLAG_PM_RUNTIME is not set, DL_FLAG_RPM_ACTIVE will be |
| 179 | * ignored. | 179 | * ignored. |
| 180 | * | 180 | * |
| 181 | * If the DL_FLAG_AUTOREMOVE is set, the link will be removed automatically | 181 | * If the DL_FLAG_AUTOREMOVE_CONSUMER is set, the link will be removed |
| 182 | * when the consumer device driver unbinds from it. The combination of both | 182 | * automatically when the consumer device driver unbinds from it. |
| 183 | * DL_FLAG_AUTOREMOVE and DL_FLAG_STATELESS set is invalid and will cause NULL | 183 | * The combination of both DL_FLAG_AUTOREMOVE_CONSUMER and DL_FLAG_STATELESS |
| 184 | * to be returned. | 184 | * set is invalid and will cause NULL to be returned. |
| 185 | * | 185 | * |
| 186 | * A side effect of the link creation is re-ordering of dpm_list and the | 186 | * A side effect of the link creation is re-ordering of dpm_list and the |
| 187 | * devices_kset list by moving the consumer device and all devices depending | 187 | * devices_kset list by moving the consumer device and all devices depending |
| @@ -198,7 +198,8 @@ struct device_link *device_link_add(struct device *consumer, | |||
| 198 | struct device_link *link; | 198 | struct device_link *link; |
| 199 | 199 | ||
| 200 | if (!consumer || !supplier || | 200 | if (!consumer || !supplier || |
| 201 | ((flags & DL_FLAG_STATELESS) && (flags & DL_FLAG_AUTOREMOVE))) | 201 | ((flags & DL_FLAG_STATELESS) && |
| 202 | (flags & DL_FLAG_AUTOREMOVE_CONSUMER))) | ||
| 202 | return NULL; | 203 | return NULL; |
| 203 | 204 | ||
| 204 | device_links_write_lock(); | 205 | device_links_write_lock(); |
| @@ -509,7 +510,7 @@ static void __device_links_no_driver(struct device *dev) | |||
| 509 | if (link->flags & DL_FLAG_STATELESS) | 510 | if (link->flags & DL_FLAG_STATELESS) |
| 510 | continue; | 511 | continue; |
| 511 | 512 | ||
| 512 | if (link->flags & DL_FLAG_AUTOREMOVE) | 513 | if (link->flags & DL_FLAG_AUTOREMOVE_CONSUMER) |
| 513 | kref_put(&link->kref, __device_link_del); | 514 | kref_put(&link->kref, __device_link_del); |
| 514 | else if (link->status != DL_STATE_SUPPLIER_UNBIND) | 515 | else if (link->status != DL_STATE_SUPPLIER_UNBIND) |
| 515 | WRITE_ONCE(link->status, DL_STATE_AVAILABLE); | 516 | WRITE_ONCE(link->status, DL_STATE_AVAILABLE); |
| @@ -545,8 +546,18 @@ void device_links_driver_cleanup(struct device *dev) | |||
| 545 | if (link->flags & DL_FLAG_STATELESS) | 546 | if (link->flags & DL_FLAG_STATELESS) |
| 546 | continue; | 547 | continue; |
| 547 | 548 | ||
| 548 | WARN_ON(link->flags & DL_FLAG_AUTOREMOVE); | 549 | WARN_ON(link->flags & DL_FLAG_AUTOREMOVE_CONSUMER); |
| 549 | WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND); | 550 | WARN_ON(link->status != DL_STATE_SUPPLIER_UNBIND); |
| 551 | |||
| 552 | /* | ||
| 553 | * autoremove the links between this @dev and its consumer | ||
| 554 | * devices that are not active, i.e. where the link state | ||
| 555 | * has moved to DL_STATE_SUPPLIER_UNBIND. | ||
| 556 | */ | ||
| 557 | if (link->status == DL_STATE_SUPPLIER_UNBIND && | ||
| 558 | link->flags & DL_FLAG_AUTOREMOVE_SUPPLIER) | ||
| 559 | kref_put(&link->kref, __device_link_del); | ||
| 560 | |||
| 550 | WRITE_ONCE(link->status, DL_STATE_DORMANT); | 561 | WRITE_ONCE(link->status, DL_STATE_DORMANT); |
| 551 | } | 562 | } |
| 552 | 563 | ||
diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c index df41b4780b3b..b413951c6abc 100644 --- a/drivers/base/power/common.c +++ b/drivers/base/power/common.c | |||
| @@ -153,6 +153,23 @@ struct device *dev_pm_domain_attach_by_id(struct device *dev, | |||
| 153 | EXPORT_SYMBOL_GPL(dev_pm_domain_attach_by_id); | 153 | EXPORT_SYMBOL_GPL(dev_pm_domain_attach_by_id); |
| 154 | 154 | ||
| 155 | /** | 155 | /** |
| 156 | * dev_pm_domain_attach_by_name - Associate a device with one of its PM domains. | ||
| 157 | * @dev: The device used to lookup the PM domain. | ||
| 158 | * @name: The name of the PM domain. | ||
| 159 | * | ||
| 160 | * For a detailed function description, see dev_pm_domain_attach_by_id(). | ||
| 161 | */ | ||
| 162 | struct device *dev_pm_domain_attach_by_name(struct device *dev, | ||
| 163 | char *name) | ||
| 164 | { | ||
| 165 | if (dev->pm_domain) | ||
| 166 | return ERR_PTR(-EEXIST); | ||
| 167 | |||
| 168 | return genpd_dev_pm_attach_by_name(dev, name); | ||
| 169 | } | ||
| 170 | EXPORT_SYMBOL_GPL(dev_pm_domain_attach_by_name); | ||
| 171 | |||
| 172 | /** | ||
| 156 | * dev_pm_domain_detach - Detach a device from its PM domain. | 173 | * dev_pm_domain_detach - Detach a device from its PM domain. |
| 157 | * @dev: Device to detach. | 174 | * @dev: Device to detach. |
| 158 | * @power_off: Used to indicate whether we should power off the device. | 175 | * @power_off: Used to indicate whether we should power off the device. |
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 9e8484189034..79bdca70a81a 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c | |||
| @@ -2374,6 +2374,30 @@ struct device *genpd_dev_pm_attach_by_id(struct device *dev, | |||
| 2374 | } | 2374 | } |
| 2375 | EXPORT_SYMBOL_GPL(genpd_dev_pm_attach_by_id); | 2375 | EXPORT_SYMBOL_GPL(genpd_dev_pm_attach_by_id); |
| 2376 | 2376 | ||
| 2377 | /** | ||
| 2378 | * genpd_dev_pm_attach_by_name - Associate a device with one of its PM domains. | ||
| 2379 | * @dev: The device used to lookup the PM domain. | ||
| 2380 | * @name: The name of the PM domain. | ||
| 2381 | * | ||
| 2382 | * Parse device's OF node to find a PM domain specifier using the | ||
| 2383 | * power-domain-names DT property. For further description see | ||
| 2384 | * genpd_dev_pm_attach_by_id(). | ||
| 2385 | */ | ||
| 2386 | struct device *genpd_dev_pm_attach_by_name(struct device *dev, char *name) | ||
| 2387 | { | ||
| 2388 | int index; | ||
| 2389 | |||
| 2390 | if (!dev->of_node) | ||
| 2391 | return NULL; | ||
| 2392 | |||
| 2393 | index = of_property_match_string(dev->of_node, "power-domain-names", | ||
| 2394 | name); | ||
| 2395 | if (index < 0) | ||
| 2396 | return NULL; | ||
| 2397 | |||
| 2398 | return genpd_dev_pm_attach_by_id(dev, index); | ||
| 2399 | } | ||
| 2400 | |||
| 2377 | static const struct of_device_id idle_state_match[] = { | 2401 | static const struct of_device_id idle_state_match[] = { |
| 2378 | { .compatible = "domain-idle-state", }, | 2402 | { .compatible = "domain-idle-state", }, |
| 2379 | { } | 2403 | { } |
