From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE7A8606A31A for ; Tue, 1 Dec 2026 15:51:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=afX/EUAx; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ac+ApwsN DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=mizxMracGmStkxn78hFoH2Qo0ftl9rikJRv5qqulYks=; b=afX/EUAxVhdCk6Vr+po7X1aJP+ kkTCHqY9vBuejwoAPvkyM67lPt6l3/wv+td+XEg7C5L6iuoB7VqB3XCC7iGNcZKO5qe1oMivLCRU7 vuuXIcfEiPm2Kf7PEljgCkV6xZpMEqFuQStA29ryKRwKbSbTSw7Bb4hWdPGUrrXVXTWyR6alGJoDv rHZ9bWzwEcJQq+sJJcXNb/MaxIh1bdJ3zRmk4QoIwbA2LPDKDBzQfZb1J2s8Bd3qT8g3qtx4xmdvO HOLfX7krd4C5QV6us+leWpldIKxgRLCaO2LACGF51PjSLlIttp1MNIA+ZU/xcJMhGZanaKB+qxFam yzjKNUtQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYQ8V-00000008ciL-2T05; Tue, 01 Dec 2026 15:51:20 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYQ8S-00000008ci2-2qDg for linux-arm-kernel@lists.infradead.org; Tue, 01 Dec 2026 15:51:18 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 15DC641850; Tue, 1 Dec 2026 15:51:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 285181F00893; Tue, 1 Dec 2026 15:51:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796140276; bh=mizxMracGmStkxn78hFoH2Qo0ftl9rikJRv5qqulYks=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=ac+ApwsNwTHPpLrHUPFs3gtYku/fsTVgEQMQFP2KxBgt3+FB2dX8xyTqFHHsOM+/x VgABSH1sPYNTp48jL56YrjLRkeCPri6OeU+dN7GuA9CNbYqw9L+/zn+X0+IXpp93uJ 5oXhvWJG7k9We1/dHJGfYovstZ5P+zVovqFfxhzrbIZfRNqp18Gg6Jxp/MJue+jdLh maVwjUklmUV/sBhIhO+1NQAAuGxsRgandjh0w791nfxG2ix5nSnINSEwdAJiiGl4mM Vny4sYPXfDIgefyY4O+S4Jcl6GwU7fJuN8InyFiumCXvYrb65M1e72AHpQddJzBgOR 4vVUstGCevhGg== From: Thomas Gleixner To: Fil Dunsky via B4 Relay , Radu Rendec , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Fil Dunsky Subject: Re: [PATCH v4 2/2] irqchip: Add Cortina Systems CS75xx peripheral interrupt controller In-Reply-To: <20261117-cs75xx-intc-v4-2-0a678f35e5f3@gmail.com> References: <20261117-cs75xx-intc-v4-0-0a678f35e5f3@gmail.com> <20261117-cs75xx-intc-v4-2-0a678f35e5f3@gmail.com> Date: Tue, 01 Dec 2026 16:51:12 +0100 Message-ID: <87mrqpov7z.ffs@fw13> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-5.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Tue, Nov 17 2026 at 23:29, Fil Dunsky via wrote: > +static void cs75xx_intc_handler(struct irq_desc *desc) > +{ > + struct irq_domain *domain = irq_desc_get_handler_data(desc); > + struct irq_chip *chip = irq_desc_get_chip(desc); > + struct irq_chip_generic *gc; > + unsigned long pending; > + unsigned int hwirq; > + > + gc = irq_get_domain_generic_chip(domain, 0); > + chained_irq_enter(chip, desc); guard_chained_irq() > + pending = readl(gc->reg_base + CS75XX_INTC_STATUS) & gc->mask_cache; > + for_each_set_bit(hwirq, &pending, CS75XX_INTC_NR_IRQS) > + generic_handle_domain_irq(domain, hwirq); > + > + chained_irq_exit(chip, desc); > +} > + > +static int __init cs75xx_intc_init(struct device_node *np, struct device_node *parent) > +{ > + struct irq_chip_generic *gc; > + struct irq_domain *domain; > + void __iomem *base; > + int parent_irq; > + int ret; int ret, parent_irq; > + base = of_io_request_and_map(np, 0, of_node_full_name(np)); > + if (IS_ERR(base)) { > + pr_err("%pOF: unable to map registers\n", np); > + return PTR_ERR(base); > + } > + > + /* Mask everything before the chained handler is installed */ > + writel(0, base + CS75XX_INTC_ENABLE); > + > + parent_irq = irq_of_parse_and_map(np, 0); > + if (!parent_irq) { > + pr_err("%pOF: unable to map parent interrupt\n", np); > + ret = -EINVAL; > + goto err_unmap; > + } > + > + domain = irq_domain_create_linear(of_fwnode_handle(np), CS75XX_INTC_NR_IRQS, > + &irq_generic_chip_ops, NULL); > + if (!domain) { > + ret = -ENOMEM; > + goto err_dispose; > + } > + > + ret = irq_alloc_domain_generic_chips(domain, CS75XX_INTC_NR_IRQS, 1, "cs75xx-intc", > + handle_level_irq, IRQ_NOREQUEST | IRQ_NOPROBE, 0, > + IRQ_GC_INIT_MASK_CACHE); > + if (ret) > + goto err_domain; > + > + gc = irq_get_domain_generic_chip(domain, 0); > + gc->reg_base = base; > + gc->chip_types[0].regs.mask = CS75XX_INTC_ENABLE; > + gc->chip_types[0].chip.irq_mask = irq_gc_mask_clr_bit; > + gc->chip_types[0].chip.irq_unmask = irq_gc_mask_set_bit; This sequence is racy because the interrupt domain becomes visible _before_ the chip has been allocated and initialized. See lan966x_oic_probe() how this can be avoided. Thanks, tglx