summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSeiji Aguchi <seiji.aguchi@hds.com>2013-02-12 13:04:41 -0800
committerBen Hutchings <ben@decadent.org.uk>2013-03-27 02:41:20 +0000
commitadddb4096d7b1bbff02d3e71a3923d830fb6bb14 (patch)
treed96b6a12db1c3813d4c97b879a7cf73335f3be64 /include
parentf9c0efa2e87f6fb07738c097985eb04932ffca90 (diff)
efi_pstore: Introducing workqueue updating sysfs
commit a93bc0c6e07ed9bac44700280e65e2945d864fd4 upstream. [Problem] efi_pstore creates sysfs entries, which enable users to access to NVRAM, in a write callback. If a kernel panic happens in an interrupt context, it may fail because it could sleep due to dynamic memory allocations during creating sysfs entries. [Patch Description] This patch removes sysfs operations from a write callback by introducing a workqueue updating sysfs entries which is scheduled after the write callback is called. Also, the workqueue is kicked in a just oops case. A system will go down in other cases such as panic, clean shutdown and emergency restart. And we don't need to create sysfs entries because there is no chance for users to access to them. efi_pstore will be robust against a kernel panic in an interrupt context with this patch. Signed-off-by: Seiji Aguchi <seiji.aguchi@hds.com> Acked-by: Matt Fleming <matt.fleming@intel.com> Signed-off-by: Tony Luck <tony.luck@intel.com> [bwh: Backported to 3.2: - Adjust contest - Don't check reason in efi_pstore_write(), as it is not given as a parameter - Move up declaration of __efivars] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include')
-rw-r--r--include/linux/efi.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/efi.h b/include/linux/efi.h
index ce95a4b2985b..8469f3f20538 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -484,7 +484,8 @@ struct efivars {
* 1) ->list - adds, removals, reads, writes
* 2) ops.[gs]et_variable() calls.
* It must not be held when creating sysfs entries or calling kmalloc.
- * ops.get_next_variable() is only called from register_efivars(),
+ * ops.get_next_variable() is only called from register_efivars()
+ * or efivar_update_sysfs_entries(),
* which is protected by the BKL, so that path is safe.
*/
spinlock_t lock;