Subject: [PATCH v5 04/10] powerpc/smp: Move topology fixups into a new function

From: Srikar Dronamraju <[email-masked]>
Date: Mon, 10 Aug 2020 12:48:28 +0530

Move topology fixup based on the platform attributes into its own
function which is called just before set_sched_topology.

Cc: linuxppc-dev <[email-masked]>
Cc: LKML <[email-masked]>
Cc: Michael Ellerman <[email-masked]>
Cc: Nicholas Piggin <[email-masked]>
Cc: Anton Blanchard <[email-masked]>
Cc: Oliver O'Halloran <[email-masked]>
Cc: Nathan Lynch <[email-masked]>
Cc: Michael Neuling <[email-masked]>
Cc: Gautham R Shenoy <[email-masked]>
Cc: Ingo Molnar <[email-masked]>
Cc: Peter Zijlstra <[email-masked]>
Cc: Valentin Schneider <[email-masked]>
Cc: Jordan Niethe <[email-masked]>
Cc: Vaidyanathan Srinivasan <[email-masked]>
Reviewed-by: Gautham R. Shenoy <[email-masked]>
Signed-off-by: Srikar Dronamraju <[email-masked]>
---
Changelog v2 -> v3:
	Rewrote changelog (Gautham)
	Renamed to powerpc/smp: Move topology fixups into  a new function

 arch/powerpc/kernel/smp.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 39224a042468..b13161a5ffc3 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -1362,6 +1362,16 @@ int setup_profiling_timer(unsigned int multiplier)
 	return 0;
 }
 
+static void fixup_topology(void)
+{
+#ifdef CONFIG_SCHED_SMT
+	if (has_big_cores) {
+		pr_info("Big cores detected but using small core scheduling\n");
+		powerpc_topology[0].mask = smallcore_smt_mask;
+	}
+#endif
+}
+
 void __init smp_cpus_done(unsigned int max_cpus)
 {
 	/*
@@ -1375,12 +1385,7 @@ void __init smp_cpus_done(unsigned int max_cpus)
 
 	dump_numa_cpu_topology();
 
-#ifdef CONFIG_SCHED_SMT
-	if (has_big_cores) {
-		pr_info("Big cores detected but using small core scheduling\n");
-		powerpc_topology[0].mask = smallcore_smt_mask;
-	}
-#endif
+	fixup_topology();
 	set_sched_topology(powerpc_topology);
 }
 
-- 
2.18.2