Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6188009rwr; Mon, 1 May 2023 18:29:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7iv1UmUYrciH1/FyuXyGLO9KrwkEQSY0NDOfEX2hLptxetkxWD48b5BfRHvA4YqGfAKdiV X-Received: by 2002:a17:90a:e646:b0:246:57ba:ab28 with SMTP id ep6-20020a17090ae64600b0024657baab28mr18636972pjb.2.1682990959748; Mon, 01 May 2023 18:29:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682990959; cv=none; d=google.com; s=arc-20160816; b=WE077Ad/n7gZSHmHVUuSD2Y6MZeiq3KkVWhjqCJiORwJYWbQY70AswqGBSSf7k99mG VauLEGMGLtTzhveFuBgABx2woWSPM7lPaMXiRboZ2lFlPXLI7MgU8X+hcw3FQhyOaqd1 4ZgLoMMUMcPyLgikkKeP0hjG5IgKRI58FtaQNcWDW8o5hhVuY6fhLS1MVqGcu9cBtgDn oEN/AboKEwCAMC3x7q5oCLuTZ1aKuY78sjXeRahytcx1YT3YETw781/LDzSYrZw7TAbR +TvtrjqL+hD1hpM83zJVVEMl1wIqgkd+tj+u3pmZyvTNO9FUxbHN2jSZQUfSF/Vpqsfx jWLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7mVH6+bWUcuKUF/qKwIgPR0gD6lIVpcYINT4JISpC94=; b=SQZJMqeSQHmms6hQc2GkzcRiYU/8m/6I7Hdwo15a7QGrSDAxIF4C2NzqXW9Y8RGCpu JtV5p17qHuuC0dXQpESSfQUXQp7B+VTCNhrz+FHGTdzOgWUpJK9AhsMqKKZKYEwram48 o6y9obR1zT6156bf07LZ7H7a/rl0rtl3r7a43QONoiEFhcNYEWySgGl/ZmvckyCvV06H 8CnckcWUi3kxO5N6oqo4np3YD6dwyAFtBElF0jKtPs2VakoLEywSX1TnylkM1T6JON+/ lSpkZqu9Wh0ajLIK/6MB51ZlPnCedc1Q9ya/Se3q3s5P45Anj6hRva7fkjAz9Tlvn6wZ Zzmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=P9fppIss; 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 v13-20020a17090a520d00b0024e29660f61si358159pjh.90.2023.05.01.18.29.05; Mon, 01 May 2023 18:29:19 -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=P9fppIss; 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 S231799AbjEBB23 (ORCPT + 99 others); Mon, 1 May 2023 21:28:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232267AbjEBB21 (ORCPT ); Mon, 1 May 2023 21:28:27 -0400 Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4E8B1FD8 for ; Mon, 1 May 2023 18:28:25 -0700 (PDT) Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-1924a23ddb7so11644403fac.0 for ; Mon, 01 May 2023 18:28:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1682990905; x=1685582905; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=7mVH6+bWUcuKUF/qKwIgPR0gD6lIVpcYINT4JISpC94=; b=P9fppIss2OxfjULIXvdy+dUX9w7PEVRop13j86caNUW0bBs6C3/wQSOOYO3cSMJtjc ihPHtbEIVh4by3RpqOVqh6TeH5TRE4WC6Co4o4k3dMbyB0lgaMEEGof1fwKOkTEK1glf AuFI2se8mKywLPekgTqxP320UZ0MMV0U29UiLdWUptUQubbBRYA1uinapXGRIR2IvQiD 7lNS1CY5aalCpYBAShhxplpZZSpD2DKbUWgbHpZEn8cVN9e8x5T4y2vxao2EkDWbh7pS G4QZTcE6knoEB0E870EGK119fD4LHTea7plc+p6aDdf+8XHQSeTfxb3VXfJShGGoXlmp iT3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682990905; x=1685582905; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=7mVH6+bWUcuKUF/qKwIgPR0gD6lIVpcYINT4JISpC94=; b=bFJgOmwi4A1fefV9G2tlMtl4C15vpnM3FMAgwLK94o0mZ3A4Zd/W4GVRL2DLkrSzdt hYPNuyvDotnI1l/DqmC17h/FGnrkf3WGbu3H6hjlFzS1Amtzkt3Xc6y+Yim5xF1qAZr0 WD++fZIyqFFVFAB+HtGM92x0k6QunF7OlnduID8r7ScDq6YdBCrH+FVCvxUaxn6BBqBV l03sIwdqdQFpwTRJXlNvPhm1WIAbqTWtRLNbSEAfmbqsMEOUMzpzoozo9GHjHHMtoCC7 xYu3wGy6ezaRiVajxDblhg62QaZVdBjmfULDuLCI/8/kFvZe4kEhwsB3+CwsghiGUW09 M1YQ== X-Gm-Message-State: AC+VfDwHFwMBLVmAk7vBfwe/d1e/yWunwX5STmgwxqVh512oElvyx81J QqOdDSWQk+HSI1pDUtHGceEAsw== X-Received: by 2002:a05:6808:8f1:b0:38e:467f:fee3 with SMTP id d17-20020a05680808f100b0038e467ffee3mr6754306oic.29.1682990904854; Mon, 01 May 2023 18:28:24 -0700 (PDT) Received: from sunil-laptop ([2409:4071:6e87:a073:45c:9455:55ad:4703]) by smtp.gmail.com with ESMTPSA id p203-20020acaf1d4000000b0038cabfcb3ccsm12099517oih.15.2023.05.01.18.28.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 May 2023 18:28:24 -0700 (PDT) Date: Tue, 2 May 2023 06:58:07 +0530 From: Sunil V L To: Conor Dooley Cc: 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, Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Len Brown , Daniel Lezcano , Thomas Gleixner , Weili Qian , Zhou Wang , Herbert Xu , Marc Zyngier , Maximilian Luz , Hans de Goede , Mark Gross , Nathan Chancellor , Nick Desaulniers , Tom Rix , "Rafael J . Wysocki" , "David S . Miller" , "Rafael J . Wysocki" , Andrew Jones Subject: Re: [PATCH V4 13/23] RISC-V: cpufeature: Add ACPI support in riscv_fill_hwcap() Message-ID: References: <20230404182037.863533-1-sunilvl@ventanamicro.com> <20230404182037.863533-14-sunilvl@ventanamicro.com> <20230429-voucher-tutor-715fd4f6c24e@spud> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230429-voucher-tutor-715fd4f6c24e@spud> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 29, 2023 at 11:31:20AM +0100, Conor Dooley wrote: > Hey Sunil, > > On Tue, Apr 04, 2023 at 11:50:27PM +0530, Sunil V L wrote: > > > @@ -103,14 +109,36 @@ void __init riscv_fill_hwcap(void) > > > > bitmap_zero(riscv_isa, RISCV_ISA_EXT_MAX); > > > > - for_each_of_cpu_node(node) { > > + if (!acpi_disabled) { > > + status = acpi_get_table(ACPI_SIG_RHCT, 0, &rhct); > > + if (ACPI_FAILURE(status)) > > + return; > > + } > > + > > + for_each_possible_cpu(cpu) { > > unsigned long this_hwcap = 0; > > DECLARE_BITMAP(this_isa, RISCV_ISA_EXT_MAX); > > const char *temp; > > > > - if (of_property_read_string(node, "riscv,isa", &isa)) { > > - pr_warn("Unable to find \"riscv,isa\" devicetree entry\n"); > > - continue; > > + if (acpi_disabled) { > > + node = of_cpu_device_node_get(cpu); > > + if (node) { > > + rc = of_property_read_string(node, "riscv,isa", &isa); > > + of_node_put(node); > > + if (rc) { > > + pr_warn("Unable to find \"riscv,isa\" devicetree entry\n"); > > + continue; > > + } > > + } else { > > + pr_warn("Unable to find cpu node\n"); > > + continue; > > I was poking at this the last few days and went back to look at the ACPI > code again. Is there a reason we don't do early-return here? IOW: > > node = of_cpu_device_node_get(cpu); > if (!node) { > pr_warn() > continue; > } > > rc = of_property_read_string(node, "riscv,isa", &isa); > of_node_put(node); > if (rc) { > pr_warn(); > continue; > } > This looks better. Will update when I send the next revision of the series. Thank you!, Conor.