All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] acpica: clear global_lock bits at FACS initialization
@ 2020-03-30  8:58 Jan Engelhardt
  2020-04-01  9:11 ` Rafael J. Wysocki
  2020-04-02 11:28   ` Dan Carpenter
  0 siblings, 2 replies; 7+ messages in thread
From: Jan Engelhardt @ 2020-03-30  8:58 UTC (permalink / raw)
  To: rafael.j.wysocki; +Cc: linux-acpi, linux-kernel

When the firmware ROM supplies a FACS table with garbage, and the
firmware code does not clear the global_lock field before booting to a
loader/OS, the garbage bytes in that field (like 0xffffffff) can
indicate that the lock is taken when it is not, thereby preventing
obtaining said lock even though it is otherwise perfectly usable if
the field were not prepopulated with garbage.

Reset the lock to a known good state upon ACPI initialization.

References: https://bugzilla.kernel.org/show_bug.cgi?id=206553
Signed-off-by: Jan Engelhardt <jengelh@inai.de>
---

 drivers/acpi/acpica/tbutils.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index c5f0b8ec70cc..26bdbc585d7e 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -56,6 +56,9 @@ acpi_status acpi_tb_initialize_facs(void)
 								     &facs));
 		acpi_gbl_FACS = facs;
 	}
+	/* Clear potential garbage from the initial FACS table. */
+	if (facs != NULL)
+		facs->global_lock &= ~0x3;
 
 	/* If there is no FACS, just continue. There was already an error msg */
 
-- 
2.26.0


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

end of thread, other threads:[~2020-04-02 11:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-30  8:58 [PATCH] acpica: clear global_lock bits at FACS initialization Jan Engelhardt
2020-04-01  9:11 ` Rafael J. Wysocki
2020-04-01 21:55   ` Kaneda, Erik
2020-04-02  0:13     ` Jan Engelhardt
2020-04-02 11:28 ` Dan Carpenter
2020-04-02 11:28   ` Dan Carpenter
2020-04-02 11:28   ` Dan Carpenter

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.