summaryrefslogtreecommitdiffstats
path: root/include/linux/pstore.h
diff options
context:
space:
mode:
authorDon Zickus <dzickus@redhat.com>2011-08-12 10:54:51 -0700
committerTony Luck <tony.luck@intel.com>2011-08-16 11:55:58 -0700
commitabd4d5587be911f63592537284dad78766d97d62 (patch)
tree50d88b64ded1189d6c816a1f90124a05354914ba /include/linux/pstore.h
parent6dda9266913ad57e09afc1a10d6473f10c806a63 (diff)
downloadop-kernel-dev-abd4d5587be911f63592537284dad78766d97d62.zip
op-kernel-dev-abd4d5587be911f63592537284dad78766d97d62.tar.gz
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 'include/linux/pstore.h')
-rw-r--r--include/linux/pstore.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index cc03bbf..b91440e 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -32,7 +32,7 @@ enum pstore_type_id {
struct pstore_info {
struct module *owner;
char *name;
- struct mutex buf_mutex; /* serialize access to 'buf' */
+ spinlock_t buf_lock; /* serialize access to 'buf' */
char *buf;
size_t bufsize;
int (*open)(struct pstore_info *psi);
OpenPOWER on IntegriCloud