]> git.baikalelectronics.ru Git - kernel.git/commit
pstore: change mutex locking to spin_locks
authorDon Zickus <dzickus@redhat.com>
Fri, 12 Aug 2011 17:54:51 +0000 (10:54 -0700)
committerTony Luck <tony.luck@intel.com>
Tue, 16 Aug 2011 18:55:58 +0000 (11:55 -0700)
commit58dee14ded0f9d6aa5bf7b27361154a92d8055d6
tree50d88b64ded1189d6c816a1f90124a05354914ba
parentedb6f5f36c23ac4902a32ec8520dcb3651f57e42
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>
drivers/acpi/apei/erst.c
drivers/firmware/efivars.c
fs/pstore/platform.c
include/linux/pstore.h