Skip to contentSkip to conversation

ACPICA: Convert acpi_gbl_hardware lock back to a raw_spinlock_t

RFC PATCH Rafael J. Wysocki 1 participant 1 message Apr 25, 2018 1 message not in the archive ACPI component architecture (acpica)

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Rafael J. Wysocki

author
#1 lore raw
Quoted 15 lines · CEST Sebastian Andrzej Siewior
Quoted 6 lines · Rafael J. Wysocki
Quoted 6 lines
include/acpi/platform/aclinux.h +0 -0
index a0b232703302..38eaa3235210 100644
@@ -102,6 +102,7 @@
 
Quoted 7 lines

include/acpi/platform/aclinux.h line 105

Quoted 3 lines
include/acpi/platform/aclinux.h +1 -0
 #define acpi_cache_t                        struct kmem_cache
 #define acpi_spinlock                       spinlock_t *
+#define acpi_raw_spinlock              raw_spinlock_t *

I would prefer to redefine acpi_spinlock as raw_spinlock_t and then acpi_os_acquire/release_lock() as raw_spin_lock_irqsave/unlock_irqrestore(), respectively.

Quoted 2 lines

I would rather not convert all current ACPI spinlock_t into raw_spinlock_t. Only those which are required to.

I'm actually not 100% sure right now (as a rule things like this come up when you are not expecting them :-)), but IIRC there are assumptions regarding at least some of the ACPICA locks as being real spinlocks.

They need to be reviewed from this angle and the code in question is far from straightforward.

Quoted 4 lines

I don't know if there is anything special about acpi_gbl_hardware_lock but we have other raw locks already (like erst_lock or c3_lock). I could come up with something like acpi_os_acquire_rawlock() if you prefer this instead.

That might work, but the other OSes using ACPICA don't actually have a "raw spinlock" concept, so this should just fall back to acpi_os_acquire_lock() if the OS doesn't implement the "raw" thing separately.