Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3662559pxb; Mon, 21 Feb 2022 03:07:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJxwdWW77/lhIot/6y8BxhsPgL0A6jqBVaRdv4Y3JA7w9VyP9b0rzLA46KjB0uWeyYKI6Ynu X-Received: by 2002:a05:6402:424b:b0:40f:1386:5fa6 with SMTP id g11-20020a056402424b00b0040f13865fa6mr20842545edb.268.1645441639138; Mon, 21 Feb 2022 03:07:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645441639; cv=none; d=google.com; s=arc-20160816; b=Jh4Wya0MJZheQmNvtIr6BjvwPssFfloe2mbw29rnCkr3EFdRGHlgwHhvyx09vypBxv WrkPdtDpdgrICdHCBFtUeQm1YTKZwufNkE383GvvY95K6n6Kw19bDiI+Nz4PUbIdbJQA bUCyx9Tfo53IoMO4mPfHSixI1DV+CO6pJmM7yXQLOB2/2KQzvLxP5hcThkCPZ4uk5NiH Ut5IR3nIMolQff9Fz+5bm7iOJbM5EEcxjukFzdu9XAqOoheuP5oKIC+BMv5wiUb0WgRa sfapjw7H8vG0f+bTeIMxiSE4OhNLuSnlUonNYl2eYfq7FkuRz+YbeBf2c42sC33uPyUW gwiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=NDnayBoadQPFPphtuATndP70faQu8HlR0S9IvQ/OyGI=; b=M1IbaR+Z8cnv4HqGqh/1k/zzjT8INhrHtFfwH/sWE2UMtAM5F4iBlkd5a6WJr9jk// rU0qQZ0zNii5JbGBZGBIVXeWqG14EKIO+fA4MRlLr0qIlFOLRtscT3ldfZmwj4z+34hm NPdNSTWWIVWYrMtToKTuDm55HAQQKv1BwAJCeM6Vev16+Z/4rJQtqm5FtH/MP/g9ROde sakWjvy4iiBsZI99irs931XvnSIQWXEQOtWGyvpExk/IYLF1/BsfsOqa2nzEcbnyEYQj YF8d9f5arnZpsqu1lsjexftcNzuZsVAFJdJOLim2SFsT9UXaREL18Ez1LIKmpOsGFf92 N1Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="V/GH8/s4"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z23si3682935ejx.877.2022.02.21.03.06.56; Mon, 21 Feb 2022 03:07:19 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b="V/GH8/s4"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355247AbiBUKqV (ORCPT + 99 others); Mon, 21 Feb 2022 05:46:21 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:39536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355230AbiBUKpm (ORCPT ); Mon, 21 Feb 2022 05:45:42 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEF9762F8 for ; Mon, 21 Feb 2022 02:06:36 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1107460C11 for ; Mon, 21 Feb 2022 10:06:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7906BC340E9; Mon, 21 Feb 2022 10:06:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645437995; bh=EAg8qRnojnOG9Klcio4JVQSoeMM7BiVD8rhDZqhOPTA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=V/GH8/s4qiWDxM0W3kR+h/+jjuT+XDRZJzuf8NykEjP8KSWvnR/dKOakQBwy/O+w/ 7DItrH5EcNbUmMmrpWkAOKVtKwLpdL3DcKZv4dwslR5YZTn91eXlyp6IJAgjgfXUsU ZOsm/7HIsELjXGT5ZGUH/CYEtZMZjgsTIEX1CQC9ASvqjApHwukq1HPtFcQQeU1OFL o8DyNv/qJwJNgOkKWzxSQHr6aw0P/jV+hBUpXeT7YYQvPBQAKozfEG57abiVgH5nC7 ussqV3e0XFqgRC2JrA2R6nYdGrsF58WTZeH2v3/DJNHvGGge+z1eyGzK1yzFmrkCUQ UXJXxlUbxZ6Aw== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nM5aT-009FuI-J8; Mon, 21 Feb 2022 10:06:33 +0000 Date: Mon, 21 Feb 2022 10:06:33 +0000 Message-ID: <87bkz04jpy.wl-maz@kernel.org> From: Marc Zyngier To: Anup Patel Cc: Anup Patel , Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Daniel Lezcano , Atish Patra , Alistair Francis , linux-riscv , "linux-kernel@vger.kernel.org List" Subject: Re: [PATCH v3 2/6] irqchip/riscv-intc: Allow drivers to directly discover INTC hwnode In-Reply-To: References: <20220220050854.743420-1-apatel@ventanamicro.com> <20220220050854.743420-3-apatel@ventanamicro.com> <87czjg4kf4.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: anup@brainfault.org, apatel@ventanamicro.com, palmer@dabbelt.com, paul.walmsley@sifive.com, tglx@linutronix.de, daniel.lezcano@linaro.org, atishp@atishpatra.org, Alistair.Francis@wdc.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Mon, 21 Feb 2022 09:55:05 +0000, Anup Patel wrote: > > On Mon, Feb 21, 2022 at 3:21 PM Marc Zyngier wrote: > > > > On Sun, 20 Feb 2022 05:08:50 +0000, > > Anup Patel wrote: > > > > > > Various RISC-V drivers (such as SBI IPI, SBI Timer, SBI PMU, and > > > KVM RISC-V) don't have associated DT node but these drivers need > > > standard per-CPU (local) interrupts defined by the RISC-V privileged > > > specification. > > > > > > We add riscv_get_intc_hwnode() in arch/riscv which allows RISC-V > > > drivers not having DT node to discover INTC hwnode which in-turn > > > helps these drivers to map per-CPU (local) interrupts provided > > > by the INTC driver. > > > > > > Signed-off-by: Anup Patel > > > --- > > > arch/riscv/include/asm/irq.h | 4 ++++ > > > arch/riscv/kernel/irq.c | 19 +++++++++++++++++++ > > > drivers/irqchip/irq-riscv-intc.c | 7 +++++++ > > > 3 files changed, 30 insertions(+) > > > [...] > > > index b65bd8878d4f..fa24ecd01d39 100644 > > > --- a/drivers/irqchip/irq-riscv-intc.c > > > +++ b/drivers/irqchip/irq-riscv-intc.c > > > @@ -92,6 +92,11 @@ static const struct irq_domain_ops riscv_intc_domain_ops = { > > > .xlate = irq_domain_xlate_onecell, > > > }; > > > > > > +static struct fwnode_handle *riscv_intc_hwnode(void) > > > +{ > > > + return (intc_domain) ? intc_domain->fwnode : NULL; > > > +} > > > > This makes no sense. Either you have found the interrupt controller > > and allocated the domain, or you haven't. But you don't register a > > callback without having found it. > > We are registering this callback after creating the INTC domain. Then why are you checking for intc_domain being NULL? > > And you have totally ignored my previous comments about the multitude > > of irq domains for the INTC. Either you get rid of all but one and you > > can register a single fwnode, or you stay with what you have today, > > Only the INTC DT nodes are per-CPU but we are creating only one > INTC domain to manage per-CPU IRQs across all CPUs. Ah, there is this guard that is only valid on the boot CPU. Fair enough. M. -- Without deviation from the norm, progress is not possible.