• Ard Biesheuvel's avatar
    efi: Replace runtime services spinlock with semaphore · dce48e35
    Ard Biesheuvel authored
    The purpose of the efi_runtime_lock is to prevent concurrent calls into
    the firmware. There is no need to use spinlocks here, as long as we ensure
    that runtime service invocations from an atomic context (i.e., EFI pstore)
    cannot block.
    
    So use a semaphore instead, and use down_trylock() in the nonblocking case.
    We don't use a mutex here because the mutex_trylock() function must not
    be called from interrupt context, whereas the down_trylock() can.
    Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
    Cc: Leif Lindholm <leif.lindholm@linaro.org>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Sylvain Chouleur <sylvain.chouleur@gmail.com>
    Signed-off-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
    dce48e35
runtime-wrappers.c 9.04 KB