• A
    efi: Replace runtime services spinlock with semaphore · dce48e35
    Ard Biesheuvel 提交于
    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: NArd 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: NMatt Fleming <matt@codeblueprint.co.uk>
    dce48e35
efi.c 20.2 KB