* [PATCH] i2c: designware: amdisp: balance genpd on probe failure
@ 2026-07-08 9:05 Guangshuo Li
2026-07-08 14:24 ` Andy Shevchenko
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Guangshuo Li @ 2026-07-08 9:05 UTC (permalink / raw)
To: Mika Westerberg, Andy Shevchenko, Nirujogi Pratap, Bin Du,
Andi Shyti, linux-i2c, linux-kernel
Cc: Guangshuo Li
The change referenced by the Fixes tag avoids a runtime PM resume during
probe by powering the ISP domain directly with dev_pm_genpd_resume()
before calling i2c_dw_probe(). Runtime PM is enabled only after
i2c_dw_probe() has succeeded.
However, the i2c_dw_probe() failure path still uses the old runtime PM
cleanup path. At that point pm_runtime_enable() has not been called yet,
so pm_runtime_disable() is not paired with any enable. The failure path
also skips the dev_pm_genpd_suspend() needed to balance the direct
dev_pm_genpd_resume() call.
Suspend the genpd on the i2c_dw_probe() failure path instead of disabling
runtime PM. This keeps the direct genpd resume/suspend pairing symmetric
on both success and failure paths.
Fixes: e2f1ada8e089 ("i2c: designware: amdisp: Fix resume-probe race condition issue")
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
---
drivers/i2c/busses/i2c-designware-amdisp.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-designware-amdisp.c b/drivers/i2c/busses/i2c-designware-amdisp.c
index 9f0ec0fae6f2..724cb05e21c8 100644
--- a/drivers/i2c/busses/i2c-designware-amdisp.c
+++ b/drivers/i2c/busses/i2c-designware-amdisp.c
@@ -81,7 +81,7 @@ static int amd_isp_dw_i2c_plat_probe(struct platform_device *pdev)
ret = i2c_dw_probe(isp_i2c_dev);
if (ret) {
dev_err_probe(&pdev->dev, ret, "i2c_dw_probe failed\n");
- goto error_release_rpm;
+ goto error_suspend_genpd;
}
dev_pm_genpd_suspend(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
@@ -89,8 +89,8 @@ static int amd_isp_dw_i2c_plat_probe(struct platform_device *pdev)
return 0;
-error_release_rpm:
- amd_isp_dw_i2c_plat_pm_cleanup(isp_i2c_dev);
+error_suspend_genpd:
+ dev_pm_genpd_suspend(&pdev->dev);
return ret;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] i2c: designware: amdisp: balance genpd on probe failure
2026-07-08 9:05 [PATCH] i2c: designware: amdisp: balance genpd on probe failure Guangshuo Li
@ 2026-07-08 14:24 ` Andy Shevchenko
2026-07-08 15:36 ` Nirujogi, Pratap
2026-07-09 6:04 ` Mukesh Savaliya
2 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2026-07-08 14:24 UTC (permalink / raw)
To: Guangshuo Li
Cc: Mika Westerberg, Nirujogi Pratap, Bin Du, Andi Shyti, linux-i2c,
linux-kernel
On Wed, Jul 08, 2026 at 05:05:52PM +0800, Guangshuo Li wrote:
> The change referenced by the Fixes tag avoids a runtime PM resume during
> probe by powering the ISP domain directly with dev_pm_genpd_resume()
> before calling i2c_dw_probe(). Runtime PM is enabled only after
> i2c_dw_probe() has succeeded.
>
> However, the i2c_dw_probe() failure path still uses the old runtime PM
> cleanup path. At that point pm_runtime_enable() has not been called yet,
> so pm_runtime_disable() is not paired with any enable. The failure path
> also skips the dev_pm_genpd_suspend() needed to balance the direct
> dev_pm_genpd_resume() call.
>
> Suspend the genpd on the i2c_dw_probe() failure path instead of disabling
> runtime PM. This keeps the direct genpd resume/suspend pairing symmetric
> on both success and failure paths.
Ideally this needs AMD people to Ack.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] i2c: designware: amdisp: balance genpd on probe failure
2026-07-08 9:05 [PATCH] i2c: designware: amdisp: balance genpd on probe failure Guangshuo Li
2026-07-08 14:24 ` Andy Shevchenko
@ 2026-07-08 15:36 ` Nirujogi, Pratap
2026-07-09 6:04 ` Mukesh Savaliya
2 siblings, 0 replies; 5+ messages in thread
From: Nirujogi, Pratap @ 2026-07-08 15:36 UTC (permalink / raw)
To: Guangshuo Li, Mika Westerberg, Andy Shevchenko, Nirujogi Pratap,
Bin Du, Andi Shyti, linux-i2c, linux-kernel
On 7/8/2026 5:05 AM, Guangshuo Li wrote:
> [You don't often get email from lgs201920130244@gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
>
>
> The change referenced by the Fixes tag avoids a runtime PM resume during
> probe by powering the ISP domain directly with dev_pm_genpd_resume()
> before calling i2c_dw_probe(). Runtime PM is enabled only after
> i2c_dw_probe() has succeeded.
>
> However, the i2c_dw_probe() failure path still uses the old runtime PM
> cleanup path. At that point pm_runtime_enable() has not been called yet,
> so pm_runtime_disable() is not paired with any enable. The failure path
> also skips the dev_pm_genpd_suspend() needed to balance the direct
> dev_pm_genpd_resume() call.
>
> Suspend the genpd on the i2c_dw_probe() failure path instead of disabling
> runtime PM. This keeps the direct genpd resume/suspend pairing symmetric
> on both success and failure paths.
>
> Fixes: e2f1ada8e089 ("i2c: designware: amdisp: Fix resume-probe race condition issue")
> Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
> ---
> drivers/i2c/busses/i2c-designware-amdisp.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-designware-amdisp.c b/drivers/i2c/busses/i2c-designware-amdisp.c
> index 9f0ec0fae6f2..724cb05e21c8 100644
> --- a/drivers/i2c/busses/i2c-designware-amdisp.c
> +++ b/drivers/i2c/busses/i2c-designware-amdisp.c
> @@ -81,7 +81,7 @@ static int amd_isp_dw_i2c_plat_probe(struct platform_device *pdev)
> ret = i2c_dw_probe(isp_i2c_dev);
> if (ret) {
> dev_err_probe(&pdev->dev, ret, "i2c_dw_probe failed\n");
> - goto error_release_rpm;
> + goto error_suspend_genpd;
> }
> dev_pm_genpd_suspend(&pdev->dev);
> pm_runtime_set_suspended(&pdev->dev);
> @@ -89,8 +89,8 @@ static int amd_isp_dw_i2c_plat_probe(struct platform_device *pdev)
>
> return 0;
>
> -error_release_rpm:
> - amd_isp_dw_i2c_plat_pm_cleanup(isp_i2c_dev);
> +error_suspend_genpd:
> + dev_pm_genpd_suspend(&pdev->dev);
> return ret;
> }
>
Good catch! I overlooked that earlier. Thanks.
Acked-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] i2c: designware: amdisp: balance genpd on probe failure
2026-07-08 9:05 [PATCH] i2c: designware: amdisp: balance genpd on probe failure Guangshuo Li
2026-07-08 14:24 ` Andy Shevchenko
2026-07-08 15:36 ` Nirujogi, Pratap
@ 2026-07-09 6:04 ` Mukesh Savaliya
2026-07-09 7:26 ` Bin Du
2 siblings, 1 reply; 5+ messages in thread
From: Mukesh Savaliya @ 2026-07-09 6:04 UTC (permalink / raw)
To: Guangshuo Li, Mika Westerberg, Andy Shevchenko, Nirujogi Pratap,
Bin Du, Andi Shyti, linux-i2c, linux-kernel
Looks fine to me, Have someone from AMD also Ack'ing this as requested
by Andy Shevchenko.
On 7/8/2026 2:35 PM, Guangshuo Li wrote:
> The change referenced by the Fixes tag avoids a runtime PM resume during
> probe by powering the ISP domain directly with dev_pm_genpd_resume()
> before calling i2c_dw_probe(). Runtime PM is enabled only after
> i2c_dw_probe() has succeeded.
>
> However, the i2c_dw_probe() failure path still uses the old runtime PM
> cleanup path. At that point pm_runtime_enable() has not been called yet,
> so pm_runtime_disable() is not paired with any enable. The failure path
> also skips the dev_pm_genpd_suspend() needed to balance the direct
> dev_pm_genpd_resume() call.
>
> Suspend the genpd on the i2c_dw_probe() failure path instead of disabling
> runtime PM. This keeps the direct genpd resume/suspend pairing symmetric
> on both success and failure paths.
>
> Fixes: e2f1ada8e089 ("i2c: designware: amdisp: Fix resume-probe race condition issue")
> Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
> ---
> drivers/i2c/busses/i2c-designware-amdisp.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Acked-by: Mukesh Kumar Savaliya <mukesh.savaliya@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] i2c: designware: amdisp: balance genpd on probe failure
2026-07-09 6:04 ` Mukesh Savaliya
@ 2026-07-09 7:26 ` Bin Du
0 siblings, 0 replies; 5+ messages in thread
From: Bin Du @ 2026-07-09 7:26 UTC (permalink / raw)
To: Mukesh Savaliya, Guangshuo Li, Mika Westerberg, Andy Shevchenko,
Nirujogi Pratap, Andi Shyti, linux-i2c, linux-kernel
On 7/9/2026 2:04 PM, Mukesh Savaliya wrote:
> Looks fine to me, Have someone from AMD also Ack'ing this as requested
> by Andy Shevchenko.
>
> On 7/8/2026 2:35 PM, Guangshuo Li wrote:
>> The change referenced by the Fixes tag avoids a runtime PM resume during
>> probe by powering the ISP domain directly with dev_pm_genpd_resume()
>> before calling i2c_dw_probe(). Runtime PM is enabled only after
>> i2c_dw_probe() has succeeded.
>>
>> However, the i2c_dw_probe() failure path still uses the old runtime PM
>> cleanup path. At that point pm_runtime_enable() has not been called yet,
>> so pm_runtime_disable() is not paired with any enable. The failure path
>> also skips the dev_pm_genpd_suspend() needed to balance the direct
>> dev_pm_genpd_resume() call.
>>
>> Suspend the genpd on the i2c_dw_probe() failure path instead of disabling
>> runtime PM. This keeps the direct genpd resume/suspend pairing symmetric
>> on both success and failure paths.
>>
>> Fixes: e2f1ada8e089 ("i2c: designware: amdisp: Fix resume-probe race
>> condition issue")
>> Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
>> ---
>> drivers/i2c/busses/i2c-designware-amdisp.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> Acked-by: Mukesh Kumar Savaliya <mukesh.savaliya@oss.qualcomm.com>
>
Acked-by: Bin Du <bin.du@amd.com>
Tested-by: Bin Du <bin.du@amd.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-07-09 7:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08 9:05 [PATCH] i2c: designware: amdisp: balance genpd on probe failure Guangshuo Li
2026-07-08 14:24 ` Andy Shevchenko
2026-07-08 15:36 ` Nirujogi, Pratap
2026-07-09 6:04 ` Mukesh Savaliya
2026-07-09 7:26 ` Bin Du
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox