Skip to contentSkip to conversation

EDAC: synopsys: Fix the wrong call of pinf->col parameter

PATCH Superseded Sherry Sun 3 participants 6 messages Feb 28, 2020 – Mar 16, 2020

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Sherry Sun

author
#0 lore raw

PATCH v2 1/1 EDAC: synopsys: Fix the wrong call of pinf->col parameter

Since ZynqMP platform call zynqmp_get_error_info() function to get ce/ue information. In this function, pinf->col parameter is not used, this parameter is only used by Zynq platforme in zynq_get_error_info(). So here pinf->col should not be called and printed for ZynqMP, need remove it.

Fixes b500b4a029d57 ("EDAC, synopsys: Add ECC support for ZynqMP DDR controller")

---
This patch is based on [PATCH V2] EDAC: synopsys: Fix back to back snprintf() messages for CE/UE Changes in V2:
- Separated this patch from the original patchset.

---
 drivers/edac/synopsys_edac.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/edac/synopsys_edac.c +4 -4
index 880ffd833718..da707d539f7f 100644
@@ -484,8 +484,8 @@ static void handle_error(struct mem_ctl_info *mci, struct synps_ecc_status *p)
 				 pinf->bitpos, pinf->data);
 		} else {
 			snprintf(priv->message, SYNPS_EDAC_MSG_SIZE,
-				 "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,
+				 "DDR ECC error type:%s Row %d Bank %d BankGroup Number %d Block Number %d Bit Position: %d Data: 0x%08x",
+				 "CE", pinf->row, pinf->bank,
 				 pinf->bankgrpnr, pinf->blknr,
 				 pinf->bitpos, pinf->data);
 		}
@@ -503,8 +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 BankGroup Number %d Block Number %d",
-				 "UE", pinf->row, pinf->bank, pinf->col,
+				 "DDR ECC error type :%s Row %d Bank %d BankGroup Number %d Block Number %d",
+				 "UE", pinf->row, pinf->bank,
 				 pinf->bankgrpnr, pinf->blknr);
 		}
 
Signature · 1 line
2.17.1
Reviewed-by on v2 1/1
#1 lore raw

Hi,

Quoted 16 lines

-----Original Message-----
From: Sherry Sun <[email protected]>
Sent: Friday, February 28, 2020 7:46 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Michal Simek <[email protected]>; Manish Narani <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: [PATCH v2] EDAC: synopsys: Fix the wrong call of pinf->col parameter

Since ZynqMP platform call zynqmp_get_error_info() function to get ce/ue information. In this function, pinf->col parameter is not used, this parameter is only used by Zynq platforme in zynq_get_error_info(). So here pinf->col should not be called and printed for ZynqMP, need remove it.

Quoted 3 lines
Fixes b500b4a029d57 ("EDAC, synopsys: Add ECC support for ZynqMP DDR

controller")

Thanks,
Manish

maintainer
#2 lore raw
In reply to Sherry Sun
Quoted 5 lines · Sherry Sun

Since ZynqMP platform call zynqmp_get_error_info() function to get ce/ue information. In this function, pinf->col parameter is not used, this parameter is only used by Zynq platforme in zynq_get_error_info(). So here pinf->col should not be called and printed for ZynqMP, need remove it.

Err, the interrupt handler intr_handler() calls the ->get_error_info() function pointer and then calls handle_error(). I.e, the same path ending in handle_error() is called on both: Zynq and ZynqMP, one through the interrupt and the other through the poller.

Because it looks like the interrupt support is only on ZynqMP? I'm looking at that DDR_ECC_INTR_SUPPORT thing.

If so, then you need to rename the interrupt handler to zynqmp_intr_handler().

And normal Zynq platform uses check_errors() which then calls handle_error().

So still not good enough: you probably "fixed" it on ZynqMP but broke it on Zynq because check_errors() calls ->get_error_info() which is zynq_get_error_info() and will have populated pinf->col.

You need to differentiate between Zynq and ZynqMP in handle_error() and issue the proper string depending on the platform.

AFAICT.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
author
#3 lore raw

Hi Borislav,

Quoted 32 lines

-----Original Message-----
From: Borislav Petkov <[email protected]>
Sent: 2020年3月16日 3:50
To: Sherry Sun <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; dl-linux-imx <[email protected]>; Frank Li <[email protected]>
Subject: Re: [PATCH v2] EDAC: synopsys: Fix the wrong call of pinf->col parameter

Quoted 5 lines · Sherry Sun

Since ZynqMP platform call zynqmp_get_error_info() function to get ce/ue information. In this function, pinf->col parameter is not used, this parameter is only used by Zynq platforme in zynq_get_error_info(). So here pinf->col should not be called and printed for ZynqMP, need remove it.

Err, the interrupt handler intr_handler() calls the ->get_error_info() function pointer and then calls handle_error(). I.e, the same path ending in handle_error() is called on both: Zynq and ZynqMP, one through the interrupt and the other through the poller.

Because it looks like the interrupt support is only on ZynqMP? I'm looking at that DDR_ECC_INTR_SUPPORT thing.

If so, then you need to rename the interrupt handler to zynqmp_intr_handler().

And normal Zynq platform uses check_errors() which then calls handle_error().

Quoted 6 lines

So still not good enough: you probably "fixed" it on ZynqMP but broke it on Zynq because check_errors() calls ->get_error_info() which is zynq_get_error_info() and will have populated pinf->col.

You need to differentiate between Zynq and ZynqMP in handle_error() and issue the proper string depending on the platform.

Maybe you misunderstood the handle_error(), this function has already distinguished between Zynq and ZynqMP through priv->p_data->quirks. And what I am doing in this patch is to remove the useless pinf->col in ZynqMP part, which won't break the Zynq part.

Thanks
Sherry Sun

Quoted 13 lines

AFAICT.

--
Regards/Gruss,
Boris.

https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpeopl
e.kernel.org%2Ftglx%2Fnotes-about- netiquette&amp;data=02%7C01%7Csherry.sun%40nxp.com%7C948bf1123f6f 4717a61508d7c91a193b%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0 %7C637198986257175149&amp;sdata=O8txcSkTpO3I34KUL0qboQ%2BvPme D7lYPHsAhWavevWg%3D&amp;reserved=0

maintainer
#4 lore raw
Quoted 4 lines · Sherry Sun

Maybe you misunderstood the handle_error(), this function has already distinguished between Zynq and ZynqMP through priv->p_data->quirks. And what I am doing in this patch is to remove the useless pinf->col in ZynqMP part, which won't break the Zynq part.

Ok, I see it now, thanks for clarifying.

Now, in your v2 pls fix this check in handle_error():

	if (!priv->p_data->quirks) {

to *actually* *explicitly* check that the platform for which this function is called, really supports interrupts, i.e., DDR_ECC_INTR_SUPPORT, and not that the ->quirks thing is != 0. Like the rest of the code does.

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
author
#5 lore raw

Hi Borislav,

Quoted 19 lines

-----Original Message-----
From: Borislav Petkov <[email protected]>
Sent: 2020年3月16日 18:44
To: Sherry Sun <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; dl-linux-imx <[email protected]>; Frank Li <[email protected]>
Subject: Re: [PATCH v2] EDAC: synopsys: Fix the wrong call of pinf->col parameter

Quoted 4 lines · Sherry Sun

Maybe you misunderstood the handle_error(), this function has already distinguished between Zynq and ZynqMP through priv->p_data->quirks. And what I am doing in this patch is to remove the useless pinf->col in ZynqMP part, which won't break the Zynq part.

Ok, I see it now, thanks for clarifying.

Quoted 8 lines

Now, in your v2 pls fix this check in handle_error():

	if (!priv->p_data->quirks) {

to *actually* *explicitly* check that the platform for which this function is called, really supports interrupts, i.e., DDR_ECC_INTR_SUPPORT, and not that the ->quirks thing is != 0. Like the rest of the code does.

Ok, I will fix this check.

Best regards
Sherry Sun

Quoted 12 lines

Thx.

--
Regards/Gruss,
Boris.

https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpeopl
e.kernel.org%2Ftglx%2Fnotes-about- netiquette&amp;data=02%7C01%7Csherry.sun%40nxp.com%7Ccd843239ffd d48a05ce408d7c996ebd5%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C 0%7C637199522356909838&amp;sdata=5p6JuXQQJgyjlaMOUH1cLLSDFbUzM R%2Fjzs5HC%2FeU1Zc%3D&amp;reserved=0