aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/Makefile1
-rw-r--r--drivers/acpi/blacklist.c14
-rw-r--r--drivers/acpi/bus.c2
-rw-r--r--drivers/acpi/ec.c10
-rw-r--r--drivers/acpi/internal.h1
-rw-r--r--drivers/acpi/processor_core.c69
-rw-r--r--drivers/acpi/processor_pdc.c108
7 files changed, 134 insertions, 71 deletions
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index c7b10b4298e..66cc3f36a95 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -32,6 +32,7 @@ acpi-$(CONFIG_ACPI_SLEEP) += proc.o
32# 32#
33acpi-y += bus.o glue.o 33acpi-y += bus.o glue.o
34acpi-y += scan.o 34acpi-y += scan.o
35acpi-y += processor_pdc.o
35acpi-y += ec.o 36acpi-y += ec.o
36acpi-$(CONFIG_ACPI_DOCK) += dock.o 37acpi-$(CONFIG_ACPI_DOCK) += dock.o
37acpi-y += pci_root.o pci_link.o pci_irq.o pci_bind.o 38acpi-y += pci_root.o pci_link.o pci_irq.o pci_bind.o
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c
index 23e5a0519af..2815df66f6f 100644
--- a/drivers/acpi/blacklist.c
+++ b/drivers/acpi/blacklist.c
@@ -185,6 +185,12 @@ static int __init dmi_disable_osi_vista(const struct dmi_system_id *d)
185 acpi_osi_setup("!Windows 2006"); 185 acpi_osi_setup("!Windows 2006");
186 return 0; 186 return 0;
187} 187}
188static int __init dmi_disable_osi_win7(const struct dmi_system_id *d)
189{
190 printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident);
191 acpi_osi_setup("!Windows 2009");
192 return 0;
193}
188 194
189static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { 195static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
190 { 196 {
@@ -211,6 +217,14 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
211 DMI_MATCH(DMI_PRODUCT_NAME, "Sony VGN-SR290J"), 217 DMI_MATCH(DMI_PRODUCT_NAME, "Sony VGN-SR290J"),
212 }, 218 },
213 }, 219 },
220 {
221 .callback = dmi_disable_osi_win7,
222 .ident = "ASUS K50IJ",
223 .matches = {
224 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
225 DMI_MATCH(DMI_PRODUCT_NAME, "K50IJ"),
226 },
227 },
214 228
215 /* 229 /*
216 * BIOS invocation of _OSI(Linux) is almost always a BIOS bug. 230 * BIOS invocation of _OSI(Linux) is almost always a BIOS bug.
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 0c1ad3105da..cf761b904e4 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -898,6 +898,8 @@ static int __init acpi_bus_init(void)
898 goto error1; 898 goto error1;
899 } 899 }
900 900
901 acpi_early_processor_set_pdc();
902
901 /* 903 /*
902 * Maybe EC region is required at bus_scan/acpi_get_devices. So it 904 * Maybe EC region is required at bus_scan/acpi_get_devices. So it
903 * is necessary to enable it as early as possible. 905 * is necessary to enable it as early as possible.
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 75b147f5c8f..fd1801bdee6 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -916,6 +916,7 @@ static int ec_validate_ecdt(const struct dmi_system_id *id)
916/* MSI EC needs special treatment, enable it */ 916/* MSI EC needs special treatment, enable it */
917static int ec_flag_msi(const struct dmi_system_id *id) 917static int ec_flag_msi(const struct dmi_system_id *id)
918{ 918{
919 printk(KERN_DEBUG PREFIX "Detected MSI hardware, enabling workarounds.\n");
919 EC_FLAGS_MSI = 1; 920 EC_FLAGS_MSI = 1;
920 EC_FLAGS_VALIDATE_ECDT = 1; 921 EC_FLAGS_VALIDATE_ECDT = 1;
921 return 0; 922 return 0;
@@ -928,8 +929,13 @@ static struct dmi_system_id __initdata ec_dmi_table[] = {
928 DMI_MATCH(DMI_BOARD_NAME, "JFL92") }, NULL}, 929 DMI_MATCH(DMI_BOARD_NAME, "JFL92") }, NULL},
929 { 930 {
930 ec_flag_msi, "MSI hardware", { 931 ec_flag_msi, "MSI hardware", {
931 DMI_MATCH(DMI_BIOS_VENDOR, "Micro-Star"), 932 DMI_MATCH(DMI_BIOS_VENDOR, "Micro-Star")}, NULL},
932 DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-Star") }, NULL}, 933 {
934 ec_flag_msi, "MSI hardware", {
935 DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star")}, NULL},
936 {
937 ec_flag_msi, "MSI hardware", {
938 DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-Star")}, NULL},
933 { 939 {
934 ec_validate_ecdt, "ASUS hardware", { 940 ec_validate_ecdt, "ASUS hardware", {
935 DMI_MATCH(DMI_BIOS_VENDOR, "ASUS") }, NULL}, 941 DMI_MATCH(DMI_BIOS_VENDOR, "ASUS") }, NULL},
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
index 074cf8682d5..cb28e0502ac 100644
--- a/drivers/acpi/internal.h
+++ b/drivers/acpi/internal.h
@@ -43,6 +43,7 @@ int acpi_power_transition(struct acpi_device *device, int state);
43extern int acpi_power_nocheck; 43extern int acpi_power_nocheck;
44 44
45int acpi_wakeup_device_init(void); 45int acpi_wakeup_device_init(void);
46void acpi_early_processor_set_pdc(void);
46 47
47/* -------------------------------------------------------------------------- 48/* --------------------------------------------------------------------------
48 Embedded Controller 49 Embedded Controller
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 41731236f9a..a19a4ff962e 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -124,29 +124,6 @@ static const struct file_operations acpi_processor_info_fops = {
124 124
125DEFINE_PER_CPU(struct acpi_processor *, processors); 125DEFINE_PER_CPU(struct acpi_processor *, processors);
126struct acpi_processor_errata errata __read_mostly; 126struct acpi_processor_errata errata __read_mostly;
127static int set_no_mwait(const struct dmi_system_id *id)
128{
129 printk(KERN_NOTICE PREFIX "%s detected - "
130 "disabling mwait for CPU C-states\n", id->ident);
131 idle_nomwait = 1;
132 return 0;
133}
134
135static struct dmi_system_id __cpuinitdata processor_idle_dmi_table[] = {
136 {
137 set_no_mwait, "IFL91 board", {
138 DMI_MATCH(DMI_BIOS_VENDOR, "COMPAL"),
139 DMI_MATCH(DMI_SYS_VENDOR, "ZEPTO"),
140 DMI_MATCH(DMI_PRODUCT_VERSION, "3215W"),
141 DMI_MATCH(DMI_BOARD_NAME, "IFL91") }, NULL},
142 {
143 set_no_mwait, "Extensa 5220", {
144 DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
145 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
146 DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
147 DMI_MATCH(DMI_BOARD_NAME, "Columbia") }, NULL},
148 {},
149};
150 127
151/* -------------------------------------------------------------------------- 128/* --------------------------------------------------------------------------
152 Errata Handling 129 Errata Handling
@@ -277,45 +254,6 @@ static int acpi_processor_errata(struct acpi_processor *pr)
277} 254}
278 255
279/* -------------------------------------------------------------------------- 256/* --------------------------------------------------------------------------
280 Common ACPI processor functions
281 -------------------------------------------------------------------------- */
282
283/*
284 * _PDC is required for a BIOS-OS handshake for most of the newer
285 * ACPI processor features.
286 */
287static int acpi_processor_set_pdc(struct acpi_processor *pr)
288{
289 struct acpi_object_list *pdc_in = pr->pdc;
290 acpi_status status = AE_OK;
291
292
293 if (!pdc_in)
294 return status;
295 if (idle_nomwait) {
296 /*
297 * If mwait is disabled for CPU C-states, the C2C3_FFH access
298 * mode will be disabled in the parameter of _PDC object.
299 * Of course C1_FFH access mode will also be disabled.
300 */
301 union acpi_object *obj;
302 u32 *buffer = NULL;
303
304 obj = pdc_in->pointer;
305 buffer = (u32 *)(obj->buffer.pointer);
306 buffer[2] &= ~(ACPI_PDC_C_C2C3_FFH | ACPI_PDC_C_C1_FFH);
307
308 }
309 status = acpi_evaluate_object(pr->handle, "_PDC", pdc_in, NULL);
310
311 if (ACPI_FAILURE(status))
312 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
313 "Could not evaluate _PDC, using legacy perf. control...\n"));
314
315 return status;
316}
317
318/* --------------------------------------------------------------------------
319 FS Interface (/proc) 257 FS Interface (/proc)
320 -------------------------------------------------------------------------- */ 258 -------------------------------------------------------------------------- */
321 259
@@ -825,9 +763,7 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
825 } 763 }
826 764
827 /* _PDC call should be done before doing anything else (if reqd.). */ 765 /* _PDC call should be done before doing anything else (if reqd.). */
828 arch_acpi_processor_init_pdc(pr);
829 acpi_processor_set_pdc(pr); 766 acpi_processor_set_pdc(pr);
830 arch_acpi_processor_cleanup_pdc(pr);
831 767
832#ifdef CONFIG_CPU_FREQ 768#ifdef CONFIG_CPU_FREQ
833 acpi_processor_ppc_has_changed(pr, 0); 769 acpi_processor_ppc_has_changed(pr, 0);
@@ -1145,11 +1081,6 @@ static int __init acpi_processor_init(void)
1145 if (!acpi_processor_dir) 1081 if (!acpi_processor_dir)
1146 return -ENOMEM; 1082 return -ENOMEM;
1147#endif 1083#endif
1148 /*
1149 * Check whether the system is DMI table. If yes, OSPM
1150 * should not use mwait for CPU-states.
1151 */
1152 dmi_check_system(processor_idle_dmi_table);
1153 result = cpuidle_register_driver(&acpi_idle_driver); 1084 result = cpuidle_register_driver(&acpi_idle_driver);
1154 if (result < 0) 1085 if (result < 0)
1155 goto out_proc; 1086 goto out_proc;
diff --git a/drivers/acpi/processor_pdc.c b/drivers/acpi/processor_pdc.c
new file mode 100644
index 00000000000..b416c32dda0
--- /dev/null
+++ b/drivers/acpi/processor_pdc.c
@@ -0,0 +1,108 @@
1#include <linux/dmi.h>
2
3#include <acpi/acpi_drivers.h>
4#include <acpi/processor.h>
5
6#include "internal.h"
7
8#define PREFIX "ACPI: "
9#define _COMPONENT ACPI_PROCESSOR_COMPONENT
10ACPI_MODULE_NAME("processor_pdc");
11
12static int set_no_mwait(const struct dmi_system_id *id)
13{
14 printk(KERN_NOTICE PREFIX "%s detected - "
15 "disabling mwait for CPU C-states\n", id->ident);
16 idle_nomwait = 1;
17 return 0;
18}
19
20static struct dmi_system_id __cpuinitdata processor_idle_dmi_table[] = {
21 {
22 set_no_mwait, "IFL91 board", {
23 DMI_MATCH(DMI_BIOS_VENDOR, "COMPAL"),
24 DMI_MATCH(DMI_SYS_VENDOR, "ZEPTO"),
25 DMI_MATCH(DMI_PRODUCT_VERSION, "3215W"),
26 DMI_MATCH(DMI_BOARD_NAME, "IFL91") }, NULL},
27 {
28 set_no_mwait, "Extensa 5220", {
29 DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
30 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
31 DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
32 DMI_MATCH(DMI_BOARD_NAME, "Columbia") }, NULL},
33 {},
34};
35
36/*
37 * _PDC is required for a BIOS-OS handshake for most of the newer
38 * ACPI processor features.
39 */
40static int acpi_processor_eval_pdc(struct acpi_processor *pr)
41{
42 struct acpi_object_list *pdc_in = pr->pdc;
43 acpi_status status = AE_OK;
44
45 if (!pdc_in)
46 return status;
47 if (idle_nomwait) {
48 /*
49 * If mwait is disabled for CPU C-states, the C2C3_FFH access
50 * mode will be disabled in the parameter of _PDC object.
51 * Of course C1_FFH access mode will also be disabled.
52 */
53 union acpi_object *obj;
54 u32 *buffer = NULL;
55
56 obj = pdc_in->pointer;
57 buffer = (u32 *)(obj->buffer.pointer);
58 buffer[2] &= ~(ACPI_PDC_C_C2C3_FFH | ACPI_PDC_C_C1_FFH);
59
60 }
61 status = acpi_evaluate_object(pr->handle, "_PDC", pdc_in, NULL);
62
63 if (ACPI_FAILURE(status))
64 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
65 "Could not evaluate _PDC, using legacy perf. control.\n"));
66
67 return status;
68}
69
70void acpi_processor_set_pdc(struct acpi_processor *pr)
71{
72 arch_acpi_processor_init_pdc(pr);
73 acpi_processor_eval_pdc(pr);
74 arch_acpi_processor_cleanup_pdc(pr);
75}
76EXPORT_SYMBOL_GPL(acpi_processor_set_pdc);
77
78static acpi_status
79early_init_pdc(acpi_handle handle, u32 lvl, void *context, void **rv)
80{
81 struct acpi_processor pr;
82
83 pr.handle = handle;
84
85 /* x86 implementation looks at pr.id to determine some
86 * CPU capabilites. We can just hard code to 0 since we're
87 * assuming the CPUs in the system are homogenous and all
88 * have the same capabilities.
89 */
90 pr.id = 0;
91
92 acpi_processor_set_pdc(&pr);
93
94 return AE_OK;
95}
96
97void acpi_early_processor_set_pdc(void)
98{
99 /*
100 * Check whether the system is DMI table. If yes, OSPM
101 * should not use mwait for CPU-states.
102 */
103 dmi_check_system(processor_idle_dmi_table);
104
105 acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
106 ACPI_UINT32_MAX,
107 early_init_pdc, NULL, NULL, NULL);
108}