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 3FF50606A329 for ; Tue, 1 Dec 2026 15:43:34 +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=mPKbNFGK; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=MCFslBoi 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=RAmkK53T6utPpBXTP1pR2L7DkoOT8sjFtmnp406NURs=; b=mPKbNFGK7HmJ+c3Z7bgPUwJ0bH LE7IL5wn8BGoNSVZZCGM7y/PiBnT47qLBQW0uxrrlUq55W6pcXWWDw1XcFBTat7jLYaXBTdil/J3w xmPw9GIaiKxRryL4ts62xs2MMOpCTODwWnBvRYFvpSb2QYQr4v37mjLgb3gL6NLktoiQ+zA3melJ9 KHpwOwoyuooZLW0ZLHhk66cmBCyoW1rz/t65XbKcvrnk3kZbi4aWBoWF8hTfmbIytTfVk8kRGSOjj gLs7qgJOcQ7EfesVZRhiuD7ZStHyfW1CUjeIh/YAChyGsmdNWA+BWHbcIMJsujIF7b8avLiwEv84n O+JA52AQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYQ0s-00000008c20-08wG; Tue, 01 Dec 2026 15:43:26 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYQ0o-00000008c1X-1oZC; Tue, 01 Dec 2026 15:43:23 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id A72D16191E; Tue, 1 Dec 2026 15:43:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33A221F000C1; Tue, 1 Dec 2026 15:43:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796139801; bh=RAmkK53T6utPpBXTP1pR2L7DkoOT8sjFtmnp406NURs=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=MCFslBoiJm4LuOXrwGRyhtTtCiWZvyVZ00LfKpEzNK4LBKx+Z7NLCexHTmZWhrvg0 4eLZesEUO494i7ECbZu9zD4Nn8ZEId+b5K1HUe450aJnTw/jNgWdsp0ruuriYx5VMi x6HhoDJKd+WtaMHy4yKTdaD/4ni/3lLXO2z820y+yJQUFgQMDd8h1x2NqL/BvwTECN 33S+NbmSWhhbYJGWBqwmS9pmX2C5nguIdE6yezXDG802XLNZO17+PR75WRaSmSXpND oXbEkA0CUYq/Pv/JJHVmyyDklfBjr0IulRNVg9rewOnnW5Jjt75xVCX63Ymlf6r53E iWvnYz1M6lZuQ== From: Thomas Gleixner To: Alexandre Mergnat , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Radu Rendec Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Alexandre Mergnat Subject: Re: [PATCH 2/2] irqchip: Add MediaTek SMMU wrapper driver In-Reply-To: <20261117-mt8196-smmu-wrapper-v1-2-229f04d9f693@baylibre.com> References: <20261117-mt8196-smmu-wrapper-v1-0-229f04d9f693@baylibre.com> <20261117-mt8196-smmu-wrapper-v1-2-229f04d9f693@baylibre.com> Date: Tue, 01 Dec 2026 16:43:18 +0100 Message-ID: <87pkvlovl5.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=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 17:31, Alexandre Mergnat wrote: > @@ -866,4 +866,15 @@ config IRQCHIP_XILINX_SMMU_CSR > ZynqMP-class platforms where a vendor CSR block mediates SMMU > interrupts. > > +config MTK_SMMU_WP > + bool "MediaTek SMMU wrapper interrupt controller" > + depends on (ARCH_MEDIATEK && ARM64) || COMPILE_TEST > + default ARCH_MEDIATEK && ARM64 > + select IRQ_DOMAIN > + help > + Support for the wrapper block that MediaTek integrates > + with the multimedia SMMUv3 of MT8196. > + The interrupts of that SMMU do not work without this > + driver. Please put this next to the existing MTK entry. > +static void mtk_smmu_wp_ack_source(struct mtk_smmu_wp *wp, unsigned int src) > +{ > + writel_relaxed(BIT(src), wp->base + MTK_SMMU_WP_IRQ_ACK); > + /* Flush the posted ACK before the SMMU is read */ > + readl(wp->base + MTK_SMMU_WP_IRQ_STA); > +} > + > +static void mtk_smmu_wp_irq_ack(struct irq_data *d) > +{ > + mtk_smmu_wp_ack_source(irq_data_get_irq_chip_data(d), d->hwirq); > +} > + > +static const struct irq_chip mtk_smmu_wp_chip = { > + .name = "mtk-smmu-wp", > + .irq_ack = mtk_smmu_wp_irq_ack, > +}; How are interrupts in this domain masked? > +static void mtk_smmu_wp_handler(struct irq_desc *desc) > +{ > + struct mtk_smmu_wp *wp = irq_desc_get_handler_data(desc); > + struct irq_chip *chip = irq_desc_get_chip(desc); > + unsigned long pending; > + unsigned int src; > + > + chained_irq_enter(chip, desc); guard_chained_irq() > + pending = readl_relaxed(wp->base + MTK_SMMU_WP_IRQ_STA); > + for_each_set_bit(src, &pending, MTK_SMMU_WP_NR_IRQS) { > + if (generic_handle_domain_irq(wp->domain, src)) { > + /* Release an unused source, which would hold the line */ > + mtk_smmu_wp_ack_source(wp, src); > + dev_warn_ratelimited(wp->dev, "unexpected source %u\n", src); > + } > + } > + > + chained_irq_exit(chip, desc); > +} Thanks, tglx