linux/drivers/acpi
Rafael J. Wysocki d5a64513c6 ACPI / EC / PM: Fix race between EC transactions and system suspend
There still is a race that may result in suspending the system in
the middle of an EC transaction in progress, which leads to problems
(like the kernel thinking that the ACPI global lock is held during
resume while in fact it's not).

To remove the race condition, modify the ACPI platform suspend and
hibernate callbacks so that EC transactions are blocked right after
executing the _PTS global control method and are allowed to happen
again right after the low-level wakeup.

Introduce acpi_pm_freeze() that will disable GPEs, wait until the
event queues are empty and block EC transactions.  Use it wherever
GPEs are disabled in preparation for switching local interrupts off.
Introduce acpi_pm_thaw() that will allow EC transactions to happen
again and enable runtime GPEs.  Use it to balance acpi_pm_freeze()
wherever necessary.

In addition to that use acpi_ec_resume_transactions_early() to
unblock EC transactions as early as reasonably possible during
resume.  Also unblock EC transactions in acpi_hibernation_finish()
and in the analogous suspend routine to make sure that the EC
transactions are enabled in all error paths.

Fixes https://bugzilla.kernel.org/show_bug.cgi?id=14668

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Reported-and-tested-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-05-28 23:35:55 -04:00
..
acpica Merge branch 'bugzilla-15749' into release 2010-04-16 16:08:07 -04:00
Kconfig ACPI: Kconfig, fix proc aggregator text 2009-10-09 13:14:51 -04:00
Makefile ACPI: processor: mv processor_pdc.c processor_core.c 2010-03-14 21:17:17 -04: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_pad: "processor_aggregator" name too long 2010-05-06 02:38:23 -04: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 _OSI(Windows 2009) on Asus K50IJ 2009-12-22 02:39:24 -05:00
bus.c ACPI: silence kmemcheck false positive 2010-04-27 03:15:08 -04:00
button.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
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 / PM: Fix race between EC transactions and system suspend 2010-05-28 23:35:55 -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: Remove repeated registered as cooling_device messages 2009-12-16 00:07:10 -05: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
hest.c ACPI: fix acpi_hest_firmware_first_pci() caused oops 2010-05-06 02:39:06 -04:00
internal.h ACPI / EC / PM: Fix race between EC transactions and system suspend 2010-05-28 23:35:55 -04:00
numa.c ACPI: NUMA: map pxms to low node ids 2010-04-04 00:50:01 -04:00
osl.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
pci_bind.c PCI / ACPI / PM: Platform support for PCI PME wake-up 2010-02-22 16:21:02 -08:00
pci_irq.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_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 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_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.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
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 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_idle.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_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 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
sleep.c ACPI / EC / PM: Fix race between EC transactions and system suspend 2010-05-28 23:35:55 -04:00
sleep.h ACPI: convert acpi_device_lock spinlock to mutex 2009-04-07 00:02:40 -04:00
system.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
tables.c ACPI: fix "acpi=ht" boot option 2010-02-18 03:49:38 -05: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.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
video_detect.c Merge branch 'acpica' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2009-12-09 19:57:06 -08:00
wakeup.c ACPI / PM: Add more run-time wake-up fields 2010-02-22 16:20:51 -08:00