Skip to contentSkip to conversation

Revert "ACPI: sleep: Put the FACS table after using it"

PATCH Applied Zhang Rui 3 participants 4 messages Jun 3, 2021 – Jun 7, 2021 ACPI

lore
Share & tools
lore

Zhang Rui

author
#0 lore raw

PATCH 1/1 Revert "ACPI: sleep: Put the FACS table after using it"

Commit 95722237cb2a ("ACPI: sleep: Put the FACS table after using it") puts the FACS table during initialization.
But the hardware signature bits in the FACS table need to be accessed, after every hibernation, to compare with the original hardware signature.

So there is no reason to release the FACS table mapping after initialization.

This reverts commit 95722237cb2ae4f7b73471058cdb19e8f4057c93.

An alternative solution is to use acpi_gbl_FACS variable instead, which is mapped by the ACPICA core and never released.

---
 drivers/acpi/sleep.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/acpi/sleep.c +1 -3
index df386571da98..3bb2adef8490 100644
@@ -1009,10 +1009,8 @@ static void acpi_sleep_hibernate_setup(void)
 		return;
 
 	acpi_get_table(ACPI_SIG_FACS, 1, (struct acpi_table_header **)&facs);
-	if (facs) {
+	if (facs)
 		s4_hardware_signature = facs->hardware_signature;
-		acpi_put_table((struct acpi_table_header *)facs);
-	}
 }
 #else /* !CONFIG_HIBERNATION */
 static inline void acpi_sleep_hibernate_setup(void) {}
Signature · 1 line
2.17.1
#1 lore raw
Quoted 26 lines · Zhang Rui

Commit 95722237cb2a ("ACPI: sleep: Put the FACS table after using it") puts the FACS table during initialization.
But the hardware signature bits in the FACS table need to be accessed, after every hibernation, to compare with the original hardware signature.

So there is no reason to release the FACS table mapping after initialization.

This reverts commit 95722237cb2ae4f7b73471058cdb19e8f4057c93.

An alternative solution is to use acpi_gbl_FACS variable instead, which is mapped by the ACPICA core and never released.

---
  drivers/acpi/sleep.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/acpi/sleep.c +0 -0
index df386571da98..3bb2adef8490 100644
@@ -1009,10 +1009,8 @@ static void acpi_sleep_hibernate_setup(void)
  		return;

drivers/acpi/sleep.c static void acpi_sleep_hibernate_setup(void) · line 1016

Quoted 10 lines
drivers/acpi/sleep.c +1 -3
 
  	acpi_get_table(ACPI_SIG_FACS, 1, (struct acpi_table_header **)&facs);
-	if (facs) {
+	if (facs)
  		s4_hardware_signature = facs->hardware_signature;
-		acpi_put_table((struct acpi_table_header *)facs);
-	}
  }
  #else /* !CONFIG_HIBERNATION */
  static inline void acpi_sleep_hibernate_setup(void) {}

My bad, thanks for the fix.

Patches for ACPI subsystem, subject will have the prefix "ACPI: ", could you please add that?

Thanks
Hanjun

author
#2 lore raw
Quoted 45 lines · Hanjun Guo
Quoted 40 lines · Zhang Rui

Commit 95722237cb2a ("ACPI: sleep: Put the FACS table after using it")
puts the FACS table during initialization.
But the hardware signature bits in the FACS table need to be accessed,
after every hibernation, to compare with the original hardware signature.

So there is no reason to release the FACS table mapping after initialization.

This reverts commit 95722237cb2ae4f7b73471058cdb19e8f4057c93.

An alternative solution is to use acpi_gbl_FACS variable instead, which
is mapped by the ACPICA core and never released.

---
  drivers/acpi/sleep.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/acpi/sleep.c +1 -3
index df386571da98..3bb2adef8490 100644
@@ -1009,10 +1009,8 @@ static void acpi_sleep_hibernate_setup(void)
  		return;
 
  	acpi_get_table(ACPI_SIG_FACS, 1, (struct acpi_table_header
 **)&facs);
-	if (facs) {
+	if (facs)
  		s4_hardware_signature = facs->hardware_signature;
-		acpi_put_table((struct acpi_table_header *)facs);
-	}
  }
  #else /* !CONFIG_HIBERNATION */
Quoted 1 line

static inline void acpi_sleep_hibernate_setup(void) {}

My bad, thanks for the fix.

Quoted 2 lines

Patches for ACPI subsystem, subject will have the prefix "ACPI: ", could you please add that?

I checked git log, and this does not apply to the revert patch. So I guess the current subject works.

thanks,
rui

maintainer Applied
#3 lore raw
In reply to Zhang Rui
Quoted 28 lines · Zhang Rui

Commit 95722237cb2a ("ACPI: sleep: Put the FACS table after using it") puts the FACS table during initialization.
But the hardware signature bits in the FACS table need to be accessed, after every hibernation, to compare with the original hardware signature.

So there is no reason to release the FACS table mapping after initialization.

This reverts commit 95722237cb2ae4f7b73471058cdb19e8f4057c93.

An alternative solution is to use acpi_gbl_FACS variable instead, which is mapped by the ACPICA core and never released.

---
 drivers/acpi/sleep.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/acpi/sleep.c +0 -0
index df386571da98..3bb2adef8490 100644
@@ -1009,10 +1009,8 @@ static void acpi_sleep_hibernate_setup(void)
                return;
 

drivers/acpi/sleep.c static void acpi_sleep_hibernate_setup(void)

Quoted 10 lines
drivers/acpi/sleep.c +1 -4
        acpi_get_table(ACPI_SIG_FACS, 1, (struct acpi_table_header **)&facs);
-       if (facs) {
+       if (facs)
                s4_hardware_signature = facs->hardware_signature;
-               acpi_put_table((struct acpi_table_header *)facs);
-       }
 }
 #else /* !CONFIG_HIBERNATION */
 static inline void acpi_sleep_hibernate_setup(void) {}
--

Applied as 5.13-rc material (with CC-stable), thanks!