linux/drivers/base
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
..
power PM / cpuidle: System resume hang fix with cpuidle 2012-07-10 21:34:49 +02:00
regmap regmap: Export regmap_reinit_cache() 2012-06-08 05:57:21 +08:00
attribute_container.c [SCSI] attirbute_container: Initialize sysfs attributes with sysfs_attr_init 2010-03-27 15:15:24 -04:00
base.h driver core: move the deferred probe pointer into the private area 2012-03-08 12:17:22 -08:00
bus.c Revert "driver core: check start node in klist_iter_init_node" 2012-04-19 19:17:30 -07:00
class.c Revert "driver core: check start node in klist_iter_init_node" 2012-04-19 19:17:30 -07:00
core.c driver-core: extend dev_printk() to pass structured data 2012-05-07 17:12:03 -07:00
cpu.c sched: Remove stale power aware scheduling remnants and dysfunctional knobs 2012-05-17 13:48:56 +02:00
dd.c driver core: fixup reversed deferred probe order 2012-06-13 13:42:39 -07:00
devres.c devres: Add devres_release() 2012-05-04 16:33:16 -07:00
devtmpfs.c devtmpfs: fix 'the the' typo 2012-04-18 15:37:35 -07:00
dma-buf.c dma-buf updates for 3.5 2012-05-25 09:37:26 -07:00
dma-coherent.c common: add dma_mmap_from_coherent() function 2012-05-21 15:06:09 +02:00
dma-contiguous.c drivers: add Contiguous Memory Allocator 2012-05-21 15:09:37 +02:00
dma-mapping.c drivers/base: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required. 2011-10-31 19:31:38 -04:00
driver.c Driver Core: don't oops with unregistered driver in driver_find_device() 2012-05-14 08:46:01 -07:00
firmware_class.c firmware_class: Move request_firmware_nowait() to workqueues 2012-03-28 23:31:00 +02:00
firmware.c firmware: change firmware_kset to firmware_kobj 2008-01-24 20:40:23 -08:00
hypervisor.c drivers/base: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required. 2011-10-31 19:31:38 -04:00
init.c driver-core: implement 'sysdev' functionality for regular devices and buses 2011-12-14 14:29:38 -08:00
isa.c dma-mapping: replace all DMA_24BIT_MASK macro with DMA_BIT_MASK(24) 2009-04-07 08:31:12 -07:00
Kconfig drivers: add Contiguous Memory Allocator 2012-05-21 15:09:37 +02:00
Makefile drivers: add Contiguous Memory Allocator 2012-05-21 15:09:37 +02:00
map.c
memory.c Linux 3.3-rc7 2012-03-14 07:44:11 +01:00
module.c driver core: module.c: Use kasprintf 2010-05-21 09:37:29 -07:00
node.c mm: fix off-by-one bug in print_nodes_state() 2012-05-29 16:22:19 -07:00
platform.c drivercore: Output common devicetree information in uevent 2012-02-01 14:26:30 -07:00
soc.c mode_t whack-a-mole: ->is_visible() returns umode_t... 2012-05-29 23:28:42 -04:00
syscore.c PM: Reintroduce dropped call to check_wakeup_irqs 2011-07-11 10:51:49 +02:00
topology.c cpu: convert 'cpu' and 'machinecheck' sysdev_class to a regular subsystem 2011-12-21 14:29:42 -08:00
transport_class.c drivers/base: transport_class explicitly requires EXPORT_SYMBOL 2011-10-31 19:31:15 -04:00