From: Matthew Garrett <mjg@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: mikew@google.com, x86@kernel.org, hpa@zytor.com,
Matthew Garrett <mjg@redhat.com>
Subject: [PATCH 2/4] efi: Only create sysfs entries while booting or running
Date: Wed, 14 Dec 2011 16:06:29 -0500 [thread overview]
Message-ID: <1323896791-10858-3-git-send-email-mjg@redhat.com> (raw)
In-Reply-To: <1323896791-10858-1-git-send-email-mjg@redhat.com>
There's no point in creating sysfs entries while the machine's on its way
down. Skip it in that case in order to avoid complexity.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
---
drivers/firmware/efivars.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index b0a8117..eb07f13 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -552,11 +552,18 @@ static int efi_pstore_write(enum pstore_type_id type, u64 *id,
if (found)
efivar_unregister(found);
- if (size)
- ret = efivar_create_sysfs_entry(efivars,
- utf16_strsize(efi_name,
- DUMP_NAME_LEN * 2),
- efi_name, &vendor);
+ if (size) {
+ switch (system_state) {
+ case SYSTEM_BOOTING:
+ case SYSTEM_RUNNING:
+ ret = efivar_create_sysfs_entry(efivars,
+ utf16_strsize(efi_name,
+ DUMP_NAME_LEN * 2),
+ efi_name, &vendor);
+ default:
+ break;
+ }
+ }
*id = part;
return ret;
--
1.7.7.1
next prev parent reply other threads:[~2011-12-14 21:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-14 21:06 Update UEFI variable support Matthew Garrett
2011-12-14 21:06 ` [PATCH 1/4] uefi: Populate runtime_version Matthew Garrett
2011-12-14 21:06 ` Matthew Garrett [this message]
2011-12-14 21:32 ` [PATCH 2/4] efi: Only create sysfs entries while booting or running Mike Waychison
2011-12-14 21:06 ` [PATCH 3/4] EFI: Add support for variables longer than 1024 bytes Matthew Garrett
2011-12-14 22:14 ` Mike Waychison
2011-12-14 22:39 ` Matthew Garrett
2011-12-14 22:44 ` H. Peter Anvin
2011-12-14 22:57 ` Matthew Garrett
2011-12-14 22:58 ` H. Peter Anvin
2011-12-15 15:44 ` Matthew Garrett
2011-12-14 22:57 ` Mike Waychison
2011-12-14 23:00 ` H. Peter Anvin
2011-12-14 23:06 ` Mike Waychison
2011-12-14 23:22 ` H. Peter Anvin
2011-12-14 23:24 ` Mike Waychison
2011-12-15 15:43 ` Matthew Garrett
2011-12-15 15:46 ` H. Peter Anvin
2011-12-15 15:48 ` Matthew Garrett
2011-12-14 21:06 ` [PATCH 4/4] EFI: Add support for QueryVariableInfo() call Matthew Garrett
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1323896791-10858-3-git-send-email-mjg@redhat.com \
--to=mjg@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mikew@google.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®