[PATCH v2 1/4] EDAC,mce_amd: Find node ID on SMCA systems using generic methods

From: Yazen Ghannam
Date: Mon Mar 20 2017 - 16:29:03 EST


From: Yazen Ghannam <yazen.ghannam@xxxxxxx>

We should move away from using AMD-specific amd_get_nb_id() to find a node
ID and move toward using generic Linux methods. We can use cpu_to_node()
since NUMA should be working as expected on newly released Fam17h systems.

Replace call to amd_get_nb_id() and related shifting by a call to
cpu_to_node() which works as expected.

Signed-off-by: Yazen Ghannam <yazen.ghannam@xxxxxxx>
---
Link: http://lkml.kernel.org/r/1486760120-60944-1-git-send-email-Yazen.Ghannam@xxxxxxx

v1->v2:
- Just use cpu_to_node() instead of trying to make amd_get_nb_id() work.

drivers/edac/mce_amd.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c
index ba35b7e..dbccf40 100644
--- a/drivers/edac/mce_amd.c
+++ b/drivers/edac/mce_amd.c
@@ -878,12 +878,8 @@ static void decode_smca_errors(struct mce *m)
pr_cont("%s.\n", smca_mce_descs[bank_type].descs[xec]);
}

- /*
- * amd_get_nb_id() returns the last level cache id.
- * The last level cache on Fam17h is 1 level below the node.
- */
if (bank_type == SMCA_UMC && xec == 0 && decode_dram_ecc)
- decode_dram_ecc(amd_get_nb_id(m->extcpu) >> 1, m);
+ decode_dram_ecc(cpu_to_node(m->extcpu), m);
}

static inline void amd_decode_err_code(u16 ec)
--
2.7.4