]> git.baikalelectronics.ru Git - kernel.git/commit
PM / ACPI: Fix suspend/resume regression caused by cpuidle cleanup.
authorDeepthi Dharwar <deepthi@linux.vnet.ibm.com>
Mon, 25 Jun 2012 21:59:54 +0000 (23:59 +0200)
committerRafael J. Wysocki <rjw@sisk.pl>
Wed, 27 Jun 2012 18:18:53 +0000 (20:18 +0200)
commit659e9a468ebfb23446b4ced69cf62d42f9e0212d
tree3e8a4c0d94b4a4c7881f77404841d65de4370276
parentacd29ed3c512a6e59ff10cfdc37470c04d254a2e
PM / ACPI: Fix suspend/resume regression caused by cpuidle cleanup.

Commit 4cfb774b88b830ed62e68280940c665556535bd1 ( 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 810e5514147683111646c5977a26a20609706f86
(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 4cfb774b broke suspend and
with commit 810e5514 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 99221ceb061 )
So reverting the commit 810e5514 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>
drivers/acpi/processor_idle.c