Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp967389rdh; Fri, 27 Oct 2023 00:13:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHlx/zkqQz2Up85r1NpBsjTDJR/P+zbO4NaVsBu5bkGIgOjppsiWpLExjq0H8Qu3FFUfvyG X-Received: by 2002:a05:6808:19a9:b0:3b2:f173:bc8 with SMTP id bj41-20020a05680819a900b003b2f1730bc8mr2185456oib.10.1698390798711; Fri, 27 Oct 2023 00:13:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698390798; cv=none; d=google.com; s=arc-20160816; b=0EsYdO/KLLQ37mAwhePmGZF/0bedE4Ek9oB6+GGVwggBXRl1oRjypNxiKbKVl3tKy0 dwp5xHSRVwhZtKx18sK/SVUkcwR5F9k4U+TEXypJ/KUSZiPmjq/swqXnznSzCdyR4bPp lMCBWug/OAyzeNrMMVnDXRjmBGgtLCGLS9Q+DV7Rv9ciQxu8tSbmd+AMASJWMEGz/GE8 kePUjneLzzELuIWtQFvA/Z9AMXsJ4Vn3nbFWnkAwrwHgPaUmfWymjOY+kJ1Ej+U1XvvA 0c012l76uQSDF4DLv7OaVedroUjo+K/wM4uJipE46cGhsVWRoTiLJ8in+OxpVpLdmGkl 6Qng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:to:dkim-signature:dkim-signature:from; bh=48pzFigEfE7Y5axy5bcPf8T1YrV6Mt9jdZdUUrCruyY=; fh=eXOjxMbbxq/GxBOE+xHNF03eTiX1a0jFct2um8lgIes=; b=otvDMdx3O2olUNiFjtwlcBQuxdwHxGFYrzF03dhpIXEd5X4+Vd5qbj3yTEwqlJSN64 idLAv+mvDqond3JRUJzFBpF0J6VK715bhxgF8fXp/Pq9DXp4RGiq0af+qRZiho9r77eT ZdoBJjdqK/CltcHdaD4+n467+7aEDKfJ06Z0SsSvRxRmmgLTz7Px+fMt19eD+Atba7nw sprE/3eobIqbp4vf7GuRBZ8DTuv/fZTYuWLKDPOs6kCYW7DS3Kd8Wum9TsSCp2AhLWZU zcxRYTPkQXa3dts74LAEhNFcK/HvdTJKp/GHctJtAs6d1Ej2UD73fe79qpVShlpHHpzm Qkxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=XCkoYDbb; dkim=neutral (no key) header.i=@linutronix.de header.b=0GPEJyc9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id p67-20020a25d846000000b00d7b295f40ffsi1782511ybg.632.2023.10.27.00.13.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 00:13:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=XCkoYDbb; dkim=neutral (no key) header.i=@linutronix.de header.b=0GPEJyc9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id BD85580ACEFB; Fri, 27 Oct 2023 00:13:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345356AbjJ0HNF (ORCPT + 99 others); Fri, 27 Oct 2023 03:13:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229590AbjJ0HND (ORCPT ); Fri, 27 Oct 2023 03:13:03 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F94A1AA; Fri, 27 Oct 2023 00:13:01 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1698390779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=48pzFigEfE7Y5axy5bcPf8T1YrV6Mt9jdZdUUrCruyY=; b=XCkoYDbbxdX8izcFbwr8Eqjrpz/IiZy9OFMLMIUw7C3IcXXWldxRkgIF+qkBVvurs9azkC VRBfNjf3U2uU3Jr8NS35HosDFVl2KEJOdkmzgT9QALLmizg63zjmrVpQKRGlgpTY4frTm8 tGyF8vIaxbs1mBQcAqrBDz1DsKqhfOd66TLWMZ6oamJ34XQm3KEY8iOPyKm4cS5VgSpi7A JOLEKuh3/xAr+LDy+DBDr/iitqpzDIOye3l2r0AWUbvyp9HkLKdOwyuM7rr9EeGLVwxoaM Qn2NGk7BqG3q0DvssdOQ+/CSlNLrYVOhnNTxhmYe6VpKA27BQW0zdYsOBVQ0/A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1698390779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=48pzFigEfE7Y5axy5bcPf8T1YrV6Mt9jdZdUUrCruyY=; b=0GPEJyc9w2S/lUYqu7AA2vKxe6BhOXt+9gTUXhCjKjqqzZFEPd3MBo+FLJYfoWdVvHFdQ4 OUu9Wdk8ZnijuBDQ== To: Yu Chien Peter Lin , acme@kernel.org, adrian.hunter@intel.com, ajones@ventanamicro.com, alexander.shishkin@linux.intel.com, andre.przywara@arm.com, anup@brainfault.org, aou@eecs.berkeley.edu, atishp@atishpatra.org, conor+dt@kernel.org, conor.dooley@microchip.com, conor@kernel.org, devicetree@vger.kernel.org, dminus@andestech.com, evan@rivosinc.com, geert+renesas@glider.be, guoren@kernel.org, heiko@sntech.de, irogers@google.com, jernej.skrabec@gmail.com, jolsa@kernel.org, jszhang@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-sunxi@lists.linux.dev, locus84@andestech.com, magnus.damm@gmail.com, mark.rutland@arm.com, mingo@redhat.com, n.shubin@yadro.com, namhyung@kernel.org, palmer@dabbelt.com, paul.walmsley@sifive.com, peterlin@andestech.com, peterz@infradead.org, prabhakar.mahadev-lad.rj@bp.renesas.com, rdunlap@infradead.org, robh+dt@kernel.org, samuel@sholland.org, sunilvl@ventanamicro.com, tim609@andestech.com, uwu@icenowy.me, wens@csie.org, will@kernel.org, ycliang@andestech.com Subject: Re: [RFC PATCH v3 RESEND 02/13] irqchip/riscv-intc: Allow large non-standard hwirq number In-Reply-To: <20231023004100.2663486-3-peterlin@andestech.com> References: <20231023004100.2663486-1-peterlin@andestech.com> <20231023004100.2663486-3-peterlin@andestech.com> Date: Fri, 27 Oct 2023 09:12:59 +0200 Message-ID: <87a5s44jyc.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-0.8 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 howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 27 Oct 2023 00:13:16 -0700 (PDT) On Mon, Oct 23 2023 at 08:40, Yu Chien Peter Lin wrote: > Currently, the implementation of the RISC-V INTC driver uses the > interrupt cause as hwirq and has a limitation of supporting a > maximum of 64 hwirqs. However, according to the privileged spec, > interrupt causes >= 16 are defined for platform use. > > This limitation prevents us from fully utilizing the available > local interrupt sources. Additionally, the hwirqs used on RISC-V > are sparse, with only interrupt numbers 1, 5 and 9 (plus Sscofpmf > or T-Head's PMU irq) being currently used for supervisor mode. > > The patch switches to using irq_domain_create_tree() which git grep "This patch" Documentation/process/ > creates the radix tree map, allowing us to handle a larger > number of hwirqs. Who is 'us'? We are not part of the chip and please write out 'hardware interrupts' > @@ -24,10 +24,8 @@ static asmlinkage void riscv_intc_irq(struct pt_regs *regs) > { > unsigned long cause = regs->cause & ~CAUSE_IRQ_FLAG; > > - if (unlikely(cause >= BITS_PER_LONG)) > - panic("unexpected interrupt cause"); > - > - generic_handle_domain_irq(intc_domain, cause); > + if (generic_handle_domain_irq(intc_domain, cause)) > + pr_warn("Failed to handle interrupt (cause: %ld)\n", cause); pr_warn_once() or at least pr_warn_ratelimited(). > } > > /* > @@ -117,8 +115,8 @@ static int __init riscv_intc_init_common(struct fwnode_handle *fn) > { > int rc; > > - intc_domain = irq_domain_create_linear(fn, BITS_PER_LONG, > - &riscv_intc_domain_ops, NULL); > + intc_domain = irq_domain_create_tree(fn, &riscv_intc_domain_ops, > + NULL); Put it into one line. Linebreaking arguments is really only required when the line length is exceedingly long. This one is not.