* [PATCH 1/3] pmdomain: imx: gpcv2: Use pm_runtime_resume_and_get()
2026-09-21 3:37 [PATCH 0/3] pmdomain: imx: Use pm_runtime_resume_and_get() phucduc.bui
@ 2026-09-21 3:37 ` phucduc.bui
2026-09-21 3:37 ` [PATCH 2/3] pmdomain: imx8m-blk-ctrl: " phucduc.bui
2026-09-21 3:37 ` [PATCH 3/3] pmdomain: imx93-blk-ctrl: " phucduc.bui
2 siblings, 0 replies; 4+ messages in thread
From: phucduc.bui @ 2026-09-21 3:37 UTC (permalink / raw)
To: Ulf Hansson, Frank Li, Sascha Hauer
Cc: Pengutronix Kernel Team, Fabio Estevam, rafael.j.wysocki,
Jacky Bai, Lucas Stach, Peng Fan, Xu Yang, Benjamin Gaignard,
Ming Qian, u.kleine-koenig, Marco Felsch, Alexander Stein,
Guoniu Zhou, linux-pm, imx, linux-arm-kernel, linux-kernel,
bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Replace the open-coded pm_runtime_get_sync() + pm_runtime_put_noidle()
error handling pattern with pm_runtime_resume_and_get(), which already
does this internally.
No functional change.
Found by manual code inspection.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/pmdomain/imx/gpcv2.c | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/drivers/pmdomain/imx/gpcv2.c b/drivers/pmdomain/imx/gpcv2.c
index a829f8da5be7..6a54ee734514 100644
--- a/drivers/pmdomain/imx/gpcv2.c
+++ b/drivers/pmdomain/imx/gpcv2.c
@@ -317,11 +317,9 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd)
u32 reg_val, pgc;
int ret;
- ret = pm_runtime_get_sync(domain->dev);
- if (ret < 0) {
- pm_runtime_put_noidle(domain->dev);
+ ret = pm_runtime_resume_and_get(domain->dev);
+ if (ret < 0)
return ret;
- }
if (!IS_ERR(domain->regulator)) {
ret = regulator_enable(domain->regulator);
@@ -1397,21 +1395,13 @@ static void imx_pgc_domain_remove(struct platform_device *pdev)
#ifdef CONFIG_PM_SLEEP
static int imx_pgc_domain_suspend(struct device *dev)
{
- int ret;
-
/*
* This may look strange, but is done so the generic PM_SLEEP code
* can power down our domain and more importantly power it up again
* after resume, without tripping over our usage of runtime PM to
* power up/down the nested domains.
*/
- ret = pm_runtime_get_sync(dev);
- if (ret < 0) {
- pm_runtime_put_noidle(dev);
- return ret;
- }
-
- return 0;
+ return pm_runtime_resume_and_get(dev);
}
static int imx_pgc_domain_resume(struct device *dev)
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH 2/3] pmdomain: imx8m-blk-ctrl: Use pm_runtime_resume_and_get()
2026-09-21 3:37 [PATCH 0/3] pmdomain: imx: Use pm_runtime_resume_and_get() phucduc.bui
2026-09-21 3:37 ` [PATCH 1/3] pmdomain: imx: gpcv2: " phucduc.bui
@ 2026-09-21 3:37 ` phucduc.bui
2026-09-21 3:37 ` [PATCH 3/3] pmdomain: imx93-blk-ctrl: " phucduc.bui
2 siblings, 0 replies; 4+ messages in thread
From: phucduc.bui @ 2026-09-21 3:37 UTC (permalink / raw)
To: Ulf Hansson, Frank Li, Sascha Hauer
Cc: Pengutronix Kernel Team, Fabio Estevam, rafael.j.wysocki,
Jacky Bai, Lucas Stach, Peng Fan, Xu Yang, Benjamin Gaignard,
Ming Qian, u.kleine-koenig, Marco Felsch, Alexander Stein,
Guoniu Zhou, linux-pm, imx, linux-arm-kernel, linux-kernel,
bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Replace the open-coded pm_runtime_get_sync() + pm_runtime_put_noidle()
error handling pattern with pm_runtime_resume_and_get(), which already
does this internally.
No functional change.
Found by manual code inspection.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/pmdomain/imx/imx8m-blk-ctrl.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/drivers/pmdomain/imx/imx8m-blk-ctrl.c b/drivers/pmdomain/imx/imx8m-blk-ctrl.c
index 479789009c7f..fe083b1e7251 100644
--- a/drivers/pmdomain/imx/imx8m-blk-ctrl.c
+++ b/drivers/pmdomain/imx/imx8m-blk-ctrl.c
@@ -99,9 +99,8 @@ static int imx8m_blk_ctrl_power_on(struct generic_pm_domain *genpd)
int ret;
/* make sure bus domain is awake */
- ret = pm_runtime_get_sync(bc->bus_power_dev);
+ ret = pm_runtime_resume_and_get(bc->bus_power_dev);
if (ret < 0) {
- pm_runtime_put_noidle(bc->bus_power_dev);
dev_err(bc->dev, "failed to power up bus domain\n");
return ret;
}
@@ -382,20 +381,16 @@ static int imx8m_blk_ctrl_suspend(struct device *dev)
* in the system suspend/resume paths due to the device parent/child
* hierarchy.
*/
- ret = pm_runtime_get_sync(bc->bus_power_dev);
- if (ret < 0) {
- pm_runtime_put_noidle(bc->bus_power_dev);
+ ret = pm_runtime_resume_and_get(bc->bus_power_dev);
+ if (ret < 0)
return ret;
- }
for (i = 0; i < bc->onecell_data.num_domains; i++) {
struct imx8m_blk_ctrl_domain *domain = &bc->domains[i];
- ret = pm_runtime_get_sync(domain->power_dev);
- if (ret < 0) {
- pm_runtime_put_noidle(domain->power_dev);
+ ret = pm_runtime_resume_and_get(domain->power_dev);
+ if (ret < 0)
goto out_fail;
- }
}
return 0;
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH 3/3] pmdomain: imx93-blk-ctrl: Use pm_runtime_resume_and_get()
2026-09-21 3:37 [PATCH 0/3] pmdomain: imx: Use pm_runtime_resume_and_get() phucduc.bui
2026-09-21 3:37 ` [PATCH 1/3] pmdomain: imx: gpcv2: " phucduc.bui
2026-09-21 3:37 ` [PATCH 2/3] pmdomain: imx8m-blk-ctrl: " phucduc.bui
@ 2026-09-21 3:37 ` phucduc.bui
2 siblings, 0 replies; 4+ messages in thread
From: phucduc.bui @ 2026-09-21 3:37 UTC (permalink / raw)
To: Ulf Hansson, Frank Li, Sascha Hauer
Cc: Pengutronix Kernel Team, Fabio Estevam, rafael.j.wysocki,
Jacky Bai, Lucas Stach, Peng Fan, Xu Yang, Benjamin Gaignard,
Ming Qian, u.kleine-koenig, Marco Felsch, Alexander Stein,
Guoniu Zhou, linux-pm, imx, linux-arm-kernel, linux-kernel,
bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Replace the open-coded pm_runtime_get_sync() + pm_runtime_put_noidle()
error handling pattern with pm_runtime_resume_and_get(), which already
does this internally.
No functional change.
Found by manual code inspection.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/pmdomain/imx/imx93-blk-ctrl.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/pmdomain/imx/imx93-blk-ctrl.c b/drivers/pmdomain/imx/imx93-blk-ctrl.c
index 243ce939ba68..6d4c55a85c64 100644
--- a/drivers/pmdomain/imx/imx93-blk-ctrl.c
+++ b/drivers/pmdomain/imx/imx93-blk-ctrl.c
@@ -152,9 +152,8 @@ static int imx93_blk_ctrl_power_on(struct generic_pm_domain *genpd)
return ret;
}
- ret = pm_runtime_get_sync(bc->dev);
+ ret = pm_runtime_resume_and_get(bc->dev);
if (ret < 0) {
- pm_runtime_put_noidle(bc->dev);
dev_err(bc->dev, "failed to power up domain\n");
goto disable_clk;
}
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread