platform/x86: quickstart: Fix race condition when reporting input event
authorArmin Wolf <W_Armin@gmx.de>
Wed, 27 Mar 2024 21:45:24 +0000 (22:45 +0100)
committerHans de Goede <hdegoede@redhat.com>
Mon, 8 Apr 2024 13:22:23 +0000 (15:22 +0200)
commit10eba55febd4784cf54bbb411636f3929723bfc0
tree8d8924428a7e8da6cd4d3435b3a637aa3220a733
parent83cfe6d8b6b986d430941d22797ca636a6789ba9
platform/x86: quickstart: Fix race condition when reporting input event

Since commit e2ffcda16290 ("ACPI: OSL: Allow Notify () handlers to run
on all CPUs"), the ACPI core allows multiple notify calls to be active
at the same time. This means that two instances of quickstart_notify()
running at the same time can mess which each others input sequences.

Fix this by protecting the input sequence with a mutex.

Compile-tested only.

Fixes: afd66f2a739e ("platform/x86: Add ACPI quickstart button (PNP0C32) driver")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20240327214524.123935-1-W_Armin@gmx.de
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/quickstart.c