Skip to content

Commit

Permalink
ras-mce-handler: Add support for Hygon Dhyana family 18h processor
Browse files Browse the repository at this point in the history
The Hygon Dhyana family 18h processor is derived from AMD family 17h.
The Hygon Dhyana support to Linux is already accepted upstream[1].

Add Hygon Dhyana support to mce handler of rasdaemon in order to handle
MCE events on Hygon Dhyana platforms.

Reference:
[1] https://git.kernel.org/tip/fec98069fb72fb656304a3e52265e0c2fc9adf87

Signed-off-by: Pu Wen <puwen@hygon.cn>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
  • Loading branch information
Pu Wen authored and mchehab committed Jun 24, 2019
1 parent 31867c5 commit 22f2d8b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ras-mce-handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ static char *cputype_name[] = {
[CPU_KNIGHTS_LANDING] = "Knights Landing",
[CPU_KNIGHTS_MILL] = "Knights Mill",
[CPU_SKYLAKE_XEON] = "Skylake server",
[CPU_NAPLES] = "AMD Family 17h Zen1"
[CPU_NAPLES] = "AMD Family 17h Zen1",
[CPU_DHYANA] = "Hygon Family 18h Moksha"
};

static enum cputype select_intel_cputype(struct ras_events *ras)
Expand Down Expand Up @@ -200,6 +201,11 @@ static int detect_cpu(struct ras_events *ras)
ret = EINVAL;
}
goto ret;
} else if (!strcmp(mce->vendor,"HygonGenuine")) {
if (mce->family == 24) {
mce->cputype = CPU_DHYANA;
}
goto ret;
} else if (!strcmp(mce->vendor,"GenuineIntel")) {
mce->cputype = select_intel_cputype(ras);
} else {
Expand Down Expand Up @@ -436,6 +442,7 @@ int ras_mce_event_handler(struct trace_seq *s,
rc = parse_amd_k8_event(ras, &e);
break;
case CPU_NAPLES:
case CPU_DHYANA:
rc = parse_amd_smca_event(ras, &e);
break;
default: /* All other CPU types are Intel */
Expand Down
1 change: 1 addition & 0 deletions ras-mce-handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ enum cputype {
CPU_KNIGHTS_MILL,
CPU_SKYLAKE_XEON,
CPU_NAPLES,
CPU_DHYANA,
};

struct mce_event {
Expand Down

0 comments on commit 22f2d8b

Please sign in to comment.