Skip to contentSkip to conversation

ACPICA: hw: Don't carry spinlock over suspend

PATCH Rafael J. Wysocki 2 participants 2 messages Oct 1, 2007 2 messages not in the archive ACPI

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20070930183936.32654.44391.stgit@samsung

A message that is not in the archive (sent off-list or not yet received): 20070930183942.32654.16220.stgit@samsung

#2 lore raw
Quoted 5 lines · Alexey Starikovskiy

ACPI uses acpi_get_register() in order to get into suspend. This function is guarded by acpi_gbl_hardware_lock, which will be carried into resume phase.
At resume interrupts are enabled and first ACPI interrupt deadlocks on this lock.

Ouch. That might have bitten quite some people, I guess.

Quoted 6 lines

Solution seems to be to not lock register read, as there are no concurrent activity at this point.

Reference: http://bugzilla.kernel.org/show_bug.cgi?id=7499

Do you think it's -stable material?

Greetings,
Rafael

Quoted 40 lines

---

 drivers/acpi/hardware/hwsleep.c |    3 ++-
 include/acpi/acpixf.h           |    2 ++
 2 files changed, 4 insertions(+), 1 deletions(-)
drivers/acpi/hardware/hwsleep.c +2 -1
index 4d0c677..c0577ca 100644
@@ -398,7 +398,8 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
 	/* Wait until we enter sleep state */
 
 	do {
-		status = acpi_get_register(ACPI_BITREG_WAKE_STATUS, &in_value);
+		status = acpi_get_register_unlocked(ACPI_BITREG_WAKE_STATUS,
+						    &in_value);
 		if (ACPI_FAILURE(status)) {
 			return_ACPI_STATUS(status);
 		}
include/acpi/acpixf.h +2 -1
index 3d7ab9e..9512f04 100644
@@ -314,6 +314,8 @@ acpi_resource_to_address64(struct acpi_resource *resource,
  */
 acpi_status acpi_get_register(u32 register_id, u32 * return_value);
 
+acpi_status acpi_get_register_unlocked(u32 register_id, u32 *return_value);
+
 acpi_status acpi_set_register(u32 register_id, u32 value);
 
 acpi_status
 
-

To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 1 line
"Premature optimization is the root of all evil." - Donald Knuth
#3 lore raw
Quoted 9 lines · Rafael J. Wysocki
Quoted 5 lines · Alexey Starikovskiy

ACPI uses acpi_get_register() in order to get into suspend. This function is guarded by acpi_gbl_hardware_lock, which will be carried into resume phase.
At resume interrupts are enabled and first ACPI interrupt deadlocks on this lock.

Ouch. That might have bitten quite some people, I guess.

Quoted 8 lines
Quoted 6 lines

Solution seems to be to not lock register read, as there are no concurrent activity at this point.

Reference: http://bugzilla.kernel.org/show_bug.cgi?id=7499

Do you think it's -stable material?

Seem to be trivial.

Regards,
Alex.