Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI / cpuidle: Remove acpi_idle_suspend (to fix suspend regression)

After commit e978aa7d7d57 ("cpuidle: Move dev->last_residency update to
driver enter routine; remove dev->last_state") setting acpi_idle_suspend
to 1 by acpi_processor_suspend() causes the ACPI cpuidle routines to
return error codes continuously, which in turn causes cpuidle to lock up
(hard).

However, acpi_idle_suspend doesn't appear to be useful for any
particular purpose (it's racy and doesn't really provide any real
protection), so it can be removed, which makes the problem go away.

Reported-and-tested-by: Tomas M. <tmezzadra@gmail.com>
Reported-and-tested-by: Ferenc Wagner <wferi@niif.hu>
Tested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Rafael J. Wysocki and committed by
Linus Torvalds
3439a8da 5b34b089

-29
-29
drivers/acpi/processor_idle.c
··· 224 224 /* 225 225 * Suspend / resume control 226 226 */ 227 - static int acpi_idle_suspend; 228 227 static u32 saved_bm_rld; 229 228 230 229 static void acpi_idle_bm_rld_save(void) ··· 242 243 243 244 int acpi_processor_suspend(struct acpi_device * device, pm_message_t state) 244 245 { 245 - if (acpi_idle_suspend == 1) 246 - return 0; 247 - 248 246 acpi_idle_bm_rld_save(); 249 - acpi_idle_suspend = 1; 250 247 return 0; 251 248 } 252 249 253 250 int acpi_processor_resume(struct acpi_device * device) 254 251 { 255 - if (acpi_idle_suspend == 0) 256 - return 0; 257 - 258 252 acpi_idle_bm_rld_restore(); 259 - acpi_idle_suspend = 0; 260 253 return 0; 261 254 } 262 255 ··· 754 763 755 764 local_irq_disable(); 756 765 757 - /* Do not access any ACPI IO ports in suspend path */ 758 - if (acpi_idle_suspend) { 759 - local_irq_enable(); 760 - cpu_relax(); 761 - return -EINVAL; 762 - } 763 - 764 766 lapic_timer_state_broadcast(pr, cx, 1); 765 767 kt1 = ktime_get_real(); 766 768 acpi_idle_do_entry(cx); ··· 793 809 return -EINVAL; 794 810 795 811 local_irq_disable(); 796 - 797 - if (acpi_idle_suspend) { 798 - local_irq_enable(); 799 - cpu_relax(); 800 - return -EINVAL; 801 - } 802 - 803 812 804 813 if (cx->entry_method != ACPI_CSTATE_FFH) { 805 814 current_thread_info()->status &= ~TS_POLLING; ··· 871 894 872 895 if (unlikely(!pr)) 873 896 return -EINVAL; 874 - 875 - 876 - if (acpi_idle_suspend) { 877 - cpu_relax(); 878 - return -EINVAL; 879 - } 880 897 881 898 if (!cx->bm_sts_skip && acpi_idle_bm_check()) { 882 899 if (drv->safe_state_index >= 0) {