aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-02-08 17:40:37 -0500
committerRafael J. Wysocki <rjw@sisk.pl>2011-02-24 13:58:53 -0500
commit5190726765b40774c069e187a958e10ccd970e65 (patch)
tree6cdfc76171e907232f91e4a094ee8ffbcc8e9797 /drivers/acpi
parent2aa15890f3c191326678f1bd68af61ec6b8753ec (diff)
ACPI: Remove the wakeup.run_wake_count device field
The wakeup.run_wake_count ACPI device field is only used by the PCI runtime PM code to "protect" devices from being prepared for generating wakeup signals more than once in a row. However, it really doesn't provide any protection, because (1) all of the functions it is supposed to protect use their own reference counters effectively ensuring that the device will be set up for generating wakeup signals just once and (2) the PCI runtime PM code uses wakeup.run_wake_count in a racy way, since nothing prevents acpi_dev_run_wake() from being called concurrently from two different threads for the same device. Remove the wakeup.run_wake_count ACPI device field which is unnecessary, confusing and used in a wrong way. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/button.c2
-rw-r--r--drivers/acpi/scan.c1
2 files changed, 0 insertions, 3 deletions
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index 76bbb78a5ad..e643a0936dc 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -430,7 +430,6 @@ static int acpi_button_add(struct acpi_device *device)
430 /* Button's GPE is run-wake GPE */ 430 /* Button's GPE is run-wake GPE */
431 acpi_enable_gpe(device->wakeup.gpe_device, 431 acpi_enable_gpe(device->wakeup.gpe_device,
432 device->wakeup.gpe_number); 432 device->wakeup.gpe_number);
433 device->wakeup.run_wake_count++;
434 device_set_wakeup_enable(&device->dev, true); 433 device_set_wakeup_enable(&device->dev, true);
435 } 434 }
436 435
@@ -453,7 +452,6 @@ static int acpi_button_remove(struct acpi_device *device, int type)
453 if (device->wakeup.flags.valid) { 452 if (device->wakeup.flags.valid) {
454 acpi_disable_gpe(device->wakeup.gpe_device, 453 acpi_disable_gpe(device->wakeup.gpe_device,
455 device->wakeup.gpe_number); 454 device->wakeup.gpe_number);
456 device->wakeup.run_wake_count--;
457 device_set_wakeup_enable(&device->dev, false); 455 device_set_wakeup_enable(&device->dev, false);
458 } 456 }
459 457
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index b99e6249460..b136c9c1e53 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -797,7 +797,6 @@ static void acpi_bus_set_run_wake_flags(struct acpi_device *device)
797 acpi_status status; 797 acpi_status status;
798 acpi_event_status event_status; 798 acpi_event_status event_status;
799 799
800 device->wakeup.run_wake_count = 0;
801 device->wakeup.flags.notifier_present = 0; 800 device->wakeup.flags.notifier_present = 0;
802 801
803 /* Power button, Lid switch always enable wakeup */ 802 /* Power button, Lid switch always enable wakeup */