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

powerpc/powernv: Invoke opal_cec_reboot2() on unrecoverable HMI.

Invoke new opal_cec_reboot2() call with reboot type
OPAL_REBOOT_PLATFORM_ERROR (for unrecoverable HMI interrupts) to inform
BMC/OCC about this error, so that BMC can collect relevant data for error
analysis and decide what component to de-configure before rebooting.

Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Mahesh Salgaonkar and committed by
Michael Ellerman
62521ea6 e784b649

+19
+19
arch/powerpc/platforms/powernv/opal-hmi.c
··· 264 264 spin_unlock_irqrestore(&opal_hmi_evt_lock, flags); 265 265 266 266 if (unrecoverable) { 267 + int ret; 268 + 267 269 /* Pull all HMI events from OPAL before we panic. */ 268 270 while (opal_get_msg(__pa(&msg), sizeof(msg)) == OPAL_SUCCESS) { 269 271 u32 type; ··· 280 278 hmi_evt = (struct OpalHMIEvent *)&msg.params[0]; 281 279 print_hmi_event_info(hmi_evt); 282 280 } 281 + 282 + /* 283 + * Unrecoverable HMI exception. We need to inform BMC/OCC 284 + * about this error so that it can collect relevant data 285 + * for error analysis before rebooting. 286 + */ 287 + ret = opal_cec_reboot2(OPAL_REBOOT_PLATFORM_ERROR, 288 + "Unrecoverable HMI exception"); 289 + if (ret == OPAL_UNSUPPORTED) { 290 + pr_emerg("Reboot type %d not supported\n", 291 + OPAL_REBOOT_PLATFORM_ERROR); 292 + } 293 + 294 + /* 295 + * Fall through and panic if opal_cec_reboot2() returns 296 + * OPAL_UNSUPPORTED. 297 + */ 283 298 panic("Unrecoverable HMI exception"); 284 299 } 285 300 }