mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
Merge tag 'x86_acpi_for_v6.4_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 ACPI update from Borislav Petkov: - Improve code generation in ACPI's global lock's acquisition function * tag 'x86_acpi_for_v6.4_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/ACPI/boot: Improve __acpi_acquire_global_lock
This commit is contained in:
@@ -1858,13 +1858,18 @@ early_param("acpi_sci", setup_acpi_sci);
|
|||||||
|
|
||||||
int __acpi_acquire_global_lock(unsigned int *lock)
|
int __acpi_acquire_global_lock(unsigned int *lock)
|
||||||
{
|
{
|
||||||
unsigned int old, new;
|
unsigned int old, new, val;
|
||||||
|
|
||||||
old = READ_ONCE(*lock);
|
old = READ_ONCE(*lock);
|
||||||
do {
|
do {
|
||||||
new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1));
|
val = (old >> 1) & 0x1;
|
||||||
|
new = (old & ~0x3) + 2 + val;
|
||||||
} while (!try_cmpxchg(lock, &old, new));
|
} while (!try_cmpxchg(lock, &old, new));
|
||||||
return ((new & 0x3) < 3) ? -1 : 0;
|
|
||||||
|
if (val)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int __acpi_release_global_lock(unsigned int *lock)
|
int __acpi_release_global_lock(unsigned int *lock)
|
||||||
|
Reference in New Issue
Block a user