Re: [PATCH v3 2/5] powerpc/xive: add error return value to xive_smp_probe()
Cédric Le Goater <[email protected]> Wed, 29 Jul 2026 19:33:56 +0200
| Newsgroups | org.ozlabs.lists.linuxppc-dev,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On 7/27/26 12:42, Gou Hao wrote: > xive_smp_probe() calls xive_init_ipis() which can fail, but its > return value is currently ignored. Change xive_smp_probe() to > return int so that errors can be propagated to callers. > > This is a preparatory patch for the next one. > > No functional change yet; the return value is always 0 at this point. > > Signed-off-by: Gou Hao <[email protected]> > Reviewed-by: Wentao Guan <[email protected]> > Reviewed-by: jiazhenyuan <[email protected]> > --- > arch/powerpc/include/asm/xive.h | 4 ++-- > arch/powerpc/sysdev/xive/common.c | 4 +++- > 2 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/arch/powerpc/include/asm/xive.h b/arch/powerpc/include/asm/xive.h > index efb0f5effcc6..4e3e3358993c 100644 > --- a/arch/powerpc/include/asm/xive.h > +++ b/arch/powerpc/include/asm/xive.h > @@ -91,7 +91,7 @@ static inline bool xive_enabled(void) { return __xive_enabled; } > > bool xive_spapr_init(void); > bool xive_native_init(void); > -void xive_smp_probe(void); > +int xive_smp_probe(void); > int xive_smp_prepare_cpu(unsigned int cpu); > void xive_smp_setup_cpu(void); > void xive_smp_disable_cpu(void); > @@ -153,7 +153,7 @@ static inline bool xive_enabled(void) { return false; } > > static inline bool xive_spapr_init(void) { return false; } > static inline bool xive_native_init(void) { return false; } > -static inline void xive_smp_probe(void) { } > +static inline int xive_smp_probe(void) { return -EINVAL; } > static inline int xive_smp_prepare_cpu(unsigned int cpu) { return -EINVAL; } > static inline void xive_smp_setup_cpu(void) { } > static inline void xive_smp_disable_cpu(void) { } > diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c > index 86c78af1f68e..9f80c16be23f 100644 > --- a/arch/powerpc/sysdev/xive/common.c > +++ b/arch/powerpc/sysdev/xive/common.c > @@ -1265,7 +1265,7 @@ noinstr static void xive_cleanup_cpu_ipi(unsigned int cpu, struct xive_cpu *xc) > xive_ops->put_ipi(cpu, xc); > } > > -void __init xive_smp_probe(void) > +int __init xive_smp_probe(void) > { > smp_ops->cause_ipi = xive_cause_ipi; > > @@ -1274,6 +1274,8 @@ void __init xive_smp_probe(void) > > /* Allocate and setup IPI for the boot CPU */ > xive_setup_cpu_ipi(smp_processor_id()); > + > + return 0; > } > > #endif /* CONFIG_SMP */ Reviewed-by: Cédric Le Goater <[email protected]> Thanks, C.