Skip to contentSkip to conversation

powernv: Invoke opal_cec_reboot2() on unrecoverable HMI.

PATCH Applied Mahesh J Salgaonkar 2 participants 2 messages Aug 4, 2015 – Aug 10, 2015 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powernv: Invoke opal_cec_reboot2() on unrecoverable HMI.

From: Mahesh Salgaonkar <[email protected]>

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.

This patch depends on:
https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-May/128341.html
https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-May/128342.html
https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-August/132045.html

---
 arch/powerpc/platforms/powernv/opal-hmi.c |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/powerpc/platforms/powernv/opal-hmi.c +19 -0
index acefdf9..d000f4e 100644
@@ -264,6 +264,8 @@ static void hmi_event_handler(struct work_struct *work)
 	spin_unlock_irqrestore(&opal_hmi_evt_lock, flags);
 
 	if (unrecoverable) {
+		int ret;
+
 		/* Pull all HMI events from OPAL before we panic. */
 		while (opal_get_msg(__pa(&msg), sizeof(msg)) == OPAL_SUCCESS) {
 			u32 type;
@@ -278,6 +280,23 @@ static void hmi_event_handler(struct work_struct *work)
 			hmi_evt = (struct OpalHMIEvent *)&msg.params[0];
 			print_hmi_event_info(hmi_evt);
 		}
+
+		/*
+		 * Unrecoverable HMI exception. We need to inform BMC/OCC
+		 * about this error so that it can collect relevant data
+		 * for error analysis before rebooting.
+		 */
+		ret = opal_cec_reboot2(OPAL_REBOOT_PLATFORM_ERROR,
+			"Unrecoverable HMI exception");
+		if (ret == OPAL_UNSUPPORTED) {
+			pr_emerg("Reboot type %d not supported\n",
+						OPAL_REBOOT_PLATFORM_ERROR);
+		}
+
+		/*
+		 * Fall through and panic if opal_cec_reboot2() returns
+		 * OPAL_UNSUPPORTED.
+		 */
 		panic("Unrecoverable HMI exception");
 	}
 }
reviewer Applied
#1 lore raw
Quoted 7 lines · Mahesh Salgaonkar

From: Mahesh Salgaonkar <[email protected]>

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.

Quoted 6 lines

This patch depends on:
https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-May/128341.html
https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-May/128342.html
https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-August/132045.html

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/62521ea6db1045a746d4

cheers