From: James Hogan <jhogan@kernel.org>
To: Huacai Chen <chenhc@lemote.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
John Crispin <john@phrozen.org>,
"Steven J . Hill" <Steven.Hill@cavium.com>,
linux-mips@linux-mips.org, Fuxin Zhang <zhangfx@lemote.com>,
Zhangjin Wu <wuzhangjin@gmail.com>
Subject: Re: [PATCH 4/8] MIPS: Add __cpu_full_name[] to make CPU names more human-readable
Date: Wed, 24 Jan 2018 22:14:09 +0000 [thread overview]
Message-ID: <20180124221408.GK5446@saruman> (raw)
In-Reply-To: <1502330682-16812-3-git-send-email-chenhc@lemote.com>
[-- Attachment #1: Type: text/plain, Size: 2098 bytes --]
On Thu, Aug 10, 2017 at 10:04:38AM +0800, Huacai Chen wrote:
> In /proc/cpuinfo, we keep "cpu model" as is, since GCC should use it
> for -march=native. Besides, we add __cpu_full_name[] to describe the
> processor in a more human-readable manner. The full name is displayed
> as "model name" in cpuinfo, which is needed by some userspace tools
> such as gnome-system-monitor.
>
> The CPU frequency in "model name" is the default value (highest), and
> there is also a "CPU MHz" whose value can be changed by cpufreq.
>
> This is only used by Loongson now (ICT is dropped in cpu name, and cpu
> name can be overwritten by BIOS).
>
> Signed-off-by: Huacai Chen <chenhc@lemote.com>
> diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c
> index 70604c7..3200c0e 100644
> --- a/arch/mips/kernel/proc.c
> +++ b/arch/mips/kernel/proc.c
> @@ -62,6 +63,11 @@ static int show_cpuinfo(struct seq_file *m, void *v)
> seq_printf(m, fmt, __cpu_name[n],
> (version >> 4) & 0x0f, version & 0x0f,
> (fp_vers >> 4) & 0x0f, fp_vers & 0x0f);
> + if (__cpu_full_name[n])
> + seq_printf(m, "model name\t\t: %s\n", __cpu_full_name[n]);
> + if (mips_cpu_frequency)
> + seq_printf(m, "CPU MHz\t\t\t: %u.%02u\n",
> + mips_cpu_frequency / 1000000, (mips_cpu_frequency / 10000) % 100);
long line
> diff --git a/arch/mips/loongson64/common/env.c b/arch/mips/loongson64/common/env.c
> index 1e8a955..6891780 100644
> --- a/arch/mips/loongson64/common/env.c
> +++ b/arch/mips/loongson64/common/env.c
> @@ -151,6 +154,10 @@ void __init prom_init_env(void)
> loongson_sysconf.nr_nodes = (loongson_sysconf.nr_cpus +
> loongson_sysconf.cores_per_node - 1) /
> loongson_sysconf.cores_per_node;
> + if (!strncmp(ecpu->cpuname, "Loongson", 8))
> + strncpy(cpu_full_name, ecpu->cpuname, sizeof(cpu_full_name));
> + if (cpu_full_name[0] == 0)
> + strncpy(cpu_full_name, __cpu_full_name[0], sizeof(cpu_full_name));
long line
Otherwise this looks reasonable I think:
Reviewed-by: James Hogan <jhogan@kernel.org>
Cheers
James
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2018-01-24 22:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-10 2:00 [PATCH 0/8] MIPS: Loongson: new features and improvements Huacai Chen
2017-08-10 2:00 ` [PATCH 1/8] MIPS: Loongson-3: Enable Store Fill Buffer at runtime Huacai Chen
2018-01-24 20:54 ` James Hogan
2017-08-10 2:04 ` [PATCH 2/8] MIPS: c-r4k: Add r4k_blast_scache_node for Loongson-3 Huacai Chen
2017-08-10 2:04 ` [PATCH 3/8] MIPS: Ensure pmd_present() returns false after pmd_mknotpresent() Huacai Chen
2018-01-24 21:47 ` James Hogan
2017-08-10 2:04 ` [PATCH 4/8] MIPS: Add __cpu_full_name[] to make CPU names more human-readable Huacai Chen
2018-01-24 22:14 ` James Hogan [this message]
2017-08-10 2:04 ` [PATCH 5/8] MIPS: Align kernel load address to 64KB Huacai Chen
2017-08-10 2:04 ` [PATCH 6/8] MIPS: Loongson: Add kexec/kdump support Huacai Chen
2018-01-24 21:22 ` [PATCH 2/8] MIPS: c-r4k: Add r4k_blast_scache_node for Loongson-3 James Hogan
2017-08-10 2:15 ` [PATCH 7/8] MIPS: Loongson: Make CPUFreq usable " Huacai Chen
2017-08-10 2:15 ` [PATCH 8/8] MIPS: Loongson: Introduce and use WAR_LLSC_MB Huacai Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180124221408.GK5446@saruman \
--to=jhogan@kernel.org \
--cc=Steven.Hill@cavium.com \
--cc=chenhc@lemote.com \
--cc=john@phrozen.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=wuzhangjin@gmail.com \
--cc=zhangfx@lemote.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox