Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1441031pxb; Wed, 20 Oct 2021 05:18:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx65/gFTyTzKH/BebFjVTxFPeIJUcVKwxuDhSHTQzSpfMQTcaa/0tcUZYx3R86d4zRw51Ej X-Received: by 2002:a05:6402:3554:: with SMTP id f20mr63094386edd.210.1634732298848; Wed, 20 Oct 2021 05:18:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634732298; cv=none; d=google.com; s=arc-20160816; b=vaq5HqE590IaXHhzmTiL9DQ65EGa599WkY4epddMmeJKpKP6oW3AqPFRuzyKJQhhs/ OPx/7ePASex/hMIxTih4WOIHysVTSS544SG9QHu/LlkeXMI6aXaMr+NCDCD/d86rCU3U UbLzjdz0oxP5jA6I8CYv2zz+fbWTPH7Rm+cGQ4vLciSMX1YLfz1wRGKGfXJYhqc9SiEG UhTyHfH2//ieFHAcbUG0Kb4bJ9Lr2MtcM2joTbNw0nPdwfmzooaMvXnRSPEUfDy4+yYu q+1wR+uP4044gHIDVWysglOdkK1I3eC+Y3Kmie4xAIVi0USWmfwqgnDgT+DJr73UsxDO /6HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=MghmPOj+7Vawb059TFQ6V/LmaCJP+eYNL/GRNVpbKJ8=; b=R+sUSWmNI/vBlW187tHeTCE4n98ZuQBRkEv2wGmYcEKv8o3bLLCAFgV7QaFIiyHSpE TgJvfqjb7M0XBt12EKlz3iAb36clAcnPCY0tPPiIHeSGVPlGBWlvWmy2iGfRNbHyBzdQ 5YObxS7X+vgeRJ5wqzTc85Fd/do7xG7LZprO2t6OMFcMW6r6eArqPZZo7XUAvPTCsBkN vdowI2O2UXAdeI6/aCL6V23hyLXKfIioHSopNOVB3qLEkxoiqtwyd0ss8i1eBtMd7QjQ +kDCBqJ4jhyURb7FVh8INn9TGlhzo5H64zAh8MoCqYZWF0HcVD+AmdfWpMreYvU3Zta9 EG6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iuOI3sZb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l4si4022161edj.282.2021.10.20.05.17.54; Wed, 20 Oct 2021 05:18:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iuOI3sZb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S230225AbhJTMR3 (ORCPT + 99 others); Wed, 20 Oct 2021 08:17:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:45814 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230174AbhJTMR1 (ORCPT ); Wed, 20 Oct 2021 08:17:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C854E6135E for ; Wed, 20 Oct 2021 12:15:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634732112; bh=k+9pFl2EGHVkIkPj7tUtcCPSW2gtLYiSKVjDm4JVkcM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=iuOI3sZblwYTQqrsuaZukaA2vfbgksh7XuU3Gjr4U32HzN50JZWkPu3E/h16zjWSu vvSD0ZIljbmTjUw3FxteIkzJm/Ay5NskuNWzpagQWYym7/P2dpzo5JRrd78LS6XLy7 bib6YJsANMbIR5mvT/88q6GQiuR8OTCtxn/xj5iNhiXflzjPcoyqthW1NOze1tW/x0 g84jZqKuzTtND8bvZA54YjpXds9thwwg4E3SCtxs5jivFOfU5ae0nugRG2F0/fuJW6 +2VILqxclL2nWQZGyg0rSICuiMZhyQxrgnZ/SIr4Cr/xvho6VxRJ8q1RC1U7Ek79zD T47wcaTx+aY0A== Received: by mail-ua1-f48.google.com with SMTP id r17so6139924uaf.8 for ; Wed, 20 Oct 2021 05:15:12 -0700 (PDT) X-Gm-Message-State: AOAM530p/0sDMmUiqDPlGmNRovOWEcOWcKvVmfvyTsQLiSuMhT9/yFPU 5ASTAAomlnGrglpdDdRFI5PfV3XjmC/fL8t8+pA= X-Received: by 2002:a05:6102:32cd:: with SMTP id o13mr42529588vss.50.1634732111782; Wed, 20 Oct 2021 05:15:11 -0700 (PDT) MIME-Version: 1.0 References: <20211016032200.2869998-1-guoren@kernel.org> <2216787.nSqPeTNalD@phil> <1708236.01x493v0YS@phil> In-Reply-To: <1708236.01x493v0YS@phil> From: Guo Ren Date: Wed, 20 Oct 2021 20:15:01 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V4 2/3] dt-bindings: update riscv plic compatible string To: Heiko Stuebner Cc: Anup Patel , Atish Patra , Marc Zyngier , Thomas Gleixner , Palmer Dabbelt , Rob Herring , Linux Kernel Mailing List , linux-riscv , Guo Ren , Palmer Dabbelt Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 17, 2021 at 12:31 AM Heiko Stuebner wrote: > > Am Samstag, 16. Oktober 2021, 14:56:51 CEST schrieb Guo Ren: > > On Sat, Oct 16, 2021 at 6:35 PM Heiko Stuebner wrote: > > > > > > Hi Guo, > > > > > > Am Samstag, 16. Oktober 2021, 05:21:59 CEST schrieb guoren@kernel.org: > > > > From: Guo Ren > > > > > > > > Add the compatible string "thead,c900-plic" to the riscv plic > > > > bindings to support allwinner d1 SOC which contains c906 core. > > > > > > The compatible strings sound good now, but some things below > > > > > > > > > > > Signed-off-by: Guo Ren > > > > Cc: Rob Herring > > > > Cc: Palmer Dabbelt > > > > Cc: Anup Patel > > > > Cc: Atish Patra > > > > > > > > --- > > > > > > > > Changes since V4: > > > > - Update description in errata style > > > > - Update enum suggested by Anup, Heiko, Samuel > > > > > > > > Changes since V3: > > > > - Rename "c9xx" to "c900" > > > > - Add thead,c900-plic in the description section > > > > --- > > > > .../interrupt-controller/sifive,plic-1.0.0.yaml | 11 ++++++++++- > > > > 1 file changed, 10 insertions(+), 1 deletion(-) > > > > > > > > diff --git a/Documentation/devicetree/bindings/interrupt-controller/sifive,plic-1.0.0.yaml b/Documentation/devicetree/bindings/interrupt-controller/sifive,plic-1.0.0.yaml > > > > index 08d5a57ce00f..272f29540135 100644 > > > > --- a/Documentation/devicetree/bindings/interrupt-controller/sifive,plic-1.0.0.yaml > > > > +++ b/Documentation/devicetree/bindings/interrupt-controller/sifive,plic-1.0.0.yaml > > > > @@ -35,6 +35,12 @@ description: > > > > contains a specific memory layout, which is documented in chapter 8 of the > > > > SiFive U5 Coreplex Series Manual . > > > > > > > > + The C9xx PLIC does not comply with the interrupt claim/completion process defined > > > > + by the RISC-V PLIC specification because C9xx PLIC will mask an IRQ when it is > > > > + claimed by PLIC driver (i.e. readl(claim) and the IRQ will be unmasked upon > > > > + completion by PLIC driver (i.e. writel(claim). This behaviour breaks the handling > > > > + of IRQS_ONESHOT by the generic handle_fasteoi_irq() used in the PLIC driver. > > > > + > > > > maintainers: > > > > - Sagar Kadam > > > > - Paul Walmsley > > > > @@ -46,7 +52,10 @@ properties: > > > > - enum: > > > > - sifive,fu540-c000-plic > > > > - canaan,k210-plic > > > > - - const: sifive,plic-1.0.0 > > > > + - enmu: > > > > > > ^ spelling enum > > > > > > > + - sifive,plic-1.0.0 > > > > + - thead,c900-plic > > > > + - allwinner,sun20i-d1-plic > > > > > > but in general I'd think that you want something like > > > > > > compatible: > > > oneOf: > > > - items: > > > - enum: > > > - sifive,fu540-c000-plic > > > - canaan,k210-plic > > > - const: sifive,plic-1.0.0 > > > - items: > > > - enum: > > > - allwinner,sun20i-d1-plic > > > - const: thead,c900-plic > > > > > > Having only one item list would allow as valid combinations like > > > "sifive,fu540-c000-plic", "thead,c900-plic" when checking the schema. > > > > > > With the oneOf and separate lists we can make sure that such > > > "illegal" combinations get flagged by the dtbs_check > > > > > > [the enum with the single allwinner entry already leaves > > > room for later addition to the c900-plic variant] > > Thx, I'll fix it in the next version. > > > > another question: Is the allwinner_sun20i_d1_plic needed to IRQCHIP_DECLARE? > > > > +IRQCHIP_DECLARE(thead_c900_plic, "thead,c900-plic", thead_c900_plic_init); > > +IRQCHIP_DECLARE(allwinner_sun20i_d1_plic, "allwinner,sun20i-d1-plic", > > thead_c900_plic_init); > > Doing > IRQCHIP_DECLARE(thead_c900_plic, "thead,c900-plic", thead_c900_plic_init); > should be enough for now. > > Compatible-parsing happens from left to right, from most-specific to > most-generic. So having the allwinner-d1 compatible in there is sort of a > safeguard. > > If at some _later point in time_ , some specific new quirk of the D1 > implementation comes to light, we can _then_ just add a > IRQCHIP_DECLARE(allwinner_d1_plic, "allwinner,sun20i-d1-plic", allwinner_d1_plic_init); > > Devicetrees should be stable and newer kernels should work with old > devicetrees, so having the soc-specific compatible in there just makes it > future proof :-) Nice tip, thx. > > > Heiko > > -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/