Skip to content

Commit 2cf95b9

Browse files
shubhraamdbp3tk0v
authored andcommitted
EDAC/versalnet: Handle split messages for non-standard errors
The current code assumes that only DDR errors have split messages. Ensure proper logging of non-standard event errors that may be split across multiple messages too. [ bp: Massage, move comment too, fix it up. ] Fixes: d5fe2fe ("EDAC: Add a driver for the AMD Versal NET DDR controller") Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://patch.msgid.link/20251023113108.3467132-1-shubhrajyoti.datta@amd.com
1 parent 79c0a2b commit 2cf95b9

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

drivers/edac/versalnet_edac.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -605,21 +605,23 @@ static int rpmsg_cb(struct rpmsg_device *rpdev, void *data,
605605
length = result[MSG_ERR_LENGTH];
606606
offset = result[MSG_ERR_OFFSET];
607607

608+
/*
609+
* The data can come in two stretches. Construct the regs from two
610+
* messages. The offset indicates the offset from which the data is to
611+
* be taken.
612+
*/
613+
for (i = 0 ; i < length; i++) {
614+
k = offset + i;
615+
j = ERROR_DATA + i;
616+
mc_priv->regs[k] = result[j];
617+
}
618+
608619
if (result[TOTAL_ERR_LENGTH] > length) {
609620
if (!mc_priv->part_len)
610621
mc_priv->part_len = length;
611622
else
612623
mc_priv->part_len += length;
613-
/*
614-
* The data can come in 2 stretches. Construct the regs from 2
615-
* messages the offset indicates the offset from which the data is to
616-
* be taken
617-
*/
618-
for (i = 0 ; i < length; i++) {
619-
k = offset + i;
620-
j = ERROR_DATA + i;
621-
mc_priv->regs[k] = result[j];
622-
}
624+
623625
if (mc_priv->part_len < result[TOTAL_ERR_LENGTH])
624626
return 0;
625627
mc_priv->part_len = 0;
@@ -705,7 +707,7 @@ static int rpmsg_cb(struct rpmsg_device *rpdev, void *data,
705707
/* Convert to bytes */
706708
length = result[TOTAL_ERR_LENGTH] * 4;
707709
log_non_standard_event(sec_type, &amd_versalnet_guid, mc_priv->message,
708-
sec_sev, (void *)&result[ERROR_DATA], length);
710+
sec_sev, (void *)&mc_priv->regs, length);
709711

710712
return 0;
711713
}

0 commit comments

Comments
 (0)