Skip to content

Commit 3c89adb

Browse files
committed
Merge tag 'pm-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management updates from Rafael Wysocki: "These include a significant update of the generic power domains (genpd) and Operating Performance Points (OPP) frameworks, mostly related to the introduction of power domain performance levels, cpufreq updates (new driver for Qualcomm Kryo processors, updates of the existing drivers, some core fixes, schedutil governor improvements), PCI power management fixes, ACPI workaround for EC-based wakeup events handling on resume from suspend-to-idle, and major updates of the turbostat and pm-graph utilities. Specifics: - Introduce power domain performance levels into the the generic power domains (genpd) and Operating Performance Points (OPP) frameworks (Viresh Kumar, Rajendra Nayak, Dan Carpenter). - Fix two issues in the runtime PM framework related to the initialization and removal of devices using device links (Ulf Hansson). - Clean up the initialization of drivers for devices in PM domains (Ulf Hansson, Geert Uytterhoeven). - Fix a cpufreq core issue related to the policy sysfs interface causing CPU online to fail for CPUs sharing one cpufreq policy in some situations (Tao Wang). - Make it possible to use platform-specific suspend/resume hooks in the cpufreq-dt driver and make the Armada 37xx DVFS use that feature (Viresh Kumar, Miquel Raynal). - Optimize policy transition notifications in cpufreq (Viresh Kumar). - Improve the iowait boost mechanism in the schedutil cpufreq governor (Patrick Bellasi). - Improve the handling of deferred frequency updates in the schedutil cpufreq governor (Joel Fernandes, Dietmar Eggemann, Rafael Wysocki, Viresh Kumar). - Add a new cpufreq driver for Qualcomm Kryo (Ilia Lin). - Fix and clean up some cpufreq drivers (Colin Ian King, Dmitry Osipenko, Doug Smythies, Luc Van Oostenryck, Simon Horman, Viresh Kumar). - Fix the handling of PCI devices with the DPM_SMART_SUSPEND flag set and update stale comments in the PCI core PM code (Rafael Wysocki). - Work around an issue related to the handling of EC-based wakeup events in the ACPI PM core during resume from suspend-to-idle if the EC has been put into the low-power mode (Rafael Wysocki). - Improve the handling of wakeup source objects in the PM core (Doug Berger, Mahendran Ganesh, Rafael Wysocki). - Update the driver core to prevent deferred probe from breaking suspend/resume ordering (Feng Kan). - Clean up the PM core somewhat (Bjorn Helgaas, Ulf Hansson, Rafael Wysocki). - Make the core suspend/resume code and cpufreq support the RT patch (Sebastian Andrzej Siewior, Thomas Gleixner). - Consolidate the PM QoS handling in cpuidle governors (Rafael Wysocki). - Fix a possible crash in the hibernation core (Tetsuo Handa). - Update the rockchip-io Adaptive Voltage Scaling (AVS) driver (David Wu). - Update the turbostat utility (fixes, cleanups, new CPU IDs, new command line options, built-in "Low Power Idle" counters support, new POLL and POLL% columns) and add an entry for it to MAINTAINERS (Len Brown, Artem Bityutskiy, Chen Yu, Laura Abbott, Matt Turner, Prarit Bhargava, Srinivas Pandruvada). - Update the pm-graph to version 5.1 (Todd Brandt). - Update the intel_pstate_tracer utility (Doug Smythies)" * tag 'pm-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (128 commits) tools/power turbostat: update version number tools/power turbostat: Add Node in output tools/power turbostat: add node information into turbostat calculations tools/power turbostat: remove num_ from cpu_topology struct tools/power turbostat: rename num_cores_per_pkg to num_cores_per_node tools/power turbostat: track thread ID in cpu_topology tools/power turbostat: Calculate additional node information for a package tools/power turbostat: Fix node and siblings lookup data tools/power turbostat: set max_num_cpus equal to the cpumask length tools/power turbostat: if --num_iterations, print for specific number of iterations tools/power turbostat: Add Cannon Lake support tools/power turbostat: delete duplicate #defines x86: msr-index.h: Correct SNB_C1/C3_AUTO_UNDEMOTE defines tools/power turbostat: Correct SNB_C1/C3_AUTO_UNDEMOTE defines tools/power turbostat: add POLL and POLL% column tools/power turbostat: Fix --hide Pk%pc10 tools/power turbostat: Build-in "Low Power Idle" counters support tools/power turbostat: Don't make man pages executable tools/power turbostat: remove blank lines tools/power turbostat: a small C-states dump readability immprovement ...
2 parents 11e7c21 + a24e16b commit 3c89adb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+3235
-1192
lines changed

