linux-kernel-test/drivers/acpi
Preeti U Murthy 8651f97bd9 PM / cpuidle: System resume hang fix with cpuidle
On certain bios, resume hangs if cpus are allowed to enter idle states
during suspend [1].

This was fixed in apci idle driver [2].But intel_idle driver does not
have this fix. Thus instead of replicating the fix in both the idle
drivers, or in more platform specific idle drivers if needed, the
more general cpuidle infrastructure could handle this.

A suspend callback in cpuidle_driver could handle this fix. But
a cpuidle_driver provides only basic functionalities like platform idle
state detection capability and mechanisms to support entry and exit
into CPU idle states. All other cpuidle functions are found in the
cpuidle generic infrastructure for good reason that all cpuidle
drivers, irrepective of their platforms will support these functions.

One option therefore would be to register a suspend callback in cpuidle
which handles this fix. This could be called through a PM_SUSPEND_PREPARE
notifier. But this is too generic a notfier for a driver to handle.

Also, ideally the job of cpuidle is not to handle side effects of suspend.
It should expose the interfaces which "handle cpuidle 'during' suspend"
or any other operation, which the subsystems call during that respective
operation.

The fix demands that during suspend, no cpus should be allowed to enter
deep C-states. The interface cpuidle_uninstall_idle_handler() in cpuidle
ensures that. Not just that it also kicks all the cpus which are already
in idle out of their idle states which was being done during cpu hotplug
through a CPU_DYING_FROZEN callbacks.

Now the question arises about when during suspend should
cpuidle_uninstall_idle_handler() be called. Since we are dealing with
drivers it seems best to call this function during dpm_suspend().
Delaying the call till dpm_suspend_noirq() does no harm, as long as it is
before cpu_hotplug_begin() to avoid race conditions with cpu hotpulg
operations. In dpm_suspend_noirq(), it would be wise to place this call
before suspend_device_irqs() to avoid ugly interactions with the same.

Ananlogously, during resume.

References:
[1] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/674075.
[2] http://marc.info/?l=linux-pm&m=133958534231884&w=2

