summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/xics/xics-common.c
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2017-04-26 17:32:38 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2017-04-26 23:28:12 +1000
commit45b21cfeb22087795f0b49397fbe529efeb99baf (patch)
tree86845b00eb677d66b5c8b88c5f1e59e519083ea6 /arch/powerpc/sysdev/xics/xics-common.c
parent83c4919058459c32138a1ebe35f72b7013a9ddbc (diff)
downloadlinux-45b21cfeb22087795f0b49397fbe529efeb99baf.tar.gz
linux-45b21cfeb22087795f0b49397fbe529efeb99baf.tar.bz2
linux-45b21cfeb22087795f0b49397fbe529efeb99baf.zip
powerpc/powernv: Fix oops on P9 DD1 in cause_ipi()
Recently we merged the native xive support for Power9, and then separately some reworks for doorbell IPI support. In isolation both series were OK, but the merged result had a bug in one case. On P9 DD1 we use pnv_p9_dd1_cause_ipi() which tries to use doorbells, and then falls back to the interrupt controller. However the fallback is implemented by calling icp_ops->cause_ipi. But now that xive support is merged we might be using xive, in which case icp_ops is not initialised, it's a xics specific structure. This leads to an oops such as: Unable to handle kernel paging request for data at address 0x00000028 Oops: Kernel access of bad area, sig: 11 [#1] NIP pnv_p9_dd1_cause_ipi+0x74/0xe0 LR smp_muxed_ipi_message_pass+0x54/0x70 To fix it, rather than using icp_ops which might be NULL, have both xics and xive set smp_ops->cause_ipi, and then in the powernv code we save that as ic_cause_ipi before overriding smp_ops->cause_ipi. For paranoia add a WARN_ON() to check if somehow smp_ops->cause_ipi is NULL. Fixes: b866cc2199d6 ("powerpc: Change the doorbell IPI calling convention") Tested-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/sysdev/xics/xics-common.c')
-rw-r--r--arch/powerpc/sysdev/xics/xics-common.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/powerpc/sysdev/xics/xics-common.c b/arch/powerpc/sysdev/xics/xics-common.c
index 2eb53c12ee6e..ffe138b8b9dc 100644
--- a/arch/powerpc/sysdev/xics/xics-common.c
+++ b/arch/powerpc/sysdev/xics/xics-common.c
@@ -145,6 +145,9 @@ void __init xics_smp_probe(void)
{
/* Register all the IPIs */
xics_request_ipi();
+
+ /* Setup cause_ipi callback based on which ICP is used */
+ smp_ops->cause_ipi = icp_ops->cause_ipi;
}
#endif /* CONFIG_SMP */