Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

EDAC/synopsys: Do not dump uninitialized pinf->col

On the ZynqMP platform, zynqmp_get_error_info() is used to read out
error information. In this function, the pinf->col parameter is not
used (it is only used by the Zynq platform's zynq_get_error_info()). So
there's no need to print pinf->col on ZynqMP.

In order to differentiate on which platform handle_error() is executed,
use DDR_ECC_INTR_SUPPORT as the check condition to distinguish between
Zynq and ZynqMP platforms.

[ bp: Massage. ]

Fixes: b500b4a029d57 ("EDAC, synopsys: Add ECC support for ZynqMP DDR controller")
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Manish Narani <manish.narani@xilinx.com>
Link: https://lkml.kernel.org/r/1584365679-27443-1-git-send-email-sherry.sun@nxp.com

authored by

Sherry Sun and committed by
Borislav Petkov
2fb3f6e1 fb33c651

+11 -11
+11 -11
drivers/edac/synopsys_edac.c
··· 477 477 478 478 if (p->ce_cnt) { 479 479 pinf = &p->ceinfo; 480 - if (!priv->p_data->quirks) { 480 + if (priv->p_data->quirks & DDR_ECC_INTR_SUPPORT) { 481 481 snprintf(priv->message, SYNPS_EDAC_MSG_SIZE, 482 - "DDR ECC error type:%s Row %d Bank %d Col %d Bit Position: %d Data: 0x%08x", 483 - "CE", pinf->row, pinf->bank, pinf->col, 482 + "DDR ECC error type:%s Row %d Bank %d BankGroup Number %d Block Number %d Bit Position: %d Data: 0x%08x", 483 + "CE", pinf->row, pinf->bank, 484 + pinf->bankgrpnr, pinf->blknr, 484 485 pinf->bitpos, pinf->data); 485 486 } else { 486 487 snprintf(priv->message, SYNPS_EDAC_MSG_SIZE, 487 - "DDR ECC error type:%s Row %d Bank %d Col %d BankGroup Number %d Block Number %d Bit Position: %d Data: 0x%08x", 488 + "DDR ECC error type:%s Row %d Bank %d Col %d Bit Position: %d Data: 0x%08x", 488 489 "CE", pinf->row, pinf->bank, pinf->col, 489 - pinf->bankgrpnr, pinf->blknr, 490 490 pinf->bitpos, pinf->data); 491 491 } 492 492 ··· 497 497 498 498 if (p->ue_cnt) { 499 499 pinf = &p->ueinfo; 500 - if (!priv->p_data->quirks) { 500 + if (priv->p_data->quirks & DDR_ECC_INTR_SUPPORT) { 501 501 snprintf(priv->message, SYNPS_EDAC_MSG_SIZE, 502 - "DDR ECC error type :%s Row %d Bank %d Col %d ", 503 - "UE", pinf->row, pinf->bank, pinf->col); 502 + "DDR ECC error type :%s Row %d Bank %d BankGroup Number %d Block Number %d", 503 + "UE", pinf->row, pinf->bank, 504 + pinf->bankgrpnr, pinf->blknr); 504 505 } else { 505 506 snprintf(priv->message, SYNPS_EDAC_MSG_SIZE, 506 - "DDR ECC error type :%s Row %d Bank %d Col %d BankGroup Number %d Block Number %d", 507 - "UE", pinf->row, pinf->bank, pinf->col, 508 - pinf->bankgrpnr, pinf->blknr); 507 + "DDR ECC error type :%s Row %d Bank %d Col %d ", 508 + "UE", pinf->row, pinf->bank, pinf->col); 509 509 } 510 510 511 511 edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci,