Commit e59b76ff authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents c3419fd6 b23eb5c7
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -162,20 +162,22 @@ void acpi_processor_ppc_init(int cpu)
	struct acpi_processor *pr = per_cpu(processors, cpu);
	int ret;

	if (!pr)
		return;

	ret = dev_pm_qos_add_request(get_cpu_device(cpu),
				     &pr->perflib_req, DEV_PM_QOS_MAX_FREQUENCY,
				     INT_MAX);
	if (ret < 0) {
	if (ret < 0)
		pr_err("Failed to add freq constraint for CPU%d (%d)\n", cpu,
		       ret);
		return;
	}
}

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

	if (pr)
		dev_pm_qos_remove_request(&pr->perflib_req);
}

+6 −4
Original line number Diff line number Diff line
@@ -130,20 +130,22 @@ void acpi_thermal_cpufreq_init(int cpu)
	struct acpi_processor *pr = per_cpu(processors, cpu);
	int ret;

	if (!pr)
		return;

	ret = dev_pm_qos_add_request(get_cpu_device(cpu),
				     &pr->thermal_req, DEV_PM_QOS_MAX_FREQUENCY,
				     INT_MAX);
	if (ret < 0) {
	if (ret < 0)
		pr_err("Failed to add freq constraint for CPU%d (%d)\n", cpu,
		       ret);
		return;
	}
}

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

	if (pr)
		dev_pm_qos_remove_request(&pr->thermal_req);
}
#else				/* ! CONFIG_CPU_FREQ */
+0 −13
Original line number Diff line number Diff line
@@ -361,19 +361,6 @@ static const struct dmi_system_id acpisleep_dmi_table[] __initconst = {
		DMI_MATCH(DMI_PRODUCT_NAME, "80E3"),
		},
	},
	/*
	 * https://bugzilla.kernel.org/show_bug.cgi?id=196907
	 * Some Dell XPS13 9360 cannot do suspend-to-idle using the Low Power
	 * S0 Idle firmware interface.
	 */
	{
	.callback = init_default_s3,
	.ident = "Dell XPS13 9360",
	.matches = {
		DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
		DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9360"),
		},
	},
	/*
	 * ThinkPad X1 Tablet(2016) cannot do suspend-to-idle using
	 * the Low Power S0 Idle firmware interface (see
+3 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
 */

#include <linux/acpi.h>
#include <linux/cpufreq.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/fwnode.h>
@@ -3179,6 +3180,8 @@ void device_shutdown(void)
	wait_for_device_probe();
	device_block_probing();

	cpufreq_suspend();

	spin_lock(&devices_kset->list_lock);
	/*
	 * Walk the devices list backward, shutting down each in turn.
+0 −10
Original line number Diff line number Diff line
@@ -2737,14 +2737,6 @@ int cpufreq_unregister_driver(struct cpufreq_driver *driver)
}
EXPORT_SYMBOL_GPL(cpufreq_unregister_driver);

/*
 * Stop cpufreq at shutdown to make sure it isn't holding any locks
 * or mutexes when secondary CPUs are halted.
 */
static struct syscore_ops cpufreq_syscore_ops = {
	.shutdown = cpufreq_suspend,
};

struct kobject *cpufreq_global_kobject;
EXPORT_SYMBOL(cpufreq_global_kobject);

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

	register_syscore_ops(&cpufreq_syscore_ops);

	return 0;
}
module_param(off, int, 0444);
Loading