* [PATCH 0/2] irqchip/imx-mu-msi: Fix MSI dispatch and probe error handling
@ 2026-11-15 14:11 Peng Fan
2026-11-15 14:11 ` [PATCH 1/2] irqchip/imx-mu-msi: Fix MSI dispatch through the parent domain Peng Fan
2026-11-15 14:11 ` [PATCH 2/2] irqchip/imx-mu-msi: Fix PM domain teardown on probe errors Peng Fan
0 siblings, 2 replies; 5+ messages in thread
From: Peng Fan @ 2026-11-15 14:11 UTC (permalink / raw)
To: Thomas Gleixner, Radu Rendec, Frank Li, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Shivamurthy Shastri,
Anna-Maria Behnsen, Marc Zyngier
Cc: linux-kernel, imx, linux-arm-kernel, Peng Fan
Two small patches to fix bugs in the i.MX MU MSI controller driver.
Patch 1: Fix MSI dispatch through the parent domain.
Patch 2: Fix PM domain teardown on probe errors.
More information could be found in commit message of each patch.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
Peng Fan (2):
irqchip/imx-mu-msi: Fix MSI dispatch through the parent domain
irqchip/imx-mu-msi: Fix PM domain teardown on probe errors
drivers/irqchip/irq-imx-mu-msi.c | 70 ++++++++++++++++++++++++----------------
1 file changed, 42 insertions(+), 28 deletions(-)
---
base-commit: 84abb955b1015477aa11a96e2f3ac1b938b77f48
change-id: 20261115-imx-mu-msi-8c4523f90b1c
Best regards,
--
Peng Fan <peng.fan@nxp.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] irqchip/imx-mu-msi: Fix MSI dispatch through the parent domain
2026-11-15 14:11 [PATCH 0/2] irqchip/imx-mu-msi: Fix MSI dispatch and probe error handling Peng Fan
@ 2026-11-15 14:11 ` Peng Fan
2026-11-16 17:14 ` Frank Li
2026-11-15 14:11 ` [PATCH 2/2] irqchip/imx-mu-msi: Fix PM domain teardown on probe errors Peng Fan
1 sibling, 1 reply; 5+ messages in thread
From: Peng Fan @ 2026-11-15 14:11 UTC (permalink / raw)
To: Thomas Gleixner, Radu Rendec, Frank Li, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Shivamurthy Shastri,
Anna-Maria Behnsen, Marc Zyngier
Cc: linux-kernel, imx, linux-arm-kernel, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
Since commit 7b2f8aa005bc ("irqchip/imx-mu-msi: Switch to MSI parent")
the driver creates the MSI parent (nexus) domain in
imx_mu_msi_domains_init(), but never stores it in msi_data->msi_domain.
The chained interrupt handler therefore calls generic_handle_domain_irq()
with a NULL domain, which resolves the hardware interrupt against
irq_default_domain instead of the MU domain. Depending on the platform
this dispatches an unrelated interrupt or drops the MSI completely.
Save the nexus domain so that the handler resolves MU channel numbers
through the domain whose reverse map was populated when the MSI was
allocated.
Fixes: 7b2f8aa005bc ("irqchip/imx-mu-msi: Switch to MSI parent")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
drivers/irqchip/irq-imx-mu-msi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/irqchip/irq-imx-mu-msi.c b/drivers/irqchip/irq-imx-mu-msi.c
index 6d7baeeb2bc8..c42ea0797624 100644
--- a/drivers/irqchip/irq-imx-mu-msi.c
+++ b/drivers/irqchip/irq-imx-mu-msi.c
@@ -238,6 +238,7 @@ static int imx_mu_msi_domains_init(struct imx_mu_msi *msi_data, struct device *d
return -ENOMEM;
}
parent->dev = parent->pm_dev = dev;
+ msi_data->msi_domain = parent;
return 0;
}
--
2.56.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] irqchip/imx-mu-msi: Fix PM domain teardown on probe errors
2026-11-15 14:11 [PATCH 0/2] irqchip/imx-mu-msi: Fix MSI dispatch and probe error handling Peng Fan
2026-11-15 14:11 ` [PATCH 1/2] irqchip/imx-mu-msi: Fix MSI dispatch through the parent domain Peng Fan
@ 2026-11-15 14:11 ` Peng Fan
2026-11-16 17:17 ` Frank Li
1 sibling, 1 reply; 5+ messages in thread
From: Peng Fan @ 2026-11-15 14:11 UTC (permalink / raw)
To: Thomas Gleixner, Radu Rendec, Frank Li, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Shivamurthy Shastri,
Anna-Maria Behnsen, Marc Zyngier
Cc: linux-kernel, imx, linux-arm-kernel, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
dev_pm_domain_attach_by_name() creates a virtual device for each
attached PM domain, which must be released with dev_pm_domain_detach().
The probe error paths only remove the device links, leaking both
virtual devices. They also return -EINVAL instead of the actual error
from imx_mu_msi_domains_init() and log the wrong domain name when the
link for the second domain cannot be created.
Detach the PM domains on every failure path and propagate the real
error code. Since the power-domains property is optional in the
fsl,mu-msi binding, treat a NULL domain as "not present" and skip the
corresponding device link rather than failing the probe.
Fixes: 70afdab904d2 ("irqchip: Add IMX MU MSI controller driver")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
drivers/irqchip/irq-imx-mu-msi.c | 69 ++++++++++++++++++++++++----------------
1 file changed, 41 insertions(+), 28 deletions(-)
diff --git a/drivers/irqchip/irq-imx-mu-msi.c b/drivers/irqchip/irq-imx-mu-msi.c
index c42ea0797624..42e930caed8d 100644
--- a/drivers/irqchip/irq-imx-mu-msi.c
+++ b/drivers/irqchip/irq-imx-mu-msi.c
@@ -300,8 +300,8 @@ static const struct imx_mu_dcfg imx_mu_cfg_imx8ulp = {
static int imx_mu_probe(struct platform_device *pdev, struct device_node *parent,
const struct imx_mu_dcfg *cfg)
{
- struct device_link *pd_link_a;
- struct device_link *pd_link_b;
+ struct device_link *pd_link_a = NULL;
+ struct device_link *pd_link_b = NULL;
struct imx_mu_msi *msi_data;
struct resource *res;
struct device *pd_a;
@@ -345,33 +345,38 @@ static int imx_mu_probe(struct platform_device *pdev, struct device_node *parent
return PTR_ERR(pd_a);
pd_b = dev_pm_domain_attach_by_name(dev, "processor-b-side");
- if (IS_ERR(pd_b))
- return PTR_ERR(pd_b);
-
- pd_link_a = device_link_add(dev, pd_a,
- DL_FLAG_STATELESS |
- DL_FLAG_PM_RUNTIME |
- DL_FLAG_RPM_ACTIVE);
-
- if (!pd_link_a) {
- dev_err(dev, "Failed to add device_link to mu a.\n");
- goto err_pd_a;
+ if (IS_ERR(pd_b)) {
+ ret = PTR_ERR(pd_b);
+ goto err_detach_a;
}
- pd_link_b = device_link_add(dev, pd_b,
- DL_FLAG_STATELESS |
- DL_FLAG_PM_RUNTIME |
- DL_FLAG_RPM_ACTIVE);
-
+ if (pd_a) {
+ pd_link_a = device_link_add(dev, pd_a,
+ DL_FLAG_STATELESS |
+ DL_FLAG_PM_RUNTIME |
+ DL_FLAG_RPM_ACTIVE);
+ if (!pd_link_a) {
+ dev_err(dev, "Failed to add device_link to mu a.\n");
+ ret = -ENODEV;
+ goto err_detach;
+ }
+ }
- if (!pd_link_b) {
- dev_err(dev, "Failed to add device_link to mu a.\n");
- goto err_pd_b;
+ if (pd_b) {
+ pd_link_b = device_link_add(dev, pd_b,
+ DL_FLAG_STATELESS |
+ DL_FLAG_PM_RUNTIME |
+ DL_FLAG_RPM_ACTIVE);
+ if (!pd_link_b) {
+ dev_err(dev, "Failed to add device_link to mu b.\n");
+ ret = -ENODEV;
+ goto err_remove_link_a;
+ }
}
ret = imx_mu_msi_domains_init(msi_data, dev);
if (ret)
- goto err_dm_init;
+ goto err_remove_links;
pm_runtime_enable(dev);
@@ -381,12 +386,20 @@ static int imx_mu_probe(struct platform_device *pdev, struct device_node *parent
return 0;
-err_dm_init:
- device_link_remove(dev, pd_b);
-err_pd_b:
- device_link_remove(dev, pd_a);
-err_pd_a:
- return -EINVAL;
+err_remove_links:
+ if (pd_link_b)
+ device_link_remove(dev, pd_b);
+err_remove_link_a:
+ if (pd_link_a)
+ device_link_remove(dev, pd_a);
+err_detach:
+ if (pd_b)
+ dev_pm_domain_detach(pd_b, true);
+err_detach_a:
+ if (pd_a)
+ dev_pm_domain_detach(pd_a, true);
+
+ return ret;
}
static int __maybe_unused imx_mu_runtime_suspend(struct device *dev)
--
2.56.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] irqchip/imx-mu-msi: Fix MSI dispatch through the parent domain
2026-11-15 14:11 ` [PATCH 1/2] irqchip/imx-mu-msi: Fix MSI dispatch through the parent domain Peng Fan
@ 2026-11-16 17:14 ` Frank Li
0 siblings, 0 replies; 5+ messages in thread
From: Frank Li @ 2026-11-16 17:14 UTC (permalink / raw)
To: Peng Fan
Cc: Thomas Gleixner, Radu Rendec, Frank Li, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Shivamurthy Shastri,
Anna-Maria Behnsen, Marc Zyngier, linux-kernel, imx,
linux-arm-kernel, Peng Fan
On Sun, Nov 15, 2026 at 10:11:25PM +0800, Peng Fan wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> Since commit 7b2f8aa005bc ("irqchip/imx-mu-msi: Switch to MSI parent")
> the driver creates the MSI parent (nexus) domain in
> imx_mu_msi_domains_init(), but never stores it in msi_data->msi_domain.
> The chained interrupt handler therefore calls generic_handle_domain_irq()
> with a NULL domain, which resolves the hardware interrupt against
> irq_default_domain instead of the MU domain. Depending on the platform
> this dispatches an unrelated interrupt or drops the MSI completely.
>
> Save the nexus domain so that the handler resolves MU channel numbers
> through the domain whose reverse map was populated when the MSI was
> allocated.
>
> Fixes: 7b2f8aa005bc ("irqchip/imx-mu-msi: Switch to MSI parent")
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/irqchip/irq-imx-mu-msi.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/irqchip/irq-imx-mu-msi.c b/drivers/irqchip/irq-imx-mu-msi.c
> index 6d7baeeb2bc8..c42ea0797624 100644
> --- a/drivers/irqchip/irq-imx-mu-msi.c
> +++ b/drivers/irqchip/irq-imx-mu-msi.c
> @@ -238,6 +238,7 @@ static int imx_mu_msi_domains_init(struct imx_mu_msi *msi_data, struct device *d
> return -ENOMEM;
> }
> parent->dev = parent->pm_dev = dev;
> + msi_data->msi_domain = parent;
> return 0;
> }
>
>
> --
> 2.56.0
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] irqchip/imx-mu-msi: Fix PM domain teardown on probe errors
2026-11-15 14:11 ` [PATCH 2/2] irqchip/imx-mu-msi: Fix PM domain teardown on probe errors Peng Fan
@ 2026-11-16 17:17 ` Frank Li
0 siblings, 0 replies; 5+ messages in thread
From: Frank Li @ 2026-11-16 17:17 UTC (permalink / raw)
To: Peng Fan
Cc: Thomas Gleixner, Radu Rendec, Frank Li, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Shivamurthy Shastri,
Anna-Maria Behnsen, Marc Zyngier, linux-kernel, imx,
linux-arm-kernel, Peng Fan
On Sun, Nov 15, 2026 at 10:11:26PM +0800, Peng Fan wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> dev_pm_domain_attach_by_name() creates a virtual device for each
> attached PM domain, which must be released with dev_pm_domain_detach().
> The probe error paths only remove the device links, leaking both
> virtual devices. They also return -EINVAL instead of the actual error
> from imx_mu_msi_domains_init() and log the wrong domain name when the
> link for the second domain cannot be created.
>
> Detach the PM domains on every failure path and propagate the real
> error code. Since the power-domains property is optional in the
> fsl,mu-msi binding, treat a NULL domain as "not present" and skip the
> corresponding device link rather than failing the probe.
>
> Fixes: 70afdab904d2 ("irqchip: Add IMX MU MSI controller driver")
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/irqchip/irq-imx-mu-msi.c | 69 ++++++++++++++++++++++++----------------
> 1 file changed, 41 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/irqchip/irq-imx-mu-msi.c b/drivers/irqchip/irq-imx-mu-msi.c
> index c42ea0797624..42e930caed8d 100644
> --- a/drivers/irqchip/irq-imx-mu-msi.c
> +++ b/drivers/irqchip/irq-imx-mu-msi.c
> @@ -300,8 +300,8 @@ static const struct imx_mu_dcfg imx_mu_cfg_imx8ulp = {
> static int imx_mu_probe(struct platform_device *pdev, struct device_node *parent,
> const struct imx_mu_dcfg *cfg)
> {
> - struct device_link *pd_link_a;
> - struct device_link *pd_link_b;
> + struct device_link *pd_link_a = NULL;
> + struct device_link *pd_link_b = NULL;
> struct imx_mu_msi *msi_data;
> struct resource *res;
> struct device *pd_a;
> @@ -345,33 +345,38 @@ static int imx_mu_probe(struct platform_device *pdev, struct device_node *parent
> return PTR_ERR(pd_a);
>
> pd_b = dev_pm_domain_attach_by_name(dev, "processor-b-side");
> - if (IS_ERR(pd_b))
> - return PTR_ERR(pd_b);
> -
> - pd_link_a = device_link_add(dev, pd_a,
> - DL_FLAG_STATELESS |
> - DL_FLAG_PM_RUNTIME |
> - DL_FLAG_RPM_ACTIVE);
> -
> - if (!pd_link_a) {
> - dev_err(dev, "Failed to add device_link to mu a.\n");
> - goto err_pd_a;
> + if (IS_ERR(pd_b)) {
> + ret = PTR_ERR(pd_b);
> + goto err_detach_a;
> }
>
> - pd_link_b = device_link_add(dev, pd_b,
> - DL_FLAG_STATELESS |
> - DL_FLAG_PM_RUNTIME |
> - DL_FLAG_RPM_ACTIVE);
> -
> + if (pd_a) {
> + pd_link_a = device_link_add(dev, pd_a,
> + DL_FLAG_STATELESS |
> + DL_FLAG_PM_RUNTIME |
> + DL_FLAG_RPM_ACTIVE);
> + if (!pd_link_a) {
> + dev_err(dev, "Failed to add device_link to mu a.\n");
> + ret = -ENODEV;
> + goto err_detach;
> + }
> + }
>
> - if (!pd_link_b) {
> - dev_err(dev, "Failed to add device_link to mu a.\n");
> - goto err_pd_b;
> + if (pd_b) {
> + pd_link_b = device_link_add(dev, pd_b,
> + DL_FLAG_STATELESS |
> + DL_FLAG_PM_RUNTIME |
> + DL_FLAG_RPM_ACTIVE);
> + if (!pd_link_b) {
> + dev_err(dev, "Failed to add device_link to mu b.\n");
> + ret = -ENODEV;
> + goto err_remove_link_a;
> + }
> }
>
> ret = imx_mu_msi_domains_init(msi_data, dev);
> if (ret)
> - goto err_dm_init;
> + goto err_remove_links;
>
> pm_runtime_enable(dev);
>
> @@ -381,12 +386,20 @@ static int imx_mu_probe(struct platform_device *pdev, struct device_node *parent
>
> return 0;
>
> -err_dm_init:
> - device_link_remove(dev, pd_b);
> -err_pd_b:
> - device_link_remove(dev, pd_a);
> -err_pd_a:
> - return -EINVAL;
> +err_remove_links:
> + if (pd_link_b)
> + device_link_remove(dev, pd_b);
> +err_remove_link_a:
> + if (pd_link_a)
> + device_link_remove(dev, pd_a);
> +err_detach:
> + if (pd_b)
> + dev_pm_domain_detach(pd_b, true);
> +err_detach_a:
> + if (pd_a)
> + dev_pm_domain_detach(pd_a, true);
> +
> + return ret;
> }
>
> static int __maybe_unused imx_mu_runtime_suspend(struct device *dev)
>
> --
> 2.56.0
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-11-16 17:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-15 14:11 [PATCH 0/2] irqchip/imx-mu-msi: Fix MSI dispatch and probe error handling Peng Fan
2026-11-15 14:11 ` [PATCH 1/2] irqchip/imx-mu-msi: Fix MSI dispatch through the parent domain Peng Fan
2026-11-16 17:14 ` Frank Li
2026-11-15 14:11 ` [PATCH 2/2] irqchip/imx-mu-msi: Fix PM domain teardown on probe errors Peng Fan
2026-11-16 17:17 ` Frank Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox