aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLenny Szubowicz <lszubowi@redhat.com>2013-06-28 16:14:10 -0400
committerTony Luck <tony.luck@intel.com>2013-06-28 18:22:31 -0400
commit74fd6c6f84b6d3e57bacb06161451c29949fbe51 (patch)
treeaa4eb66b5b89aca1db19d9c42570c99ee35891c2
parent8e48b1a8ed58595c40f2748c0f2da55b04da2dd6 (diff)
acpi: Eliminate console msg if pstore.backend excludes ERST
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>
-rw-r--r--drivers/acpi/apei/erst.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c
index 6d894bfd8b8f..f7b3b39e94fc 100644
--- a/drivers/acpi/apei/erst.c
+++ b/drivers/acpi/apei/erst.c
@@ -1180,20 +1180,28 @@ static int __init erst_init(void)
1180 if (!erst_erange.vaddr) 1180 if (!erst_erange.vaddr)
1181 goto err_release_erange; 1181 goto err_release_erange;
1182 1182
1183 pr_info(ERST_PFX
1184 "Error Record Serialization Table (ERST) support is initialized.\n");
1185
1183 buf = kmalloc(erst_erange.size, GFP_KERNEL); 1186 buf = kmalloc(erst_erange.size, GFP_KERNEL);
1184 spin_lock_init(&erst_info.buf_lock); 1187 spin_lock_init(&erst_info.buf_lock);
1185 if (buf) { 1188 if (buf) {
1186 erst_info.buf = buf + sizeof(struct cper_pstore_record); 1189 erst_info.buf = buf + sizeof(struct cper_pstore_record);
1187 erst_info.bufsize = erst_erange.size - 1190 erst_info.bufsize = erst_erange.size -
1188 sizeof(struct cper_pstore_record); 1191 sizeof(struct cper_pstore_record);
1189 if (pstore_register(&erst_info)) { 1192 rc = pstore_register(&erst_info);
1190 pr_info(ERST_PFX "Could not register with persistent store\n"); 1193 if (rc) {
1194 if (rc != -EPERM)
1195 pr_info(ERST_PFX
1196 "Could not register with persistent store\n");
1197 erst_info.buf = NULL;
1198 erst_info.bufsize = 0;
1191 kfree(buf); 1199 kfree(buf);
1192 } 1200 }
1193 } 1201 } else
1194 1202 pr_err(ERST_PFX
1195 pr_info(ERST_PFX 1203 "Failed to allocate %lld bytes for persistent store error log\n",
1196 "Error Record Serialization Table (ERST) support is initialized.\n"); 1204 erst_erange.size);
1197 1205
1198 return 0; 1206 return 0;
1199 1207