diff options
Diffstat (limited to 'drivers/acpi/osl.c')
-rw-r--r-- | drivers/acpi/osl.c | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 03017b1eb38b..65b25a303b86 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -190,36 +190,11 @@ acpi_status __init acpi_os_initialize(void) | |||
190 | return AE_OK; | 190 | return AE_OK; |
191 | } | 191 | } |
192 | 192 | ||
193 | static void bind_to_cpu0(struct work_struct *work) | ||
194 | { | ||
195 | set_cpus_allowed_ptr(current, cpumask_of(0)); | ||
196 | kfree(work); | ||
197 | } | ||
198 | |||
199 | static void bind_workqueue(struct workqueue_struct *wq) | ||
200 | { | ||
201 | struct work_struct *work; | ||
202 | |||
203 | work = kzalloc(sizeof(struct work_struct), GFP_KERNEL); | ||
204 | INIT_WORK(work, bind_to_cpu0); | ||
205 | queue_work(wq, work); | ||
206 | } | ||
207 | |||
208 | acpi_status acpi_os_initialize1(void) | 193 | acpi_status acpi_os_initialize1(void) |
209 | { | 194 | { |
210 | /* | 195 | kacpid_wq = create_workqueue("kacpid"); |
211 | * On some machines, a software-initiated SMI causes corruption unless | 196 | kacpi_notify_wq = create_workqueue("kacpi_notify"); |
212 | * the SMI runs on CPU 0. An SMI can be initiated by any AML, but | 197 | kacpi_hotplug_wq = create_workqueue("kacpi_hotplug"); |
213 | * typically it's done in GPE-related methods that are run via | ||
214 | * workqueues, so we can avoid the known corruption cases by binding | ||
215 | * the workqueues to CPU 0. | ||
216 | */ | ||
217 | kacpid_wq = create_singlethread_workqueue("kacpid"); | ||
218 | bind_workqueue(kacpid_wq); | ||
219 | kacpi_notify_wq = create_singlethread_workqueue("kacpi_notify"); | ||
220 | bind_workqueue(kacpi_notify_wq); | ||
221 | kacpi_hotplug_wq = create_singlethread_workqueue("kacpi_hotplug"); | ||
222 | bind_workqueue(kacpi_hotplug_wq); | ||
223 | BUG_ON(!kacpid_wq); | 198 | BUG_ON(!kacpid_wq); |
224 | BUG_ON(!kacpi_notify_wq); | 199 | BUG_ON(!kacpi_notify_wq); |
225 | BUG_ON(!kacpi_hotplug_wq); | 200 | BUG_ON(!kacpi_hotplug_wq); |
@@ -765,7 +740,14 @@ static acpi_status __acpi_os_execute(acpi_execute_type type, | |||
765 | else | 740 | else |
766 | INIT_WORK(&dpc->work, acpi_os_execute_deferred); | 741 | INIT_WORK(&dpc->work, acpi_os_execute_deferred); |
767 | 742 | ||
768 | ret = queue_work(queue, &dpc->work); | 743 | /* |
744 | * On some machines, a software-initiated SMI causes corruption unless | ||
745 | * the SMI runs on CPU 0. An SMI can be initiated by any AML, but | ||
746 | * typically it's done in GPE-related methods that are run via | ||
747 | * workqueues, so we can avoid the known corruption cases by always | ||
748 | * queueing on CPU 0. | ||
749 | */ | ||
750 | ret = queue_work_on(0, queue, &dpc->work); | ||
769 | 751 | ||
770 | if (!ret) { | 752 | if (!ret) { |
771 | printk(KERN_ERR PREFIX | 753 | printk(KERN_ERR PREFIX |