[PATCH] powernv/hmi: Use the "unknown" checkstop type as a fallback

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE3795d

7 messages, 4 authors, 2016-03-15 · open the first message on its own page

[PATCH] powernv/hmi: Use the "unknown" checkstop type as a fallback

From: Russell Currey <hidden>
Date: 2016-03-15 03:27:01

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 <redacted>
---
 arch/powerpc/platforms/powernv/opal-hmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/powernv/opal-hmi.c b/arch/powerpc/platforms/powernv/opal-hmi.c
index d000f4e..bff4dd1 100644
--- a/arch/powerpc/platforms/powernv/opal-hmi.c
+++ b/arch/powerpc/platforms/powernv/opal-hmi.c
@@ -157,7 +157,7 @@ static void print_checkstop_reason(const char *level,
 	case CHECKSTOP_TYPE_NX:
 		print_nx_checkstop_reason(level, hmi_evt);
 		break;
-	case CHECKSTOP_TYPE_UNKNOWN:
+	default:
 		printk("%s	Unknown Malfunction Alert.\n", level);
 		break;
 	}
-- 
2.7.3

Re: [PATCH] powernv/hmi: Use the "unknown" checkstop type as a fallback

From: Daniel Axtens <hidden>
Date: 2016-03-15 03:41:36

Russell Currey [off-list ref] writes:
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.
Just checked the surrounding function; you're quite right.
Reviewed-by: Daniel Axtens <redacted>
quoted hunk
Signed-off-by: Russell Currey <redacted>
---
 arch/powerpc/platforms/powernv/opal-hmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/powernv/opal-hmi.c b/arch/powerpc/platforms/powernv/opal-hmi.c
index d000f4e..bff4dd1 100644
--- a/arch/powerpc/platforms/powernv/opal-hmi.c
+++ b/arch/powerpc/platforms/powernv/opal-hmi.c
@@ -157,7 +157,7 @@ static void print_checkstop_reason(const char *level,
 	case CHECKSTOP_TYPE_NX:
 		print_nx_checkstop_reason(level, hmi_evt);
 		break;
-	case CHECKSTOP_TYPE_UNKNOWN:
+	default:
 		printk("%s	Unknown Malfunction Alert.\n", level);
 		break;
 	}
-- 
2.7.3

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] powernv/hmi: Use the "unknown" checkstop type as a fallback

From: Andrew Donnellan <hidden>
Date: 2016-03-15 03:57:50

On 15/03/16 14:26, 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 <redacted>
Indeed it looks like there isn't a fallback case.

Would it be useful to print xstop_type in the unknown case?

Reviewed-by: Andrew Donnellan <redacted>

-- 
Andrew Donnellan              Software Engineer, OzLabs
andrew.donnellan@au1.ibm.com  Australia Development Lab, Canberra
+61 2 6201 8874 (work)        IBM Australia Limited

Re: [PATCH] powernv/hmi: Use the "unknown" checkstop type as a fallback

From: Russell Currey <hidden>
Date: 2016-03-15 05:15:30

On Tue, 2016-03-15 at 14:56 +1100, Andrew Donnellan wrote:
On 15/03/16 14:26, Russell Currey wrote:
quoted
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 <redacted>
Indeed it looks like there isn't a fallback case.

Would it be useful to print xstop_type in the unknown case?
I don't think so - if there's a new checkstop type, specific handling for
it should be implemented in the kernel, and if you're getting unknown
checkstops that are bringing down your machine you should be looking at the
OPAL firmware log anyway, which would contain details if there was
something "new".
Reviewed-by: Andrew Donnellan <redacted>

Re: [PATCH] powernv/hmi: Use the "unknown" checkstop type as a fallback

From: Andrew Donnellan <hidden>
Date: 2016-03-15 05:37:23

On 15/03/16 16:15, Russell Currey wrote:
quoted
Would it be useful to print xstop_type in the unknown case?
I don't think so - if there's a new checkstop type, specific handling for
it should be implemented in the kernel, and if you're getting unknown
checkstops that are bringing down your machine you should be looking at the
OPAL firmware log anyway, which would contain details if there was
something "new".
That's fair, would primarily help debugging in the rather corner case of 
new skiboot, old kernel, and no access to the OPAL log...

-- 
Andrew Donnellan              Software Engineer, OzLabs
andrew.donnellan@au1.ibm.com  Australia Development Lab, Canberra
+61 2 6201 8874 (work)        IBM Australia Limited

Re: [PATCH] powernv/hmi: Use the "unknown" checkstop type as a fallback

From: Russell Currey <hidden>
Date: 2016-03-15 05:41:01

On Tue, 2016-03-15 at 16:36 +1100, Andrew Donnellan wrote:
On 15/03/16 16:15, Russell Currey wrote:
quoted
quoted
Would it be useful to print xstop_type in the unknown case?
I don't think so - if there's a new checkstop type, specific handling
for
it should be implemented in the kernel, and if you're getting unknown
checkstops that are bringing down your machine you should be looking at
the
OPAL firmware log anyway, which would contain details if there was
something "new".
That's fair, would primarily help debugging in the rather corner case of 
new skiboot, old kernel, and no access to the OPAL log...
I think if you don't have access to the OPAL log, finding out what number
OPAL sent isn't going to help you.

Re: [PATCH] powernv/hmi: Use the "unknown" checkstop type as a fallback

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2016-03-15 09:28:26

On Tue, 2016-03-15 at 16:15 +1100, Russell Currey wrote:
On Tue, 2016-03-15 at 14:56 +1100, Andrew Donnellan wrote:
quoted
On 15/03/16 14:26, Russell Currey wrote:
quoted
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 <redacted>
Indeed it looks like there isn't a fallback case.

Would it be useful to print xstop_type in the unknown case?
I don't think so - if there's a new checkstop type, specific handling for
it should be implemented in the kernel, and if you're getting unknown
checkstops that are bringing down your machine you should be looking at the
OPAL firmware log anyway, which would contain details if there was
something "new".
That's probably true.

But it's trivial to print it out, so I'd rather we did.

Putting it in a local would be nice, rather than saying
hmi_evt->u.xstop_error.xstop_type twice.

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help