* [PATCH V2] powernv/hmi: Use the "unknown" checkstop type as a fallback
@ 2016-03-15 10:14 Russell Currey
2016-04-11 12:35 ` [V2] " Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Russell Currey @ 2016-03-15 10:14 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Russell Currey
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>
---
V2: Print the type in the error message thanks to Andrew and Michael
---
arch/powerpc/platforms/powernv/opal-hmi.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/opal-hmi.c b/arch/powerpc/platforms/powernv/opal-hmi.c
index d000f4e..38dd321 100644
--- a/arch/powerpc/platforms/powernv/opal-hmi.c
+++ b/arch/powerpc/platforms/powernv/opal-hmi.c
@@ -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;
}
}
--
2.7.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [V2] powernv/hmi: Use the "unknown" checkstop type as a fallback
2016-03-15 10:14 [PATCH V2] powernv/hmi: Use the "unknown" checkstop type as a fallback Russell Currey
@ 2016-04-11 12:35 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2016-04-11 12:35 UTC (permalink / raw)
To: Russell Currey, linuxppc-dev
On Tue, 2016-15-03 at 10:14:12 UTC, Russell Currey wrote:
> 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>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/f8a25db47ebc11fe228735d916
cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-04-11 12:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-15 10:14 [PATCH V2] powernv/hmi: Use the "unknown" checkstop type as a fallback Russell Currey
2016-04-11 12:35 ` [V2] " Michael Ellerman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.