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

MIPS: SGI-IP27: Store cpu speed when scanning for CPUs and use it later

Remember CPU speed while scanning for available CPUs to avoid
looking it up a second time when printing CPU speed.

Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

authored by

Thomas Bogendoerfer and committed by
Paul Burton
d31f9e64 78691e4f

+5 -21
+1
arch/mips/include/asm/mach-ip27/topology.h
··· 7 7 8 8 struct cpuinfo_ip27 { 9 9 nasid_t p_nasid; /* my node ID in numa-as-id-space */ 10 + unsigned short p_speed; /* cpu speed in MHz */ 10 11 unsigned char p_slice; /* Physical position on node board */ 11 12 }; 12 13
-1
arch/mips/sgi-ip27/ip27-common.h
··· 6 6 extern nasid_t master_nasid; 7 7 8 8 extern void cpu_node_probe(void); 9 - extern void cpu_time_init(void); 10 9 extern void hub_rt_clock_event_init(void); 11 10 extern void hub_rtc_init(nasid_t nasid); 12 11 extern void install_cpu_nmi_handler(int slice);
+2 -1
arch/mips/sgi-ip27/ip27-init.c
··· 83 83 84 84 per_hub_init(nasid); 85 85 86 - cpu_time_init(); 86 + pr_info("CPU %d clock is %dMHz.\n", cpu, sn_cpu_info[cpu].p_speed); 87 + 87 88 install_ipi(); 88 89 89 90 /* Install our NMI handler if symmon hasn't installed one. */
+2
arch/mips/sgi-ip27/ip27-smp.c
··· 47 47 set_cpu_possible(cpuid, true); 48 48 cputonasid(cpus_found) = nasid; 49 49 cputoslice(cpus_found) = acpu->cpu_info.physid; 50 + sn_cpu_info[cpus_found].p_speed = 51 + acpu->cpu_speed; 50 52 cpus_found++; 51 53 } 52 54 acpu = (klcpu_t *)find_component(brd, (klinfo_t *)acpu,
-19
arch/mips/sgi-ip27/ip27-timer.c
··· 150 150 hub_rt_clock_event_init(); 151 151 } 152 152 153 - void cpu_time_init(void) 154 - { 155 - lboard_t *board; 156 - klcpu_t *cpu; 157 - int cpuid; 158 - 159 - /* Don't use ARCS. ARCS is fragile. Klconfig is simple and sane. */ 160 - board = find_lboard(KL_CONFIG_INFO(get_nasid()), KLTYPE_IP27); 161 - if (!board) 162 - panic("Can't find board info for myself."); 163 - 164 - cpuid = LOCAL_HUB_L(PI_CPU_NUM) ? IP27_CPU0_INDEX : IP27_CPU1_INDEX; 165 - cpu = (klcpu_t *) KLCF_COMP(board, cpuid); 166 - if (!cpu) 167 - panic("No information about myself?"); 168 - 169 - printk("CPU %d clock is %dMHz.\n", smp_processor_id(), cpu->cpu_speed); 170 - } 171 - 172 153 void hub_rtc_init(nasid_t nasid) 173 154 { 174 155