Skip to content

Commit

Permalink
powerpc/powernv: Use the "unknown" checkstop type as a fallback
Browse files Browse the repository at this point in the history
The HMI code knows about three types of errors: CORE, NX and UNKNOWN.
If OPAL were to add a new type, it would not be handled at all since
there is no fallback case.  Instead of explicitly checking for UNKNOWN,
treat any checkstop type without a handler as unknown.

Signed-off-by: Russell Currey <ruscur@russell.cc>
Reviewed-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Russell Currey authored and Michael Ellerman committed Apr 11, 2016
1 parent d88e397 commit f8a25db
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions arch/powerpc/platforms/powernv/opal-hmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,17 @@ static void print_nx_checkstop_reason(const char *level,
static void print_checkstop_reason(const char *level,
struct OpalHMIEvent *hmi_evt)
{
switch (hmi_evt->u.xstop_error.xstop_type) {
uint8_t type = hmi_evt->u.xstop_error.xstop_type;
switch (type) {
case CHECKSTOP_TYPE_CORE:
print_core_checkstop_reason(level, hmi_evt);
break;
case CHECKSTOP_TYPE_NX:
print_nx_checkstop_reason(level, hmi_evt);
break;
case CHECKSTOP_TYPE_UNKNOWN:
printk("%s Unknown Malfunction Alert.\n", level);
default:
printk("%s Unknown Malfunction Alert of type %d\n",
level, type);
break;
}
}
Expand Down

0 comments on commit f8a25db

Please sign in to comment.