Reported-and-tested-by: Dave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2012-07-10 21:34:49 +02:00
..
acpica Revert "ACPI: ignore FADT reset-reg-sup flag" 2012-04-20 11:19:35 -07:00
apei ACPI, APEI, Avoid too much error reporting in runtime 2012-06-12 00:17:18 -04:00
ac.c treewide: fix potentially dangerous trailing ';' in #defined values/expressions 2011-07-21 14:10:00 +02:00
acpi_ipmi.c
acpi_memhotplug.c
acpi_pad.c acpi_pad: fix power_saving thread deadlock 2012-06-30 00:51:13 -04:00
battery.c ACPI battery: only refresh the sysfs files when pertinent information changes 2012-05-08 01:49:57 -04:00
bgrt.c acpi, bgrd: Add missing <linux/io.h> to drivers/acpi/bgrt.c 2012-05-17 07:18:26 -07:00
blacklist.c acpi: delete module.h include from files explicitly not needing it 2011-10-31 19:30:33 -04:00
bus.c ACPI / PM: Make __acpi_bus_get_power() cover D3cold correctly 2012-05-29 21:20:24 +02:00
button.c ACPI button: remove unused procfs I/F 2011-03-22 23:20:35 -04:00
cm_sbs.c
container.c
custom_method.c ACPI: Split out custom_method functionality into an own driver 2011-05-29 01:50:40 -04:00
debugfs.c acpi: add export.h to files using THIS_MODULE/EXPORT_SYMBOL 2011-10-31 19:30:34 -04:00
dock.c module_param: make bool parameters really bool (drivers & misc) 2012-01-13 09:32:20 +10:30
ec_sys.c simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
ec.c Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux 2012-03-30 16:45:39 -07:00
event.c acpi: add export.h to files using THIS_MODULE/EXPORT_SYMBOL 2011-10-31 19:30:34 -04:00
fan.c ACPI: constify ops structs 2011-07-16 18:36:17 -04:00
glue.c ACPI: Add stubs for (un)register_acpi_bus_type 2012-05-11 17:03:12 -07:00
hed.c
internal.h ACPI: Cleanup custom_method debug stuff 2011-05-29 01:50:04 -04:00
Kconfig drivers: acpi: Fix dependency for ACPI_HOTPLUG_CPU 2012-06-04 00:07:33 -04:00
Makefile ACPI: Add support for exposing BGRT data 2012-03-30 04:09:24 -04:00
numa.c ACPI: Store SRAT table revision 2012-01-17 04:19:04 -05:00
nvs.c ACPI / PM: print physical addresses consistently with other parts of kernel 2012-03-30 02:46:57 -04:00
osl.c Revert "ACPI: Make ACPI interrupt threaded" 2012-04-18 10:16:27 -07:00
pci_bind.c
pci_irq.c PCI/PM/Runtime: make PCI traces quieter 2012-01-06 12:11:16 -08:00
pci_link.c acpi: use KERN_CONT in printk() continuation lines 2012-05-08 08:55:26 -07:00
pci_root.c PCI: Rework ASPM disable code 2012-01-06 12:10:26 -08:00
pci_slot.c module_param: make bool parameters really bool (drivers & misc) 2012-01-13 09:32:20 +10:30
power.c ACPI / PM: Make __acpi_bus_get_power() cover D3cold correctly 2012-05-29 21:20:24 +02:00
proc.c acpi: add export.h to files using THIS_MODULE/EXPORT_SYMBOL 2011-10-31 19:30:34 -04:00
processor_core.c ACPI: processor: fix acpi_get_cpuid for UP processor 2012-01-17 05:25:08 -05:00
processor_driver.c ACPI: intel_idle : break dependency between modules 2012-07-05 22:37:47 +02:00
processor_idle.c PM / cpuidle: System resume hang fix with cpuidle 2012-07-10 21:34:49 +02:00
processor_perflib.c ACPI: Ignore invalid _PSS entries, but use valid ones 2012-05-08 01:56:37 -04:00
processor_thermal.c ACPI: Do cpufreq clamping for throttling per package v2 2012-03-22 02:16:14 -04:00
processor_throttling.c ACPI throttling: fix endian bug in acpi_read_throttling_status() 2012-03-30 16:06:12 -04:00
reboot.c Revert "ACPI: ignore FADT reset-reg-sup flag" 2012-04-20 11:19:35 -07:00
sbs.c Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2011-08-02 21:17:02 -10:00
sbshc.c acpi: add module.h to files implicitly using/relying on it. 2011-10-31 19:30:32 -04:00
sbshc.h
scan.c ACPI / PM: Generate wakeup events on fixed power button 2012-05-29 21:20:23 +02:00
sleep.c Merge branches 'bugfix-battery', 'bugfix-misc', 'bugfix-rafael', 'bugfix-turbostat', 'bugfix-video' and 'workaround-pss' into release 2012-06-04 00:48:41 -04:00
sleep.h
sysfs.c ACPI sysfs.c strlen fix 2012-06-05 00:02:05 -04:00
tables.c
thermal.c ACPI: Evaluate thermal trip points before reading temperature 2012-03-30 02:38:31 -04:00
utils.c ACPI: Add _PLD support 2012-05-11 17:03:12 -07:00
video_detect.c platform/x86: drop deprecated asus_acpi driver 2012-03-20 12:02:18 -04:00
video.c Merge branches 'acpi_pad-bugzilla-42981', 'apei-bugzilla-43282', 'video-bugzilla-43168', 'bugzilla-40002' and 'bugfix-misc' into release 2012-06-30 00:53:50 -04:00
wakeup.c ACPI / Wakeup: Enable button GPEs unconditionally during initialization 2011-02-12 01:39:53 +01:00