From: Lenny Szubowicz <lszubowi@redhat.com>
To: tony.luck@intel.com, cbouatmailru@gmail.com,
matt.fleming@intel.com, linux-kernel@vger.kernel.org
Cc: n.hamaguchi@jp.fujitsu.com, dzickus@redhat.com
Subject: [PATCH 2/3] acpi: Eliminate console msg if pstore.backend excludes ERST
Date: Fri, 28 Jun 2013 16:14:10 -0400 [thread overview]
Message-ID: <1372450451-8790-3-git-send-email-lszubowi@redhat.com> (raw)
In-Reply-To: <1372450451-8790-1-git-send-email-lszubowi@redhat.com>
This is patch 2/3 of a patch set that avoids what misleadingly appears
to be a error during boot:
ERST: Could not register with persistent store
This message is displayed if the system has a valid ACPI ERST table and the
pstore.backend kernel parameter has been used to disable use of ERST by
pstore. But this same message is used for errors that preclude registration.
In erst_init don't complain if the setting of kernel parameter pstore.backend
precludes use of ACPI ERST for pstore. Routine pstore_register will inform
about the facility that does register.
Also, don't leave a dangling pointer to deallocated mem for the pstore
buffer when registration fails.
Signed-off-by: Lenny Szubowicz <lszubowi@redhat.com>
Reported-by: Naotaka Hamaguchi <n.hamaguchi@jp.fujitsu.com>
---
drivers/acpi/apei/erst.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c
index 6d894bf..f7b3b39 100644
--- a/drivers/acpi/apei/erst.c
+++ b/drivers/acpi/apei/erst.c
@@ -1180,20 +1180,28 @@ static int __init erst_init(void)
if (!erst_erange.vaddr)
goto err_release_erange;
+ pr_info(ERST_PFX
+ "Error Record Serialization Table (ERST) support is initialized.\n");
+
buf = kmalloc(erst_erange.size, GFP_KERNEL);
spin_lock_init(&erst_info.buf_lock);
if (buf) {
erst_info.buf = buf + sizeof(struct cper_pstore_record);
erst_info.bufsize = erst_erange.size -
sizeof(struct cper_pstore_record);
- if (pstore_register(&erst_info)) {
- pr_info(ERST_PFX "Could not register with persistent store\n");
+ rc = pstore_register(&erst_info);
+ if (rc) {
+ if (rc != -EPERM)
+ pr_info(ERST_PFX
+ "Could not register with persistent store\n");
+ erst_info.buf = NULL;
+ erst_info.bufsize = 0;
kfree(buf);
}
- }
-
- pr_info(ERST_PFX
- "Error Record Serialization Table (ERST) support is initialized.\n");
+ } else
+ pr_err(ERST_PFX
+ "Failed to allocate %lld bytes for persistent store error log\n",
+ erst_erange.size);
return 0;
--
1.8.2.1
next prev parent reply other threads:[~2013-06-28 20:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-28 20:14 [PATCH 0/3] acpi: Eliminate misleading erst pstore console message Lenny Szubowicz
2013-06-28 20:14 ` [PATCH 1/3] pstore: Return unique error if backend registration excluded by kernel param Lenny Szubowicz
2013-06-28 20:14 ` Lenny Szubowicz [this message]
2013-06-28 20:44 ` [PATCH 2/3] acpi: Eliminate console msg if pstore.backend excludes ERST Tony Luck
2013-06-28 20:57 ` Lenny Szubowicz
2013-06-28 20:14 ` [PATCH 3/3] efivars: If pstore_register fails, free unneeded pstore buffer Lenny Szubowicz
2013-06-28 22:42 ` [PATCH 0/3] acpi: Eliminate misleading erst pstore console message Tony Luck
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=1372450451-8790-3-git-send-email-lszubowi@redhat.com \
--to=lszubowi@redhat.com \
--cc=cbouatmailru@gmail.com \
--cc=dzickus@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matt.fleming@intel.com \
--cc=n.hamaguchi@jp.fujitsu.com \
--cc=tony.luck@intel.com \
/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®