android_kernel_motorola_sm6225/drivers/acpi
Deepthi Dharwar 75cc523587 PM / ACPI: Fix suspend/resume regression caused by cpuidle cleanup.
Commit e978aa7d7d ( cpuidle: Move
dev->last_residency update to driver enter routine; remove dev->last_state)
was  breaking suspend on laptops, as reported in the below link
	- https://lkml.org/lkml/2011/11/11/164

This was fixed in commit 3439a8da16
(ACPI / cpuidle: Remove acpi_idle_suspend (to fix suspend regression)
by removing acpi_idle_suspend flag.
	- https://lkml.org/lkml/2011/11/14/74

But this did fix did not work on all systems
as Suspend/resume regression was reported on Lenovo S10-3
recently by Dave.
	- https://lkml.org/lkml/2012/5/27/115
It looked like with commit e978aa7d broke suspend and
with commit 3439a8da resume was not working with acpi_idle driver.

This patch fixes the regression that caused this issue
in the first place. acpi_idle_suspend flag is essential on
some x86 systems to prevent the cpus from going to deeper C-states
when suspend is triggered ( commit b04e7bdb98 )
So reverting the commit 3439a8da is essential.

By default, irqs are disabled in cpu_idle arch specific call
and re-enabled in idle state return path . During suspend,
the acpi_idle_suspend flag is set, which
prevents the cpus from going to deeper idle states,
it is essential to enabling the irqs in this return path too.

To address the suspend issue,
we were not re-enabling the interrupts while returning from
acpi_idle_enter_bm() routine if acpi_idle_suspend flag is set.
and this caused suspend failure.

In addition to the above, to improve the readability of the code,
return of -ENIVAL is replaced with -EBUSY in acpi_idle_suspend
return path. Implying that the system is currently busy when suspend
is in progress, which prevents the cpus from entering deeper C-states.

Reported-and-Tested-by: Dav Hansen <dave@linux.vnet.ibm.com>
Tested-by: Preeti Murthy <preeti@linux.vnet.ibm.com>
Signed-off-by: Deepthi Dharwar <deepthi@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-06-27 20:18:53 +02:00
..
acpica Revert "ACPI: ignore FADT reset-reg-sup flag" 2012-04-20 11:19:35 -07:00
apei Merge branch 'apei' into release 2012-03-30 16:14:02 -04:00
ac.c treewide: fix potentially dangerous trailing ';' in #defined values/expressions 2011-07-21 14:10:00 +02:00
acpi_ipmi.c IPMI/ACPI: Add the IPMI opregion driver to enable ACPI to access BMC controller 2010-12-14 00:22:14 -05: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: minor printk format change in acpi_pad 2011-03-23 01:36:45 -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 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
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.c Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux 2012-03-30 16:45:39 -07:00
ec_sys.c simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -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 ACPI Hardware Error Device (PNP0C33) support 2010-05-19 22:40:24 -04:00
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 / ACPI / PM: Platform support for PCI PME wake-up 2010-02-22 16:21:02 -08:00
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 Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux 2012-03-30 16:45:39 -07:00
processor_idle.c PM / ACPI: Fix suspend/resume regression caused by cpuidle cleanup. 2012-06-27 20:18:53 +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 ACPI: static sleep_states[] and acpi_gts_bfs_check 2010-10-19 13:44:37 -04:00
sysfs.c ACPI: Export FADT pm_profile integer value to userspace 2011-11-06 20:48:42 -05:00
tables.c ACPI: delete the "acpi=ht" boot option 2010-03-14 20:58:38 -04:00
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.c ACPI video: use after input_unregister_device() 2012-06-01 13:41:40 -04:00
video_detect.c platform/x86: drop deprecated asus_acpi driver 2012-03-20 12:02:18 -04:00
wakeup.c ACPI / Wakeup: Enable button GPEs unconditionally during initialization 2011-02-12 01:39:53 +01:00