Documentation/devicetree/bindings/opp/kryo-cpufreq.txt

Lines changed: 680 additions & 0 deletions
Large diffs are not rendered by default.

Documentation/devicetree/bindings/opp/opp.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ This defines voltage-current-frequency combinations along with other related
8282
properties.
8383

8484
Required properties:
85-
- opp-hz: Frequency in Hz, expressed as a 64-bit big-endian integer.
85+
- opp-hz: Frequency in Hz, expressed as a 64-bit big-endian integer. This is a
86+
required property for all device nodes but devices like power domains. The
87+
power domain nodes must have another (implementation dependent) property which
88+
uniquely identifies the OPP nodes.
8689

8790
Optional properties:
8891
- opp-microvolt: voltage in micro Volts.
@@ -159,7 +162,7 @@ Optional properties:
159162

160163
- status: Marks the node enabled/disabled.
161164

162-
- required-opp: This contains phandle to an OPP node in another device's OPP
165+
- required-opps: This contains phandle to an OPP node in another device's OPP
163166
table. It may contain an array of phandles, where each phandle points to an
164167
OPP of a different device. It should not contain multiple phandles to the OPP
165168
nodes in the same OPP table. This specifies the minimum required OPP of the

Documentation/devicetree/bindings/power/power_domain.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ inside a PM domain with index 0 of a power controller represented by a node
127127
with the label "power".
128128

129129
Optional properties:
130-
- required-opp: This contains phandle to an OPP node in another device's OPP
130+
- required-opps: This contains phandle to an OPP node in another device's OPP
131131
table. It may contain an array of phandles, where each phandle points to an
132132
OPP of a different device. It should not contain multiple phandles to the OPP
133133
nodes in the same OPP table. This specifies the minimum required OPP of the
@@ -175,14 +175,14 @@ Example:
175175
compatible = "foo,i-leak-current";
176176
reg = <0x12350000 0x1000>;
177177
power-domains = <&power 0>;
178-
required-opp = <&domain0_opp_0>;
178+
required-opps = <&domain0_opp_0>;
179179
};
180180

181181
leaky-device1@12350000 {
182182
compatible = "foo,i-leak-current";
183183
reg = <0x12350000 0x1000>;
184184
power-domains = <&power 1>;
185-
required-opp = <&domain1_opp_1>;
185+
required-opps = <&domain1_opp_1>;
186186
};
187187

188188
[1]. Documentation/devicetree/bindings/power/domain-idle-state.txt

Documentation/devicetree/bindings/power/rockchip-io-domain.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ SoC is on the same page.
3131

3232
Required properties:
3333
- compatible: should be one of:
34+
- "rockchip,px30-io-voltage-domain" for px30
35+
- "rockchip,px30-pmu-io-voltage-domain" for px30 pmu-domains
3436
- "rockchip,rk3188-io-voltage-domain" for rk3188
3537
- "rockchip,rk3228-io-voltage-domain" for rk3228
3638
- "rockchip,rk3288-io-voltage-domain" for rk3288
@@ -51,6 +53,19 @@ a phandle the relevant regulator. All specified supplies must be able
5153
to report their voltage. The IO Voltage Domain for any non-specified
5254
supplies will be not be touched.
5355

