All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "ACPI: sleep: Put the FACS table after using it"
@ 2021-06-03  2:34 Zhang Rui
  2021-06-03  2:52 ` Hanjun Guo
  2021-06-07 13:02 ` Rafael J. Wysocki
  0 siblings, 2 replies; 4+ messages in thread
From: Zhang Rui @ 2021-06-03  2:34 UTC (permalink / raw)
  To: linux-acpi; +Cc: rjw, guohanjun, rui.zhang

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.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=212277
Reported-by: Stephan Hohe <sth.dev@tejp.de>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/acpi/sleep.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index df386571da98..3bb2adef8490 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -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) {}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Revert "ACPI: sleep: Put the FACS table after using it"
  2021-06-03  2:34 [PATCH] Revert "ACPI: sleep: Put the FACS table after using it" Zhang Rui
@ 2021-06-03  2:52 ` Hanjun Guo
  2021-06-03  2:55   ` Zhang Rui
  2021-06-07 13:02 ` Rafael J. Wysocki
  1 sibling, 1 reply; 4+ messages in thread
From: Hanjun Guo @ 2021-06-03  2:52 UTC (permalink / raw)
  To: Zhang Rui, linux-acpi; +Cc: rjw

On 2021/6/3 10:34, Zhang Rui wrote:
> 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.
> 
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=212277
> Reported-by: Stephan Hohe <sth.dev@tejp.de>
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> ---
>   drivers/acpi/sleep.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
> index df386571da98..3bb2adef8490 100644
> --- a/drivers/acpi/sleep.c
> +++ b/drivers/acpi/sleep.c
> @@ -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) {}

My bad, thanks for the fix.

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

Thanks
Hanjun

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Revert "ACPI: sleep: Put the FACS table after using it"
  2021-06-03  2:52 ` Hanjun Guo
@ 2021-06-03  2:55   ` Zhang Rui
  0 siblings, 0 replies; 4+ messages in thread
From: Zhang Rui @ 2021-06-03  2:55 UTC (permalink / raw)
  To: Hanjun Guo, linux-acpi; +Cc: rjw

On Thu, 2021-06-03 at 10:52 +0800, Hanjun Guo wrote:
> On 2021/6/3 10:34, Zhang Rui wrote:
> > 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.
> > 
> > Link: https://bugzilla.kernel.org/show_bug.cgi?id=212277
> > Reported-by: Stephan Hohe <sth.dev@tejp.de>
> > Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> > ---
> >   drivers/acpi/sleep.c | 4 +---
> >   1 file changed, 1 insertion(+), 3 deletions(-)
> > 
> > diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
> > index df386571da98..3bb2adef8490 100644
> > --- a/drivers/acpi/sleep.c
> > +++ b/drivers/acpi/sleep.c
> > @@ -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) {}
> 
> My bad, thanks for the fix.
> 
> 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Revert "ACPI: sleep: Put the FACS table after using it"
  2021-06-03  2:34 [PATCH] Revert "ACPI: sleep: Put the FACS table after using it" Zhang Rui
  2021-06-03  2:52 ` Hanjun Guo
@ 2021-06-07 13:02 ` Rafael J. Wysocki
  1 sibling, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2021-06-07 13:02 UTC (permalink / raw)
  To: Zhang Rui; +Cc: ACPI Devel Maling List, Rafael J. Wysocki, Hanjun Guo

On Thu, Jun 3, 2021 at 4:24 AM Zhang Rui <rui.zhang@intel.com> wrote:
>
> 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.
>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=212277
> Reported-by: Stephan Hohe <sth.dev@tejp.de>
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> ---
>  drivers/acpi/sleep.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
> index df386571da98..3bb2adef8490 100644
> --- a/drivers/acpi/sleep.c
> +++ b/drivers/acpi/sleep.c
> @@ -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) {}
> --

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-07 13:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-03  2:34 [PATCH] Revert "ACPI: sleep: Put the FACS table after using it" Zhang Rui
2021-06-03  2:52 ` Hanjun Guo
2021-06-03  2:55   ` Zhang Rui
2021-06-07 13:02 ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.