From patchwork Sat Dec 3 13:54:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiezhu Yang X-Patchwork-Id: 29282 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1378780wrr; Sat, 3 Dec 2022 05:59:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf71hdS3yT0Mo8iAQEp/us9hGsWkvMQls9G5e4el7TKMaF9p3uUjebvjEmJUi4QBb0imV5WR X-Received: by 2002:a17:90b:3809:b0:20a:c64c:ae80 with SMTP id mq9-20020a17090b380900b0020ac64cae80mr70807584pjb.12.1670075967199; Sat, 03 Dec 2022 05:59:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670075967; cv=none; d=google.com; s=arc-20160816; b=zgY0G4VtOhxwa0UXMvM0/Kf/Id47Y2UUiGr38g8oD2MKYBFLhinSprafNrngoG8YYl SXd/VbTTcxi8+LjtAFSkMTf8ZwBXiojjLLSfDnV8QJHeeE9vPM3KDJlmXVlb89BTSEjH vkhajs6YuXiTlTaMtcOuIA2SaUjJbdVzDAHRRmyIKN1Kc4DgndQ/CO9ge7BKISYDlayk kks2aMptYRP/w2OVIcCBOFSqYuaqIziAA4q65nr/lV26vjTBjH4dddBWEhHtJHKAZeUx yQ28QL1uXKf2dZkvNZFUsS4Msi1UG/r/CxAY1IStBQK7ZXuZLlORlm9Hi3PFbaIMAQBk W/oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=qZkgwkZJvqZBPbYMkACcK55pY/kE8+kACxCCBdNWe1g=; b=XVC2j7IHFT9f1TBO93oFlzVDw8+74vr2kKQIxeKqDPw/Wt1p2QzdqmjebWzeVVHYN0 tbjAmuALCyQ9lUUHtUSq/CPaCZXQ7IqF5tUjMY3b/hivboDbYTgU7oqi/2UNv25XJRBC XkDP15GSz1rhSZ1KOIC0M/iUww7UR4JXUCPq5Tsx9rGaBm+yEuHvwCD2kUURVcCsg9hX IHTbNHo05wK3n1unxEB6lMtibnkrPfxn3rXlTBpXvofBb9lvuy5lbeDRNuGvfj7t8wJC rZywTGFSN9wTLUweUTisxFtcAOBiWDSbssFwmJhij5qS5wPFWB9/hM/hv3dS1C9/b/1z FDUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q15-20020a170902eb8f00b00188758ff467si9541987plg.29.2022.12.03.05.59.14; Sat, 03 Dec 2022 05:59:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229767AbiLCNy1 (ORCPT + 99 others); Sat, 3 Dec 2022 08:54:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229744AbiLCNyW (ORCPT ); Sat, 3 Dec 2022 08:54:22 -0500 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 70D05193EE for ; Sat, 3 Dec 2022 05:54:19 -0800 (PST) Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8Bx1vAJVYtjDPsCAA--.6924S3; Sat, 03 Dec 2022 21:54:18 +0800 (CST) Received: from linux.localdomain (unknown [113.200.148.30]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxZ1cIVYtjkBMlAA--.8238S2; Sat, 03 Dec 2022 21:54:16 +0800 (CST) From: Tiezhu Yang To: Huacai Chen , WANG Xuerui Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] LoongArch: Make lscpu show "Model name" and "CPU family" Date: Sat, 3 Dec 2022 21:54:16 +0800 Message-Id: <1670075656-4754-1-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: AQAAf8CxZ1cIVYtjkBMlAA--.8238S2 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBjvJXoW7uF4fZrWrZr4rtrW7Xr43KFg_yoW8Ar1DpF W3CF4UJw4DGwn8J3yxta48uw4Y9Fn8J3W2van3GrW3C3WUXr4kXw10vw4xXF4Y9r1fKw4r ZFZYgF15KFyUJaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU b7AYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_JrI_Jryl8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVWUJVWUCwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwA2z4 x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r4UJVWxJr1l e2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27wAqx4xG64xvF2 IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4U McvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x0EwIxGrwCFx2 IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v2 6r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67 AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IY s7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Jr 0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU8czVUUUUUU== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751201577245166585?= X-GMAIL-MSGID: =?utf-8?q?1751201577245166585?= 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), ... }; Link: https://github.com/util-linux/util-linux/blob/master/sys-utils/lscpu-cputype.c 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",