Store the error type in struct edac_raw_error_desc. This makes the type parameter of edac_raw_mc_handle_error() obsolete. [ kernel-doc typo ] Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Robert Richter <rrichter@marvell.com> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org> Acked-by: Aristeu Rozanski <aris@redhat.com> Link: https://lkml.kernel.org/r/20200123090210.26933-4-rrichter@marvell.com
Unified · Split
| @@ -1084,8 +1084,7 @@ static void edac_ue_error(struct mem_ctl_info *mci, · 1083 unmodified lines | ||
| 1084 | 1084 | edac_inc_ue_error(mci, enable_per_layer_report, pos, error_count); |
| 1085 | 1085 | } |
| 1086 | 1086 | |
| 1087 | −void edac_raw_mc_handle_error(const enum hw_event_mc_err_type type, | |
| 1088 | − struct mem_ctl_info *mci, | |
| 1087 | +void edac_raw_mc_handle_error(struct mem_ctl_info *mci, | |
| 1089 | 1088 | struct edac_raw_error_desc *e) |
| 1090 | 1089 | { |
| 1091 | 1090 | char detail[80]; |
| @@ -1100,14 +1099,14 @@ void edac_raw_mc_handle_error(const enum hw_event_mc_err_type type, · 8 unmodified lines | ||
| 1100 | 1099 | |
| 1101 | 1100 | /* Report the error via the trace interface */ |
| 1102 | 1101 | if (IS_ENABLED(CONFIG_RAS)) |
| 1103 | − trace_mc_event(type, e->msg, e->label, e->error_count, | |
| 1102 | + trace_mc_event(e->type, e->msg, e->label, e->error_count, | |
| 1104 | 1103 | mci->mc_idx, e->top_layer, e->mid_layer, |
| 1105 | 1104 | e->low_layer, |
| 1106 | 1105 | (e->page_frame_number << PAGE_SHIFT) | e->offset_in_page, |
| 1107 | 1106 | grain_bits, e->syndrome, e->other_detail); |
| 1108 | 1107 | |
| 1109 | 1108 | /* Memory type dependent details about the error */ |
| 1110 | − if (type == HW_EVENT_ERR_CORRECTED) { | |
| 1109 | + if (e->type == HW_EVENT_ERR_CORRECTED) { | |
| 1111 | 1110 | snprintf(detail, sizeof(detail), |
| 1112 | 1111 | "page:0x%lx offset:0x%lx grain:%ld syndrome:0x%lx", |
| 1113 | 1112 | e->page_frame_number, e->offset_in_page, |
| @@ -1152,6 +1151,7 @@ void edac_mc_handle_error(const enum hw_event_mc_err_type type, · 38 unmodified lines | ||
| 1152 | 1151 | /* Fills the error report buffer */ |
| 1153 | 1152 | memset(e, 0, sizeof (*e)); |
| 1154 | 1153 | e->error_count = error_count; |
| 1154 | + e->type = type; | |
| 1155 | 1155 | e->top_layer = top_layer; |
| 1156 | 1156 | e->mid_layer = mid_layer; |
| 1157 | 1157 | e->low_layer = low_layer; |
| @@ -1282,6 +1282,6 @@ void edac_mc_handle_error(const enum hw_event_mc_err_type type, · 124 unmodified lines | ||
| 1282 | 1282 | if (p > e->location) |
| 1283 | 1283 | *(p - 1) = '\0'; |
| 1284 | 1284 | |
| 1285 | − edac_raw_mc_handle_error(type, mci, e); | |
| 1285 | + edac_raw_mc_handle_error(mci, e); | |
| 1286 | 1286 | } |
| 1287 | 1287 | EXPORT_SYMBOL_GPL(edac_mc_handle_error); |
| @@ -212,7 +212,6 @@ extern int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci, · 211 unmodified lines | ||
| 212 | 212 | * edac_raw_mc_handle_error() - Reports a memory event to userspace without |
| 213 | 213 | * doing anything to discover the error location. |
| 214 | 214 | * |
| 215 | − * @type: severity of the error (CE/UE/Fatal) | |
| 216 | 215 | * @mci: a struct mem_ctl_info pointer |
| 217 | 216 | * @e: error description |
| 218 | 217 | * |
| @@ -220,8 +219,7 @@ extern int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci, · 1 unmodified line | ||
| 220 | 219 | * only be called directly when the hardware error come directly from BIOS, |
| 221 | 220 | * like in the case of APEI GHES driver. |
| 222 | 221 | */ |
| 223 | −void edac_raw_mc_handle_error(const enum hw_event_mc_err_type type, | |
| 224 | − struct mem_ctl_info *mci, | |
| 222 | +void edac_raw_mc_handle_error(struct mem_ctl_info *mci, | |
| 225 | 223 | struct edac_raw_error_desc *e); |
| 226 | 224 | |
| 227 | 225 | /** |
| @@ -201,7 +201,6 @@ static void ghes_edac_dmidecode(const struct dmi_header *dh, void *arg) · 200 unmodified lines | ||
| 201 | 201 | |
| 202 | 202 | void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err) |
| 203 | 203 | { |
| 204 | − enum hw_event_mc_err_type type; | |
| 205 | 204 | struct edac_raw_error_desc *e; |
| 206 | 205 | struct mem_ctl_info *mci; |
| 207 | 206 | struct ghes_edac_pvt *pvt; |
| @@ -240,17 +239,17 @@ void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err) · 32 unmodified lines | ||
| 240 | 239 | |
| 241 | 240 | switch (sev) { |
| 242 | 241 | case GHES_SEV_CORRECTED: |
| 243 | − type = HW_EVENT_ERR_CORRECTED; | |
| 242 | + e->type = HW_EVENT_ERR_CORRECTED; | |
| 244 | 243 | break; |
| 245 | 244 | case GHES_SEV_RECOVERABLE: |
| 246 | − type = HW_EVENT_ERR_UNCORRECTED; | |
| 245 | + e->type = HW_EVENT_ERR_UNCORRECTED; | |
| 247 | 246 | break; |
| 248 | 247 | case GHES_SEV_PANIC: |
| 249 | − type = HW_EVENT_ERR_FATAL; | |
| 248 | + e->type = HW_EVENT_ERR_FATAL; | |
| 250 | 249 | break; |
| 251 | 250 | default: |
| 252 | 251 | case GHES_SEV_NO: |
| 253 | − type = HW_EVENT_ERR_INFO; | |
| 252 | + e->type = HW_EVENT_ERR_INFO; | |
| 254 | 253 | } |
| 255 | 254 | |
| 256 | 255 | edac_dbg(1, "error validation_bits: 0x%08llx\n", |
| @@ -442,7 +441,7 @@ void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err) · 185 unmodified lines | ||
| 442 | 441 | if (p > pvt->other_detail) |
| 443 | 442 | *(p - 1) = '\0'; |
| 444 | 443 | |
| 445 | − edac_raw_mc_handle_error(type, mci, e); | |
| 444 | + edac_raw_mc_handle_error(mci, e); | |
| 446 | 445 | |
| 447 | 446 | unlock: |
| 448 | 447 | spin_unlock_irqrestore(&ghes_lock, flags); |
| @@ -442,6 +442,7 @@ struct errcount_attribute_data { · 441 unmodified lines | ||
| 442 | 442 | * struct edac_raw_error_desc - Raw error report structure |
| 443 | 443 | * @grain: minimum granularity for an error report, in bytes |
| 444 | 444 | * @error_count: number of errors of the same type |
| 445 | + * @type: severity of the error (CE/UE/Fatal) | |
| 445 | 446 | * @top_layer: top layer of the error (layer[0]) |
| 446 | 447 | * @mid_layer: middle layer of the error (layer[1]) |
| 447 | 448 | * @low_layer: low layer of the error (layer[2]) |
| @@ -462,6 +463,7 @@ struct edac_raw_error_desc { · 14 unmodified lines | ||
| 462 | 463 | long grain; |
| 463 | 464 | |
| 464 | 465 | u16 error_count; |
| 466 | + enum hw_event_mc_err_type type; | |
| 465 | 467 | int top_layer; |
| 466 | 468 | int mid_layer; |
| 467 | 469 | int low_layer; |