Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 206204
b: refs/heads/master
c: 8fec62b
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo committed Jun 29, 2010
1 parent 3e90c68 commit e63da25
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 82805ab77d25643f579d90397dcd34f05d1b750a
refs/heads/master: 8fec62b2d9d0c80b594d0d85678bfdf57a70df1b
40 changes: 11 additions & 29 deletions trunk/drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,36 +191,11 @@ acpi_status __init acpi_os_initialize(void)
return AE_OK;
}

static void bind_to_cpu0(struct work_struct *work)
{
set_cpus_allowed_ptr(current, cpumask_of(0));
kfree(work);
}

static void bind_workqueue(struct workqueue_struct *wq)
{
struct work_struct *work;

work = kzalloc(sizeof(struct work_struct), GFP_KERNEL);
INIT_WORK(work, bind_to_cpu0);
queue_work(wq, work);
}

acpi_status acpi_os_initialize1(void)
{
/*
* On some machines, a software-initiated SMI causes corruption unless
* the SMI runs on CPU 0. An SMI can be initiated by any AML, but
* typically it's done in GPE-related methods that are run via
* workqueues, so we can avoid the known corruption cases by binding
* the workqueues to CPU 0.
*/
kacpid_wq = create_singlethread_workqueue("kacpid");
bind_workqueue(kacpid_wq);
kacpi_notify_wq = create_singlethread_workqueue("kacpi_notify");
bind_workqueue(kacpi_notify_wq);
kacpi_hotplug_wq = create_singlethread_workqueue("kacpi_hotplug");
bind_workqueue(kacpi_hotplug_wq);
kacpid_wq = create_workqueue("kacpid");
kacpi_notify_wq = create_workqueue("kacpi_notify");
kacpi_hotplug_wq = create_workqueue("kacpi_hotplug");
BUG_ON(!kacpid_wq);
BUG_ON(!kacpi_notify_wq);
BUG_ON(!kacpi_hotplug_wq);
Expand Down Expand Up @@ -766,7 +741,14 @@ static acpi_status __acpi_os_execute(acpi_execute_type type,
else
INIT_WORK(&dpc->work, acpi_os_execute_deferred);

ret = queue_work(queue, &dpc->work);
/*
* On some machines, a software-initiated SMI causes corruption unless
* the SMI runs on CPU 0. An SMI can be initiated by any AML, but
* typically it's done in GPE-related methods that are run via
* workqueues, so we can avoid the known corruption cases by always
* queueing on CPU 0.
*/
ret = queue_work_on(0, queue, &dpc->work);

if (!ret) {
printk(KERN_ERR PREFIX
Expand Down

0 comments on commit e63da25

Please sign in to comment.