diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2013-08-01 18:25:05 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2013-08-01 18:25:05 -0400 |
commit | bf6c216282a260d3ce727c23fc15f28a76beff0b (patch) | |
tree | 455ce140a0d854ec3dfe800dd4e322672dd22e47 | |
parent | 5ae90d8e467e625e447000cb4335c4db973b1095 (diff) | |
parent | cb82a2e4f9468c1bb8c1050903d3dab61b3b679d (diff) |
Merge tag 'ras_for_3.12' into x86/ras
ERST error message formatting cleanup.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r-- | drivers/acpi/apei/erst.c | 51 |
1 files changed, 23 insertions, 28 deletions
diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c index 88d0b0f9f92b..40ffcdafbc6f 100644 --- a/drivers/acpi/apei/erst.c +++ b/drivers/acpi/apei/erst.c | |||
@@ -39,7 +39,8 @@ | |||
39 | 39 | ||
40 | #include "apei-internal.h" | 40 | #include "apei-internal.h" |
41 | 41 | ||
42 | #define ERST_PFX "ERST: " | 42 | #undef pr_fmt |
43 | #define pr_fmt(fmt) "ERST: " fmt | ||
43 | 44 | ||
44 | /* ERST command status */ | 45 | /* ERST command status */ |
45 | #define ERST_STATUS_SUCCESS 0x0 | 46 | #define ERST_STATUS_SUCCESS 0x0 |
@@ -109,8 +110,7 @@ static inline int erst_errno(int command_status) | |||
109 | static int erst_timedout(u64 *t, u64 spin_unit) | 110 | static int erst_timedout(u64 *t, u64 spin_unit) |
110 | { | 111 | { |
111 | if ((s64)*t < spin_unit) { | 112 | if ((s64)*t < spin_unit) { |
112 | pr_warning(FW_WARN ERST_PFX | 113 | pr_warn(FW_WARN "Firmware does not respond in time.\n"); |
113 | "Firmware does not respond in time\n"); | ||
114 | return 1; | 114 | return 1; |
115 | } | 115 | } |
116 | *t -= spin_unit; | 116 | *t -= spin_unit; |
@@ -186,8 +186,8 @@ static int erst_exec_stall(struct apei_exec_context *ctx, | |||
186 | 186 | ||
187 | if (ctx->value > FIRMWARE_MAX_STALL) { | 187 | if (ctx->value > FIRMWARE_MAX_STALL) { |
188 | if (!in_nmi()) | 188 | if (!in_nmi()) |
189 | pr_warning(FW_WARN ERST_PFX | 189 | pr_warn(FW_WARN |
190 | "Too long stall time for stall instruction: %llx.\n", | 190 | "Too long stall time for stall instruction: 0x%llx.\n", |
191 | ctx->value); | 191 | ctx->value); |
192 | stall_time = FIRMWARE_MAX_STALL; | 192 | stall_time = FIRMWARE_MAX_STALL; |
193 | } else | 193 | } else |
@@ -206,8 +206,8 @@ static int erst_exec_stall_while_true(struct apei_exec_context *ctx, | |||
206 | 206 | ||
207 | if (ctx->var1 > FIRMWARE_MAX_STALL) { | 207 | if (ctx->var1 > FIRMWARE_MAX_STALL) { |
208 | if (!in_nmi()) | 208 | if (!in_nmi()) |
209 | pr_warning(FW_WARN ERST_PFX | 209 | pr_warn(FW_WARN |
210 | "Too long stall time for stall while true instruction: %llx.\n", | 210 | "Too long stall time for stall while true instruction: 0x%llx.\n", |
211 | ctx->var1); | 211 | ctx->var1); |
212 | stall_time = FIRMWARE_MAX_STALL; | 212 | stall_time = FIRMWARE_MAX_STALL; |
213 | } else | 213 | } else |
@@ -271,8 +271,7 @@ static int erst_exec_move_data(struct apei_exec_context *ctx, | |||
271 | 271 | ||
272 | /* ioremap does not work in interrupt context */ | 272 | /* ioremap does not work in interrupt context */ |
273 | if (in_interrupt()) { | 273 | if (in_interrupt()) { |
274 | pr_warning(ERST_PFX | 274 | pr_warn("MOVE_DATA can not be used in interrupt context.\n"); |
275 | "MOVE_DATA can not be used in interrupt context"); | ||
276 | return -EBUSY; | 275 | return -EBUSY; |
277 | } | 276 | } |
278 | 277 | ||
@@ -522,8 +521,7 @@ retry: | |||
522 | ERST_RECORD_ID_CACHE_SIZE_MAX); | 521 | ERST_RECORD_ID_CACHE_SIZE_MAX); |
523 | if (new_size <= erst_record_id_cache.size) { | 522 | if (new_size <= erst_record_id_cache.size) { |
524 | if (printk_ratelimit()) | 523 | if (printk_ratelimit()) |
525 | pr_warning(FW_WARN ERST_PFX | 524 | pr_warn(FW_WARN "too many record IDs!\n"); |
526 | "too many record ID!\n"); | ||
527 | return 0; | 525 | return 0; |
528 | } | 526 | } |
529 | alloc_size = new_size * sizeof(entries[0]); | 527 | alloc_size = new_size * sizeof(entries[0]); |
@@ -759,8 +757,7 @@ static int __erst_clear_from_storage(u64 record_id) | |||
759 | static void pr_unimpl_nvram(void) | 757 | static void pr_unimpl_nvram(void) |
760 | { | 758 | { |
761 | if (printk_ratelimit()) | 759 | if (printk_ratelimit()) |
762 | pr_warning(ERST_PFX | 760 | pr_warn("NVRAM ERST Log Address Range not implemented yet.\n"); |
763 | "NVRAM ERST Log Address Range is not implemented yet\n"); | ||
764 | } | 761 | } |
765 | 762 | ||
766 | static int __erst_write_to_nvram(const struct cper_record_header *record) | 763 | static int __erst_write_to_nvram(const struct cper_record_header *record) |
@@ -1120,7 +1117,7 @@ static int __init erst_init(void) | |||
1120 | goto err; | 1117 | goto err; |
1121 | 1118 | ||
1122 | if (erst_disable) { | 1119 | if (erst_disable) { |
1123 | pr_info(ERST_PFX | 1120 | pr_info( |
1124 | "Error Record Serialization Table (ERST) support is disabled.\n"); | 1121 | "Error Record Serialization Table (ERST) support is disabled.\n"); |
1125 | goto err; | 1122 | goto err; |
1126 | } | 1123 | } |
@@ -1131,14 +1128,14 @@ static int __init erst_init(void) | |||
1131 | goto err; | 1128 | goto err; |
1132 | else if (ACPI_FAILURE(status)) { | 1129 | else if (ACPI_FAILURE(status)) { |
1133 | const char *msg = acpi_format_exception(status); | 1130 | const char *msg = acpi_format_exception(status); |
1134 | pr_err(ERST_PFX "Failed to get table, %s\n", msg); | 1131 | pr_err("Failed to get table, %s\n", msg); |
1135 | rc = -EINVAL; | 1132 | rc = -EINVAL; |
1136 | goto err; | 1133 | goto err; |
1137 | } | 1134 | } |
1138 | 1135 | ||
1139 | rc = erst_check_table(erst_tab); | 1136 | rc = erst_check_table(erst_tab); |
1140 | if (rc) { | 1137 | if (rc) { |
1141 | pr_err(FW_BUG ERST_PFX "ERST table is invalid\n"); | 1138 | pr_err(FW_BUG "ERST table is invalid.\n"); |
1142 | goto err; | 1139 | goto err; |
1143 | } | 1140 | } |
1144 | 1141 | ||
@@ -1156,21 +1153,19 @@ static int __init erst_init(void) | |||
1156 | rc = erst_get_erange(&erst_erange); | 1153 | rc = erst_get_erange(&erst_erange); |
1157 | if (rc) { | 1154 | if (rc) { |
1158 | if (rc == -ENODEV) | 1155 | if (rc == -ENODEV) |
1159 | pr_info(ERST_PFX | 1156 | pr_info( |
1160 | "The corresponding hardware device or firmware implementation " | 1157 | "The corresponding hardware device or firmware implementation " |
1161 | "is not available.\n"); | 1158 | "is not available.\n"); |
1162 | else | 1159 | else |
1163 | pr_err(ERST_PFX | 1160 | pr_err("Failed to get Error Log Address Range.\n"); |
1164 | "Failed to get Error Log Address Range.\n"); | ||
1165 | goto err_unmap_reg; | 1161 | goto err_unmap_reg; |
1166 | } | 1162 | } |
1167 | 1163 | ||
1168 | r = request_mem_region(erst_erange.base, erst_erange.size, "APEI ERST"); | 1164 | r = request_mem_region(erst_erange.base, erst_erange.size, "APEI ERST"); |
1169 | if (!r) { | 1165 | if (!r) { |
1170 | pr_err(ERST_PFX | 1166 | pr_err("Can not request [mem %#010llx-%#010llx] for ERST.\n", |
1171 | "Can not request iomem region <0x%16llx-0x%16llx> for ERST.\n", | 1167 | (unsigned long long)erst_erange.base, |
1172 | (unsigned long long)erst_erange.base, | 1168 | (unsigned long long)erst_erange.base + erst_erange.size - 1); |
1173 | (unsigned long long)erst_erange.base + erst_erange.size); | ||
1174 | rc = -EIO; | 1169 | rc = -EIO; |
1175 | goto err_unmap_reg; | 1170 | goto err_unmap_reg; |
1176 | } | 1171 | } |
@@ -1180,7 +1175,7 @@ static int __init erst_init(void) | |||
1180 | if (!erst_erange.vaddr) | 1175 | if (!erst_erange.vaddr) |
1181 | goto err_release_erange; | 1176 | goto err_release_erange; |
1182 | 1177 | ||
1183 | pr_info(ERST_PFX | 1178 | pr_info( |
1184 | "Error Record Serialization Table (ERST) support is initialized.\n"); | 1179 | "Error Record Serialization Table (ERST) support is initialized.\n"); |
1185 | 1180 | ||
1186 | buf = kmalloc(erst_erange.size, GFP_KERNEL); | 1181 | buf = kmalloc(erst_erange.size, GFP_KERNEL); |
@@ -1192,15 +1187,15 @@ static int __init erst_init(void) | |||
1192 | rc = pstore_register(&erst_info); | 1187 | rc = pstore_register(&erst_info); |
1193 | if (rc) { | 1188 | if (rc) { |
1194 | if (rc != -EPERM) | 1189 | if (rc != -EPERM) |
1195 | pr_info(ERST_PFX | 1190 | pr_info( |
1196 | "Could not register with persistent store\n"); | 1191 | "Could not register with persistent store.\n"); |
1197 | erst_info.buf = NULL; | 1192 | erst_info.buf = NULL; |
1198 | erst_info.bufsize = 0; | 1193 | erst_info.bufsize = 0; |
1199 | kfree(buf); | 1194 | kfree(buf); |
1200 | } | 1195 | } |
1201 | } else | 1196 | } else |
1202 | pr_err(ERST_PFX | 1197 | pr_err( |
1203 | "Failed to allocate %lld bytes for persistent store error log\n", | 1198 | "Failed to allocate %lld bytes for persistent store error log.\n", |
1204 | erst_erange.size); | 1199 | erst_erange.size); |
1205 | 1200 | ||
1206 | return 0; | 1201 | return 0; |