aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/edac_mc.c
diff options
context:
space:
mode:
authorBorislav Petkov <borislav.petkov@amd.com>2012-09-10 12:36:09 -0400
committerBorislav Petkov <bp@alien8.de>2012-11-28 05:24:12 -0500
commitf430d5707aa47af8669bbc0083a79e7d780908b2 (patch)
treec2fce05c7a3112f4ca7f600cdc3705b05de7ee04 /drivers/edac/edac_mc.c
parent4da1b7bfe7699881c761d71b5e299a65bce48ab2 (diff)
EDAC: Handle empty msg strings when reporting errors
A reported error could look like this [ 226.178315] EDAC MC0: 1 CE on mc#0csrow#0channel#0 (csrow:0 channel:0 page:0x427c0d offset:0xde0 grain:0 syndrome:0x1c6) with two spaces back-to-back due to the msg argument of edac_mc_handle_error being passed on empty by the specific drivers. Handle that. Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Diffstat (limited to 'drivers/edac/edac_mc.c')
-rw-r--r--drivers/edac/edac_mc.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index d5074222db69..39c75246c2ae 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -966,20 +966,22 @@ static void edac_ce_error(struct mem_ctl_info *mci,
966 long grain) 966 long grain)
967{ 967{
968 unsigned long remapped_page; 968 unsigned long remapped_page;
969 char *msg_aux = "";
970
971 if (*msg)
972 msg_aux = " ";
969 973
970 if (edac_mc_get_log_ce()) { 974 if (edac_mc_get_log_ce()) {
971 if (other_detail && *other_detail) 975 if (other_detail && *other_detail)
972 edac_mc_printk(mci, KERN_WARNING, 976 edac_mc_printk(mci, KERN_WARNING,
973 "%d CE %s on %s (%s %s - %s)\n", 977 "%d CE %s%son %s (%s %s - %s)\n",
974 error_count, 978 error_count, msg, msg_aux, label,
975 msg, label, location, 979 location, detail, other_detail);
976 detail, other_detail);
977 else 980 else
978 edac_mc_printk(mci, KERN_WARNING, 981 edac_mc_printk(mci, KERN_WARNING,
979 "%d CE %s on %s (%s %s)\n", 982 "%d CE %s%son %s (%s %s)\n",
980 error_count, 983 error_count, msg, msg_aux, label,
981 msg, label, location, 984 location, detail);
982 detail);
983 } 985 }
984 edac_inc_ce_error(mci, enable_per_layer_report, pos, error_count); 986 edac_inc_ce_error(mci, enable_per_layer_report, pos, error_count);
985 987
@@ -1014,27 +1016,31 @@ static void edac_ue_error(struct mem_ctl_info *mci,
1014 const char *other_detail, 1016 const char *other_detail,
1015 const bool enable_per_layer_report) 1017 const bool enable_per_layer_report)
1016{ 1018{
1019 char *msg_aux = "";
1020
1021 if (*msg)
1022 msg_aux = " ";
1023
1017 if (edac_mc_get_log_ue()) { 1024 if (edac_mc_get_log_ue()) {
1018 if (other_detail && *other_detail) 1025 if (other_detail && *other_detail)
1019 edac_mc_printk(mci, KERN_WARNING, 1026 edac_mc_printk(mci, KERN_WARNING,
1020 "%d UE %s on %s (%s %s - %s)\n", 1027 "%d UE %s%son %s (%s %s - %s)\n",
1021 error_count, 1028 error_count, msg, msg_aux, label,
1022 msg, label, location, detail, 1029 location, detail, other_detail);
1023 other_detail);
1024 else 1030 else
1025 edac_mc_printk(mci, KERN_WARNING, 1031 edac_mc_printk(mci, KERN_WARNING,
1026 "%d UE %s on %s (%s %s)\n", 1032 "%d UE %s%son %s (%s %s)\n",
1027 error_count, 1033 error_count, msg, msg_aux, label,
1028 msg, label, location, detail); 1034 location, detail);
1029 } 1035 }
1030 1036
1031 if (edac_mc_get_panic_on_ue()) { 1037 if (edac_mc_get_panic_on_ue()) {
1032 if (other_detail && *other_detail) 1038 if (other_detail && *other_detail)
1033 panic("UE %s on %s (%s%s - %s)\n", 1039 panic("UE %s%son %s (%s%s - %s)\n",
1034 msg, label, location, detail, other_detail); 1040 msg, msg_aux, label, location, detail, other_detail);
1035 else 1041 else
1036 panic("UE %s on %s (%s%s)\n", 1042 panic("UE %s%son %s (%s%s)\n",
1037 msg, label, location, detail); 1043 msg, msg_aux, label, location, detail);
1038 } 1044 }
1039 1045
1040 edac_inc_ue_error(mci, enable_per_layer_report, pos, error_count); 1046 edac_inc_ue_error(mci, enable_per_layer_report, pos, error_count);