Message ID | 20230404182037.863533-13-sunilvl@ventanamicro.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp79056vqo; Tue, 4 Apr 2023 11:26:32 -0700 (PDT) X-Google-Smtp-Source: AKy350YvKVEhjIk+v7mZ0fylFBZbbSuRjZXHRDFJmdhFx++Dced4TVR35psCf6gPGa1xLXYm8TEe X-Received: by 2002:a17:902:cec5:b0:1a1:e364:3452 with SMTP id d5-20020a170902cec500b001a1e3643452mr4582191plg.29.1680632791957; Tue, 04 Apr 2023 11:26:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680632791; cv=none; d=google.com; s=arc-20160816; b=iVMONKG/zOTjs1ypzSs/AwbPUOqyZNflbUsMgP2VsF9YD+nw+ksANEnduCaJPayB7T 7//+2fLc6bRNxHAnJPjHjrSMNtWKKO0StK+PGNN2I4SQU/TlzEvy6HVT8Ke3ZZnt/DV2 IJDVoAFBAer3kuUu1zAJfgZscQXNT4XsRaAmXNKP094Gsn7VIFme8rROF44rrdYL4G/i z/TIjudlJmH49lfF29LHmmB5oP6d4UINltSWbs6/9QOjD/JsWbTequMmHOrmN2MM/MkX bEe31Pw6aQboJiK4WXQ52uo9rEwt8Og3vJHPAyYMvS7co8/1MaJNDqS+Z5ZYTmk9uXyQ 2ybg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vOfAYG3XRnm+elp9Rz4INSxNTdbKknHW/6eObzO7hi8=; b=LPgW8NLXVW0S5Z4Fz6coOpStl3jNXmWyZhlgSYpp+pcDKgDAJVcdQDSf85q97VbQld sOur9QODiuBgTaTcKHzCiuJwj/I2UcfJ95ipyFueeVDytvAI2KJ/Wnv7OoAxgvISQiID REEJ7MtVRSOEZToTvZixw5XlcwOqX/Yi6zOSY4rdVBoV74oA50HYQaU8vQj7VFOIMQYI 6hpEVHJhg7PXfT1UBBkOVh6yeHrA13yaCCXSVN6snCdNTGJBkdMuPdqjQQIZ0BlLSt6r SF5fZCA5cvEZQExiqp0TX8zOtWD7v/ySqyPbLuF4YZyrWrZ7leGCwDrkFreTSMsh8b5r 1EhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=L8YECRNq; 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 o17-20020a170903301100b001a1c690e190si10206203pla.44.2023.04.04.11.26.19; Tue, 04 Apr 2023 11:26:31 -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; dkim=pass header.i=@ventanamicro.com header.s=google header.b=L8YECRNq; 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 S236266AbjDDSXU (ORCPT <rfc822;a1648639935@gmail.com> + 99 others); Tue, 4 Apr 2023 14:23:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236501AbjDDSWw (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 4 Apr 2023 14:22:52 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89F6C6592 for <linux-kernel@vger.kernel.org>; Tue, 4 Apr 2023 11:22:11 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id u38so22038718pfg.10 for <linux-kernel@vger.kernel.org>; Tue, 04 Apr 2023 11:22:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1680632531; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vOfAYG3XRnm+elp9Rz4INSxNTdbKknHW/6eObzO7hi8=; b=L8YECRNq9zHfdajtfyIxGzHpmgAu+8AIVFW1slPJBQJ6rehzKPbVARoQnJZcn0eLo4 MZJwlkBXNWwUdUTfaNSKkrkxTTu4KyG2qGOMUv/QmEqqV/DRdXVfjGa7HoDimM+6d0Kg y44bdJ5lRuCVCZ3T+qr98D9JJokhrxPqVeAEAv1arA8yLOHyPwK8xWkKJ3OcxXDmqC5V H7brCz+RrTXiJPi9Lxx2SXxvCy/V3plJ/cxF8IDBy4naSeNVcIgT7e3QC0gr8GOJkO6s ryRvuYpFL1C2f4FEG39wrbBR1+mNGg+skArfvu24iysSkTM4p9nW7XTd1b93qfcYm83d 3Nuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680632531; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vOfAYG3XRnm+elp9Rz4INSxNTdbKknHW/6eObzO7hi8=; b=z0d7uJZgy4bnCh98etaOIr3akyYIq1BIhmicK9WXB2osEQBjUZiPS67RKLl2HLefdt SxrQiP1wMhDsDfhKiidYRAEke58vLlArY5k5PrgxfNnLMQnt/jwRGVlGYEXEO7fdY/uN Gak/0BVFTniYkvMn2cR00ENl8KoAv4NNLgIZ5TIVTIUJVdhgGEMEutcPPEINGQib6rHq IWcmIiTBCBl7FkLRaWgHG7uG27zqyLQjv81+PbsDOu5qcW8GQaEe/zAlHf3HcTSPpV7A vWzu0jnYfjB8GWImay395yLiogFNjQLyndLLymvPj/3cNTMHc1GOA+iK4FpQxzaHUfrI mFoA== X-Gm-Message-State: AAQBX9cvWOz1KbhE1ofpoTg+dIgJG6P9uEF6MbvVOrXYbpnGNUf42NhQ U3o6AOL1AVLfsW7ZlQl99pbVAA== X-Received: by 2002:a62:7b8a:0:b0:625:1487:f06c with SMTP id w132-20020a627b8a000000b006251487f06cmr2926744pfc.29.1680632531143; Tue, 04 Apr 2023 11:22:11 -0700 (PDT) Received: from localhost.localdomain ([106.51.184.50]) by smtp.gmail.com with ESMTPSA id o12-20020a056a001bcc00b0062dcf5c01f9sm9018524pfw.36.2023.04.04.11.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Apr 2023 11:22:10 -0700 (PDT) From: Sunil V L <sunilvl@ventanamicro.com> To: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-crypto@vger.kernel.org, platform-driver-x86@vger.kernel.org, llvm@lists.linux.dev Cc: Jonathan Corbet <corbet@lwn.net>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Len Brown <lenb@kernel.org>, Daniel Lezcano <daniel.lezcano@linaro.org>, Thomas Gleixner <tglx@linutronix.de>, Weili Qian <qianweili@huawei.com>, Zhou Wang <wangzhou1@hisilicon.com>, Herbert Xu <herbert@gondor.apana.org.au>, Marc Zyngier <maz@kernel.org>, Maximilian Luz <luzmaximilian@gmail.com>, Hans de Goede <hdegoede@redhat.com>, Mark Gross <markgross@kernel.org>, Nathan Chancellor <nathan@kernel.org>, Nick Desaulniers <ndesaulniers@google.com>, Tom Rix <trix@redhat.com>, "Rafael J . Wysocki" <rafael@kernel.org>, "David S . Miller" <davem@davemloft.net>, Sunil V L <sunilvl@ventanamicro.com> Subject: [PATCH V4 12/23] RISC-V: cpufeature: Avoid calling riscv_of_processor_hartid() Date: Tue, 4 Apr 2023 23:50:26 +0530 Message-Id: <20230404182037.863533-13-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230404182037.863533-1-sunilvl@ventanamicro.com> References: <20230404182037.863533-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762271210077939539?= X-GMAIL-MSGID: =?utf-8?q?1762271210077939539?= |
Series |
Add basic ACPI support for RISC-V
|
|
Commit Message
Sunil V L
April 4, 2023, 6:20 p.m. UTC
riscv_fill_hwcap() finds hartid of each cpu but never really uses
it. So, remove this unnecessary call.
Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
---
arch/riscv/kernel/cpufeature.c | 5 -----
1 file changed, 5 deletions(-)
Comments
On Tue, Apr 04, 2023 at 11:50:26PM +0530, Sunil V L wrote: > riscv_fill_hwcap() finds hartid of each cpu but never really uses > it. So, remove this unnecessary call. "Never uses it" or "never really uses it"? This commit message misses the point though I think - is this here to get the hartid, or is it here to do all the property validation that riscv_of_processor_hartid() does for a cpu node? This was added all the way back in 4.20 in commit 732e8e4130ff ("RISC-V: properly determine hardware caps"). As the loop is a for_each_of_cpu_node(), I don't think this change is actually valid - there's no guarantee that the cpu we are iterating over is actually available and the riscv_of_processor_hartid() check is used to skip "bad" cpus AFAICT. Perhaps I am missing something, I don't think you can do this until you switch the loop to use something that only uses cpus that you know are valid. Cheers, Conor. > Signed-off-by: Sunil V L <sunilvl@ventanamicro.com> > --- > arch/riscv/kernel/cpufeature.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c > index 59d58ee0f68d..63e56ce04162 100644 > --- a/arch/riscv/kernel/cpufeature.c > +++ b/arch/riscv/kernel/cpufeature.c > @@ -91,7 +91,6 @@ void __init riscv_fill_hwcap(void) > char print_str[NUM_ALPHA_EXTS + 1]; > int i, j, rc; > unsigned long isa2hwcap[26] = {0}; > - unsigned long hartid; > > isa2hwcap['i' - 'a'] = COMPAT_HWCAP_ISA_I; > isa2hwcap['m' - 'a'] = COMPAT_HWCAP_ISA_M; > @@ -109,10 +108,6 @@ void __init riscv_fill_hwcap(void) > DECLARE_BITMAP(this_isa, RISCV_ISA_EXT_MAX); > const char *temp; > > - rc = riscv_of_processor_hartid(node, &hartid); > - if (rc < 0) > - continue; > - > if (of_property_read_string(node, "riscv,isa", &isa)) { > pr_warn("Unable to find \"riscv,isa\" devicetree entry\n"); > continue; > -- > 2.34.1 > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv
diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 59d58ee0f68d..63e56ce04162 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -91,7 +91,6 @@ void __init riscv_fill_hwcap(void) char print_str[NUM_ALPHA_EXTS + 1]; int i, j, rc; unsigned long isa2hwcap[26] = {0}; - unsigned long hartid; isa2hwcap['i' - 'a'] = COMPAT_HWCAP_ISA_I; isa2hwcap['m' - 'a'] = COMPAT_HWCAP_ISA_M; @@ -109,10 +108,6 @@ void __init riscv_fill_hwcap(void) DECLARE_BITMAP(this_isa, RISCV_ISA_EXT_MAX); const char *temp; - rc = riscv_of_processor_hartid(node, &hartid); - if (rc < 0) - continue; - if (of_property_read_string(node, "riscv,isa", &isa)) { pr_warn("Unable to find \"riscv,isa\" devicetree entry\n"); continue;