56+
Possible supplies for PX30:
57+
- vccio6-supply: The supply connected to VCCIO6.
58+
- vccio1-supply: The supply connected to VCCIO1.
59+
- vccio2-supply: The supply connected to VCCIO2.
60+
- vccio3-supply: The supply connected to VCCIO3.
61+
- vccio4-supply: The supply connected to VCCIO4.
62+
- vccio5-supply: The supply connected to VCCIO5.
63+
- vccio-oscgpi-supply: The supply connected to VCCIO_OSCGPI.
64+
65+
Possible supplies for PX30 pmu-domains:
66+
- pmuio1-supply: The supply connected to PMUIO1.
67+
- pmuio2-supply: The supply connected to PMUIO2.
68+
5469
Possible supplies for rk3188:
5570
- ap0-supply: The supply connected to AP0_VCC.
5671
- ap1-supply: The supply connected to AP1_VCC.

MAINTAINERS

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11663,6 +11663,13 @@ F: Documentation/devicetree/bindings/media/qcom,camss.txt
1166311663
F: Documentation/media/v4l-drivers/qcom_camss.rst
1166411664
F: drivers/media/platform/qcom/camss-8x16/
1166511665

11666+
QUALCOMM CPUFREQ DRIVER MSM8996/APQ8096
11667+
M: Ilia Lin <ilia.lin@gmail.com>
11668+
L: linux-pm@vger.kernel.org
11669+
S: Maintained
11670+
F: Documentation/devicetree/bindings/opp/kryo-cpufreq.txt
11671+
F: drivers/cpufreq/qcom-cpufreq-kryo.c
11672+
1166611673
QUALCOMM EMAC GIGABIT ETHERNET DRIVER
1166711674
M: Timur Tabi <timur@codeaurora.org>
1166811675
L: netdev@vger.kernel.org
@@ -14380,6 +14387,15 @@ S: Maintained
1438014387
F: drivers/tc/
1438114388
F: include/linux/tc.h
1438214389

14390+
TURBOSTAT UTILITY
14391+
M: "Len Brown" <lenb@kernel.org>
14392+
L: linux-pm@vger.kernel.org
14393+
B: https://bugzilla.kernel.org
14394+
Q: https://patchwork.kernel.org/project/linux-pm/list/
14395+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux.git turbostat
14396+
S: Supported
14397+
F: tools/power/x86/turbostat/
14398+
1438314399
TW5864 VIDEO4LINUX DRIVER
1438414400
M: Bluecherry Maintainers <maintainers@bluecherrydvr.com>
1438514401
M: Anton Sviridenko <anton@corp.bluecherry.net>

arch/x86/include/asm/msr-index.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
#define NHM_C3_AUTO_DEMOTE (1UL << 25)
6363
#define NHM_C1_AUTO_DEMOTE (1UL << 26)
6464
#define ATM_LNC_C6_AUTO_DEMOTE (1UL << 25)
65-
#define SNB_C1_AUTO_UNDEMOTE (1UL << 27)
66-
#define SNB_C3_AUTO_UNDEMOTE (1UL << 28)
65+
#define SNB_C3_AUTO_UNDEMOTE (1UL << 27)
66+
#define SNB_C1_AUTO_UNDEMOTE (1UL << 28)
6767

6868
#define MSR_MTRRcap 0x000000fe
6969

