Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Netlogic: Mark Netlogic chips as SMT capable

Netlogic XLR chip has multiple cores. Each core includes four integrated
hardware threads, and they share L1 data and instruction caches.

If the chip is marked to be SMT capable, scheduler then could do more, say,
idle load balancing.

Changes are now confined only to the code of XLR, and hardware is probed
to get core ID for correct setup.

[jayachandranc: simplified and adapted for new merged XLR/XLP code]

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Jayachandran C <jayachandranc@netlogicmicro.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/2972/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Hillf Danton and committed by
Ralf Baechle
b3ea5818 2aa54b20

+7 -4
+7 -4
arch/mips/netlogic/common/smp.c
··· 108 108 */ 109 109 static void __cpuinit nlm_init_secondary(void) 110 110 { 111 + current_cpu_data.core = hard_smp_processor_id() / 4; 111 112 nlm_smp_irq_init(); 113 + } 114 + 115 + void nlm_prepare_cpus(unsigned int max_cpus) 116 + { 117 + /* declare we are SMT capable */ 118 + smp_num_siblings = nlm_threads_per_core; 112 119 } 113 120 114 121 void nlm_smp_finish(void) ··· 188 181 189 182 pr_info("Detected %i Slave CPU(s)\n", num_cpus); 190 183 nlm_set_nmi_handler(nlm_boot_secondary_cpus); 191 - } 192 - 193 - void nlm_prepare_cpus(unsigned int max_cpus) 194 - { 195 184 } 196 185 197 186 static int nlm_parse_cpumask(u32 cpu_mask)