Skip to content

Commit

Permalink
acpi: Eliminate console msg if pstore.backend excludes ERST
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Tony Luck <tony.luck@intel.com>
  • Loading branch information
Lenny Szubowicz authored and Tony Luck committed Jun 28, 2013
1 parent 8e48b1a commit 74fd6c6
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions drivers/acpi/apei/erst.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 74fd6c6

Please sign in to comment.