powerpc/powernv: Return secondary CPUs to firmware before FW update

Firmware update on PowerNV platform takes several minutes. During
this time one CPU is stuck in FW and the kernel complains about "soft
lockups".

This patch returns all secondary CPUs to firmware before starting
firmware update process.

[ Reworked a bit and cleaned up -- BenH ]

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
Vasant Hegde
2014-04-09 22:48:55 +05:30
کامیت شده توسط Benjamin Herrenschmidt
والد 654837e8fe
کامیت 2196c6f1ed
3فایلهای تغییر یافته به همراه66 افزوده شده و 7 حذف شده

مشاهده پرونده

@@ -98,11 +98,32 @@ static void pnv_show_cpuinfo(struct seq_file *m)
of_node_put(root);
}
static void pnv_prepare_going_down(void)
{
/*
* Disable all notifiers from OPAL, we can't
* service interrupts anymore anyway
*/
opal_notifier_disable();
/* Soft disable interrupts */
local_irq_disable();
/*
* Return secondary CPUs to firwmare if a flash update
* is pending otherwise we will get all sort of error
* messages about CPU being stuck etc.. This will also
* have the side effect of hard disabling interrupts so
* past this point, the kernel is effectively dead.
*/
opal_flash_term_callback();
}
static void __noreturn pnv_restart(char *cmd)
{
long rc = OPAL_BUSY;
opal_notifier_disable();
pnv_prepare_going_down();
while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) {
rc = opal_cec_reboot();
@@ -119,7 +140,7 @@ static void __noreturn pnv_power_off(void)
{
long rc = OPAL_BUSY;
opal_notifier_disable();
pnv_prepare_going_down();
while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) {
rc = opal_cec_power_down(0);