Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/powernv: Use the "unknown" checkstop type as a fallback

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>

authored by

Russell Currey and committed by
Michael Ellerman
f8a25db4 d88e397f

+5 -3
+5 -3
arch/powerpc/platforms/powernv/opal-hmi.c
··· 150 150 static void print_checkstop_reason(const char *level, 151 151 struct OpalHMIEvent *hmi_evt) 152 152 { 153 - switch (hmi_evt->u.xstop_error.xstop_type) { 153 + uint8_t type = hmi_evt->u.xstop_error.xstop_type; 154 + switch (type) { 154 155 case CHECKSTOP_TYPE_CORE: 155 156 print_core_checkstop_reason(level, hmi_evt); 156 157 break; 157 158 case CHECKSTOP_TYPE_NX: 158 159 print_nx_checkstop_reason(level, hmi_evt); 159 160 break; 160 - case CHECKSTOP_TYPE_UNKNOWN: 161 - printk("%s Unknown Malfunction Alert.\n", level); 161 + default: 162 + printk("%s Unknown Malfunction Alert of type %d\n", 163 + level, type); 162 164 break; 163 165 } 164 166 }