aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-01-06 17:33:30 -0500
committerLen Brown <len.brown@intel.com>2011-01-07 01:16:41 -0500
commitb014f4f1aad3f25d5c7d877a394869645ea0c96b (patch)
treea191dd3771cd012f5877b32db5f786445c441cc7 /drivers/acpi
parent9cd031441a4fd09273b7c2beb337d0b2683d104c (diff)
ACPI / PM: Do not enable multiple devices to wake up simultaneously
If a device is enabled to wake up the system from sleep states via /proc/acpi/wakeup and there are other devices associated with the same wakeup GPE, all of these devices are automatically enabled to wake up the system. This isn't correct, because the fact the GPE is shared need not imply that wakeup power has to be enabled for all the devices at the same time (i.e. it is possible that one device will have its wakeup power enabled and it will wake up the system from a sleep state if the shared wakeup GPE is enabled, while another device having its wakeup power disabled will not wake up the system even though the GPE is enabled). Rework acpi_system_write_wakeup_device() so that it only enables wakeup for one device at a time. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/proc.c26
1 files changed, 1 insertions, 25 deletions
diff --git a/drivers/acpi/proc.c b/drivers/acpi/proc.c
index afad67769db6..129effbb7bd4 100644
--- a/drivers/acpi/proc.c
+++ b/drivers/acpi/proc.c
@@ -341,7 +341,6 @@ acpi_system_write_wakeup_device(struct file *file,
341 char strbuf[5]; 341 char strbuf[5];
342 char str[5] = ""; 342 char str[5] = "";
343 unsigned int len = count; 343 unsigned int len = count;
344 struct acpi_device *found_dev = NULL;
345 344
346 if (len > 4) 345 if (len > 4)
347 len = 4; 346 len = 4;
@@ -363,33 +362,10 @@ acpi_system_write_wakeup_device(struct file *file,
363 if (!strncmp(dev->pnp.bus_id, str, 4)) { 362 if (!strncmp(dev->pnp.bus_id, str, 4)) {
364 dev->wakeup.state.enabled = 363 dev->wakeup.state.enabled =
365 dev->wakeup.state.enabled ? 0 : 1; 364 dev->wakeup.state.enabled ? 0 : 1;
366 found_dev = dev; 365 physical_device_enable_wakeup(dev);
367 break; 366 break;
368 } 367 }
369 } 368 }
370 if (found_dev) {
371 physical_device_enable_wakeup(found_dev);
372 list_for_each_safe(node, next, &acpi_wakeup_device_list) {
373 struct acpi_device *dev = container_of(node,
374 struct
375 acpi_device,
376 wakeup_list);
377
378 if ((dev != found_dev) &&
379 (dev->wakeup.gpe_number ==
380 found_dev->wakeup.gpe_number)
381 && (dev->wakeup.gpe_device ==
382 found_dev->wakeup.gpe_device)) {
383 printk(KERN_WARNING
384 "ACPI: '%s' and '%s' have the same GPE, "
385 "can't disable/enable one separately\n",
386 dev->pnp.bus_id, found_dev->pnp.bus_id);
387 dev->wakeup.state.enabled =
388 found_dev->wakeup.state.enabled;
389 physical_device_enable_wakeup(dev);
390 }
391 }
392 }
393 mutex_unlock(&acpi_device_lock); 369 mutex_unlock(&acpi_device_lock);
394 return count; 370 return count;
395} 371}