drivers/acpi/acpica/evgpe.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,12 @@ acpi_ev_detect_gpe(struct acpi_namespace_node *gpe_device,
634634

635635
flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
636636

637+
if (!gpe_event_info) {
638+
gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
639+
if (!gpe_event_info)
640+
goto error_exit;
641+
}
642+
637643
/* Get the info block for the entire GPE register */
638644

639645
gpe_register_info = gpe_event_info->register_info;

drivers/acpi/acpica/evxfgpe.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,28 @@ acpi_get_gpe_status(acpi_handle gpe_device,
637637

638638
ACPI_EXPORT_SYMBOL(acpi_get_gpe_status)
639639

640+
/*******************************************************************************
641+
*
642+
* FUNCTION: acpi_gispatch_gpe
643+
*
644+
* PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1
645+
* gpe_number - GPE level within the GPE block
646+
*
647+
* RETURN: None
648+
*
649+
* DESCRIPTION: Detect and dispatch a General Purpose Event to either a function
650+
* (e.g. EC) or method (e.g. _Lxx/_Exx) handler.
651+
*
652+
******************************************************************************/
653+
void acpi_dispatch_gpe(acpi_handle gpe_device, u32 gpe_number)
654+
{
655+
ACPI_FUNCTION_TRACE(acpi_dispatch_gpe);
656+
657+
acpi_ev_detect_gpe(gpe_device, NULL, gpe_number);
658+
}
659+
660+
ACPI_EXPORT_SYMBOL(acpi_dispatch_gpe)
661+
640662
/*******************************************************************************
641663
*
642664
* FUNCTION: acpi_finish_gpe

drivers/acpi/device_pm.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,18 +1257,15 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on)
12571257
struct acpi_device *adev = ACPI_COMPANION(dev);
12581258

12591259
if (!adev)
1260-
return -ENODEV;
1261-
1262-
if (dev->pm_domain)
1263-
return -EEXIST;
1260+
return 0;
12641261

12651262
/*
12661263
* Only attach the power domain to the first device if the
12671264
* companion is shared by multiple. This is to prevent doing power
12681265
* management twice.
12691266
*/
12701267
if (!acpi_device_is_first_physical_node(adev, dev))
1271-
return -EBUSY;
1268+
return 0;
12721269

12731270
acpi_add_pm_notifier(adev, dev, acpi_pm_notify_work_func);
12741271
dev_pm_domain_set(dev, &acpi_general_pm_domain);
@@ -1278,7 +1275,7 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on)
12781275
}
12791276

12801277
dev->pm_domain->detach = acpi_dev_pm_detach;
1281-
return 0;
1278+
return 1;
12821279
}
12831280
EXPORT_SYMBOL_GPL(acpi_dev_pm_attach);
12841281
#endif /* CONFIG_PM */

drivers/acpi/ec.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,6 +1034,12 @@ void acpi_ec_unblock_transactions(void)
10341034
acpi_ec_start(first_ec, true);
10351035
}
10361036

1037+
void acpi_ec_dispatch_gpe(void)
1038+
{
1039+
if (first_ec)
1040+
acpi_dispatch_gpe(NULL, first_ec->gpe);
1041+
}
1042+
10371043
/* --------------------------------------------------------------------------
10381044
Event Management
10391045
-------------------------------------------------------------------------- */

drivers/acpi/internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ int acpi_ec_ecdt_probe(void);
188188
int acpi_ec_dsdt_probe(void);
189189
void acpi_ec_block_transactions(void);
190190
void acpi_ec_unblock_transactions(void);
191+
void acpi_ec_dispatch_gpe(void);
191192
int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit,
192193
acpi_handle handle, acpi_ec_query_func func,
193194
void *data);

drivers/acpi/sleep.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,13 @@ static void acpi_s2idle_wake(void)
989989
!irqd_is_wakeup_armed(irq_get_irq_data(acpi_sci_irq))) {
990990
pm_system_cancel_wakeup();
991991
s2idle_wakeup = true;
992+
/*
993+
* On some platforms with the LPS0 _DSM device noirq resume
994+
* takes too much time for EC wakeup events to survive, so look
995+
* for them now.
996+
*/
997+
if (lps0_device_handle)
998+
acpi_ec_dispatch_gpe();
992999
}
9931000
}
9941001

drivers/amba/bus.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ static int amba_probe(struct device *dev)
251251
break;
252252

253253
ret = dev_pm_domain_attach(dev, true);
254-
if (ret == -EPROBE_DEFER)
254+
if (ret)
255255
break;
256256

257257
ret = amba_get_enable_pclk(pcdev);
@@ -378,7 +378,7 @@ static int amba_device_try_add(struct amba_device *dev, struct resource *parent)
378378
}
379379

380380
ret = dev_pm_domain_attach(&dev->dev, true);
381-
if (ret == -EPROBE_DEFER) {
381+
if (ret) {
382382
iounmap(tmp);
383383
goto err_release;
384384
}

drivers/base/base.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,6 @@ extern void device_links_driver_cleanup(struct device *dev);
161161
extern void device_links_no_driver(struct device *dev);
162162
extern bool device_links_busy(struct device *dev);
163163
extern void device_links_unbind_consumers(struct device *dev);
164+
165+
/* device pm support */
166+
void device_pm_move_to_tail(struct device *dev);

drivers/base/core.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,26 @@ static int device_reorder_to_tail(struct device *dev, void *not_used)
144144
return 0;
145145
}
146146

147+
/**
148+
* device_pm_move_to_tail - Move set of devices to the end of device lists
149+
* @dev: Device to move
150+
*
151+
* This is a device_reorder_to_tail() wrapper taking the requisite locks.
152+
*
153+
* It moves the @dev along with all of its children and all of its consumers
154+
* to the ends of the device_kset and dpm_list, recursively.
155+
*/
156+
void device_pm_move_to_tail(struct device *dev)
157+
{
158+
int idx;
159+
160+
idx = device_links_read_lock();
161+
device_pm_lock();
162+
device_reorder_to_tail(dev, NULL);
163+
device_pm_unlock();
164+
device_links_read_unlock(idx);
165+
}
166+
147167
/**
148168
* device_link_add - Create a link between two devices.
149169
* @consumer: Consumer end of the link.

drivers/base/dd.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,7 @@ static void deferred_probe_work_func(struct work_struct *work)
122122
* the list is a good order for suspend but deferred
123123
* probe makes that very unsafe.
124124
*/
125-
device_pm_lock();
126-
device_pm_move_last(dev);
127-
device_pm_unlock();
125+
device_pm_move_to_tail(dev);
128126

129127
dev_dbg(dev, "Retrying from deferred list\n");
130128
if (initcall_debug && !initcalls_done)
@@ -582,7 +580,7 @@ int driver_probe_device(struct device_driver *drv, struct device *dev)
582580
pr_debug("bus: '%s': %s: matched device %s with driver %s\n",
583581
drv->bus->name, __func__, dev_name(dev), drv->name);
584582

585-
pm_runtime_get_suppliers(dev);
583+
pm_runtime_resume_suppliers(dev);
586584
if (dev->parent)
587585
pm_runtime_get_sync(dev->parent);
588586

@@ -593,7 +591,6 @@ int driver_probe_device(struct device_driver *drv, struct device *dev)
593591
if (dev->parent)
594592
pm_runtime_put(dev->parent);
595593

596-
pm_runtime_put_suppliers(dev);
597594
return ret;
598595
}
599596

drivers/base/platform.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -572,17 +572,16 @@ static int platform_drv_probe(struct device *_dev)
572572
return ret;
573573

574574
ret = dev_pm_domain_attach(_dev, true);
575-
if (ret != -EPROBE_DEFER) {
576-
if (drv->probe) {
577-
ret = drv->probe(dev);
578-
if (ret)
579-
dev_pm_domain_detach(_dev, true);
580-
} else {
581-
/* don't fail if just dev_pm_domain_attach failed */
582-
ret = 0;
583-
}
575+
if (ret)
576+
goto out;
577+
578+
if (drv->probe) {
579+
ret = drv->probe(dev);
580+
if (ret)
581+
dev_pm_domain_detach(_dev, true);
584582
}
585583

584+
out:
586585
if (drv->prevent_deferred_probe && ret == -EPROBE_DEFER) {
587586
dev_warn(_dev, "probe deferral not supported\n");
588587
ret = -ENXIO;

drivers/base/power/common.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,21 @@ EXPORT_SYMBOL_GPL(dev_pm_put_subsys_data);
9898
* Callers must ensure proper synchronization of this function with power
9999
* management callbacks.
100100
*
101-
* Returns 0 on successfully attached PM domain or negative error code.
101+
* Returns 0 on successfully attached PM domain, or when it is found that the
102+
* device doesn't need a PM domain, else a negative error code.
102103
*/
103104
int dev_pm_domain_attach(struct device *dev, bool power_on)
104105
{
105106
int ret;
106107

108+
if (dev->pm_domain)
109+
return 0;
110+
107111
ret = acpi_dev_pm_attach(dev, power_on);
108-
if (ret)
112+
if (!ret)
109113
ret = genpd_dev_pm_attach(dev);
110114

111-
return ret;
115+
return ret < 0 ? ret : 0;
112116
}
113117
EXPORT_SYMBOL_GPL(dev_pm_domain_attach);
114118

0 commit comments

Comments
 (0)