]> Git Repo - linux.git/commit - include/linux/efi.h
efi: Don't use spinlocks for efi vars
authorSylvain Chouleur <[email protected]>
Fri, 15 Jul 2016 19:36:30 +0000 (21:36 +0200)
committerMatt Fleming <[email protected]>
Fri, 9 Sep 2016 15:08:42 +0000 (16:08 +0100)
commit21b3ddd39feecd2f4d6c52bcd30f0a4fa14f125a
tree40773635e6415ce23293c67eda0327dddec90ae7
parent217b27d4671a0a3f34147f1b341683d36b7457db
efi: Don't use spinlocks for efi vars

All efivars operations are protected by a spinlock which prevents
interruptions and preemption. This is too restricted, we just need a
lock preventing concurrency.
The idea is to use a semaphore of count 1 and to have two ways of
locking, depending on the context:
- In interrupt context, we call down_trylock(), if it fails we return
  an error
- In normal context, we call down_interruptible()

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: Sylvain Chouleur <[email protected]>
Signed-off-by: Ard Biesheuvel <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Sylvain Chouleur <[email protected]>
Signed-off-by: Matt Fleming <[email protected]>
drivers/firmware/efi/efi-pstore.c
drivers/firmware/efi/efivars.c
drivers/firmware/efi/vars.c
fs/efivarfs/inode.c
fs/efivarfs/super.c
include/linux/efi.h
This page took 0.08058 seconds and 4 git commands to generate.