Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1820077rwb; Thu, 29 Sep 2022 02:43:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4QxAxPPbJDitM1fmXCIBiLyca7JWW5431R/leDerY9QLNUCofaT1XYmZJT3VN0oW/0V8Pt X-Received: by 2002:a05:6402:496:b0:443:a5f5:d3b with SMTP id k22-20020a056402049600b00443a5f50d3bmr2420308edv.331.1664444580211; Thu, 29 Sep 2022 02:43:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664444580; cv=none; d=google.com; s=arc-20160816; b=vliT+r5dzVaUhkMBHUmq/n3M0mlNaT9GZQnVxzntVEhw5iuSJcaaGbJY9Sqay97FSR 64FqOMGpVY4TB5TWU/SPfyrZLYVgbc1RtwFZErj/ucVAGDYEmPna5cnvSwon3UBwLxZF lETcqXVUkzEOPb+6nayIlvCfJzdJztrMjRleJxJY27HgiDAxepXoh+6Pko0DnBeci1xe FP1Qy/y0JR884yaFdCmWIaB8h9iR9/RtCtRT/jL1Wt04GYuHhETFBvIKyLqsT/7N3V2k zZGODFoF1eZ05SA6Jmgpbls1JLx+B7h20vQbYfR1+HmZ2/PCavO63oiocK6AzxO4QxUd Wufg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=IzdxvJizCCSpVuiroPfCDkqCV6zYw4cbc+g1Zg163dc=; b=Y29Cj08l6gzjAgpR+TSrMgqp8XaGyBKuLwZliVrjAl7tnaTWPpGyChuF5wmwdjzVpT 1Itrdg5EB19Dz2MCjMsmJHp1oq+i9ZWt2tzk52eH7tlC3pnewK+AqNvRLn/YzhmtBeMP eygjKgJDt3ArnC0q2r6+NQm0DvHp5Tze39VIR6Kcm4OvofEOvy4cRXLBGtPkmxp7fndR +HMO5XZZzokpWS4u+7Fnx21Ho0FCg/PHTheoWOKle3YP/a6QUF1OK3dF6nePVngKsQ2W 4Jk5mndDPPZZRbTVCUisDD+2AOKbGqCx6tynC4DcDOOyx2XnWXcM9QibnbyCUoMXd7Ac 07IA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w9-20020a05640234c900b00450bda7e40bsi8487496edc.29.2022.09.29.02.42.34; Thu, 29 Sep 2022 02:43:00 -0700 (PDT) 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 S235039AbiI2JOc (ORCPT + 99 others); Thu, 29 Sep 2022 05:14:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235694AbiI2JOZ (ORCPT ); Thu, 29 Sep 2022 05:14:25 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 879328276A for ; Thu, 29 Sep 2022 02:14:23 -0700 (PDT) Received: from [10.20.42.32] (unknown [10.20.42.32]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxvmvtYTVjv7QjAA--.56279S3; Thu, 29 Sep 2022 17:14:22 +0800 (CST) Subject: Re: [PATCH V3] LoongArch: Fix cpu name after s3/s4 To: WANG Xuerui , Huacai Chen Cc: linux-kernel@vger.kernel.org, loongarch@lists.linux.dev References: <20220929085530.8742-1-lvjianmin@loongson.cn> <1776fe36-b954-b2c9-a2c1-157363f25ce2@xen0n.name> From: Jianmin Lv Message-ID: <05fcc572-8b58-629c-db9f-4c540c7b4f21@loongson.cn> Date: Thu, 29 Sep 2022 17:14:21 +0800 User-Agent: Mozilla/5.0 (X11; Linux loongarch64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <1776fe36-b954-b2c9-a2c1-157363f25ce2@xen0n.name> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8DxvmvtYTVjv7QjAA--.56279S3 X-Coremail-Antispam: 1UD129KBjvJXoW7tr15JFy7GFy3Xw1xKry8Xwb_yoW8XFW8pF n2yan8CrZF9r95Gasxtr13JryUZrn7G347Xas5J3W8ZF4UZr1qgryUXw4qgF15Aa1xKr40 vF4Dua92vFW7XaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvGb7Iv0xC_Kw4lb4IE77IF4wAFc2x0x2IEx4CE42xK8VAvwI8I cIk0rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2 AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v2 6r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVWxJr0_GcWl84ACjcxK6I8E87Iv6xkF7I0E14 v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xf McIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7 v_Jr0_Gr1lF7xvr2IY64vIr41lc7I2V7IY0VAS07AlzVAYIcxG8wCY02Avz4vE-syl42xK 82IYc2Ij64vIr41l42xK82IY6x8ErcxFaVAv8VW5Wr1UJr1l4I8I3I0E4IkC6x0Yz7v_Jr 0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY 17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcV C0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY 6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa 73UjIFyTuYvjxUqEoXUUUUU X-CM-SenderInfo: 5oymxthqpl0qxorr0wxvrqhubq/ X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 On 2022/9/29 下午5:06, WANG Xuerui wrote: > On 9/29/22 16:55, Jianmin Lv wrote: >> On coming back from s3/s4, the cpu name will be overwritten >> in cpu_probe path of seconary cpu, so we don't overwrite it >> if it has been initialized. > > The sentences are confusing, first "the CPU name will be overwritten" > then "don't overwrite it if initialized" -- seems the CPU name will get > overwritten despite the patch's clear intent. > > Better to keep it simple: "Don't overwrite the CPU name on coming back > from S3/S4 if it is already initialized." > Thanks, Xuerui, let me change it. >> >> Signed-off-by: Jianmin Lv >> >> 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); > > Otherwise LGTM. > > Reviewed-by: WANG Xuerui >