[lkml]   [2022]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] LoongArch: Make lscpu show "Model name" and "CPU family"
When update the latest kernel on LoongArch, and then use lscpu command
to show cpuinfo, we can not see "Model name" and "CPU family", this is
because there are no matched patterns in /proc/cpuinfo, use small letter
of "Model Name" and "CPU Family" in show_cpuinfo() to fix it.

Here is the related code of lscpu:

static const struct cpuinfo_pattern type_patterns[] =
DEF_PAT_CPUTYPE( "cpu family", PAT_FAMILY, family),
DEF_PAT_CPUTYPE( "model name", PAT_MODEL_NAME, modelname),

Fixes: 7153c3cbb5b9 ("LoongArch: Add misc common routines")
Signed-off-by: Tiezhu Yang <>
arch/loongarch/kernel/proc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/loongarch/kernel/proc.c b/arch/loongarch/kernel/proc.c
index 5c67cc4..eafd1cf 100644
--- a/arch/loongarch/kernel/proc.c
+++ b/arch/loongarch/kernel/proc.c
@@ -49,8 +49,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
seq_printf(m, "processor\t\t: %ld\n", n);
seq_printf(m, "package\t\t\t: %d\n", cpu_data[n].package);
seq_printf(m, "core\t\t\t: %d\n", cpu_data[n].core);
- seq_printf(m, "CPU Family\t\t: %s\n", __cpu_family[n]);
- seq_printf(m, "Model Name\t\t: %s\n", __cpu_full_name[n]);
+ seq_printf(m, "cpu family\t\t: %s\n", __cpu_family[n]);
+ seq_printf(m, "model name\t\t: %s\n", __cpu_full_name[n]);
seq_printf(m, "CPU Revision\t\t: 0x%02x\n", version);
seq_printf(m, "FPU Revision\t\t: 0x%02x\n", fp_version);
seq_printf(m, "CPU MHz\t\t\t: %llu.%02llu\n",
 \ /
  Last update: 2022-12-03 14:55    [W:0.037 / U:2.684 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site