diff options
Diffstat (limited to 'arch/riscv/kernel/cpu.c')
-rw-r--r-- | arch/riscv/kernel/cpu.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index 4723e235dcaa..cccc6f61c538 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/seq_file.h> | 15 | #include <linux/seq_file.h> |
16 | #include <linux/of.h> | 16 | #include <linux/of.h> |
17 | #include <asm/smp.h> | ||
17 | 18 | ||
18 | /* | 19 | /* |
19 | * Returns the hart ID of the given device tree node, or -1 if the device tree | 20 | * Returns the hart ID of the given device tree node, or -1 if the device tree |
@@ -138,11 +139,12 @@ static void c_stop(struct seq_file *m, void *v) | |||
138 | 139 | ||
139 | static int c_show(struct seq_file *m, void *v) | 140 | static int c_show(struct seq_file *m, void *v) |
140 | { | 141 | { |
141 | unsigned long hart_id = (unsigned long)v - 1; | 142 | unsigned long cpu_id = (unsigned long)v - 1; |
142 | struct device_node *node = of_get_cpu_node(hart_id, NULL); | 143 | struct device_node *node = of_get_cpu_node(cpuid_to_hartid_map(cpu_id), |
144 | NULL); | ||
143 | const char *compat, *isa, *mmu; | 145 | const char *compat, *isa, *mmu; |
144 | 146 | ||
145 | seq_printf(m, "hart\t: %lu\n", hart_id); | 147 | seq_printf(m, "hart\t: %lu\n", cpu_id); |
146 | if (!of_property_read_string(node, "riscv,isa", &isa)) | 148 | if (!of_property_read_string(node, "riscv,isa", &isa)) |
147 | print_isa(m, isa); | 149 | print_isa(m, isa); |
148 | if (!of_property_read_string(node, "mmu-type", &mmu)) | 150 | if (!of_property_read_string(node, "mmu-type", &mmu)) |