linux/drivers/acpi
Rafael J. Wysocki 28f4f8a9de ACPI / ACPICA: Fix reference counting problems with GPE handlers
If a handler is installed for a GPE associated with an AML method and
such that it cannot wake up the system from sleep states, the GPE
remains enabled after the handler has been installed, although it
should be disabled in that case to avoid spurious execution of the
handler.

Fix this issue by making acpi_install_gpe_handler() disable GPEs
that were previously associated with AML methods and cannot wake up
the system from sleep states.

Analogously, make acpi_remove_gpe_handler() enable the GPEs that
are associated with AML methods after their handlers have been
removed and cannot wake up the system from sleep states.  In addition
to that, fix a code ordering issue in acpi_remove_gpe_handler() that
renders the locking ineffective (ACPI_MTX_EVENTS is released
temporarily in the middle of the routine to wait for the completion
of events already in progress).

For this purpose introduce acpi_raw_disable_gpe() and
acpi_raw_enable_gpe() to be called with acpi_gbl_gpe_lock held
and rework acpi_disable_gpe() and acpi_enable_gpe(), respectively, to
use them.  Also rework acpi_gpe_can_wake() to use
acpi_raw_disable_gpe() instead of calling acpi_disable_gpe() after
releasing the lock to avoid the possible theoretical race with
acpi_install_gpe_handler().

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: "Moore, Robert" <robert.moore@intel.com>
Cc: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-08-07 10:30:12 -04:00
..
acpica ACPI / ACPICA: Fix reference counting problems with GPE handlers 2010-08-07 10:30:12 -04:00
apei correct console log level when ERST ACPI table is not found 2010-07-01 18:40:29 -07:00
ac.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
acpi_memhotplug.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
acpi_pad.c ACPI: acpi_pad: Don't needlessly mark LAPIC unstable 2010-06-04 03:48:10 -04:00
atomicio.c acpi: update gfp/slab.h includes 2010-06-28 10:19:19 +10:00
battery.c Merge branches 'battery', 'bugzilla-14667', 'bugzilla-15096', 'bugzilla-15480', 'bugzilla-15521', 'bugzilla-15605', 'gpe-reference-counters', 'misc', 'pxm-fix' and 'video-random-key' into release 2010-04-06 17:06:22 -04:00
blacklist.c ACPI: Disable Vista compatibility for Sony VGN-NS50B_L 2010-06-10 11:31:03 -04:00
bus.c drivers: acpi: don't use own implementation of hex_to_bin() 2010-05-25 08:07:06 -07:00
button.c ACPICA: Remove wakeup GPE reference counting which is not used 2010-07-06 22:34:26 -04:00
cm_sbs.c ACPI: Move definition of PREFIX from acpi_bus.h to internal..h 2009-08-28 19:57:27 -04:00
container.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
debug.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
dock.c Merge branches 'battery', 'bugzilla-14667', 'bugzilla-15096', 'bugzilla-15480', 'bugzilla-15521', 'bugzilla-15605', 'gpe-reference-counters', 'misc', 'pxm-fix' and 'video-random-key' into release 2010-04-06 17:06:22 -04:00
ec.c ACPI / EC: Do not use acpi_set_gpe 2010-07-06 22:34:27 -04:00
event.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
fan.c ACPI: fan: fix unbalanced code block 2010-06-10 11:24:51 -04:00
glue.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
hed.c ACPI Hardware Error Device (PNP0C33) support 2010-05-19 22:40:24 -04:00
internal.h ACPI / EC / PM: Fix names of functions that block/unblock EC transactions 2010-05-28 23:36:06 -04:00
Kconfig ACPI Hardware Error Device (PNP0C33) support 2010-05-19 22:40:24 -04:00
Makefile ACPI Hardware Error Device (PNP0C33) support 2010-05-19 22:40:24 -04:00
numa.c ACPI: NUMA: map pxms to low node ids 2010-04-04 00:50:01 -04:00
osl.c ACPI / ACPICA: Do not execute _PRW methods during initialization 2010-07-12 14:17:39 -04:00
pci_bind.c PCI / ACPI / PM: Platform support for PCI PME wake-up 2010-02-22 16:21:02 -08:00
pci_irq.c x86, acpi/irq: pci device dev->irq is an isa irq not a gsi 2010-05-04 13:34:30 -07:00
pci_link.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pci_root.c Merge branch 'bjorn-pci-root-v4-2.6.35' into release 2010-05-28 16:17:16 -04:00
pci_slot.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
power_meter.c power_meter: acpi_device_class "power_meter_resource" too long 2010-05-06 02:38:24 -04:00
power.c Merge branch 'master' into for-next 2010-04-23 02:08:44 +02:00
proc.c Fix misspellings of "separate" in strings. 2010-02-04 11:55:46 +01:00
processor_core.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
processor_driver.c ACPI: Do not try to set up acpi processor stuff on cores exceeding maxcpus= 2010-06-09 18:04:12 -04:00
processor_idle.c ACPI: Eliminate us to pm ticks conversion in common path 2010-06-04 15:22:28 -04:00
processor_perflib.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
processor_thermal.c ACPI: Remove unnecessary cast. 2010-01-15 23:06:44 -05:00
processor_throttling.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
reboot.c ACPI: reboot.c: use new acpi_reset interface 2008-12-31 01:15:00 -05:00
sbs.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
sbshc.c sbshc: acpi_device_class "smbus_host_controller" too long 2010-05-06 02:38:25 -04:00
sbshc.h ACPI: SBS: Ignore alarms coming from unknown devices 2007-12-14 15:14:06 -05:00
scan.c ACPI / ACPICA: Do not execute _PRW methods during initialization 2010-07-12 14:17:39 -04:00
sleep.c ACPICA: Introduce acpi_gpe_wakeup() 2010-07-06 22:34:26 -04:00
sleep.h drivers/acpi/sleep.h: Checkpatch cleanup 2010-05-28 15:31:33 -04:00
system.c ACPICA: Remove wakeup GPE reference counting which is not used 2010-07-06 22:34:26 -04:00
tables.c ACPI: delete the "acpi=ht" boot option 2010-03-14 20:58:38 -04:00
thermal.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
utils.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
video_detect.c ACPI: video: fix acpi_backlight=video 2010-05-20 01:31:00 -04:00
video.c Merge branch 'misc-2.6.35' into release 2010-05-28 16:18:20 -04:00
wakeup.c ACPICA: Introduce acpi_gpe_wakeup() 2010-07-06 22:34:26 -04:00