62 lines
2.0 KiB
Diff
62 lines
2.0 KiB
Diff
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
|
|
--- a/drivers/idle/intel_idle.c
|
|
+++ b/drivers/idle/intel_idle.c
|
|
@@ -53,6 +53,7 @@
|
|
#include <linux/notifier.h>
|
|
#include <linux/cpu.h>
|
|
#include <linux/moduleparam.h>
|
|
+#include <linux/pm_qos.h>
|
|
#include <linux/sysfs.h>
|
|
#include <asm/cpuid/api.h>
|
|
#include <asm/cpu_device_id.h>
|
|
@@ -2697,6 +2698,9 @@ static void __init cmdline_table_adjust(struct cpuidle_driver *drv)
|
|
pr_info("Failed to adjust C-states with data from 'intel_idle.table'\n");
|
|
}
|
|
|
|
+#define INTEL_IDLE_INIT_QOS 20
|
|
+static struct pm_qos_request qos_req __initdata;
|
|
+
|
|
static int __init intel_idle_init(void)
|
|
{
|
|
const struct x86_cpu_id *id;
|
|
@@ -2766,6 +2770,13 @@ static int __init intel_idle_init(void)
|
|
if (retval)
|
|
pr_warn("failed to initialized sysfs");
|
|
|
|
+ /*
|
|
+ * Some platforms, in particular the Intel S1200BTL motherboard, have a
|
|
+ * problem with using package idle states too early, so prevent that
|
|
+ * from taking place until the device_initcall() phase is over.
|
|
+ */
|
|
+ cpu_latency_qos_add_request(&qos_req, INTEL_IDLE_INIT_QOS);
|
|
+
|
|
retval = cpuidle_register_driver(&intel_idle_driver);
|
|
if (retval) {
|
|
struct cpuidle_driver *drv = cpuidle_get_driver();
|
|
@@ -2790,6 +2801,9 @@ static int __init intel_idle_init(void)
|
|
intel_idle_cpuidle_devices_uninit();
|
|
cpuidle_unregister_driver(&intel_idle_driver);
|
|
init_driver_fail:
|
|
+ if (cpu_latency_qos_request_active((&qos_req)))
|
|
+ cpu_latency_qos_remove_request(&qos_req);
|
|
+
|
|
intel_idle_sysfs_uninit();
|
|
free_percpu(intel_idle_cpuidle_devices);
|
|
return retval;
|
|
@@ -2797,6 +2811,15 @@ static int __init intel_idle_init(void)
|
|
}
|
|
subsys_initcall_sync(intel_idle_init);
|
|
|
|
+static int __init intel_idle_init_complete(void)
|
|
+{
|
|
+ if (cpu_latency_qos_request_active((&qos_req)))
|
|
+ cpu_latency_qos_remove_request(&qos_req);
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+device_initcall_sync(intel_idle_init_complete);
|
|
+
|
|
/*
|
|
* We are not really modular, but we used to support that. Meaning we also
|
|
* support "intel_idle.max_cstate=..." at boot and also a read-only export of
|