From: sashiko-bot@kernel.org
To: "Anup Patel" <anup.patel@oss.qualcomm.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2] driver core: platform: Setup device MSI domain just before driver probe
Date: Mon, 27 Jul 2026 08:57:24 +0000 [thread overview]
Message-ID: <20260727085725.780231F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260727084003.1951324-1-anup.patel@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Removal of explicit `-EPROBE_DEFER` fallbacks causes permanent probe failures for MSI client drivers.
- [High] Inconsistent and unsafe use of `dev->of_node` instead of `to_of_node(fwnode)` in `platform_dma_configure()`.
--
--- Patch [1]: [PATCH v2] driver core: platform: Setup device MSI domain just before driver probe ---
commit af1d054c0ea0f493a963d5cdb4333c67d265bf5a
Author: Anup Patel <anup.patel@oss.qualcomm.com>
driver core: platform: Setup device MSI domain just before driver probe
This commit extends platform_dma_configure() to configure device MSI
domains for both OF and ACPI devices prior to driver probe. It also
removes the duplicate MSI domain setup and probe deferral logic from
several RISC-V MSI client drivers.
> diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> index fb9120b0bcfe0..965ed6ae5bb54 100644
> --- a/drivers/base/platform.c
> +++ b/drivers/base/platform.c
> @@ -1477,8 +1477,12 @@ static int platform_dma_configure(struct device *dev)
> int ret = 0;
>
> if (is_of_node(fwnode)) {
> + if (!dev_get_msi_domain(dev))
> + of_msi_configure(dev, dev->of_node);
[Severity: High]
Should this use to_of_node(fwnode) instead of dev->of_node?
If a platform device has a valid fwnode but dev->of_node is NULL (which can
happen with dynamically instantiated MFD children), passing dev->of_node to
of_msi_configure() will silently fail to configure the MSI domain.
The very next line uses to_of_node(fwnode) safely for of_dma_configure().
> ret = of_dma_configure(dev, to_of_node(fwnode), true);
> } else if (is_acpi_device_node(fwnode)) {
[ ... ]
> diff --git a/drivers/irqchip/irq-riscv-aplic-msi.c b/drivers/irqchip/irq-riscv-aplic-msi.c
> index fb8d1838609fb..2cf5d42cd66a8 100644
> --- a/drivers/irqchip/irq-riscv-aplic-msi.c
> +++ b/drivers/irqchip/irq-riscv-aplic-msi.c
[ ... ]
> @@ -245,32 +244,6 @@ int aplic_msi_setup(struct device *dev, void __iomem *regs)
> /* Setup global config and interrupt delivery */
> aplic_init_hw_global(priv, true);
>
> - /* Set the APLIC device MSI domain if not available */
> - if (!dev_get_msi_domain(dev)) {
[ ... ]
> - if (!dev_get_msi_domain(dev))
> - return -EPROBE_DEFER;
> - }
> -
> if (!msi_create_device_irq_domain(dev, MSI_DEFAULT_DOMAIN, &aplic_msi_template,
> priv->nr_irqs + 1, priv, priv)) {
> dev_err(dev, "failed to create MSI irq domain\n");
[Severity: High]
Does removing the explicit -EPROBE_DEFER fallback cause a permanent probe
failure here?
If the IMSIC controller isn't probed first (for example, if fw_devlink is
disabled or fails to guarantee probe ordering), the parent MSI domain won't
be set yet in platform_dma_configure().
Without the -EPROBE_DEFER path, msi_create_device_irq_domain() will fail
with -ENOMEM because the parent domain is missing, and the driver probe
will permanently fail instead of deferring.
This same probe deferral removal appears to cause similar permanent probe
failures in rpmi_sysmsi_probe() in drivers/irqchip/irq-riscv-rpmi-sysmsi.c
and mpxy_mbox_probe() in drivers/mailbox/riscv-sbi-mpxy-mbox.c.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260727084003.1951324-1-anup.patel@oss.qualcomm.com?part=1
next prev parent reply other threads:[~2026-07-27 8:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 8:40 [PATCH v2] driver core: platform: Setup device MSI domain just before driver probe Anup Patel
2026-07-27 8:57 ` sashiko-bot [this message]
2026-07-27 12:16 ` Robin Murphy
2026-07-27 13:53 ` Anup Patel
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=20260727085725.780231F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=anup.patel@oss.qualcomm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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