aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/osl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/osl.c')
-rw-r--r--drivers/acpi/osl.c60
1 files changed, 11 insertions, 49 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 78418ce4fc78..f14d3f251d26 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -191,36 +191,11 @@ acpi_status __init acpi_os_initialize(void)
191 return AE_OK; 191 return AE_OK;
192} 192}
193 193
194static void bind_to_cpu0(struct work_struct *work)
195{
196 set_cpus_allowed_ptr(current, cpumask_of(0));
197 kfree(work);
198}
199
200static void bind_workqueue(struct workqueue_struct *wq)
201{
202 struct work_struct *work;
203
204 work = kzalloc(sizeof(struct work_struct), GFP_KERNEL);
205 INIT_WORK(work, bind_to_cpu0);
206 queue_work(wq, work);
207}
208
209acpi_status acpi_os_initialize1(void) 194acpi_status acpi_os_initialize1(void)
210{ 195{
211 /* 196 kacpid_wq = create_workqueue("kacpid");
212 * On some machines, a software-initiated SMI causes corruption unless 197 kacpi_notify_wq = create_workqueue("kacpi_notify");
213 * the SMI runs on CPU 0. An SMI can be initiated by any AML, but 198 kacpi_hotplug_wq = create_workqueue("kacpi_hotplug");
214 * typically it's done in GPE-related methods that are run via
215 * workqueues, so we can avoid the known corruption cases by binding
216 * the workqueues to CPU 0.
217 */
218 kacpid_wq = create_singlethread_workqueue("kacpid");
219 bind_workqueue(kacpid_wq);
220 kacpi_notify_wq = create_singlethread_workqueue("kacpi_notify");
221 bind_workqueue(kacpi_notify_wq);
222 kacpi_hotplug_wq = create_singlethread_workqueue("kacpi_hotplug");
223 bind_workqueue(kacpi_hotplug_wq);
224 BUG_ON(!kacpid_wq); 199 BUG_ON(!kacpid_wq);
225 BUG_ON(!kacpi_notify_wq); 200 BUG_ON(!kacpi_notify_wq);
226 BUG_ON(!kacpi_hotplug_wq); 201 BUG_ON(!kacpi_hotplug_wq);
@@ -766,7 +741,14 @@ static acpi_status __acpi_os_execute(acpi_execute_type type,
766 else 741 else
767 INIT_WORK(&dpc->work, acpi_os_execute_deferred); 742 INIT_WORK(&dpc->work, acpi_os_execute_deferred);
768 743
769 ret = queue_work(queue, &dpc->work); 744 /*
745 * On some machines, a software-initiated SMI causes corruption unless
746 * the SMI runs on CPU 0. An SMI can be initiated by any AML, but
747 * typically it's done in GPE-related methods that are run via
748 * workqueues, so we can avoid the known corruption cases by always
749 * queueing on CPU 0.
750 */
751 ret = queue_work_on(0, queue, &dpc->work);
770 752
771 if (!ret) { 753 if (!ret) {
772 printk(KERN_ERR PREFIX 754 printk(KERN_ERR PREFIX
@@ -1064,26 +1046,6 @@ static int __init acpi_serialize_setup(char *str)
1064 1046
1065__setup("acpi_serialize", acpi_serialize_setup); 1047__setup("acpi_serialize", acpi_serialize_setup);
1066 1048
1067/*
1068 * Wake and Run-Time GPES are expected to be separate.
1069 * We disable wake-GPEs at run-time to prevent spurious
1070 * interrupts.
1071 *
1072 * However, if a system exists that shares Wake and
1073 * Run-time events on the same GPE this flag is available
1074 * to tell Linux to keep the wake-time GPEs enabled at run-time.
1075 */
1076static int __init acpi_wake_gpes_always_on_setup(char *str)
1077{
1078 printk(KERN_INFO PREFIX "wake GPEs not disabled\n");
1079
1080 acpi_gbl_leave_wake_gpes_disabled = FALSE;
1081
1082 return 1;
1083}
1084
1085__setup("acpi_wake_gpes_always_on", acpi_wake_gpes_always_on_setup);
1086
1087/* Check of resource interference between native drivers and ACPI 1049/* Check of resource interference between native drivers and ACPI
1088 * OperationRegions (SystemIO and System Memory only). 1050 * OperationRegions (SystemIO and System Memory only).
1089 * IO ports and memory declared in ACPI might be used by the ACPI subsystem 1051 * IO ports and memory declared in ACPI might be used by the ACPI subsystem