* [PATCH] i3c: master: dw-i3c: Balance PM runtime usage count on probe failure
@ 2026-03-21 9:04 Felix Gu
2026-03-23 18:52 ` Frank Li
2026-04-12 14:39 ` Alexandre Belloni
0 siblings, 2 replies; 3+ messages in thread
From: Felix Gu @ 2026-03-21 9:04 UTC (permalink / raw)
To: Alexandre Belloni, Frank Li, Adrian Ng Ho Yin
Cc: linux-i3c, linux-kernel, Felix Gu
When DW_I3C_DISABLE_RUNTIME_PM_QUIRK is set, the probe function calls
pm_runtime_get_noresume() to prevent runtime suspend. However, if
i3c_master_register() fails, the error path does not balance this
call, leaving the usage count incremented.
Add pm_runtime_put_noidle() in the error cleanup path to properly
balance the usage count.
Fixes: fba0e56ee752 ("i3c: dw: Disable runtime PM on Agilex5 to avoid bus hang on IBI")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
drivers/i3c/master/dw-i3c-master.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index d6bdb32397fb..9c8de64c203b 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -1669,6 +1669,8 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
return 0;
err_disable_pm:
+ if (master->quirks & DW_I3C_DISABLE_RUNTIME_PM_QUIRK)
+ pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_dont_use_autosuspend(&pdev->dev);
---
base-commit: b5d083a3ed1e2798396d5e491432e887da8d4a06
change-id: 20260321-dw-i3c-1-92224b35d7e4
Best regards,
--
Felix Gu <ustc.gu@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] i3c: master: dw-i3c: Balance PM runtime usage count on probe failure
2026-03-21 9:04 [PATCH] i3c: master: dw-i3c: Balance PM runtime usage count on probe failure Felix Gu
@ 2026-03-23 18:52 ` Frank Li
2026-04-12 14:39 ` Alexandre Belloni
1 sibling, 0 replies; 3+ messages in thread
From: Frank Li @ 2026-03-23 18:52 UTC (permalink / raw)
To: Felix Gu; +Cc: Alexandre Belloni, Adrian Ng Ho Yin, linux-i3c, linux-kernel
On Sat, Mar 21, 2026 at 05:04:43PM +0800, Felix Gu wrote:
> When DW_I3C_DISABLE_RUNTIME_PM_QUIRK is set, the probe function calls
> pm_runtime_get_noresume() to prevent runtime suspend. However, if
> i3c_master_register() fails, the error path does not balance this
> call, leaving the usage count incremented.
>
> Add pm_runtime_put_noidle() in the error cleanup path to properly
> balance the usage count.
>
> Fixes: fba0e56ee752 ("i3c: dw: Disable runtime PM on Agilex5 to avoid bus hang on IBI")
> Signed-off-by: Felix Gu <ustc.gu@gmail.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/i3c/master/dw-i3c-master.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
> index d6bdb32397fb..9c8de64c203b 100644
> --- a/drivers/i3c/master/dw-i3c-master.c
> +++ b/drivers/i3c/master/dw-i3c-master.c
> @@ -1669,6 +1669,8 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
> return 0;
>
> err_disable_pm:
> + if (master->quirks & DW_I3C_DISABLE_RUNTIME_PM_QUIRK)
> + pm_runtime_put_noidle(&pdev->dev);
> pm_runtime_disable(&pdev->dev);
> pm_runtime_set_suspended(&pdev->dev);
> pm_runtime_dont_use_autosuspend(&pdev->dev);
>
> ---
> base-commit: b5d083a3ed1e2798396d5e491432e887da8d4a06
> change-id: 20260321-dw-i3c-1-92224b35d7e4
>
> Best regards,
> --
> Felix Gu <ustc.gu@gmail.com>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] i3c: master: dw-i3c: Balance PM runtime usage count on probe failure
2026-03-21 9:04 [PATCH] i3c: master: dw-i3c: Balance PM runtime usage count on probe failure Felix Gu
2026-03-23 18:52 ` Frank Li
@ 2026-04-12 14:39 ` Alexandre Belloni
1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2026-04-12 14:39 UTC (permalink / raw)
To: Frank Li, Adrian Ng Ho Yin, Felix Gu; +Cc: linux-i3c, linux-kernel
On Sat, 21 Mar 2026 17:04:43 +0800, Felix Gu wrote:
> When DW_I3C_DISABLE_RUNTIME_PM_QUIRK is set, the probe function calls
> pm_runtime_get_noresume() to prevent runtime suspend. However, if
> i3c_master_register() fails, the error path does not balance this
> call, leaving the usage count incremented.
>
> Add pm_runtime_put_noidle() in the error cleanup path to properly
> balance the usage count.
>
> [...]
Applied, thanks!
[1/1] i3c: master: dw-i3c: Balance PM runtime usage count on probe failure
https://git.kernel.org/i3c/c/19d6dd322c3f
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-12 14:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-21 9:04 [PATCH] i3c: master: dw-i3c: Balance PM runtime usage count on probe failure Felix Gu
2026-03-23 18:52 ` Frank Li
2026-04-12 14:39 ` Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®