Skip to content

Commit e59b76f

Browse files
committed
Merge tag 'pm-5.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fixes from Rafael Wysocki: "These include a fix for a recent regression in the ACPI CPU performance scaling code, a PCI device power management fix, a system shutdown fix related to cpufreq, a removal of an ACPI suspend-to-idle blacklist entry and a build warning fix. Specifics: - Fix possible NULL pointer dereference in the ACPI processor scaling initialization code introduced by a recent cpufreq update (Rafael Wysocki). - Fix possible deadlock due to suspending cpufreq too late during system shutdown (Rafael Wysocki). - Make the PCI device system resume code path be more consistent with its PM-runtime counterpart to fix an issue with missing delay on transitions from D3cold to D0 during system resume from suspend-to-idle on some systems (Rafael Wysocki). - Drop Dell XPS13 9360 from the LPS0 Idle _DSM blacklist to make it use suspend-to-idle by default (Mario Limonciello). - Fix build warning in the core system suspend support code (Ben Dooks)" * tag 'pm-5.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: processor: Avoid NULL pointer dereferences at init time PCI: PM: Fix pci_power_up() PM: sleep: include <linux/pm_runtime.h> for pm_wq cpufreq: Avoid cpufreq_suspend() deadlock on system shutdown ACPI: PM: Drop Dell XPS13 9360 from LPS0 Idle _DSM blacklist
2 parents c3419fd + b23eb5c commit e59b76f

File tree

7 files changed

+27
-44
lines changed

7 files changed

+27
-44
lines changed

drivers/acpi/processor_perflib.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,21 +162,23 @@ void acpi_processor_ppc_init(int cpu)
162162
struct acpi_processor *pr = per_cpu(processors, cpu);
163163
int ret;
164164

165+
if (!pr)
166+
return;
167+
165168
ret = dev_pm_qos_add_request(get_cpu_device(cpu),
166169
&pr->perflib_req, DEV_PM_QOS_MAX_FREQUENCY,
167170
INT_MAX);
168-
if (ret < 0) {
171+
if (ret < 0)
169172
pr_err("Failed to add freq constraint for CPU%d (%d)\n", cpu,
170173
ret);
171-
return;
172-
}
173174
}
174175

175176
void acpi_processor_ppc_exit(int cpu)
176177
{
177178
struct acpi_processor *pr = per_cpu(processors, cpu);
178179

179-
dev_pm_qos_remove_request(&pr->perflib_req);
180+
if (pr)
181+
dev_pm_qos_remove_request(&pr->perflib_req);
180182
}
181183

182184
static int acpi_processor_get_performance_control(struct acpi_processor *pr)

drivers/acpi/processor_thermal.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,21 +130,23 @@ void acpi_thermal_cpufreq_init(int cpu)
130130
struct acpi_processor *pr = per_cpu(processors, cpu);
131131
int ret;
132132

133+
if (!pr)
134+
return;
135+
133136
ret = dev_pm_qos_add_request(get_cpu_device(cpu),
134137
&pr->thermal_req, DEV_PM_QOS_MAX_FREQUENCY,
135138
INT_MAX);
136-
if (ret < 0) {
139+
if (ret < 0)
137140
pr_err("Failed to add freq constraint for CPU%d (%d)\n", cpu,
138141
ret);
139-
return;
140-
}
141142
}
142143

143144
void acpi_thermal_cpufreq_exit(int cpu)
144145
{
145146
struct acpi_processor *pr = per_cpu(processors, cpu);
146147

147-
dev_pm_qos_remove_request(&pr->thermal_req);
148+
if (pr)
149+
dev_pm_qos_remove_request(&pr->thermal_req);
148150
}
149151
#else /* ! CONFIG_CPU_FREQ */
150152
static int cpufreq_get_max_state(unsigned int cpu)

drivers/acpi/sleep.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -361,19 +361,6 @@ static const struct dmi_system_id acpisleep_dmi_table[] __initconst = {
361361
DMI_MATCH(DMI_PRODUCT_NAME, "80E3"),
362362
},
363363
},
364-
/*
365-
* https://bugzilla.kernel.org/show_bug.cgi?id=196907
366-
* Some Dell XPS13 9360 cannot do suspend-to-idle using the Low Power
367-
* S0 Idle firmware interface.
368-
*/
369-
{
370-
.callback = init_default_s3,
371-
.ident = "Dell XPS13 9360",
372-
.matches = {
373-
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
374-
DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9360"),
375-
},
376-
},
377364
/*
378365
* ThinkPad X1 Tablet(2016) cannot do suspend-to-idle using
379366
* the Low Power S0 Idle firmware interface (see

drivers/base/core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
#include <linux/acpi.h>
12+
#include <linux/cpufreq.h>
1213
#include <linux/device.h>
1314
#include <linux/err.h>
1415
#include <linux/fwnode.h>
@@ -3179,6 +3180,8 @@ void device_shutdown(void)
31793180
wait_for_device_probe();
31803181
device_block_probing();
31813182

3183+
cpufreq_suspend();
3184+
31823185
spin_lock(&devices_kset->list_lock);
31833186
/*
31843187
* Walk the devices list backward, shutting down each in turn.

drivers/cpufreq/cpufreq.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2737,14 +2737,6 @@ int cpufreq_unregister_driver(struct cpufreq_driver *driver)
27372737
}
27382738
EXPORT_SYMBOL_GPL(cpufreq_unregister_driver);
27392739

2740-
/*
2741-
* Stop cpufreq at shutdown to make sure it isn't holding any locks
2742-
* or mutexes when secondary CPUs are halted.
2743-
*/
2744-
static struct syscore_ops cpufreq_syscore_ops = {
2745-
.shutdown = cpufreq_suspend,
2746-
};
2747-
27482740
struct kobject *cpufreq_global_kobject;
27492741
EXPORT_SYMBOL(cpufreq_global_kobject);
27502742

@@ -2756,8 +2748,6 @@ static int __init cpufreq_core_init(void)
27562748
cpufreq_global_kobject = kobject_create_and_add("cpufreq", &cpu_subsys.dev_root->kobj);
27572749
BUG_ON(!cpufreq_global_kobject);
27582750

2759-
register_syscore_ops(&cpufreq_syscore_ops);
2760-
27612751
return 0;
27622752
}
27632753
module_param(off, int, 0444);

drivers/pci/pci.c

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -958,19 +958,6 @@ void pci_refresh_power_state(struct pci_dev *dev)
958958
pci_update_current_state(dev, dev->current_state);
959959
}
960960

961-
/**
962-
* pci_power_up - Put the given device into D0 forcibly
963-
* @dev: PCI device to power up
964-
*/
965-
void pci_power_up(struct pci_dev *dev)
966-
{
967-
if (platform_pci_power_manageable(dev))
968-
platform_pci_set_power_state(dev, PCI_D0);
969-
970-
pci_raw_set_power_state(dev, PCI_D0);
971-
pci_update_current_state(dev, PCI_D0);
972-
}
973-
974961
/**
975962
* pci_platform_power_transition - Use platform to change device power state
976963
* @dev: PCI device to handle.
@@ -1153,6 +1140,17 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state)
11531140
}
11541141
EXPORT_SYMBOL(pci_set_power_state);
11551142

1143+
/**
1144+
* pci_power_up - Put the given device into D0 forcibly
1145+
* @dev: PCI device to power up
1146+
*/
1147+
void pci_power_up(struct pci_dev *dev)
1148+
{
1149+
__pci_start_power_transition(dev, PCI_D0);
1150+
pci_raw_set_power_state(dev, PCI_D0);
1151+
pci_update_current_state(dev, PCI_D0);
1152+
}
1153+
11561154
/**
11571155
* pci_choose_state - Choose the power state of a PCI device
11581156
* @dev: PCI device to be suspended

kernel/power/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <linux/seq_file.h>
1616
#include <linux/suspend.h>
1717
#include <linux/syscalls.h>
18+
#include <linux/pm_runtime.h>
1819

1920
#include "power.h"
2021

0 commit comments

Comments
 (0)