From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EDB8C433F5 for ; Sat, 29 Jan 2022 18:33:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353001AbiA2Scx (ORCPT ); Sat, 29 Jan 2022 13:32:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233178AbiA2Scu (ORCPT ); Sat, 29 Jan 2022 13:32:50 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A03A8C061714; Sat, 29 Jan 2022 10:32:49 -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 3C1D561031; Sat, 29 Jan 2022 18:32:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99DC9C340E5; Sat, 29 Jan 2022 18:32:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643481168; bh=sHO6GimdDcqPPYsNMQBDk7VYsvx7NWX6tUEz2POgf5A=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hQtTt2c3HZTCI64ZRgHV/mWz4TLossUR6GI/6DLuPw6I1jCOzV2Yphol5E9PzzQHE 7S82rFllmhAclNDRRzh2dmQ74VYMUI8OqV4mE91oUmosrH7ig9YN4MET6a4i5bW4zv /oVQ+bB/Iw3AD1hbyUmrc6O7VaJg1yegZYmvJKq4F5zxWjR8uNkI8cYyAMgzyfLvMM SJtv/JXGt3mDDFi7E25cn6Z7QjJ9KfPg1OR3BMlbr1E9IzJCTFgiKYwoQj8xciJg7w LFtpsLfesfpvHpb+OSkRj5plEcCeDz+ntltDxV6SOBixzAgkf/H8dEjDRkwl9FrCyQ qUrKM2BawO3Rw== Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.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 1nDsWk-0043dU-IK; Sat, 29 Jan 2022 18:32:46 +0000 Date: Sat, 29 Jan 2022 18:32:46 +0000 Message-ID: <87r18qxui9.wl-maz@kernel.org> From: Marc Zyngier To: guoren@kernel.org Cc: anup@brainfault.org, tglx@linutronix.de, palmer@dabbelt.com, samuel@sholland.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, Guo Ren Subject: Re: [PATCH V6 2/2] irqchip/sifive-plic: Fixup thead,c900-plic dt parse in opensbi In-Reply-To: <20220129162726.1154501-3-guoren@kernel.org> References: <20220129162726.1154501-1-guoren@kernel.org> <20220129162726.1154501-3-guoren@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: guoren@kernel.org, anup@brainfault.org, tglx@linutronix.de, palmer@dabbelt.com, samuel@sholland.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, guoren@linux.alibaba.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 29 Jan 2022 16:27:26 +0000, guoren@kernel.org wrote: > > From: Guo Ren > > The thead,c900-plic has been used in opensbi to distinguish > PLIC [1]. Although PLICs have the same behaviors in Linux, > they are different hardware with some custom initializing in > firmware(opensbi). > > [1]: https://github.com/riscv-software-src/opensbi/commit/78c2b19218bd62653b9fb31623a42ced45f38ea6 > > Signed-off-by: Guo Ren > Cc: Anup Patel > Cc: Marc Zyngier > Cc: Palmer Dabbelt > Cc: Samuel Holland > Cc: Thomas Gleixner > --- > drivers/irqchip/irq-sifive-plic.c | 25 +++++++++++++++++++++++-- > 1 file changed, 23 insertions(+), 2 deletions(-) > > diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c > index 259065d271ef..245655928076 100644 > --- a/drivers/irqchip/irq-sifive-plic.c > +++ b/drivers/irqchip/irq-sifive-plic.c > @@ -172,7 +172,7 @@ static void plic_irq_eoi(struct irq_data *d) > } > } > > -static struct irq_chip plic_chip = { > +static struct irq_chip sifive_plic_chip = { > .name = "SiFive PLIC", > .irq_mask = plic_irq_mask, > .irq_unmask = plic_irq_unmask, > @@ -182,12 +182,24 @@ static struct irq_chip plic_chip = { > #endif > }; > > +static struct irq_chip thead_plic_chip = { > + .name = "T-Head PLIC", > + .irq_mask = plic_irq_mask, > + .irq_unmask = plic_irq_unmask, > + .irq_eoi = plic_irq_eoi, > +#ifdef CONFIG_SMP > + .irq_set_affinity = plic_set_affinity, > +#endif > +}; For pure entertainment, let's compare the two structures: static struct irq_chip plic_chip = { .name = "SiFive PLIC", .irq_mask = plic_irq_mask, .irq_unmask = plic_irq_unmask, .irq_eoi = plic_irq_eoi, #ifdef CONFIG_SMP .irq_set_affinity = plic_set_affinity, #endif }; Oh wait: a string. Must be really important. Not. > + > +static struct irq_chip *def_plic_chip = &sifive_plic_chip; > + > static int plic_irqdomain_map(struct irq_domain *d, unsigned int irq, > irq_hw_number_t hwirq) > { > struct plic_priv *priv = d->host_data; > > - irq_domain_set_info(d, irq, hwirq, &plic_chip, d->host_data, > + irq_domain_set_info(d, irq, hwirq, def_plic_chip, d->host_data, > handle_fasteoi_irq, NULL, NULL); > irq_set_noprobe(irq); > irq_set_affinity(irq, &priv->lmask); > @@ -396,5 +408,14 @@ static int __init plic_init(struct device_node *node, > return error; > } > > +static int __init thead_c900_plic_init(struct device_node *node, > + struct device_node *parent) > +{ > + def_plic_chip = &thead_plic_chip; > + > + return plic_init(node, parent); > +} > + > IRQCHIP_DECLARE(sifive_plic, "sifive,plic-1.0.0", plic_init); > IRQCHIP_DECLARE(riscv_plic0, "riscv,plic0", plic_init); /* for legacy systems */ > +IRQCHIP_DECLARE(thead_c900_plic, "thead,c900-plic", thead_c900_plic_init); Sorry, but I can't see any point to this patch. M. -- Without deviation from the norm, progress is not possible. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 67137C433EF for ; Sat, 29 Jan 2022 18:33:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=x0yasm+H4apQkygWc62+tisS2ZLUjz5v31rp+FdMP6M=; b=K3k2QfdUYSvrlQ 2X6sJINd+KpyaR1SK8L56xIkc88LuSLMWb44w3E3qiouHj9a6Sb5Ovz8Z7/5TExK5RFqrgN8dzMG1 dVtmkW3kO5mwrg/YX0nWsNoDAMB54FD7Ly3w0ZetA35NT0sDr8/0jsJ2x4ZxV/hSCkRgbsRngqWvb baQPQdoIP+gGzxKdcRwUwg4J02S7RY+6sF/JRQoDWvQgCuhWPE3Ogpxn9DLMqfyqo8iJjCngiK8Qe RY5ATiuCY/2nSKhdezRMT/yKPZuGrCYgfoswPvxkzTZSj6ZJDS3er/SIUW90uScijeS+q7uyfW4/i ug6kSm8nMwvRBWcucQqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDsWs-005HMN-5S; Sat, 29 Jan 2022 18:32:54 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDsWp-005HM3-48 for linux-riscv@lists.infradead.org; Sat, 29 Jan 2022 18:32:52 +0000 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 ams.source.kernel.org (Postfix) with ESMTPS id C839FB827FC; Sat, 29 Jan 2022 18:32:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99DC9C340E5; Sat, 29 Jan 2022 18:32:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643481168; bh=sHO6GimdDcqPPYsNMQBDk7VYsvx7NWX6tUEz2POgf5A=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hQtTt2c3HZTCI64ZRgHV/mWz4TLossUR6GI/6DLuPw6I1jCOzV2Yphol5E9PzzQHE 7S82rFllmhAclNDRRzh2dmQ74VYMUI8OqV4mE91oUmosrH7ig9YN4MET6a4i5bW4zv /oVQ+bB/Iw3AD1hbyUmrc6O7VaJg1yegZYmvJKq4F5zxWjR8uNkI8cYyAMgzyfLvMM SJtv/JXGt3mDDFi7E25cn6Z7QjJ9KfPg1OR3BMlbr1E9IzJCTFgiKYwoQj8xciJg7w LFtpsLfesfpvHpb+OSkRj5plEcCeDz+ntltDxV6SOBixzAgkf/H8dEjDRkwl9FrCyQ qUrKM2BawO3Rw== Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.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 1nDsWk-0043dU-IK; Sat, 29 Jan 2022 18:32:46 +0000 Date: Sat, 29 Jan 2022 18:32:46 +0000 Message-ID: <87r18qxui9.wl-maz@kernel.org> From: Marc Zyngier To: guoren@kernel.org Cc: anup@brainfault.org, tglx@linutronix.de, palmer@dabbelt.com, samuel@sholland.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, Guo Ren Subject: Re: [PATCH V6 2/2] irqchip/sifive-plic: Fixup thead, c900-plic dt parse in opensbi In-Reply-To: <20220129162726.1154501-3-guoren@kernel.org> References: <20220129162726.1154501-1-guoren@kernel.org> <20220129162726.1154501-3-guoren@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") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: guoren@kernel.org, anup@brainfault.org, tglx@linutronix.de, palmer@dabbelt.com, samuel@sholland.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, guoren@linux.alibaba.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220129_103251_487802_0E1FE3E6 X-CRM114-Status: GOOD ( 26.66 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Sat, 29 Jan 2022 16:27:26 +0000, guoren@kernel.org wrote: > > From: Guo Ren > > The thead,c900-plic has been used in opensbi to distinguish > PLIC [1]. Although PLICs have the same behaviors in Linux, > they are different hardware with some custom initializing in > firmware(opensbi). > > [1]: https://github.com/riscv-software-src/opensbi/commit/78c2b19218bd62653b9fb31623a42ced45f38ea6 > > Signed-off-by: Guo Ren > Cc: Anup Patel > Cc: Marc Zyngier > Cc: Palmer Dabbelt > Cc: Samuel Holland > Cc: Thomas Gleixner > --- > drivers/irqchip/irq-sifive-plic.c | 25 +++++++++++++++++++++++-- > 1 file changed, 23 insertions(+), 2 deletions(-) > > diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c > index 259065d271ef..245655928076 100644 > --- a/drivers/irqchip/irq-sifive-plic.c > +++ b/drivers/irqchip/irq-sifive-plic.c > @@ -172,7 +172,7 @@ static void plic_irq_eoi(struct irq_data *d) > } > } > > -static struct irq_chip plic_chip = { > +static struct irq_chip sifive_plic_chip = { > .name = "SiFive PLIC", > .irq_mask = plic_irq_mask, > .irq_unmask = plic_irq_unmask, > @@ -182,12 +182,24 @@ static struct irq_chip plic_chip = { > #endif > }; > > +static struct irq_chip thead_plic_chip = { > + .name = "T-Head PLIC", > + .irq_mask = plic_irq_mask, > + .irq_unmask = plic_irq_unmask, > + .irq_eoi = plic_irq_eoi, > +#ifdef CONFIG_SMP > + .irq_set_affinity = plic_set_affinity, > +#endif > +}; For pure entertainment, let's compare the two structures: static struct irq_chip plic_chip = { .name = "SiFive PLIC", .irq_mask = plic_irq_mask, .irq_unmask = plic_irq_unmask, .irq_eoi = plic_irq_eoi, #ifdef CONFIG_SMP .irq_set_affinity = plic_set_affinity, #endif }; Oh wait: a string. Must be really important. Not. > + > +static struct irq_chip *def_plic_chip = &sifive_plic_chip; > + > static int plic_irqdomain_map(struct irq_domain *d, unsigned int irq, > irq_hw_number_t hwirq) > { > struct plic_priv *priv = d->host_data; > > - irq_domain_set_info(d, irq, hwirq, &plic_chip, d->host_data, > + irq_domain_set_info(d, irq, hwirq, def_plic_chip, d->host_data, > handle_fasteoi_irq, NULL, NULL); > irq_set_noprobe(irq); > irq_set_affinity(irq, &priv->lmask); > @@ -396,5 +408,14 @@ static int __init plic_init(struct device_node *node, > return error; > } > > +static int __init thead_c900_plic_init(struct device_node *node, > + struct device_node *parent) > +{ > + def_plic_chip = &thead_plic_chip; > + > + return plic_init(node, parent); > +} > + > IRQCHIP_DECLARE(sifive_plic, "sifive,plic-1.0.0", plic_init); > IRQCHIP_DECLARE(riscv_plic0, "riscv,plic0", plic_init); /* for legacy systems */ > +IRQCHIP_DECLARE(thead_c900_plic, "thead,c900-plic", thead_c900_plic_init); Sorry, but I can't see any point to this patch. M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv