Message ID | 20231003044403.1974628-2-apatel@ventanamicro.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp1853456vqb; Mon, 2 Oct 2023 21:45:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHwq/4QDClzJ9EPLDUspOxqEMaQiDtSDf3pzZvtx0Rmgz2CuYhuk25q3B3v/xPqgR8qWbBK X-Received: by 2002:a05:6a21:8182:b0:161:2508:b0fd with SMTP id pd2-20020a056a21818200b001612508b0fdmr10498032pzb.19.1696308310025; Mon, 02 Oct 2023 21:45:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696308310; cv=none; d=google.com; s=arc-20160816; b=zt909r8In8IJM8Vjc++IO13SleQgztrmJYtUJfYh2J8q3B60LVewqz0Le5fUAv2qc4 eizq6YjIjRRdugxOvZRiedZEk5aouNxnHWae80lx+bTQ2VPCuxpyoJcnpmbVI+g+sONT 9uw+jo9pEvBl+jd+T3FO8ltADYvS+XjzYl8dKbBKiGRcfDfL+eFh8eY1f5s9KBgyoiP6 vS4zGZ9YdHSgg/aeF3rFn5edtoo8Uhiaos4m1hcbfpDDSfN7wDxcazgwLI3zHqnyy+Zi m1Q+SmHTwX1HL+w9hIb8gy+GHwQPeir5G2NHrFTKpEJ8VeVgAUP6wknblHzDmMA4hFzC FNbw== 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=SYhetJOGeGWONv0pBZCT4Mywf3EBvVtv+lOqGOUogJM=; fh=PAZPsFsa9jQyIATJnzpooD5UQJPM5J9eK5udTear3XQ=; b=lthBLK0Att3JeEtPlONdt5lCeGHK9fvHcFz5r9h3ICWs3MPw58ow3yDDn3SrCHen0J bt2vyJ9WRZ1goTUA/T/sibnI33EIwdLEl0NbGRRx2XUBFUBsTWiq220eO7XwUh7WqjPw KQY9EiRUeO1DP+97GZFBC0AYbK78uhRm4QzN7GkiblTWu5GpM74yIGQ5CDLfiPDth3MK xH5fAD6vNiUP7BLF8GrZ5YIGz89UEadFE9Xgf01e0t/kjfyjNl5EZfP0dXv8zmwVb8uV fxmDMIiYPKnwboCat1FPAEOocVbjcqS9okqmv/dT+EMdWQUVQP6BXIuOpz4TSmhQQhTJ bgoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=MGWqBN++; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id km3-20020a17090327c300b001b9fb999147si604388plb.89.2023.10.02.21.45.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 21:45:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=MGWqBN++; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5BCE880EA958; Mon, 2 Oct 2023 21:45:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239080AbjJCEoo (ORCPT <rfc822;pusanteemu@gmail.com> + 18 others); Tue, 3 Oct 2023 00:44:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbjJCEol (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 3 Oct 2023 00:44:41 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3403A4 for <linux-kernel@vger.kernel.org>; Mon, 2 Oct 2023 21:44:38 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-692ada71d79so359914b3a.1 for <linux-kernel@vger.kernel.org>; Mon, 02 Oct 2023 21:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1696308278; x=1696913078; darn=vger.kernel.org; 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=SYhetJOGeGWONv0pBZCT4Mywf3EBvVtv+lOqGOUogJM=; b=MGWqBN++F1Hxu97r99D7yTvRrzn25Xi2XUOhljOaG0Jn2ct8pFRXnLb2vA/phH22Fk SlJ7LxABDa4uLDocC99oP7xYLHUFc0mAaIe4EjR5jPuKwPM8TAIWg+9EKV/eEbBYeWKA Y93lJK4AIy76U+oFHhitEOfbznFHhYlzoxxf0RhvOiRnbTFhX716uf/rCiERaaU+Abiz +6r3/2ESNOPtUVOriAEIhBLX2j48xr8AvLX3b+Dzb72DA+PLRrJRdRkFRH2QAM4INhzx L3xCblEQ0p3w5yS66ipFW0mIPYvoZ2GWwDJn542lq4hsbfm/RVz3z4I4KnCYXKAA1V+C HyJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696308278; x=1696913078; 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=SYhetJOGeGWONv0pBZCT4Mywf3EBvVtv+lOqGOUogJM=; b=fYc5XaRCuJjGa9ao9x8TJSSd2nm6RjX9xyqG+jHhUYshebUIrG7RrKE2/MTi4hLShj fP/OXyf1YlQ2SfjcUjSNgtD3EkuI9PytPs93vpf3cWhrlWbmKx3V2D6FqsBj1RGTPSMA 5mxjW4jzy3zjx+X1MNCRreHOUVr9b87O9jwDEtbgCa2uByE/IOpMreq11BOB16jNntE/ dLQd+i2yeFSN5n+7TksIgIlmb8qsk6XPitABvnL8m+3FRply0TX+gAeDlFY9l6trpWEA 4NjA7OTY5jZjnII5nP11znmqQ+UvprywZAWdR4LHWBQvYQdzNNnKBB/mw/TjgGvJm9b2 giuA== X-Gm-Message-State: AOJu0YyVzKGguAAOQuvMbnnkBWggr57vCNen69ThhPwZU3ZZWKwUWlda qb9HSuKy7xE8BIyeimR8QiezWg== X-Received: by 2002:a05:6a00:c92:b0:68c:69ca:2786 with SMTP id a18-20020a056a000c9200b0068c69ca2786mr13194905pfv.34.1696308278346; Mon, 02 Oct 2023 21:44:38 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([171.76.84.132]) by smtp.gmail.com with ESMTPSA id h9-20020aa786c9000000b0068e49cb1692sm346421pfo.1.2023.10.02.21.44.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 21:44:37 -0700 (PDT) From: Anup Patel <apatel@ventanamicro.com> To: Palmer Dabbelt <palmer@dabbelt.com>, Paul Walmsley <paul.walmsley@sifive.com>, Thomas Gleixner <tglx@linutronix.de>, Marc Zyngier <maz@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Frank Rowand <frowand.list@gmail.com>, Conor Dooley <conor+dt@kernel.org> Cc: Atish Patra <atishp@atishpatra.org>, Andrew Jones <ajones@ventanamicro.com>, Sunil V L <sunilvl@ventanamicro.com>, Saravana Kannan <saravanak@google.com>, Anup Patel <anup@brainfault.org>, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anup Patel <apatel@ventanamicro.com>, Atish Patra <atishp@rivosinc.com> Subject: [PATCH v10 01/15] RISC-V: Don't fail in riscv_of_parent_hartid() for disabled HARTs Date: Tue, 3 Oct 2023 10:13:49 +0530 Message-Id: <20231003044403.1974628-2-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231003044403.1974628-1-apatel@ventanamicro.com> References: <20231003044403.1974628-1-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 02 Oct 2023 21:45:05 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778708182044094874 X-GMAIL-MSGID: 1778708182044094874 |
Series |
Linux RISC-V AIA Support
|
|
Commit Message
Anup Patel
Oct. 3, 2023, 4:43 a.m. UTC
The riscv_of_processor_hartid() used by riscv_of_parent_hartid() fails for HARTs disabled in the DT. This results in the following warning thrown by the RISC-V INTC driver for the E-core on SiFive boards: [ 0.000000] riscv-intc: unable to find hart id for /cpus/cpu@0/interrupt-controller The riscv_of_parent_hartid() is only expected to read the hartid from the DT so we should directly call of_get_cpu_hwid() instead of calling riscv_of_processor_hartid(). Fixes: ad635e723e17 ("riscv: cpu: Add 64bit hartid support on RV64") Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Atish Patra <atishp@rivosinc.com> --- arch/riscv/kernel/cpu.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index c17dacb1141c..157ace8b262c 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -125,13 +125,14 @@ int __init riscv_early_of_processor_hartid(struct device_node *node, unsigned lo */ int riscv_of_parent_hartid(struct device_node *node, unsigned long *hartid) { - int rc; - for (; node; node = node->parent) { if (of_device_is_compatible(node, "riscv")) { - rc = riscv_of_processor_hartid(node, hartid); - if (!rc) - return 0; + *hartid = (unsigned long)of_get_cpu_hwid(node, 0); + if (*hartid == ~0UL) { + pr_warn("Found CPU without hart ID\n"); + return -ENODEV; + } + return 0; } }