lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201111122317.27576.rjw@sisk.pl>
Date:	Sat, 12 Nov 2011 23:17:27 +0100
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	Len Brown <lenb@...nel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	Ferenc Wagner <wferi@...f.hu>, "Tomas M." <tmezzadra@...il.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	deepthi@...ux.vnet.ibm.com, g.trinabh@...il.com, j-pihet@...com,
	khilman@...com, arjan@...ux.intel.com, len.brown@...el.com,
	Arjan van de Ven <arjan@...radead.org>,
	Linux PM list <linux-pm@...r.kernel.org>
Subject: [PATCH] ACPI / cpuidle: Remove acpi_idle_suspend (to fix suspend regression)

From: Rafael J. Wysocki <rjw@...k.pl>

After commit e978aa7d7d57d04eb5f88a7507c4fb98577def77 (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@...il.com>
Reported-and-tested-by: Ferenc Wagner <wferi@...f.hu>
Signed-off-by: Rafael J. Wysocki <rjw@...k.pl>
---
 drivers/acpi/processor_idle.c |   29 -----------------------------
 1 file changed, 29 deletions(-)

Index: linux/drivers/acpi/processor_idle.c
===================================================================
--- linux.orig/drivers/acpi/processor_idle.c
+++ linux/drivers/acpi/processor_idle.c
@@ -224,7 +224,6 @@ static void lapic_timer_state_broadcast(
 /*
  * Suspend / resume control
  */
-static int acpi_idle_suspend;
 static u32 saved_bm_rld;
 
 static void acpi_idle_bm_rld_save(void)
@@ -243,21 +242,13 @@ static void acpi_idle_bm_rld_restore(voi
 
 int acpi_processor_suspend(struct acpi_device * device, pm_message_t state)
 {
-	if (acpi_idle_suspend == 1)
-		return 0;
-
 	acpi_idle_bm_rld_save();
-	acpi_idle_suspend = 1;
 	return 0;
 }
 
 int acpi_processor_resume(struct acpi_device * device)
 {
-	if (acpi_idle_suspend == 0)
-		return 0;
-
 	acpi_idle_bm_rld_restore();
-	acpi_idle_suspend = 0;
 	return 0;
 }
 
@@ -763,13 +754,6 @@ static int acpi_idle_enter_c1(struct cpu
 
 	local_irq_disable();
 
-	/* Do not access any ACPI IO ports in suspend path */
-	if (acpi_idle_suspend) {
-		local_irq_enable();
-		cpu_relax();
-		return -EINVAL;
-	}
-
 	lapic_timer_state_broadcast(pr, cx, 1);
 	kt1 = ktime_get_real();
 	acpi_idle_do_entry(cx);
@@ -810,13 +794,6 @@ static int acpi_idle_enter_simple(struct
 
 	local_irq_disable();
 
-	if (acpi_idle_suspend) {
-		local_irq_enable();
-		cpu_relax();
-		return -EINVAL;
-	}
-
-
 	if (cx->entry_method != ACPI_CSTATE_FFH) {
 		current_thread_info()->status &= ~TS_POLLING;
 		/*
@@ -895,12 +872,6 @@ static int acpi_idle_enter_bm(struct cpu
 	if (unlikely(!pr))
 		return -EINVAL;
 
-
-	if (acpi_idle_suspend) {
-		cpu_relax();
-		return -EINVAL;
-	}
-
 	if (!cx->bm_sts_skip && acpi_idle_bm_check()) {
 		if (drv->safe_state_index >= 0) {
 			return drv->states[drv->safe_state_index].enter(dev,

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