diff options
author | Don Zickus <dzickus@redhat.com> | 2011-08-12 13:54:51 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2011-08-16 14:55:58 -0400 |
commit | abd4d5587be911f63592537284dad78766d97d62 (patch) | |
tree | 50d88b64ded1189d6c816a1f90124a05354914ba /drivers/firmware | |
parent | 6dda9266913ad57e09afc1a10d6473f10c806a63 (diff) |
pstore: change mutex locking to spin_locks
pstore was using mutex locking to protect read/write access to the
backend plug-ins. This causes problems when pstore is executed in
an NMI context through panic() -> kmsg_dump().
This patch changes the mutex to a spin_lock_irqsave then also checks to
see if we are in an NMI context. If we are in an NMI and can't get the
lock, just print a message stating that and blow by the locking.
All this is probably a hack around the bigger locking problem but it
solves my current situation of trying to sleep in an NMI context.
Tested by loading the lkdtm module and executing a HARDLOCKUP which
will cause the machine to panic inside the nmi handler.
Signed-off-by: Don Zickus <dzickus@redhat.com>
Acked-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/efivars.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index eb80b549ed8d..be8bcb035e2a 100644 --- a/drivers/firmware/efivars.c +++ b/drivers/firmware/efivars.c | |||
@@ -978,7 +978,7 @@ int register_efivars(struct efivars *efivars, | |||
978 | if (efivars->efi_pstore_info.buf) { | 978 | if (efivars->efi_pstore_info.buf) { |
979 | efivars->efi_pstore_info.bufsize = 1024; | 979 | efivars->efi_pstore_info.bufsize = 1024; |
980 | efivars->efi_pstore_info.data = efivars; | 980 | efivars->efi_pstore_info.data = efivars; |
981 | mutex_init(&efivars->efi_pstore_info.buf_mutex); | 981 | spin_lock_init(&efivars->efi_pstore_info.buf_lock); |
982 | pstore_register(&efivars->efi_pstore_info); | 982 | pstore_register(&efivars->efi_pstore_info); |
983 | } | 983 | } |
984 | 984 | ||