aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware/efi/efi-pstore.c
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2020-09-23 10:07:49 +0200
committerArd Biesheuvel <ardb@kernel.org>2020-09-29 19:40:57 +0200
commitc9b51a2dbfe7f47643e133bf48e1bf28f1b85d2a (patch)
tree89c10bc6f1d281ccfbbb93f00438f161e7ba8881 /drivers/firmware/efi/efi-pstore.c
parentefi: pstore: disentangle from deprecated efivars module (diff)
downloadlinux-dev-c9b51a2dbfe7f47643e133bf48e1bf28f1b85d2a.tar.xz
linux-dev-c9b51a2dbfe7f47643e133bf48e1bf28f1b85d2a.zip
efi: pstore: move workqueue handling out of efivars
The worker thread that gets kicked off to sync the state of the EFI variable list is only used by the EFI pstore implementation, and is defined in its source file. So let's move its scheduling there as well. Since our efivar_init() scan will bail on duplicate entries, there is no need to disable the workqueue like we did before, so we can run it unconditionally. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/firmware/efi/efi-pstore.c')
-rw-r--r--drivers/firmware/efi/efi-pstore.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/firmware/efi/efi-pstore.c b/drivers/firmware/efi/efi-pstore.c
index 785f5e6b3a41..0ef086e43090 100644
--- a/drivers/firmware/efi/efi-pstore.c
+++ b/drivers/firmware/efi/efi-pstore.c
@@ -21,6 +21,7 @@ module_param_named(pstore_disable, efivars_pstore_disable, bool, 0644);
EFI_VARIABLE_RUNTIME_ACCESS)
static LIST_HEAD(efi_pstore_list);
+static DECLARE_WORK(efivar_work, NULL);
static int efi_pstore_open(struct pstore_info *psi)
{
@@ -267,8 +268,9 @@ static int efi_pstore_write(struct pstore_record *record)
ret = efivar_entry_set_safe(efi_name, vendor, PSTORE_EFI_ATTRIBUTES,
preemptible(), record->size, record->psi->buf);
- if (record->reason == KMSG_DUMP_OOPS)
- efivar_run_worker();
+ if (record->reason == KMSG_DUMP_OOPS && try_module_get(THIS_MODULE))
+ if (!schedule_work(&efivar_work))
+ module_put(THIS_MODULE);
return ret;
};
@@ -412,6 +414,7 @@ static void efi_pstore_update_entries(struct work_struct *work)
}
kfree(entry);
+ module_put(THIS_MODULE);
}
static __init int efivars_pstore_init(void)