MIPS: generic: enable SMP on SMVP systems
Subsystems (2)
PATCH 1/1 MIPS: generic: enable SMP on SMVP systems
In addition to CPS SMP setups, also try to initialise MT SMP setups with multiple VPEs per CPU core. CMP SMP support is not provided as it is considered deprecated.
Additionally, rework the code by dropping the err variable and make it similar to how other platforms perform this initialisation.
--- arch/mips/generic/init.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
arch/mips/generic/init.c +6 -5
@@ -110,14 +110,15 @@ void __init plat_mem_setup(void)void __init device_tree_init (void ) { -int err; -unflatten_and_copy_device_tree ();mips_cpc_probe (); - err =register_cps_smp_ops (); -if (err) - err =register_up_smp_ops (); +if (!register_cps_smp_ops ()) +return ; +if (!register_vsmp_smp_ops ()) +return ; + +register_up_smp_ops (); } int __init apply_mips_fdt_fixups(void *fdt_out, size_t fdt_out_size,
Signature · 1 line
2.33.1
Quoted 6 lines · Sander Vanheule
In addition to CPS SMP setups, also try to initialise MT SMP setups with multiple VPEs per CPU core. CMP SMP support is not provided as it is considered deprecated.
Additionally, rework the code by dropping the err variable and make it similar to how other platforms perform this initialisation.
Hi,
Thanks for your patch :-)
However there is a probem that register_vsmp_smp_ops never returns error if CONFIG_MIPS_MT_SMP is enabled. But generic kernel is supposed to run on systems with & without MT.
So probably you need:
arch/mips/include/asm/smp-ops.h +0 -0
@@ -101,6 +101,9 @@ static inline int register_vsmp_smp_ops(void)
#ifdef CONFIG_MIPS_MT_SMP
extern const struct plat_smp_ops vsmp_smp_ops;
+ if (!cpu_has_mipsmt)
+ return -ENODEV;
+
register_smp_ops(&vsmp_smp_ops);
return 0;
Thanks.
- Jiaxun
Hi Jiaxun,
Quoted 25 lines · Jiaxun Yang
Quoted 6 lines · Sander Vanheule
In addition to CPS SMP setups, also try to initialise MT SMP setups with multiple VPEs per CPU core. CMP SMP support is not provided as it is considered deprecated.
Additionally, rework the code by dropping the err variable and make it similar to how other platforms perform this initialisation.
Hi,
Thanks for your patch :-)
However there is a probem that
register_vsmp_smp_opsnever returns error ifCONFIG_MIPS_MT_SMPis enabled. But generic kernel is supposed to run on systems with & without MT.So probably you need:
arch/mips/include/asm/smp-ops.h +0
-0
arch/mips/include/asm/smp-ops.h static inline int register_vsmp_smp_ops(void) · line 109
Quoted 9 lines
arch/mips/include/asm/smp-ops.h +3
-0@@ -101,6 +101,9 @@ static inline int register_vsmp_smp_ops(void) #ifdef CONFIG_MIPS_MT_SMP extern const struct plat_smp_ops vsmp_smp_ops; + if (!cpu_has_mipsmt) + return -ENODEV; + register_smp_ops(&vsmp_smp_ops); return 0;
Thanks for the feedback, I was wondering if we had missed something :) I'll send a v2 (series) including this addition.
Best,
Sander