diff options
author | Jianmin Lv <lvjianmin@loongson.cn> | 2022-10-12 10:36:08 +0200 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2022-10-12 10:36:08 +0200 |
commit | 4b2edd38282a42742d8f2039767fa4f1919330f0 (patch) | |
tree | a5df545e9e8fb396db617bf07dfbafd3464500b4 /arch/loongarch | |
parent | Merge tag 'efi-next-for-v6.1' into loongarch-next (diff) | |
download | linux-4b2edd38282a42742d8f2039767fa4f1919330f0.tar.xz linux-4b2edd38282a42742d8f2039767fa4f1919330f0.zip |
LoongArch: Fix cpu name after CPU-hotplug
Don't overwrite the SMBIOS-provided CPU name on coming back from CPU-
hotplug (including S3/S4) if it is already initialized.
Reviewed-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch')
-rw-r--r-- | arch/loongarch/kernel/cpu-probe.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/loongarch/kernel/cpu-probe.c b/arch/loongarch/kernel/cpu-probe.c index 529ab8f44ec6..255a09876ef2 100644 --- a/arch/loongarch/kernel/cpu-probe.c +++ b/arch/loongarch/kernel/cpu-probe.c @@ -187,7 +187,9 @@ static inline void cpu_probe_loongson(struct cpuinfo_loongarch *c, unsigned int uint64_t *vendor = (void *)(&cpu_full_name[VENDOR_OFFSET]); uint64_t *cpuname = (void *)(&cpu_full_name[CPUNAME_OFFSET]); - __cpu_full_name[cpu] = cpu_full_name; + if (!__cpu_full_name[cpu]) + __cpu_full_name[cpu] = cpu_full_name; + *vendor = iocsr_read64(LOONGARCH_IOCSR_VENDOR); *cpuname = iocsr_read64(LOONGARCH_IOCSR_CPUNAME); |