Commit ea50a3a1 authored by Jan Engelhardt's avatar Jan Engelhardt Committed by Kleber Sacilotto de Souza

acpi/x86: ignore unspecified bit positions in the ACPI global lock field

BugLink: https://bugs.launchpad.net/bugs/1875905

commit ecb9c790 upstream.

The value in "new" is constructed from "old" such that all bits defined
as reserved by the ACPI spec[1] are left untouched. But if those bits
do not happen to be all zero, "new < 3" will not evaluate to true.

The firmware of the laptop(s) Medion MD63490 / Akoya P15648 comes with
garbage inside the "FACS" ACPI table. The starting value is
old=0x4944454d, therefore new=0x4944454e, which is >= 3. Mask off
the reserved bits.

[1] https://uefi.org/sites/default/files/resources/ACPI_6_2.pdf

Link: https://bugzilla.kernel.org/show_bug.cgi?id=206553
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: default avatarJan Engelhardt <jengelh@inai.de>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarIan May <ian.may@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent c8dac75e
...@@ -1708,7 +1708,7 @@ int __acpi_acquire_global_lock(unsigned int *lock) ...@@ -1708,7 +1708,7 @@ int __acpi_acquire_global_lock(unsigned int *lock)
new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1)); new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1));
val = cmpxchg(lock, old, new); val = cmpxchg(lock, old, new);
} while (unlikely (val != old)); } while (unlikely (val != old));
return (new < 3) ? -1 : 0; return ((new & 0x3) < 3) ? -1 : 0;
} }
int __acpi_release_global_lock(unsigned int *lock) int __acpi_release_global_lock(unsigned int *lock)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment