aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-09 14:16:28 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-09 14:16:28 -0500
commit3fefc31843cfe2b5f072efe11ed9ccaf6a7a5092 (patch)
tree972363ae187c21bb3d4ec8948bf06603973dd163
parentd93d4ce103fdd6c6689e94cfbd0316b027d6ead2 (diff)
parente029b9bf1221f200319541cd6861912b89345665 (diff)
Merge tag 'pm-final-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull final power management fixes from Rafael Wysocki: "These fix a regression in the schedutil cpufreq governor introduced by a recent change and blacklist Dell XPS13 9360 from using the Low Power S0 Idle _DSM interface which triggers serious problems on one of these machines. Specifics: - Prevent the schedutil cpufreq governor from using the utilization of a wrong CPU in some cases which started to happen after one of the recent changes in it (Chris Redpath). - Blacklist Dell XPS13 9360 from using the Low Power S0 Idle _DSM interface as that causes serious issue (related to NVMe) to appear on one of these machines, even though the other Dells XPS13 9360 in somewhat different HW configurations behave correctly (Rafael Wysocki)" * tag 'pm-final-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI / PM: Blacklist Low Power S0 Idle _DSM for Dell XPS13 9360 cpufreq: schedutil: Examine the correct CPU when we update util
-rw-r--r--drivers/acpi/sleep.c28
-rw-r--r--kernel/sched/cpufreq_schedutil.c6
2 files changed, 29 insertions, 5 deletions
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 6804ddab3052..8082871b409a 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -160,6 +160,14 @@ static int __init init_nvs_nosave(const struct dmi_system_id *d)
160 return 0; 160 return 0;
161} 161}
162 162
163static bool acpi_sleep_no_lps0;
164
165static int __init init_no_lps0(const struct dmi_system_id *d)
166{
167 acpi_sleep_no_lps0 = true;
168 return 0;
169}
170
163static const struct dmi_system_id acpisleep_dmi_table[] __initconst = { 171static const struct dmi_system_id acpisleep_dmi_table[] __initconst = {
164 { 172 {
165 .callback = init_old_suspend_ordering, 173 .callback = init_old_suspend_ordering,
@@ -343,6 +351,19 @@ static const struct dmi_system_id acpisleep_dmi_table[] __initconst = {
343 DMI_MATCH(DMI_PRODUCT_NAME, "80E3"), 351 DMI_MATCH(DMI_PRODUCT_NAME, "80E3"),
344 }, 352 },
345 }, 353 },
354 /*
355 * https://bugzilla.kernel.org/show_bug.cgi?id=196907
356 * Some Dell XPS13 9360 cannot do suspend-to-idle using the Low Power
357 * S0 Idle firmware interface.
358 */
359 {
360 .callback = init_no_lps0,
361 .ident = "Dell XPS13 9360",
362 .matches = {
363 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
364 DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9360"),
365 },
366 },
346 {}, 367 {},
347}; 368};
348 369
@@ -485,6 +506,7 @@ static void acpi_pm_end(void)
485} 506}
486#else /* !CONFIG_ACPI_SLEEP */ 507#else /* !CONFIG_ACPI_SLEEP */
487#define acpi_target_sleep_state ACPI_STATE_S0 508#define acpi_target_sleep_state ACPI_STATE_S0
509#define acpi_sleep_no_lps0 (false)
488static inline void acpi_sleep_dmi_check(void) {} 510static inline void acpi_sleep_dmi_check(void) {}
489#endif /* CONFIG_ACPI_SLEEP */ 511#endif /* CONFIG_ACPI_SLEEP */
490 512
@@ -863,6 +885,12 @@ static int lps0_device_attach(struct acpi_device *adev,
863 if (lps0_device_handle) 885 if (lps0_device_handle)
864 return 0; 886 return 0;
865 887
888 if (acpi_sleep_no_lps0) {
889 acpi_handle_info(adev->handle,
890 "Low Power S0 Idle interface disabled\n");
891 return 0;
892 }
893
866 if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) 894 if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0))
867 return 0; 895 return 0;
868 896
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
index 9209d83ecdcf..ba0da243fdd8 100644
--- a/kernel/sched/cpufreq_schedutil.c
+++ b/kernel/sched/cpufreq_schedutil.c
@@ -649,6 +649,7 @@ static int sugov_start(struct cpufreq_policy *policy)
649 struct sugov_cpu *sg_cpu = &per_cpu(sugov_cpu, cpu); 649 struct sugov_cpu *sg_cpu = &per_cpu(sugov_cpu, cpu);
650 650
651 memset(sg_cpu, 0, sizeof(*sg_cpu)); 651 memset(sg_cpu, 0, sizeof(*sg_cpu));
652 sg_cpu->cpu = cpu;
652 sg_cpu->sg_policy = sg_policy; 653 sg_cpu->sg_policy = sg_policy;
653 sg_cpu->flags = SCHED_CPUFREQ_RT; 654 sg_cpu->flags = SCHED_CPUFREQ_RT;
654 sg_cpu->iowait_boost_max = policy->cpuinfo.max_freq; 655 sg_cpu->iowait_boost_max = policy->cpuinfo.max_freq;
@@ -714,11 +715,6 @@ struct cpufreq_governor *cpufreq_default_governor(void)
714 715
715static int __init sugov_register(void) 716static int __init sugov_register(void)
716{ 717{
717 int cpu;
718
719 for_each_possible_cpu(cpu)
720 per_cpu(sugov_cpu, cpu).cpu = cpu;
721
722 return cpufreq_register_governor(&schedutil_gov); 718 return cpufreq_register_governor(&schedutil_gov);
723} 719}
724fs_initcall(sugov_register); 720fs_initcall(sugov_register);