* [PATCH 1/6] dt-bindings: interrupt-controller: Add NXP S32N79 MRU MSI controller
2026-12-04 12:56 [PATCH 0/6] irqchip: Add NXP S32N79 MRU MSI controller Ghennadi Procopciuc via B4 Relay
@ 2026-12-04 12:56 ` Ghennadi Procopciuc via B4 Relay
2026-12-04 13:21 ` sashiko-bot
2026-12-04 12:56 ` [PATCH 2/6] irqchip: Add NXP S32N79 MRU MSI controller driver Ghennadi Procopciuc via B4 Relay
` (4 subsequent siblings)
5 siblings, 1 reply; 12+ messages in thread
From: Ghennadi Procopciuc via B4 Relay @ 2026-12-04 12:56 UTC (permalink / raw)
To: Thomas Gleixner, Krzysztof Kozlowski, Sascha Hauer, Rob Herring,
Frank Li, Conor Dooley
Cc: Pengutronix Kernel Team, imx, devicetree, NXP S32 Linux Team,
linux-kernel, Fabio Estevam, Radu Rendec, linux-arm-kernel,
echanude, clizzi, aruizrui, ghennadi.procopciuc, eballetb
From: Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com>
Add the binding for the Message Receive Unit (MRU) MSI controller found on
the NXP S32N79 SoC.
On S32N79, a hardware erratum prevents the MSI writes of the integrated
NETC endpoints from being translated by the GIC ITS. The MSIs of these
endpoints are therefore targeted at the mailboxes of MRU instances, and
the MRUs raise GIC SPIs on their behalf.
An MRU instance has a 64 KiB page with the channel controls, followed by
one 64 KiB mailbox page per channel. A write to the first mailbox of a
channel raises the channel interrupt, and the channel interrupts of an
instance are ORed into one GIC SPI. Each reg entry covers the control page
and the mailbox pages, because the mailboxes are the MSI targets.
The node groups up to 32 MRU instances into a single MSI controller, with
one register region and one SPI per instance. One node per instance with
a list of msi-parent entries does not work: the vectors of a PCI function
come from a single MSI parent domain, and that domain has to span all the
instances so that consecutive vectors land on different SPIs.
marvell,odmi-controller.yaml describes its frames the same way.
The other MRU instances of the SoC are mailboxes of other subsystems,
such as the FSS and the other cohorts, and are not part of the node.
The MSI specifier is empty, because the MRU does not use the requester ID
of the device, so #msi-cells is required and must be 0.
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com>
---
.../interrupt-controller/nxp,s32n79-mru-msi.yaml | 86 ++++++++++++++++++++++
1 file changed, 86 insertions(+)
diff --git a/Documentation/devicetree/bindings/interrupt-controller/nxp,s32n79-mru-msi.yaml b/Documentation/devicetree/bindings/interrupt-controller/nxp,s32n79-mru-msi.yaml
new file mode 100644
index 000000000000..a24dbe1bbd93
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/nxp,s32n79-mru-msi.yaml
@@ -0,0 +1,86 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/nxp,s32n79-mru-msi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP S32N79 Message Receive Unit (MRU) MSI controller
+
+maintainers:
+ - Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com>
+
+description: |
+ The Message Receive Unit (MRU) has a set of channels, each with its own
+ mailbox page. A write to the first mailbox of a channel raises the
+ interrupt of that channel. On S32N79, the channel interrupts of an MRU
+ instance are ORed into a single GIC SPI.
+
+ This binding groups the MRU instances reserved for this use into one MSI
+ controller, so that PCIe endpoints can target the mailboxes with MSI and
+ MSI-X writes. The S32N79 integrated NETC endpoints need it, because a
+ hardware erratum keeps their MSI writes from being translated by the GIC
+ ITS.
+
+ All the instances are described in a single node, with one reg and one
+ interrupts entry per instance, so that the vectors of one PCI function
+ can be spread over the instances and therefore over different SPIs.
+
+allOf:
+ - $ref: /schemas/interrupt-controller/msi-controller.yaml#
+
+properties:
+ compatible:
+ const: nxp,s32n79-mru-msi
+
+ reg:
+ minItems: 1
+ maxItems: 32
+ description:
+ Register space of each MRU instance, covering the channel control page
+ and the mailbox pages.
+
+ interrupts:
+ minItems: 1
+ maxItems: 32
+ description:
+ SPI of each MRU instance, in the same order as the reg entries.
+
+ msi-controller: true
+
+ "#msi-cells":
+ const: 0
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - msi-controller
+ - "#msi-cells"
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+ msi-controller@40a40000 {
+ compatible = "nxp,s32n79-mru-msi";
+ msi-controller;
+ #msi-cells = <0>;
+ reg = <0x40a40000 0x40000>,
+ <0x40a80000 0x40000>,
+ <0x40ac0000 0x40000>,
+ <0x40b00000 0x40000>,
+ <0x41a40000 0x40000>,
+ <0x41a80000 0x40000>,
+ <0x41ac0000 0x40000>,
+ <0x41b00000 0x40000>;
+ interrupts = <GIC_SPI 705 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 706 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 707 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 708 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 735 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 736 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 737 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 738 IRQ_TYPE_LEVEL_HIGH>;
+ };
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 1/6] dt-bindings: interrupt-controller: Add NXP S32N79 MRU MSI controller
2026-12-04 12:56 ` [PATCH 1/6] dt-bindings: interrupt-controller: " Ghennadi Procopciuc via B4 Relay
@ 2026-12-04 13:21 ` sashiko-bot
0 siblings, 0 replies; 12+ messages in thread
From: sashiko-bot @ 2026-12-04 13:21 UTC (permalink / raw)
To: Ghennadi Procopciuc; +Cc: imx, devicetree, robh, conor+dt, Frank.Li
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] dt-bindings: grouping independent MRU instances encodes OS
MSI-domain limit
- [Low] dt-bindings: nxp,s32n79-mru-msi: non-canonical property order in
example
--
commit f6243ae11f12c6552a692bda81a7f63a3e9dcb26
Author: Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com>
dt-bindings: interrupt-controller: Add NXP S32N79 MRU MSI controller
This commit adds a Devicetree binding schema for using NXP S32N79 Message
Receive Unit (MRU) instances as an MSI controller.
> diff --git a/Documentation/devicetree/bindings/interrupt-controller/nxp,s32n79-mru-msi.yaml b/Documentation/devicetree/bindings/interrupt-controller/nxp,s32n79-mru-msi.yaml
> new file mode 100644
> index 0000000000000..a24dbe1bbd93e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/interrupt-controller/nxp,s32n79-mru-msi.yaml
[ ... ]
> + reg:
> + minItems: 1
> + maxItems: 32
> + description:
> + Register space of each MRU instance, covering the channel control page
> + and the mailbox pages.
> +
> + interrupts:
> + minItems: 1
> + maxItems: 32
> + description:
> + SPI of each MRU instance, in the same order as the reg entries.
[Severity: Medium]
Should each MRU instance be its own DT node rather than packing up to 32
independent instances into parallel reg and interrupts arrays?
Each MRU is an independent mailbox block with its own MMIO region and SPI,
and the example merges instances 16 MiB apart. Grouping them works around
of_check_msi_parent() only parsing index 0 of msi-parent, whereas
writing-bindings.rst says bindings should describe hardware, not OS limits.
Encoding that limitation into the DT ABI prevents describing per-instance
resources such as clocks, power-domains, or resets, and forces rewriting
the reg and interrupts arrays when reassigning an MRU. Modeling one
instance per node (like fsl,mu-msi.yaml) lets the driver aggregate them.
[ ... ]
> + msi-controller@40a40000 {
> + compatible = "nxp,s32n79-mru-msi";
> + msi-controller;
> + #msi-cells = <0>;
> + reg = <0x40a40000 0x40000>,
> + <0x40a80000 0x40000>,
> + <0x40ac0000 0x40000>,
> + <0x40b00000 0x40000>,
> + <0x41a40000 0x40000>,
> + <0x41a80000 0x40000>,
> + <0x41ac0000 0x40000>,
> + <0x41b00000 0x40000>;
> + interrupts = <GIC_SPI 705 IRQ_TYPE_LEVEL_HIGH>,
[Severity: Low]
This example places msi-controller and #msi-cells before reg and interrupts.
Per Documentation/devicetree/bindings/dts-coding-style.rst, reg should follow
compatible, then interrupts, then msi-controller and #msi-cells, matching the
order already used in the schema's properties and required lists.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-b4-s32n79-mru-msi-v1-0-e66f9b0dfa79@oss.nxp.com?part=1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/6] irqchip: Add NXP S32N79 MRU MSI controller driver
2026-12-04 12:56 [PATCH 0/6] irqchip: Add NXP S32N79 MRU MSI controller Ghennadi Procopciuc via B4 Relay
2026-12-04 12:56 ` [PATCH 1/6] dt-bindings: interrupt-controller: " Ghennadi Procopciuc via B4 Relay
@ 2026-12-04 12:56 ` Ghennadi Procopciuc via B4 Relay
2026-12-04 13:56 ` sashiko-bot
` (2 more replies)
2026-12-04 12:56 ` [PATCH 3/6] MAINTAINERS: Add entry for " Ghennadi Procopciuc via B4 Relay
` (3 subsequent siblings)
5 siblings, 3 replies; 12+ messages in thread
From: Ghennadi Procopciuc via B4 Relay @ 2026-12-04 12:56 UTC (permalink / raw)
To: Thomas Gleixner, Krzysztof Kozlowski, Sascha Hauer, Rob Herring,
Frank Li, Conor Dooley
Cc: Pengutronix Kernel Team, imx, devicetree, NXP S32 Linux Team,
linux-kernel, Fabio Estevam, Radu Rendec, linux-arm-kernel,
echanude, clizzi, aruizrui, ghennadi.procopciuc, eballetb
From: Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com>
On S32N79, a hardware erratum prevents the MSI writes of the integrated
NETC endpoints from being translated by the GIC ITS. Add a driver that
uses the Message Receive Unit (MRU) blocks as the MSI controller for
these endpoints instead.
Each MRU has three channels. A write to the first mailbox of a channel
sets its status bit and raises the channel interrupt, and the channel
interrupts of an MRU are ORed into one GIC SPI. A chained handler reads
the status of the channels, clears it and dispatches the vector of every
channel with a pending message. The status is cleared before the
dispatch, because the vector may run later on another CPU.
Each vector gets a channel of its own. The channels sit in separate
64 KiB pages, so PCI functions that are isolated by the IOMMU cannot
write to each other's mailboxes. The channels of all the MRUs are handed
out channel index first, so consecutive vectors land on different MRUs
and do not share an SPI.
Since the channels of an MRU share one SPI, per-vector affinity uses the
interrupt redirection for demultiplexed interrupts: if the SPI is taken
on a CPU outside the affinity mask of a vector, the vector handler runs
from irq_work on a CPU that is in the mask. The SPIs of the MRUs are
spread over the online CPUs at probe.
When the endpoint sits behind an IOMMU, the mailbox page is mapped with
iommu_dma_prepare_msi(). That helper is not exported, so the driver can
only be built in. It is enabled by default on ARCH_S32, because the NETC
endpoints have no working MSI parent without it.
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com>
---
drivers/irqchip/Kconfig | 21 +++
drivers/irqchip/Makefile | 1 +
drivers/irqchip/irq-mru-msi.c | 402 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 424 insertions(+)
diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
index 136bab41f801..b80243d09791 100644
--- a/drivers/irqchip/Kconfig
+++ b/drivers/irqchip/Kconfig
@@ -852,4 +852,25 @@ config IRQCHIP_XILINX_SMMU_CSR
ZynqMP-class platforms where a vendor CSR block mediates SMMU
interrupts.
+config NXP_MRU_MSI
+ bool "NXP S32N79 MRU MSI controller"
+ depends on ARCH_S32 || COMPILE_TEST
+ depends on OF && PCI_MSI
+ default ARCH_S32
+ select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP
+ select IRQ_DOMAIN_HIERARCHY
+ select IRQ_MSI_IOMMU
+ select IRQ_MSI_LIB
+ help
+ Support for the Message Receive Unit (MRU) block of the NXP S32N79
+ used as an MSI and MSI-X controller. The mailboxes of the MRU
+ instances are the targets of the MSI writes of PCI devices, and
+ the channel interrupts are forwarded to the GIC as SPIs.
+
+ The integrated NETC endpoints of the S32N79 need it, because
+ their MSI writes do not reach the GIC ITS.
+
+ This driver cannot be built as a module because the IOMMU MSI
+ mapping helper it calls is not exported.
+
endmenu
diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile
index 16a5fd126c9a..379781d3e2b3 100644
--- a/drivers/irqchip/Makefile
+++ b/drivers/irqchip/Makefile
@@ -136,3 +136,4 @@ obj-$(CONFIG_MCHP_EIC) += irq-mchp-eic.o
obj-$(CONFIG_SOPHGO_SG2042_MSI) += irq-sg2042-msi.o
obj-$(CONFIG_SUNPLUS_SP7021_INTC) += irq-sp7021-intc.o
obj-$(CONFIG_IRQCHIP_XILINX_SMMU_CSR) += irq-xilinx-smmu-csr.o
+obj-$(CONFIG_NXP_MRU_MSI) += irq-mru-msi.o
diff --git a/drivers/irqchip/irq-mru-msi.c b/drivers/irqchip/irq-mru-msi.c
new file mode 100644
index 000000000000..13d184b2ca2c
--- /dev/null
+++ b/drivers/irqchip/irq-mru-msi.c
@@ -0,0 +1,402 @@
+// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
+/*
+ * Copyright 2025 NXP
+ *
+ * This driver exposes a set of Message Receive Units (MRUs) as an MSI
+ * controller. Each MRU is organized into multiple channels, and each channel
+ * contains a mailbox. A write to the first mailbox of a channel raises the
+ * interrupt of that channel.
+ *
+ * The channel interrupts of an MRU are ORed into a single SPI, which a chained
+ * handler demultiplexes. All the channels of all the MRUs are tracked in one
+ * bitmap, ordered by channel index first:
+ *
+ * ----------------||---------------||-----------------
+ * Bitmap bits | 0 | 1 | 2 | 3 || 4 | 5 | 6 | 7 || 8 | 9 | 10 | 11 |
+ * ----------------||---------------||-----------------
+ * MRU Index 0 1 2 3 || 0 1 2 3 || 0 1 2 3
+ * Channel index 0 0 0 0 || 1 1 1 1 || 2 2 2 2
+ *
+ * Assumptions for the example above:
+ * - Number of MRUs: 4
+ * - Number of channels per MRU: 3
+ *
+ * The channels are handed out in bitmap order, so consecutive vectors land on
+ * different MRUs and therefore on different SPIs. The redirection only moves
+ * the vector handler to a CPU in its affinity mask: the SPI is still taken and
+ * demultiplexed on the CPU it is routed to. Spreading the vectors over the
+ * SPIs keeps that work from piling up on a single CPU.
+ */
+#include <linux/bitmap.h>
+#include <linux/bits.h>
+#include <linux/cpumask.h>
+#include <linux/device.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/iommu.h>
+#include <linux/irq.h>
+#include <linux/irqchip/chained_irq.h>
+#include <linux/irqchip/irq-msi-lib.h>
+#include <linux/irqdesc.h>
+#include <linux/irqdomain.h>
+#include <linux/lockdep.h>
+#include <linux/msi.h>
+#include <linux/numa.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/sizes.h>
+
+#define MRU_CHANS_PER_MRU 3
+
+/* Each channel has a 16 byte block of control registers. */
+#define MRU_CH_STRIDE 0x10
+#define MRU_CH_CFG0 0x0
+#define MRU_CH_MBSTAT 0x8
+
+#define MRU_CFG0_CHE BIT(0)
+#define MRU_CFG0_CHR BIT(1)
+#define MRU_CFG0_IE BIT(2)
+#define MRU_CFG0_MBE0 BIT(16)
+
+#define MRU_MBSTAT_MBS0 BIT(16)
+
+/*
+ * The first 64 KiB page holds the channel controls. The mailboxes of channel n
+ * start at the page n + 1.
+ */
+#define MRU_PAGE_SIZE SZ_64K
+#define MRU_REGION_SIZE ((MRU_CHANS_PER_MRU + 1) * MRU_PAGE_SIZE)
+
+struct mru_msi;
+
+struct mru {
+ struct mru_msi *priv;
+ void __iomem *base;
+ phys_addr_t addr;
+ unsigned int index;
+ int irq;
+};
+
+struct mru_msi {
+ struct irq_domain *domain;
+ unsigned long *chans_bitmap;
+ struct device *dev;
+ struct mru *mrus;
+ unsigned int nmrus;
+ unsigned int nchans;
+};
+
+static unsigned int mru_pos2mru(const struct mru_msi *priv, unsigned int pos)
+{
+ return pos % priv->nmrus;
+}
+
+static unsigned int mru_pos2chan(const struct mru_msi *priv, unsigned int pos)
+{
+ return pos / priv->nmrus;
+}
+
+static unsigned int mru_mru2pos(const struct mru_msi *priv, unsigned int mru,
+ unsigned int chan)
+{
+ return chan * priv->nmrus + mru;
+}
+
+static void __iomem *mru_chan_base(const struct mru_msi *priv,
+ unsigned int pos)
+{
+ const struct mru *mru = &priv->mrus[mru_pos2mru(priv, pos)];
+
+ return mru->base + mru_pos2chan(priv, pos) * MRU_CH_STRIDE;
+}
+
+static phys_addr_t mru_mailbox_phys(const struct mru_msi *priv,
+ unsigned int pos)
+{
+ const struct mru *mru = &priv->mrus[mru_pos2mru(priv, pos)];
+
+ return mru->addr + (mru_pos2chan(priv, pos) + 1) * MRU_PAGE_SIZE;
+}
+
+/*
+ * The channel registers ignore writes while CHE is clear, so CHE has to be set
+ * by a write of its own before the other bits can be changed. Only CHE and
+ * CHR are writable while CHE is clear.
+ */
+static void mru_chan_enable(void __iomem *chan)
+{
+ u32 cfg0 = readl(chan + MRU_CH_CFG0);
+
+ cfg0 |= MRU_CFG0_CHE;
+ writel(cfg0, chan + MRU_CH_CFG0);
+
+ /*
+ * Only mailbox 0 is enabled. The mailboxes of a channel sit in one
+ * IOMMU page, so a device that may write one of them may write all
+ * of them. Every vector therefore gets a channel of its own.
+ */
+ cfg0 |= MRU_CFG0_MBE0;
+ writel(cfg0, chan + MRU_CH_CFG0);
+
+ /*
+ * A message left from before the channel was disabled would raise the
+ * interrupt as soon as IE is set.
+ */
+ writel(MRU_MBSTAT_MBS0, chan + MRU_CH_MBSTAT);
+
+ cfg0 |= MRU_CFG0_IE;
+ writel(cfg0, chan + MRU_CH_CFG0);
+}
+
+static void mru_chan_disable(void __iomem *chan)
+{
+ u32 cfg0 = readl(chan + MRU_CH_CFG0);
+
+ cfg0 &= ~MRU_CFG0_IE;
+ writel(cfg0, chan + MRU_CH_CFG0);
+
+ cfg0 &= ~MRU_CFG0_MBE0;
+ writel(cfg0, chan + MRU_CH_CFG0);
+
+ cfg0 &= ~MRU_CFG0_CHE;
+ writel(cfg0, chan + MRU_CH_CFG0);
+}
+
+/*
+ * The chained handler clears the status of the channel before it dispatches
+ * the vector. The vector can run later on another CPU, and by then the next
+ * message must be able to raise the SPI again. The flow handler of the device
+ * domain still needs an irq_ack() to call.
+ */
+static void mru_msi_irq_ack(struct irq_data *d)
+{
+}
+
+static void mru_msi_compose_msg(struct irq_data *d, struct msi_msg *msg)
+{
+ struct mru_msi *priv = irq_data_get_irq_chip_data(d);
+
+ msi_msg_set_addr(irq_data_get_msi_desc(d), msg,
+ mru_mailbox_phys(priv, d->hwirq));
+ msg->data = 0;
+}
+
+static const struct irq_chip mru_msi_parent_chip = {
+ .name = "MRU",
+ .irq_ack = mru_msi_irq_ack,
+ .irq_compose_msi_msg = mru_msi_compose_msg,
+#ifdef CONFIG_SMP
+ .irq_set_affinity = irq_chip_redirect_set_affinity,
+#endif
+};
+
+static int mru_msi_domain_alloc(struct irq_domain *domain, unsigned int virq,
+ unsigned int nr_irqs, void *args)
+{
+ struct mru_msi *priv = domain->host_data;
+ msi_alloc_info_t *info = args;
+ unsigned int pos;
+ int ret;
+
+ lockdep_assert_held(&domain->root->mutex);
+
+ if (WARN_ON_ONCE(nr_irqs != 1))
+ return -EINVAL;
+
+ pos = find_first_zero_bit(priv->chans_bitmap, priv->nchans);
+ if (pos >= priv->nchans)
+ return -ENOSPC;
+
+ ret = iommu_dma_prepare_msi(info->desc, mru_mailbox_phys(priv, pos));
+ if (ret)
+ return ret;
+
+ __set_bit(pos, priv->chans_bitmap);
+
+ irq_domain_set_info(domain, virq, pos, &mru_msi_parent_chip, priv,
+ handle_edge_irq, NULL, NULL);
+
+ mru_chan_enable(mru_chan_base(priv, pos));
+
+ return 0;
+}
+
+static void mru_msi_domain_free(struct irq_domain *domain, unsigned int virq,
+ unsigned int nr_irqs)
+{
+ struct irq_data *d = irq_domain_get_irq_data(domain, virq);
+ struct mru_msi *priv = domain->host_data;
+
+ lockdep_assert_held(&domain->root->mutex);
+
+ mru_chan_disable(mru_chan_base(priv, d->hwirq));
+ __clear_bit(d->hwirq, priv->chans_bitmap);
+}
+
+static const struct irq_domain_ops mru_msi_domain_ops = {
+ .select = msi_lib_irq_domain_select,
+ .alloc = mru_msi_domain_alloc,
+ .free = mru_msi_domain_free,
+};
+
+#define MRU_MSI_FLAGS_REQUIRED (MSI_FLAG_USE_DEF_DOM_OPS | \
+ MSI_FLAG_USE_DEF_CHIP_OPS)
+
+#define MRU_MSI_FLAGS_SUPPORTED (MSI_GENERIC_FLAGS_MASK | \
+ MSI_FLAG_PCI_MSIX)
+
+static const struct msi_parent_ops mru_msi_parent_ops = {
+ .required_flags = MRU_MSI_FLAGS_REQUIRED,
+ .supported_flags = MRU_MSI_FLAGS_SUPPORTED,
+ .chip_flags = MSI_CHIP_FLAG_SET_ACK,
+ .bus_select_token = DOMAIN_BUS_NEXUS,
+ .bus_select_mask = MATCH_PCI_MSI,
+ .prefix = "MRU-",
+ .init_dev_msi_info = msi_lib_init_dev_msi_info,
+};
+
+static void mru_msi_irq_handler(struct irq_desc *desc)
+{
+ struct mru *mru = irq_desc_get_handler_data(desc);
+ struct irq_chip *chip = irq_desc_get_chip(desc);
+ struct mru_msi *priv = mru->priv;
+ unsigned int chan, pos;
+
+ chained_irq_enter(chip, desc);
+
+ for (chan = 0; chan < MRU_CHANS_PER_MRU; chan++) {
+ void __iomem *mbstat = mru->base + chan * MRU_CH_STRIDE +
+ MRU_CH_MBSTAT;
+
+ if (!(readl(mbstat) & MRU_MBSTAT_MBS0))
+ continue;
+
+ writel(MRU_MBSTAT_MBS0, mbstat);
+
+ pos = mru_mru2pos(priv, mru->index, chan);
+ if (!generic_handle_demux_domain_irq(priv->domain, pos))
+ dev_err_ratelimited(priv->dev,
+ "unexpected message on MRU%u channel %u\n",
+ mru->index, chan);
+ }
+
+ chained_irq_exit(chip, desc);
+}
+
+static int mru_msi_create_domain(struct mru_msi *priv)
+{
+ struct irq_domain_info info = {
+ .fwnode = dev_fwnode(priv->dev),
+ .size = priv->nchans,
+ .ops = &mru_msi_domain_ops,
+ .host_data = priv,
+ };
+
+ priv->domain = msi_create_parent_irq_domain(&info, &mru_msi_parent_ops);
+ if (!priv->domain)
+ return dev_err_probe(priv->dev, -ENOMEM,
+ "failed to create the MSI parent domain\n");
+
+ return 0;
+}
+
+static int mru_msi_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct mru_msi *priv;
+ struct resource *res;
+ unsigned int i, chan;
+ int ret;
+
+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+ if (!priv)
+ return -ENOMEM;
+
+ priv->dev = dev;
+
+ while (platform_get_resource(pdev, IORESOURCE_MEM, priv->nmrus))
+ priv->nmrus++;
+
+ if (!priv->nmrus)
+ return dev_err_probe(dev, -EINVAL, "no MRU register space\n");
+
+ priv->nchans = priv->nmrus * MRU_CHANS_PER_MRU;
+
+ priv->mrus = devm_kcalloc(dev, priv->nmrus, sizeof(*priv->mrus),
+ GFP_KERNEL);
+ if (!priv->mrus)
+ return -ENOMEM;
+
+ priv->chans_bitmap = devm_bitmap_zalloc(dev, priv->nchans, GFP_KERNEL);
+ if (!priv->chans_bitmap)
+ return -ENOMEM;
+
+ for (i = 0; i < priv->nmrus; i++) {
+ struct mru *mru = &priv->mrus[i];
+
+ mru->priv = priv;
+ mru->index = i;
+
+ mru->base = devm_platform_get_and_ioremap_resource(pdev, i,
+ &res);
+ if (IS_ERR(mru->base))
+ return PTR_ERR(mru->base);
+
+ if (resource_size(res) < MRU_REGION_SIZE)
+ return dev_err_probe(dev, -EINVAL,
+ "MRU%u register space too small\n", i);
+
+ mru->addr = res->start;
+
+ mru->irq = platform_get_irq(pdev, i);
+ if (mru->irq < 0)
+ return mru->irq;
+
+ /* Reset the channels, in case they were left enabled. */
+ for (chan = 0; chan < MRU_CHANS_PER_MRU; chan++)
+ writel(MRU_CFG0_CHR, mru->base + chan * MRU_CH_STRIDE +
+ MRU_CH_CFG0);
+ }
+
+ ret = mru_msi_create_domain(priv);
+ if (ret)
+ return ret;
+
+ /* The handlers use the domain, so they are installed last. */
+ for (i = 0; i < priv->nmrus; i++) {
+ struct mru *mru = &priv->mrus[i];
+ unsigned int cpu;
+
+ irq_set_chained_handler_and_data(mru->irq, mru_msi_irq_handler,
+ mru);
+
+ /*
+ * The vectors choose their own CPU through the redirection, so
+ * the SPIs are only spread to keep the demux work of the
+ * instances on different CPUs. A failure is not fatal.
+ */
+ cpu = cpumask_local_spread(i, NUMA_NO_NODE);
+ ret = irq_set_affinity(mru->irq, cpumask_of(cpu));
+ if (ret)
+ dev_warn(dev, "MRU%u: cannot set the SPI affinity: %d\n",
+ i, ret);
+ }
+
+ return 0;
+}
+
+static const struct of_device_id mru_msi_of_match[] = {
+ { .compatible = "nxp,s32n79-mru-msi" },
+ { }
+};
+
+static struct platform_driver mru_msi_driver = {
+ .probe = mru_msi_probe,
+ .driver = {
+ .name = "nxp-mru-msi",
+ .of_match_table = mru_msi_of_match,
+ /* The MSI parent domain cannot be removed once it is in use. */
+ .suppress_bind_attrs = true,
+ },
+};
+builtin_platform_driver(mru_msi_driver);
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 2/6] irqchip: Add NXP S32N79 MRU MSI controller driver
2026-12-04 12:56 ` [PATCH 2/6] irqchip: Add NXP S32N79 MRU MSI controller driver Ghennadi Procopciuc via B4 Relay
@ 2026-12-04 13:56 ` sashiko-bot
2026-12-04 17:51 ` Frank Li
2026-12-04 19:26 ` Thomas Gleixner
2 siblings, 0 replies; 12+ messages in thread
From: sashiko-bot @ 2026-12-04 13:56 UTC (permalink / raw)
To: Ghennadi Procopciuc; +Cc: imx, devicetree, robh, conor+dt, Frank.Li
Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [Medium] irqchip: irq-mru-msi: stale MRU_MBSTAT_MBS0 stuck after
mru_chan_disable()
- [Medium] irqchip: missing readback after status clear in
mru_msi_irq_handler()
- [Medium] irqchip: mru-msi enables channel before irq_startup()
breaking redirect
- [Low] irqchip: irq-mru-msi: spurious irq_set_affinity() warnings on
non-SMP
--
commit 03fca14b0ce76bed8370472a06fe8f139d02a756
Author: Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com>
irqchip: Add NXP S32N79 MRU MSI controller driver
This commit adds an MSI parent irqchip driver for the NXP S32N79 Message
Receive Unit (MRU) blocks, exposing each MRU channel mailbox as an MSI
target and demultiplexing the shared per-MRU GIC SPIs.
> diff --git a/drivers/irqchip/irq-mru-msi.c b/drivers/irqchip/irq-mru-msi.c
> new file mode 100644
> index 0000000000000..13d184b2ca2c0
> --- /dev/null
> +++ b/drivers/irqchip/irq-mru-msi.c
> @@ -0,0 +1,402 @@
[ ... ]
> +static void mru_chan_disable(void __iomem *chan)
> +{
> + u32 cfg0 = readl(chan + MRU_CH_CFG0);
> +
> + cfg0 &= ~MRU_CFG0_IE;
> + writel(cfg0, chan + MRU_CH_CFG0);
> +
> + cfg0 &= ~MRU_CFG0_MBE0;
> + writel(cfg0, chan + MRU_CH_CFG0);
> +
> + cfg0 &= ~MRU_CFG0_CHE;
> + writel(cfg0, chan + MRU_CH_CFG0);
> +}
[Severity: Medium]
Can mru_chan_disable() leave MRU_MBSTAT_MBS0 latched after MRU_CFG0_CHE is
cleared?
If an MSI was pending at teardown or arrives before MRU_CFG0_MBE0 is cleared,
MBS0 stays set with CHE clear. Because writes to channel registers are
ignored while CHE is clear, every sibling channel interrupt in
mru_msi_irq_handler() will fail to clear MBS0 and log an unexpected message.
Similarly, mru_msi_domain_alloc() enables the channel before
irq_domain_insert_irq() publishes the revmap entry, leaving a brief window
where a sibling interrupt can observe MBS0 set before the mapping exists.
Clearing MRU_MBSTAT_MBS0 while CHE is still set (or resetting the channel
with MRU_CFG0_CHR) and skipping disabled channels in mru_msi_irq_handler()
would avoid this.
[ ... ]
> +static int mru_msi_domain_alloc(struct irq_domain *domain, unsigned int virq,
> + unsigned int nr_irqs, void *args)
> +{
[ ... ]
> + irq_domain_set_info(domain, virq, pos, &mru_msi_parent_chip, priv,
> + handle_edge_irq, NULL, NULL);
> +
> + mru_chan_enable(mru_chan_base(priv, pos));
> +
> + return 0;
> +}
[Severity: Medium]
Is it safe to enable the MRU channel in mru_msi_domain_alloc() before
irq_startup() has run irq_chip_redirect_set_affinity()?
When request_irq() uses IRQF_NO_AUTOEN, desc->action is installed while
effective_affinity stays empty and desc->redirect.target_cpu stays 0. If a
mailbox write fires before irq_startup() (for example on a non-PVM PCI MSI
device), demux_redirect_remote() queues desc->redirect.work onto CPU 0.
If CPU 0 is offline (migrate_one_irq() skips unstarted IRQs),
irq_work_queue_on() warns and leaves IRQ_WORK_PENDING | IRQ_WORK_BUSY stuck
on offline CPU 0, dropping future redirected interrupts for that vector and
hanging synchronize_irq() or free_irq() in irq_work_sync().
Moving MRU_CFG0_IE control to irq_mask/irq_unmask (or
irq_startup/irq_shutdown) with MSI_FLAG_PCI_MSI_MASK_PARENT would keep the
channel masked until irq_startup().
[ ... ]
> + for (chan = 0; chan < MRU_CHANS_PER_MRU; chan++) {
> + void __iomem *mbstat = mru->base + chan * MRU_CH_STRIDE +
> + MRU_CH_MBSTAT;
> +
> + if (!(readl(mbstat) & MRU_MBSTAT_MBS0))
> + continue;
> +
> + writel(MRU_MBSTAT_MBS0, mbstat);
> +
> + pos = mru_mru2pos(priv, mru->index, chan);
> + if (!generic_handle_demux_domain_irq(priv->domain, pos))
> + dev_err_ratelimited(priv->dev,
> + "unexpected message on MRU%u channel %u\n",
> + mru->index, chan);
> + }
> +
> + chained_irq_exit(chip, desc);
> +}
[Severity: Medium]
Does this writel(MRU_MBSTAT_MBS0, mbstat) need a readback before dispatching
and exiting the chained handler?
mru->base is mapped with ioremap() (PROT_DEVICE_nGnRE on arm64), so writel()
is posted. For the last channel, or when demux_redirect_remote() redirects
the vector to another CPU, no further read from mru->base occurs before
chained_irq_exit() writes ICC_EOIR1_EL1 or ICC_DIR_EL1.
Because GICv3 system register writes are not ordered behind posted MMIO
writes, the level-high SPI can be deactivated before the clear reaches the
MRU, causing spurious SPI re-entries (or a lost MSI if a redirected handler
re-arms the endpoint before the clear arrives).
A readl(mbstat) right after the write ensures the clear has reached the MRU.
[ ... ]
> + cpu = cpumask_local_spread(i, NUMA_NO_NODE);
> + ret = irq_set_affinity(mru->irq, cpumask_of(cpu));
> + if (ret)
> + dev_warn(dev, "MRU%u: cannot set the SPI affinity: %d\n",
> + i, ret);
[Severity: Low]
Will this log a spurious warning for every MRU on !CONFIG_SMP builds?
CONFIG_NXP_MRU_MSI does not depend on SMP, and on !CONFIG_SMP
irq_set_affinity() is a stub that always returns -EINVAL. Guarding the
affinity setup with if (IS_ENABLED(CONFIG_SMP)) would avoid the boot-time
warnings.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-b4-s32n79-mru-msi-v1-0-e66f9b0dfa79@oss.nxp.com?part=2
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 2/6] irqchip: Add NXP S32N79 MRU MSI controller driver
2026-12-04 12:56 ` [PATCH 2/6] irqchip: Add NXP S32N79 MRU MSI controller driver Ghennadi Procopciuc via B4 Relay
2026-12-04 13:56 ` sashiko-bot
@ 2026-12-04 17:51 ` Frank Li
2026-12-04 19:26 ` Thomas Gleixner
2 siblings, 0 replies; 12+ messages in thread
From: Frank Li @ 2026-12-04 17:51 UTC (permalink / raw)
To: ghennadi.procopciuc
Cc: Thomas Gleixner, Krzysztof Kozlowski, Sascha Hauer, Rob Herring,
Frank Li, Conor Dooley, Pengutronix Kernel Team, imx, devicetree,
NXP S32 Linux Team, linux-kernel, Fabio Estevam, Radu Rendec,
linux-arm-kernel, echanude, clizzi, aruizrui, eballetb
On Fri, Dec 04, 2026 at 02:56:47PM +0200, Ghennadi Procopciuc via B4 Relay wrote:
> [You don't often get email from devnull+ghennadi.procopciuc.oss.nxp.com@kernel.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> From: Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com>
>
> On S32N79, a hardware erratum prevents the MSI writes of the integrated
> NETC endpoints from being translated by the GIC ITS. Add a driver that
> uses the Message Receive Unit (MRU) blocks as the MSI controller for
> these endpoints instead.
>
> Each MRU has three channels. A write to the first mailbox of a channel
> sets its status bit and raises the channel interrupt, and the channel
> interrupts of an MRU are ORed into one GIC SPI. A chained handler reads
> the status of the channels, clears it and dispatches the vector of every
> channel with a pending message. The status is cleared before the
> dispatch, because the vector may run later on another CPU.
>
> Each vector gets a channel of its own. The channels sit in separate
> 64 KiB pages, so PCI functions that are isolated by the IOMMU cannot
> write to each other's mailboxes. The channels of all the MRUs are handed
> out channel index first, so consecutive vectors land on different MRUs
> and do not share an SPI.
>
> Since the channels of an MRU share one SPI, per-vector affinity uses the
> interrupt redirection for demultiplexed interrupts: if the SPI is taken
> on a CPU outside the affinity mask of a vector, the vector handler runs
> from irq_work on a CPU that is in the mask. The SPIs of the MRUs are
> spread over the online CPUs at probe.
>
> When the endpoint sits behind an IOMMU, the mailbox page is mapped with
> iommu_dma_prepare_msi(). That helper is not exported, so the driver can
> only be built in. It is enabled by default on ARCH_S32, because the NETC
> endpoints have no working MSI parent without it.
>
> Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com>
> ---
> drivers/irqchip/Kconfig | 21 +++
> drivers/irqchip/Makefile | 1 +
> drivers/irqchip/irq-mru-msi.c | 402 ++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 424 insertions(+)
>
> diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
> index 136bab41f801..b80243d09791 100644
> --- a/drivers/irqchip/Kconfig
> +++ b/drivers/irqchip/Kconfig
> @@ -852,4 +852,25 @@ config IRQCHIP_XILINX_SMMU_CSR
> ZynqMP-class platforms where a vendor CSR block mediates SMMU
> interrupts.
>
> +config NXP_MRU_MSI
> + bool "NXP S32N79 MRU MSI controller"
> + depends on ARCH_S32 || COMPILE_TEST
> + depends on OF && PCI_MSI
> + default ARCH_S32
> + select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP
> + select IRQ_DOMAIN_HIERARCHY
> + select IRQ_MSI_IOMMU
> + select IRQ_MSI_LIB
> + help
> + Support for the Message Receive Unit (MRU) block of the NXP S32N79
> + used as an MSI and MSI-X controller. The mailboxes of the MRU
> + instances are the targets of the MSI writes of PCI devices, and
> + the channel interrupts are forwarded to the GIC as SPIs.
> +
> + The integrated NETC endpoints of the S32N79 need it, because
> + their MSI writes do not reach the GIC ITS.
> +
> + This driver cannot be built as a module because the IOMMU MSI
> + mapping helper it calls is not exported.
> +
> endmenu
> diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile
> index 16a5fd126c9a..379781d3e2b3 100644
> --- a/drivers/irqchip/Makefile
> +++ b/drivers/irqchip/Makefile
> @@ -136,3 +136,4 @@ obj-$(CONFIG_MCHP_EIC) += irq-mchp-eic.o
> obj-$(CONFIG_SOPHGO_SG2042_MSI) += irq-sg2042-msi.o
> obj-$(CONFIG_SUNPLUS_SP7021_INTC) += irq-sp7021-intc.o
> obj-$(CONFIG_IRQCHIP_XILINX_SMMU_CSR) += irq-xilinx-smmu-csr.o
> +obj-$(CONFIG_NXP_MRU_MSI) += irq-mru-msi.o
> diff --git a/drivers/irqchip/irq-mru-msi.c b/drivers/irqchip/irq-mru-msi.c
> new file mode 100644
> index 000000000000..13d184b2ca2c
> --- /dev/null
> +++ b/drivers/irqchip/irq-mru-msi.c
> @@ -0,0 +1,402 @@
> +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
> +/*
> + * Copyright 2025 NXP
> + *
> + * This driver exposes a set of Message Receive Units (MRUs) as an MSI
> + * controller. Each MRU is organized into multiple channels, and each channel
> + * contains a mailbox. A write to the first mailbox of a channel raises the
> + * interrupt of that channel.
> + *
> + * The channel interrupts of an MRU are ORed into a single SPI, which a chained
> + * handler demultiplexes. All the channels of all the MRUs are tracked in one
> + * bitmap, ordered by channel index first:
> + *
> + * ----------------||---------------||-----------------
> + * Bitmap bits | 0 | 1 | 2 | 3 || 4 | 5 | 6 | 7 || 8 | 9 | 10 | 11 |
> + * ----------------||---------------||-----------------
> + * MRU Index 0 1 2 3 || 0 1 2 3 || 0 1 2 3
> + * Channel index 0 0 0 0 || 1 1 1 1 || 2 2 2 2
> + *
> + * Assumptions for the example above:
> + * - Number of MRUs: 4
> + * - Number of channels per MRU: 3
> + *
> + * The channels are handed out in bitmap order, so consecutive vectors land on
> + * different MRUs and therefore on different SPIs. The redirection only moves
> + * the vector handler to a CPU in its affinity mask: the SPI is still taken and
> + * demultiplexed on the CPU it is routed to. Spreading the vectors over the
> + * SPIs keeps that work from piling up on a single CPU.
> + */
Add empty line here.
> +#include <linux/bitmap.h>
> +#include <linux/bits.h>
> +#include <linux/cpumask.h>
> +#include <linux/device.h>
> +#include <linux/interrupt.h>
> +#include <linux/io.h>
> +#include <linux/iommu.h>
> +#include <linux/irq.h>
> +#include <linux/irqchip/chained_irq.h>
> +#include <linux/irqchip/irq-msi-lib.h>
> +#include <linux/irqdesc.h>
> +#include <linux/irqdomain.h>
> +#include <linux/lockdep.h>
> +#include <linux/msi.h>
> +#include <linux/numa.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
> +#include <linux/sizes.h>
> +
> +#define MRU_CHANS_PER_MRU 3
> +
> +/* Each channel has a 16 byte block of control registers. */
> +#define MRU_CH_STRIDE 0x10
> +#define MRU_CH_CFG0 0x0
> +#define MRU_CH_MBSTAT 0x8
> +
> +#define MRU_CFG0_CHE BIT(0)
> +#define MRU_CFG0_CHR BIT(1)
> +#define MRU_CFG0_IE BIT(2)
> +#define MRU_CFG0_MBE0 BIT(16)
> +
> +#define MRU_MBSTAT_MBS0 BIT(16)
> +
> +/*
> + * The first 64 KiB page holds the channel controls. The mailboxes of channel n
> + * start at the page n + 1.
> + */
> +#define MRU_PAGE_SIZE SZ_64K
> +#define MRU_REGION_SIZE ((MRU_CHANS_PER_MRU + 1) * MRU_PAGE_SIZE)
> +
> +struct mru_msi;
> +
> +struct mru {
> + struct mru_msi *priv;
> + void __iomem *base;
> + phys_addr_t addr;
> + unsigned int index;
> + int irq;
> +};
> +
> +struct mru_msi {
> + struct irq_domain *domain;
> + unsigned long *chans_bitmap;
> + struct device *dev;
> + struct mru *mrus;
> + unsigned int nmrus;
> + unsigned int nchans;
> +};
> +
> +static unsigned int mru_pos2mru(const struct mru_msi *priv, unsigned int pos)
> +{
> + return pos % priv->nmrus;
> +}
> +
> +static unsigned int mru_pos2chan(const struct mru_msi *priv, unsigned int pos)
> +{
> + return pos / priv->nmrus;
> +}
> +
> +static unsigned int mru_mru2pos(const struct mru_msi *priv, unsigned int mru,
> + unsigned int chan)
> +{
> + return chan * priv->nmrus + mru;
> +}
> +
> +static void __iomem *mru_chan_base(const struct mru_msi *priv,
> + unsigned int pos)
> +{
> + const struct mru *mru = &priv->mrus[mru_pos2mru(priv, pos)];
> +
> + return mru->base + mru_pos2chan(priv, pos) * MRU_CH_STRIDE;
> +}
> +
> +static phys_addr_t mru_mailbox_phys(const struct mru_msi *priv,
> + unsigned int pos)
> +{
> + const struct mru *mru = &priv->mrus[mru_pos2mru(priv, pos)];
> +
> + return mru->addr + (mru_pos2chan(priv, pos) + 1) * MRU_PAGE_SIZE;
> +}
> +
> +/*
> + * The channel registers ignore writes while CHE is clear, so CHE has to be set
> + * by a write of its own before the other bits can be changed. Only CHE and
> + * CHR are writable while CHE is clear.
> + */
> +static void mru_chan_enable(void __iomem *chan)
> +{
> + u32 cfg0 = readl(chan + MRU_CH_CFG0);
> +
> + cfg0 |= MRU_CFG0_CHE;
> + writel(cfg0, chan + MRU_CH_CFG0);
> +
> + /*
> + * Only mailbox 0 is enabled. The mailboxes of a channel sit in one
> + * IOMMU page, so a device that may write one of them may write all
> + * of them. Every vector therefore gets a channel of its own.
> + */
> + cfg0 |= MRU_CFG0_MBE0;
> + writel(cfg0, chan + MRU_CH_CFG0);
> +
> + /*
> + * A message left from before the channel was disabled would raise the
> + * interrupt as soon as IE is set.
> + */
> + writel(MRU_MBSTAT_MBS0, chan + MRU_CH_MBSTAT);
> +
> + cfg0 |= MRU_CFG0_IE;
> + writel(cfg0, chan + MRU_CH_CFG0);
> +}
> +
> +static void mru_chan_disable(void __iomem *chan)
> +{
> + u32 cfg0 = readl(chan + MRU_CH_CFG0);
> +
> + cfg0 &= ~MRU_CFG0_IE;
> + writel(cfg0, chan + MRU_CH_CFG0);
> +
> + cfg0 &= ~MRU_CFG0_MBE0;
> + writel(cfg0, chan + MRU_CH_CFG0);
> +
> + cfg0 &= ~MRU_CFG0_CHE;
> + writel(cfg0, chan + MRU_CH_CFG0);
> +}
> +
> +/*
> + * The chained handler clears the status of the channel before it dispatches
> + * the vector. The vector can run later on another CPU, and by then the next
> + * message must be able to raise the SPI again. The flow handler of the device
> + * domain still needs an irq_ack() to call.
> + */
> +static void mru_msi_irq_ack(struct irq_data *d)
> +{
> +}
> +
> +static void mru_msi_compose_msg(struct irq_data *d, struct msi_msg *msg)
> +{
> + struct mru_msi *priv = irq_data_get_irq_chip_data(d);
> +
> + msi_msg_set_addr(irq_data_get_msi_desc(d), msg,
> + mru_mailbox_phys(priv, d->hwirq));
> + msg->data = 0;
> +}
> +
> +static const struct irq_chip mru_msi_parent_chip = {
> + .name = "MRU",
> + .irq_ack = mru_msi_irq_ack,
> + .irq_compose_msi_msg = mru_msi_compose_msg,
> +#ifdef CONFIG_SMP
> + .irq_set_affinity = irq_chip_redirect_set_affinity,
> +#endif
> +};
> +
> +static int mru_msi_domain_alloc(struct irq_domain *domain, unsigned int virq,
> + unsigned int nr_irqs, void *args)
> +{
> + struct mru_msi *priv = domain->host_data;
> + msi_alloc_info_t *info = args;
> + unsigned int pos;
> + int ret;
> +
> + lockdep_assert_held(&domain->root->mutex);
> +
> + if (WARN_ON_ONCE(nr_irqs != 1))
> + return -EINVAL;
> +
> + pos = find_first_zero_bit(priv->chans_bitmap, priv->nchans);
> + if (pos >= priv->nchans)
> + return -ENOSPC;
> +
> + ret = iommu_dma_prepare_msi(info->desc, mru_mailbox_phys(priv, pos));
> + if (ret)
> + return ret;
> +
> + __set_bit(pos, priv->chans_bitmap);
> +
> + irq_domain_set_info(domain, virq, pos, &mru_msi_parent_chip, priv,
> + handle_edge_irq, NULL, NULL);
> +
> + mru_chan_enable(mru_chan_base(priv, pos));
> +
> + return 0;
> +}
> +
> +static void mru_msi_domain_free(struct irq_domain *domain, unsigned int virq,
> + unsigned int nr_irqs)
> +{
> + struct irq_data *d = irq_domain_get_irq_data(domain, virq);
> + struct mru_msi *priv = domain->host_data;
> +
> + lockdep_assert_held(&domain->root->mutex);
> +
> + mru_chan_disable(mru_chan_base(priv, d->hwirq));
> + __clear_bit(d->hwirq, priv->chans_bitmap);
> +}
> +
> +static const struct irq_domain_ops mru_msi_domain_ops = {
> + .select = msi_lib_irq_domain_select,
> + .alloc = mru_msi_domain_alloc,
> + .free = mru_msi_domain_free,
> +};
> +
> +#define MRU_MSI_FLAGS_REQUIRED (MSI_FLAG_USE_DEF_DOM_OPS | \
> + MSI_FLAG_USE_DEF_CHIP_OPS)
> +
> +#define MRU_MSI_FLAGS_SUPPORTED (MSI_GENERIC_FLAGS_MASK | \
> + MSI_FLAG_PCI_MSIX)
> +
> +static const struct msi_parent_ops mru_msi_parent_ops = {
> + .required_flags = MRU_MSI_FLAGS_REQUIRED,
> + .supported_flags = MRU_MSI_FLAGS_SUPPORTED,
> + .chip_flags = MSI_CHIP_FLAG_SET_ACK,
> + .bus_select_token = DOMAIN_BUS_NEXUS,
> + .bus_select_mask = MATCH_PCI_MSI,
> + .prefix = "MRU-",
> + .init_dev_msi_info = msi_lib_init_dev_msi_info,
> +};
> +
> +static void mru_msi_irq_handler(struct irq_desc *desc)
> +{
> + struct mru *mru = irq_desc_get_handler_data(desc);
> + struct irq_chip *chip = irq_desc_get_chip(desc);
> + struct mru_msi *priv = mru->priv;
> + unsigned int chan, pos;
> +
> + chained_irq_enter(chip, desc);
> +
> + for (chan = 0; chan < MRU_CHANS_PER_MRU; chan++) {
> + void __iomem *mbstat = mru->base + chan * MRU_CH_STRIDE +
> + MRU_CH_MBSTAT;
> +
> + if (!(readl(mbstat) & MRU_MBSTAT_MBS0))
> + continue;
> +
> + writel(MRU_MBSTAT_MBS0, mbstat);
> +
> + pos = mru_mru2pos(priv, mru->index, chan);
> + if (!generic_handle_demux_domain_irq(priv->domain, pos))
> + dev_err_ratelimited(priv->dev,
> + "unexpected message on MRU%u channel %u\n",
> + mru->index, chan);
> + }
> +
> + chained_irq_exit(chip, desc);
> +}
> +
> +static int mru_msi_create_domain(struct mru_msi *priv)
> +{
> + struct irq_domain_info info = {
> + .fwnode = dev_fwnode(priv->dev),
> + .size = priv->nchans,
> + .ops = &mru_msi_domain_ops,
> + .host_data = priv,
> + };
> +
> + priv->domain = msi_create_parent_irq_domain(&info, &mru_msi_parent_ops);
> + if (!priv->domain)
> + return dev_err_probe(priv->dev, -ENOMEM,
> + "failed to create the MSI parent domain\n");
> +
> + return 0;
> +}
> +
> +static int mru_msi_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + struct mru_msi *priv;
> + struct resource *res;
> + unsigned int i, chan;
> + int ret;
> +
> + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
Now have devm_kzalloc_obj()
> + if (!priv)
> + return -ENOMEM;
> +
> + priv->dev = dev;
> +
> + while (platform_get_resource(pdev, IORESOURCE_MEM, priv->nmrus))
> + priv->nmrus++;
> +
> + if (!priv->nmrus)
> + return dev_err_probe(dev, -EINVAL, "no MRU register space\n");
> +
> + priv->nchans = priv->nmrus * MRU_CHANS_PER_MRU;
> +
> + priv->mrus = devm_kcalloc(dev, priv->nmrus, sizeof(*priv->mrus),
> + GFP_KERNEL);
devm_kzalloc_objs()
Frank
> + if (!priv->mrus)
> + return -ENOMEM;
> +
> + priv->chans_bitmap = devm_bitmap_zalloc(dev, priv->nchans, GFP_KERNEL);
> + if (!priv->chans_bitmap)
> + return -ENOMEM;
> +
> + for (i = 0; i < priv->nmrus; i++) {
> + struct mru *mru = &priv->mrus[i];
> +
> + mru->priv = priv;
> + mru->index = i;
> +
> + mru->base = devm_platform_get_and_ioremap_resource(pdev, i,
> + &res);
> + if (IS_ERR(mru->base))
> + return PTR_ERR(mru->base);
> +
> + if (resource_size(res) < MRU_REGION_SIZE)
> + return dev_err_probe(dev, -EINVAL,
> + "MRU%u register space too small\n", i);
> +
> + mru->addr = res->start;
> +
> + mru->irq = platform_get_irq(pdev, i);
> + if (mru->irq < 0)
> + return mru->irq;
> +
> + /* Reset the channels, in case they were left enabled. */
> + for (chan = 0; chan < MRU_CHANS_PER_MRU; chan++)
> + writel(MRU_CFG0_CHR, mru->base + chan * MRU_CH_STRIDE +
> + MRU_CH_CFG0);
> + }
> +
> + ret = mru_msi_create_domain(priv);
> + if (ret)
> + return ret;
> +
> + /* The handlers use the domain, so they are installed last. */
> + for (i = 0; i < priv->nmrus; i++) {
> + struct mru *mru = &priv->mrus[i];
> + unsigned int cpu;
> +
> + irq_set_chained_handler_and_data(mru->irq, mru_msi_irq_handler,
> + mru);
> +
> + /*
> + * The vectors choose their own CPU through the redirection, so
> + * the SPIs are only spread to keep the demux work of the
> + * instances on different CPUs. A failure is not fatal.
> + */
> + cpu = cpumask_local_spread(i, NUMA_NO_NODE);
> + ret = irq_set_affinity(mru->irq, cpumask_of(cpu));
> + if (ret)
> + dev_warn(dev, "MRU%u: cannot set the SPI affinity: %d\n",
> + i, ret);
> + }
> +
> + return 0;
> +}
> +
> +static const struct of_device_id mru_msi_of_match[] = {
> + { .compatible = "nxp,s32n79-mru-msi" },
> + { }
> +};
> +
> +static struct platform_driver mru_msi_driver = {
> + .probe = mru_msi_probe,
> + .driver = {
> + .name = "nxp-mru-msi",
> + .of_match_table = mru_msi_of_match,
> + /* The MSI parent domain cannot be removed once it is in use. */
> + .suppress_bind_attrs = true,
> + },
> +};
> +builtin_platform_driver(mru_msi_driver);
>
> --
> 2.43.0
>
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 2/6] irqchip: Add NXP S32N79 MRU MSI controller driver
2026-12-04 12:56 ` [PATCH 2/6] irqchip: Add NXP S32N79 MRU MSI controller driver Ghennadi Procopciuc via B4 Relay
2026-12-04 13:56 ` sashiko-bot
2026-12-04 17:51 ` Frank Li
@ 2026-12-04 19:26 ` Thomas Gleixner
2 siblings, 0 replies; 12+ messages in thread
From: Thomas Gleixner @ 2026-12-04 19:26 UTC (permalink / raw)
To: Ghennadi Procopciuc via B4 Relay, Krzysztof Kozlowski,
Sascha Hauer, Rob Herring, Frank Li, Conor Dooley
Cc: Pengutronix Kernel Team, imx, devicetree, NXP S32 Linux Team,
linux-kernel, Fabio Estevam, Radu Rendec, linux-arm-kernel,
echanude, clizzi, aruizrui, ghennadi.procopciuc, eballetb
On Fri, Dec 04 2026 at 14:56, Ghennadi Procopciuc via wrote:
> +
> +struct mru_msi;
> +
> +struct mru {
> + struct mru_msi *priv;
> + void __iomem *base;
> + phys_addr_t addr;
> + unsigned int index;
> + int irq;
> +};
> +
> +struct mru_msi {
> + struct irq_domain *domain;
> + unsigned long *chans_bitmap;
> + struct device *dev;
> + struct mru *mrus;
> + unsigned int nmrus;
> + unsigned int nchans;
> +};
Please read and follow:
https://docs.kernel.org/process/maintainer-tip.html
Especially struct definitions and bracket rules. Also you have 100
characters so please get rid of pointless line breaks.
> +/*
> + * The chained handler clears the status of the channel before it dispatches
> + * the vector. The vector can run later on another CPU, and by then the next
> + * message must be able to raise the SPI again. The flow handler of the device
> + * domain still needs an irq_ack() to call.
> + */
> +static void mru_msi_irq_ack(struct irq_data *d)
> +{
> +}
It's amazing how much comment an empty callback needs. The two lines of
code doing the ACK in the callback wouldn't need any and would actually
do it in the right context :)
> +static void mru_msi_compose_msg(struct irq_data *d, struct msi_msg *msg)
> +{
> + struct mru_msi *priv = irq_data_get_irq_chip_data(d);
> +
> + msi_msg_set_addr(irq_data_get_msi_desc(d), msg,
> + mru_mailbox_phys(priv, d->hwirq));
> + msg->data = 0;
> +}
> +
> +static const struct irq_chip mru_msi_parent_chip = {
> + .name = "MRU",
> + .irq_ack = mru_msi_irq_ack,
> + .irq_compose_msi_msg = mru_msi_compose_msg,
> +#ifdef CONFIG_SMP
> + .irq_set_affinity = irq_chip_redirect_set_affinity,
> +#endif
> +};
As there are no mask/unmask callbacks, this relies fully on the device
MSI implementation to provide them. MSI-X must provide masking, but MSI
does not, which can be a real pain as you have no way to prevent an
interrupt storm from a malfunctioning device.
Aside of that usually the on-SOC registers are faster to access than the
PCI registers for masking. MSI_FLAG_PCI_MSI_MASK_PARENT makes this work
so that only on startup/shutdown the masking happens at the PCI device
level, but run-time mask/unmask goes to the parent domain chip.
Just a hint. I personally don't care about debugging an interrupt storm
on your SoC :)
> +static void mru_msi_irq_handler(struct irq_desc *desc)
> +{
> + struct mru *mru = irq_desc_get_handler_data(desc);
> + struct irq_chip *chip = irq_desc_get_chip(desc);
> + struct mru_msi *priv = mru->priv;
> + unsigned int chan, pos;
> +
> + chained_irq_enter(chip, desc);
guard_chained_irq()
> + for (chan = 0; chan < MRU_CHANS_PER_MRU; chan++) {
> + void __iomem *mbstat = mru->base + chan * MRU_CH_STRIDE +
> + MRU_CH_MBSTAT;
> +
> + if (!(readl(mbstat) & MRU_MBSTAT_MBS0))
> + continue;
> +
> + writel(MRU_MBSTAT_MBS0, mbstat);
> +
> + pos = mru_mru2pos(priv, mru->index, chan);
> + if (!generic_handle_demux_domain_irq(priv->domain, pos))
> + dev_err_ratelimited(priv->dev,
> + "unexpected message on MRU%u channel %u\n",
> + mru->index, chan);
That message is nice, but that happens when an interrupt is not
mapped. But what masks the interrupt channel?
Thanks,
tglx
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 3/6] MAINTAINERS: Add entry for NXP S32N79 MRU MSI controller driver
2026-12-04 12:56 [PATCH 0/6] irqchip: Add NXP S32N79 MRU MSI controller Ghennadi Procopciuc via B4 Relay
2026-12-04 12:56 ` [PATCH 1/6] dt-bindings: interrupt-controller: " Ghennadi Procopciuc via B4 Relay
2026-12-04 12:56 ` [PATCH 2/6] irqchip: Add NXP S32N79 MRU MSI controller driver Ghennadi Procopciuc via B4 Relay
@ 2026-12-04 12:56 ` Ghennadi Procopciuc via B4 Relay
2026-12-04 12:56 ` [PATCH 4/6] arm64: dts: s32n79: add MRU MSI controller node Ghennadi Procopciuc via B4 Relay
` (2 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Ghennadi Procopciuc via B4 Relay @ 2026-12-04 12:56 UTC (permalink / raw)
To: Thomas Gleixner, Krzysztof Kozlowski, Sascha Hauer, Rob Herring,
Frank Li, Conor Dooley
Cc: Pengutronix Kernel Team, imx, devicetree, NXP S32 Linux Team,
linux-kernel, Fabio Estevam, Radu Rendec, linux-arm-kernel,
echanude, clizzi, aruizrui, ghennadi.procopciuc, eballetb
From: Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com>
Add a MAINTAINERS entry for the NXP S32N79 MRU MSI controller driver and
its devicetree binding.
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com>
---
MAINTAINERS | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 05b2d9e36b6d..460891cd8e4e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -20397,6 +20397,15 @@ S: Maintained
F: Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml
F: drivers/extcon/extcon-ptn5150.c
+NXP S32N79 MRU MSI CONTROLLER DRIVER
+M: Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com>
+R: NXP S32 Linux Team <s32@nxp.com>
+L: imx@lists.linux.dev
+L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+S: Maintained
+F: Documentation/devicetree/bindings/interrupt-controller/nxp,s32n79-mru-msi.yaml
+F: drivers/irqchip/irq-mru-msi.c
+
NXP SGTL5000 DRIVER
M: Fabio Estevam <festevam@gmail.com>
L: linux-sound@vger.kernel.org
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 4/6] arm64: dts: s32n79: add MRU MSI controller node
2026-12-04 12:56 [PATCH 0/6] irqchip: Add NXP S32N79 MRU MSI controller Ghennadi Procopciuc via B4 Relay
` (2 preceding siblings ...)
2026-12-04 12:56 ` [PATCH 3/6] MAINTAINERS: Add entry for " Ghennadi Procopciuc via B4 Relay
@ 2026-12-04 12:56 ` Ghennadi Procopciuc via B4 Relay
2026-12-04 14:04 ` sashiko-bot
2026-12-04 12:56 ` [PATCH 5/6] arm64: dts: s32n79-rdb: enable the MRU MSI controller Ghennadi Procopciuc via B4 Relay
2026-12-04 12:56 ` [PATCH 6/6] arm64: dts: s32n79: route the NETC IEP18 MSIs to the MRU Ghennadi Procopciuc via B4 Relay
5 siblings, 1 reply; 12+ messages in thread
From: Ghennadi Procopciuc via B4 Relay @ 2026-12-04 12:56 UTC (permalink / raw)
To: Thomas Gleixner, Krzysztof Kozlowski, Sascha Hauer, Rob Herring,
Frank Li, Conor Dooley
Cc: Pengutronix Kernel Team, imx, devicetree, NXP S32 Linux Team,
linux-kernel, Fabio Estevam, Radu Rendec, linux-arm-kernel,
echanude, clizzi, aruizrui, ghennadi.procopciuc, eballetb
From: Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com>
Add the MRU MSI controller node, made of eight MRU instances and their
SPIs. The remaining MRU instances stay available for other software.
The node is disabled by default.
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com>
---
arch/arm64/boot/dts/freescale/s32n79.dtsi | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/s32n79.dtsi b/arch/arm64/boot/dts/freescale/s32n79.dtsi
index 65cf65e82832..7a26688d3538 100644
--- a/arch/arm64/boot/dts/freescale/s32n79.dtsi
+++ b/arch/arm64/boot/dts/freescale/s32n79.dtsi
@@ -12,6 +12,36 @@ / {
#address-cells = <2>;
#size-cells = <2>;
+ aps-bus {
+ compatible = "simple-bus";
+ ranges = <0x40a00000 0x0 0x40a00000 0x2000000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ mru_msi_controller: msi-controller@40a40000 {
+ compatible = "nxp,s32n79-mru-msi";
+ reg = <0x40a40000 0x40000>,
+ <0x40a80000 0x40000>,
+ <0x40ac0000 0x40000>,
+ <0x40b00000 0x40000>,
+ <0x41a40000 0x40000>,
+ <0x41a80000 0x40000>,
+ <0x41ac0000 0x40000>,
+ <0x41b00000 0x40000>;
+ interrupts = <GIC_SPI 705 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 706 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 707 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 708 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 735 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 736 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 737 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 738 IRQ_TYPE_LEVEL_HIGH>;
+ msi-controller;
+ #msi-cells = <0>;
+ status = "disabled";
+ };
+ };
+
cis-bus {
compatible = "simple-bus";
ranges = <0x4f200000 0x0 0x4f200000 0xc00000>;
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 4/6] arm64: dts: s32n79: add MRU MSI controller node
2026-12-04 12:56 ` [PATCH 4/6] arm64: dts: s32n79: add MRU MSI controller node Ghennadi Procopciuc via B4 Relay
@ 2026-12-04 14:04 ` sashiko-bot
0 siblings, 0 replies; 12+ messages in thread
From: sashiko-bot @ 2026-12-04 14:04 UTC (permalink / raw)
To: Ghennadi Procopciuc; +Cc: imx, devicetree, robh, conor+dt, Frank.Li
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] arm64: dts: s32n79: aps-bus lacks unit address and generic node
name
--
commit 178cc60f42b5e8c164b04fccc6744135f5300a0a
Author: Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com>
arm64: dts: s32n79: add MRU MSI controller node
This commit adds the MRU MSI controller node and its parent aps-bus node
to the NXP S32N79 device tree, disabled by default.
> diff --git a/arch/arm64/boot/dts/freescale/s32n79.dtsi b/arch/arm64/boot/dts/freescale/s32n79.dtsi
> index 65cf65e828328..7a26688d35382 100644
> --- a/arch/arm64/boot/dts/freescale/s32n79.dtsi
> +++ b/arch/arm64/boot/dts/freescale/s32n79.dtsi
> @@ -12,6 +12,36 @@ / {
> #address-cells = <2>;
> #size-cells = <2>;
>
> + aps-bus {
> + compatible = "simple-bus";
> + ranges = <0x40a00000 0x0 0x40a00000 0x2000000>;
> + #address-cells = <1>;
> + #size-cells = <1>;
[Severity: Low]
Should aps-bus be named bus@40a00000?
Because this node has a non-empty ranges property without a unit address,
W=1 DTB builds emit a dtc unit_address_vs_reg warning. Devicetree
conventions also call for generic node names like bus rather than
aps-bus.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-b4-s32n79-mru-msi-v1-0-e66f9b0dfa79@oss.nxp.com?part=4
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 5/6] arm64: dts: s32n79-rdb: enable the MRU MSI controller
2026-12-04 12:56 [PATCH 0/6] irqchip: Add NXP S32N79 MRU MSI controller Ghennadi Procopciuc via B4 Relay
` (3 preceding siblings ...)
2026-12-04 12:56 ` [PATCH 4/6] arm64: dts: s32n79: add MRU MSI controller node Ghennadi Procopciuc via B4 Relay
@ 2026-12-04 12:56 ` Ghennadi Procopciuc via B4 Relay
2026-12-04 12:56 ` [PATCH 6/6] arm64: dts: s32n79: route the NETC IEP18 MSIs to the MRU Ghennadi Procopciuc via B4 Relay
5 siblings, 0 replies; 12+ messages in thread
From: Ghennadi Procopciuc via B4 Relay @ 2026-12-04 12:56 UTC (permalink / raw)
To: Thomas Gleixner, Krzysztof Kozlowski, Sascha Hauer, Rob Herring,
Frank Li, Conor Dooley
Cc: Pengutronix Kernel Team, imx, devicetree, NXP S32 Linux Team,
linux-kernel, Fabio Estevam, Radu Rendec, linux-arm-kernel,
echanude, clizzi, aruizrui, ghennadi.procopciuc, eballetb
From: Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com>
Enable the MRU MSI controller on the S32N79-RDB. The board uses it for
the MSIs of its NETC endpoints.
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com>
---
arch/arm64/boot/dts/freescale/s32n79-rdb.dts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/s32n79-rdb.dts b/arch/arm64/boot/dts/freescale/s32n79-rdb.dts
index 897ba24ac03a..005edad633a8 100644
--- a/arch/arm64/boot/dts/freescale/s32n79-rdb.dts
+++ b/arch/arm64/boot/dts/freescale/s32n79-rdb.dts
@@ -47,6 +47,10 @@ &irqsteer_coss {
status = "okay";
};
+&mru_msi_controller {
+ status = "okay";
+};
+
&uart0 {
status = "okay";
};
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 6/6] arm64: dts: s32n79: route the NETC IEP18 MSIs to the MRU
2026-12-04 12:56 [PATCH 0/6] irqchip: Add NXP S32N79 MRU MSI controller Ghennadi Procopciuc via B4 Relay
` (4 preceding siblings ...)
2026-12-04 12:56 ` [PATCH 5/6] arm64: dts: s32n79-rdb: enable the MRU MSI controller Ghennadi Procopciuc via B4 Relay
@ 2026-12-04 12:56 ` Ghennadi Procopciuc via B4 Relay
5 siblings, 0 replies; 12+ messages in thread
From: Ghennadi Procopciuc via B4 Relay @ 2026-12-04 12:56 UTC (permalink / raw)
To: Thomas Gleixner, Krzysztof Kozlowski, Sascha Hauer, Rob Herring,
Frank Li, Conor Dooley
Cc: Pengutronix Kernel Team, imx, devicetree, NXP S32 Linux Team,
linux-kernel, Fabio Estevam, Radu Rendec, linux-arm-kernel,
echanude, clizzi, aruizrui, ghennadi.procopciuc, eballetb
From: Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com>
On S32N79, a hardware erratum prevents the MSI writes of the NETC
endpoints from being translated by the GIC ITS, so their interrupts never
fire.
Replace the msi-map of the NETC IEP18 bus, which points to the ITS, with
an msi-parent that points to the MRU MSI controller. The MRU does not use
the requester ID, so no RID translation is needed. msi-parent also lets
fw_devlink order the probe of the host bridge after the MRU, which it
does not do for msi-map. The iommu-map is kept, because the MRU driver
maps the mailbox pages through the SMMU.
Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com>
---
arch/arm64/boot/dts/freescale/s32n79.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/freescale/s32n79.dtsi b/arch/arm64/boot/dts/freescale/s32n79.dtsi
index 7a26688d3538..15c0591919fa 100644
--- a/arch/arm64/boot/dts/freescale/s32n79.dtsi
+++ b/arch/arm64/boot/dts/freescale/s32n79.dtsi
@@ -167,7 +167,7 @@ netc_iep18: pcie@241200000 {
device_type = "pci";
bus-range = <0x0 0x0>;
iommu-map = <0x0 &smmu 0xc0000 0x100>;
- msi-map = <0x0 &its 0xc0000 0x100>;
+ msi-parent = <&mru_msi_controller>;
dma-coherent;
status = "disabled";
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread