lkml.org 
[lkml]   [2012]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[RFC][PATCH 0/2] make efivars/efi_pstore interrupt-safe
Date
[Problem]
There are following problems related to an interrupt context in efivar/efi_pstore.

Currently, efivars enables interrupt while taking efivars->lock.
So, there is a risk to be deadlocking in a write callback of efi_pstore if kernel panics
in interrupt context while taking efi_lock.

Also, efi_pstore creates sysfs entries ,which enable users to access to NVRAM, in a write callback.
If a kernel panic happens in interrupt contexts, pstore may fail because it could sleep due to dynamic
memory allocations during creating sysfs entries.

To resolve the problems above, a goal of this patchset is making efivars/efi_pstore interrupt-safe.

[Patch Description]
Patch 1/2 efivars: Disable external interrupt while holding efivars->lock
This patch replaces spin_lock/spin_unlock with spin_lock_irqsave/spin_lock_irqrestore to make efivars interrupt safe

Patch 2/2 efi_pstore: Introducing workqueue updating sysfs entries
This patch removes sysfs operations from write callback by introducing a workqueue updating sysfs entries

drivers/firmware/efivars.c | 193 +++++++++++++++++++++++++++++++++++---------
include/linux/efi.h | 6 +-
2 files changed, 161 insertions(+), 38 deletions(-)



\
 
 \ /
  Last update: 2012-08-17 22:21    [W:0.367 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site