Skip to content

Commit ecb9c79

Browse files
jengelhrafaeljw
authored andcommitted
acpi/x86: ignore unspecified bit positions in the ACPI global lock field
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 <[email protected]> Signed-off-by: Jan Engelhardt <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 1ffb8d0 commit ecb9c79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kernel/acpi/boot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,7 @@ int __acpi_acquire_global_lock(unsigned int *lock)
17481748
new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1));
17491749
val = cmpxchg(lock, old, new);
17501750
} while (unlikely (val != old));
1751-
return (new < 3) ? -1 : 0;
1751+
return ((new & 0x3) < 3) ? -1 : 0;
17521752
}
17531753

17541754
int __acpi_release_global_lock(unsigned int *lock)

0 commit comments

Comments
 (0)