diff mbox series

[v3,2/3] EDAC/mce_amd: Extract node id from MCA_IPID

Message ID 20210823185437.94417-3-nchatrad@amd.com (mailing list archive)
State New, archived
Headers show
Series x86/edac/amd64: Add support for noncpu nodes | expand

Commit Message

Naveen Krishna Chatradhi Aug. 23, 2021, 6:54 p.m. UTC
On SMCA banks of the NONCPU nodes, the node id information is
available in MCA_IPID[47:44](InstanceIdHi).

Signed-off-by: Muralidhara M K <muralimk@amd.com>
Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>
---
Changes since v2:
1. Modified subject and commit message
2. Added Reviewed by Yazen Ghannam

 drivers/edac/mce_amd.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

Comments

Borislav Petkov Aug. 27, 2021, 10:24 a.m. UTC | #1
On Tue, Aug 24, 2021 at 12:24:36AM +0530, Naveen Krishna Chatradhi wrote:
> On SMCA banks of the NONCPU nodes, the node id information is
> available in MCA_IPID[47:44](InstanceIdHi).
> 
> Signed-off-by: Muralidhara M K <muralimk@amd.com>
> Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
> Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>
> ---
> Changes since v2:
> 1. Modified subject and commit message
> 2. Added Reviewed by Yazen Ghannam
> 
>  drivers/edac/mce_amd.c | 19 +++++++++++++++++--
>  1 file changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c
> index 27d56920b469..1398032ba25a 100644
> --- a/drivers/edac/mce_amd.c
> +++ b/drivers/edac/mce_amd.c
> @@ -1072,8 +1072,23 @@ static void decode_smca_error(struct mce *m)
>  	if (xec < smca_mce_descs[bank_type].num_descs)
>  		pr_cont(", %s.\n", smca_mce_descs[bank_type].descs[xec]);
>  
> -	if (bank_type == SMCA_UMC && xec == 0 && decode_dram_ecc)
> -		decode_dram_ecc(topology_die_id(m->extcpu), m);
> +	if (xec == 0 && decode_dram_ecc) {
> +		int node_id = 0;
> +
> +		if (bank_type == SMCA_UMC) {
> +			node_id = topology_die_id(m->extcpu);
> +		} else if (bank_type == SMCA_UMC_V2) {
> +			/*
> +			 * SMCA_UMC_V2 is used on the noncpu nodes, extract

Above "NONCPU", here "noncpu", I don't like that "noncpu" nomenclature.
I wonder if we can do without it...
Yazen Ghannam Sept. 1, 2021, 6:18 p.m. UTC | #2
On Fri, Aug 27, 2021 at 12:24:29PM +0200, Borislav Petkov wrote:
> On Tue, Aug 24, 2021 at 12:24:36AM +0530, Naveen Krishna Chatradhi wrote:
> > On SMCA banks of the NONCPU nodes, the node id information is
> > available in MCA_IPID[47:44](InstanceIdHi).
> > 
> > Signed-off-by: Muralidhara M K <muralimk@amd.com>
> > Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
> > Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>
> > ---
> > Changes since v2:
> > 1. Modified subject and commit message
> > 2. Added Reviewed by Yazen Ghannam
> > 
> >  drivers/edac/mce_amd.c | 19 +++++++++++++++++--
> >  1 file changed, 17 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c
> > index 27d56920b469..1398032ba25a 100644
> > --- a/drivers/edac/mce_amd.c
> > +++ b/drivers/edac/mce_amd.c
> > @@ -1072,8 +1072,23 @@ static void decode_smca_error(struct mce *m)
> >  	if (xec < smca_mce_descs[bank_type].num_descs)
> >  		pr_cont(", %s.\n", smca_mce_descs[bank_type].descs[xec]);
> >  
> > -	if (bank_type == SMCA_UMC && xec == 0 && decode_dram_ecc)
> > -		decode_dram_ecc(topology_die_id(m->extcpu), m);
> > +	if (xec == 0 && decode_dram_ecc) {
> > +		int node_id = 0;
> > +
> > +		if (bank_type == SMCA_UMC) {
> > +			node_id = topology_die_id(m->extcpu);
> > +		} else if (bank_type == SMCA_UMC_V2) {
> > +			/*
> > +			 * SMCA_UMC_V2 is used on the noncpu nodes, extract
> 
> Above "NONCPU", here "noncpu", I don't like that "noncpu" nomenclature.
> I wonder if we can do without it...
>

Yeah, I think that's fair.

Thanks,
Yazen
diff mbox series

Patch

diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c
index 27d56920b469..1398032ba25a 100644
--- a/drivers/edac/mce_amd.c
+++ b/drivers/edac/mce_amd.c
@@ -1072,8 +1072,23 @@  static void decode_smca_error(struct mce *m)
 	if (xec < smca_mce_descs[bank_type].num_descs)
 		pr_cont(", %s.\n", smca_mce_descs[bank_type].descs[xec]);
 
-	if (bank_type == SMCA_UMC && xec == 0 && decode_dram_ecc)
-		decode_dram_ecc(topology_die_id(m->extcpu), m);
+	if (xec == 0 && decode_dram_ecc) {
+		int node_id = 0;
+
+		if (bank_type == SMCA_UMC) {
+			node_id = topology_die_id(m->extcpu);
+		} else if (bank_type == SMCA_UMC_V2) {
+			/*
+			 * SMCA_UMC_V2 is used on the noncpu nodes, extract
+			 * the node id from MCA_IPID[47:44](InstanceIdHi)
+			 */
+			node_id = ((m->ipid >> 44) & 0xF);
+		} else {
+			return;
+		}
+
+		decode_dram_ecc(node_id, m);
+	}
 }
 
 static inline void amd_decode_err_code(u16 ec)