From: Thomas Gleixner <tglx@kernel.org>
To: Alexandre Mergnat <amergnat@baylibre.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Radu Rendec <radu@rendec.net>
Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
Alexandre Mergnat <amergnat@baylibre.com>
Subject: Re: [PATCH 2/2] irqchip: Add MediaTek SMMU wrapper driver
Date: Tue, 01 Dec 2026 16:43:18 +0100 [thread overview]
Message-ID: <87pkvlovl5.ffs@fw13> (raw)
In-Reply-To: <20261117-mt8196-smmu-wrapper-v1-2-229f04d9f693@baylibre.com>
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
prev parent reply other threads:[~2026-12-01 15:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 17:31 [PATCH 0/2] Add MediaTek MT8196 SMMU wrapper interrupt controller Alexandre Mergnat
2026-11-17 17:31 ` [PATCH 1/2] dt-bindings: interrupt-controller: Add MT8196 SMMU wrapper Alexandre Mergnat
2026-12-01 2:50 ` Rob Herring (Arm)
2026-11-17 17:31 ` [PATCH 2/2] irqchip: Add MediaTek SMMU wrapper driver Alexandre Mergnat
2026-12-01 15:43 ` Thomas Gleixner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pkvlovl5.ffs@fw13 \
--to=tglx@kernel.org \
--cc=amergnat@baylibre.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=radu@rendec.net \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox