From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796392580; b=JOnSrcLXys8n4Z2iwkdlV+KtedPPFLX5H6M+goICxSXMuPQ6vbBMnMvS3aFhaGl2fv4b ynWd9IfG/P3qkdL3QEUgtA9w90QnLDdTQ1s6hGSAbQZJbTOyDVa/3P44ues6zBZ43m+hf YznZn/QZyRT8mxMuAsaJE32cYAMl78Cnjyr1nxKChAUMHf4fqq4u2+IG2IZismQOKHLOg GaYHdpuuXa4/VHPwuCB5JoB4sPfz4uJS39AIi4DYe9X6PEagYXH+bLhbDKob0vqL6wXKQ bEvXdZ/EB4REX7EfXtu9s9aId8GxDQzGqbBIqq+8lTcPD1n5vlqr9RdSBQ684J1fliw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796392580; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=ru2RyI2dKiWfcEBiJUE08AfUANLl6aRZQUYBP1/W+2w=; b=xamO8O1j1MJFyy1HhhQN48W0AMtuVDRKpf2wB/uauryRb5tGd5+KFpxOLvQ3EwGUg1Iz if7whce9IoNcP/BD2IoHWJ+iiR+tJM2J0APxi6a+czHctrprU0IcXr/j2smxFw7f3iIvt S3vnmgam2dKqLkOv06D7pn5xtEbabAQwzRTbtaV6t9Zjvrq0BwngFMpaB0WfxOwOreTeL kCb1MJ29BDqVvSj9DMxJTOsK05vNRE1D0uesjlJsDfNGqa8xmYT1ms3nk/O2T7CH2g/Cp PFc6oKWr5M3myfuG+UI27Hj1gsjTme2Xcz9aS3AkU4a7oESJFGbZMCLYC+VSR+MN4tA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="Lu/EEAuX"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E179B606A322; Fri, 4 Dec 2026 13:56:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Lu/EEAuX Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39AD31F00931; Fri, 4 Dec 2026 13:56:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796392579; bh=ru2RyI2dKiWfcEBiJUE08AfUANLl6aRZQUYBP1/W+2w=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Lu/EEAuX0y0X0OakPaf8PxeqPK+rOAmBjcR8gL6Dut+Ygjv0/2dWDXD+TX8VLwO8k B1G3dMmPu3xEAnYtAhhyofC6X5Rms2eY0xbI1bv+XVfaXbtqDtBe49pNaNWggM1eZQ 9jTy6EXe7VRMtC713j9Gc1XHQHQxxarkWRwElHQ2e6GEac2PJXgiThVcFkRgoQIWHE CivCeDeEIbi/39QlahNdZhE8e/n2S3hHpEih6EsskDW4brtpJDIzQ4sM+OsASycb7I 4U2gazpDmcH4T8wg/yAa/x26H+gZXblV2u+YAKIL3bd+g5A8ZwctNzHBlGnjjwzxUC xPqXDZDaZ1S4A== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 2/6] irqchip: Add NXP S32N79 MRU MSI controller driver Reply-To: sashiko-reviews@lists.linux.dev To: "Ghennadi Procopciuc" Cc: imx@lists.linux.dev, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org, Frank.Li@kernel.org In-Reply-To: <20261204-b4-s32n79-mru-msi-v1-2-e66f9b0dfa79@oss.nxp.com> References: <20261204-b4-s32n79-mru-msi-v1-0-e66f9b0dfa79@oss.nxp.com> <20261204-b4-s32n79-mru-msi-v1-2-e66f9b0dfa79@oss.nxp.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 13:56:18 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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 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 =3D readl(chan + MRU_CH_CFG0); > + > + cfg0 &=3D ~MRU_CFG0_IE; > + writel(cfg0, chan + MRU_CH_CFG0); > + > + cfg0 &=3D ~MRU_CFG0_MBE0; > + writel(cfg0, chan + MRU_CH_CFG0); > + > + cfg0 &=3D ~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 cleare= d, 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 =3D 0; chan < MRU_CHANS_PER_MRU; chan++) { > + void __iomem *mbstat =3D mru->base + chan * MRU_CH_STRIDE + > + MRU_CH_MBSTAT; > + > + if (!(readl(mbstat) & MRU_MBSTAT_MBS0)) > + continue; > + > + writel(MRU_MBSTAT_MBS0, mbstat); > + > + pos =3D 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 =3D cpumask_local_spread(i, NUMA_NO_NODE); > + ret =3D 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. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204-b4-s32n79-= mru-msi-v1-0-e66f9b0dfa79@oss.nxp.com?part=3D2