Skip to content

Commit

Permalink
Merge tag 'edac_urgent-2020-03-08' of git://git.kernel.org/pub/scm/li…
Browse files Browse the repository at this point in the history
…nux/kernel/git/ras/ras

Pull EDAC fix from Borislav Petkov:
 "Error reporting fix for synopsys_edac: do not overwrite partial
  decoded error message (Sherry Sun)"

* tag 'edac_urgent-2020-03-08' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
  EDAC/synopsys: Do not print an error with back-to-back snprintf() calls
  • Loading branch information
torvalds committed Mar 9, 2020
2 parents 378fee2 + dfc6014 commit efe582a
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions drivers/edac/synopsys_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,20 +479,14 @@ static void handle_error(struct mem_ctl_info *mci, struct synps_ecc_status *p)
pinf = &p->ceinfo;
if (!priv->p_data->quirks) {
snprintf(priv->message, SYNPS_EDAC_MSG_SIZE,
"DDR ECC error type:%s Row %d Bank %d Col %d ",
"CE", pinf->row, pinf->bank, pinf->col);
snprintf(priv->message, SYNPS_EDAC_MSG_SIZE,
"Bit Position: %d Data: 0x%08x\n",
"DDR ECC error type:%s Row %d Bank %d Col %d Bit Position: %d Data: 0x%08x",
"CE", pinf->row, pinf->bank, pinf->col,
pinf->bitpos, pinf->data);
} else {
snprintf(priv->message, SYNPS_EDAC_MSG_SIZE,
"DDR ECC error type:%s Row %d Bank %d Col %d ",
"CE", pinf->row, pinf->bank, pinf->col);
snprintf(priv->message, SYNPS_EDAC_MSG_SIZE,
"BankGroup Number %d Block Number %d ",
pinf->bankgrpnr, pinf->blknr);
snprintf(priv->message, SYNPS_EDAC_MSG_SIZE,
"Bit Position: %d Data: 0x%08x\n",
"DDR ECC error type:%s Row %d Bank %d Col %d BankGroup Number %d Block Number %d Bit Position: %d Data: 0x%08x",
"CE", pinf->row, pinf->bank, pinf->col,
pinf->bankgrpnr, pinf->blknr,
pinf->bitpos, pinf->data);
}

Expand All @@ -509,10 +503,8 @@ static void handle_error(struct mem_ctl_info *mci, struct synps_ecc_status *p)
"UE", pinf->row, pinf->bank, pinf->col);
} else {
snprintf(priv->message, SYNPS_EDAC_MSG_SIZE,
"DDR ECC error type :%s Row %d Bank %d Col %d ",
"UE", pinf->row, pinf->bank, pinf->col);
snprintf(priv->message, SYNPS_EDAC_MSG_SIZE,
"BankGroup Number %d Block Number %d",
"DDR ECC error type :%s Row %d Bank %d Col %d BankGroup Number %d Block Number %d",
"UE", pinf->row, pinf->bank, pinf->col,
pinf->bankgrpnr, pinf->blknr);
}

Expand Down

0 comments on commit efe582a

Please sign in to comment.