clk: imx: scu: Fix pm_runtime_get_sync() error checking
Subsystems (3)
PATCH 1/1 clk: imx: scu: Fix pm_runtime_get_sync() error checking
If the device is already in a runtime PM enabled state pm_runtime_get_sync() will return 1, so a test for negative value should be used to check for errors.
--- drivers/clk/imx/clk-scu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/imx/clk-scu.c +1 -1
@@ -529,7 +529,7 @@ static int imx_clk_scu_probe(struct platform_device *pdev)pm_runtime_enable (dev); ret =pm_runtime_get_sync (dev); -if (ret) { +if (ret <0 ) {pm_genpd_remove_device (dev);pm_runtime_disable (dev);return ret;
Signature · 7 lines
2.17.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 6 lines · Miaoqian Lin
If the device is already in a runtime PM enabled state
pm_runtime_get_sync()will return 1, so a test for negative value should be used to check for errors.Fixes 78edeb080330 ("clk: imx: scu: add runtime pm support")Signed-off-by Miaoqian Lin <[email protected]>
Quoted 20 lines
--- drivers/clk/imx/clk-scu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/imx/clk-scu.c +1
-2@@ -529,7 +529,7 @@ static int imx_clk_scu_probe(struct platform_device *pdev)pm_runtime_enable (dev); ret =pm_runtime_get_sync (dev); -if (ret) { +if (ret <0 ) {pm_genpd_remove_device (dev);pm_runtime_disable (dev);return ret; --2.17.1
Stephen Boyd
maintainerQuoting Miaoqian Lin (2022-04-11 23:57:18)
Quoted 3 lines
If the device is already in a runtime PM enabled state
pm_runtime_get_sync()will return 1, so a test for negative value should be used to check for errors.
Maybe it should use pm_runtime_resume_and_get() instead?
Quoted 23 lines
Fixes 78edeb080330 ("clk: imx: scu: add runtime pm support")Signed-off-by Miaoqian Lin <[email protected]>--- drivers/clk/imx/clk-scu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/imx/clk-scu.c +1
-1@@ -529,7 +529,7 @@ static int imx_clk_scu_probe(struct platform_device *pdev)pm_runtime_enable (dev); ret =pm_runtime_get_sync (dev); -if (ret) { +if (ret <0 ) {pm_genpd_remove_device (dev);pm_runtime_disable (dev);return ret;Signature · 1 line
2.17.1
Quoted 5 lines · Stephen Boyd
Quoting Miaoqian Lin (2022-04-11 23:57:18)
Quoted 3 lines
If the device is already in a runtime PM enabled state
pm_runtime_get_sync()will return 1, so a test for negative value should be used to check for errors.Maybe it should use
pm_runtime_resume_and_get()instead?
Fair enough,I will send patch v2.
Quoted 22 lines
Quoted 22 lines
Fixes 78edeb080330 ("clk: imx: scu: add runtime pm support")Signed-off-by Miaoqian Lin <[email protected]>--- drivers/clk/imx/clk-scu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/imx/clk-scu.c +1
-1@@ -529,7 +529,7 @@ static int imx_clk_scu_probe(struct platform_device *pdev)pm_runtime_enable (dev); ret =pm_runtime_get_sync (dev); -if (ret) { +if (ret <0 ) {pm_genpd_remove_device (dev);pm_runtime_disable (dev);return ret;Signature · 1 line
2.17.1
PATCH v2 1/1 clk: imx: scu: Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage
In reply to Stephen BoydIf the device is already in a runtime PM enabled state pm_runtime_get_sync() will return 1.
Also, we need to call pm_runtime_put_noidle() when pm_runtime_get_sync() fails, so use pm_runtime_resume_and_get() instead. this function will handle this.
--- drivers/clk/imx/clk-scu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/imx/clk-scu.c +1 -1
@@ -528,7 +528,7 @@ static int imx_clk_scu_probe(struct platform_device *pdev)pm_runtime_use_autosuspend (&pdev->dev);pm_runtime_enable (dev); - ret =pm_runtime_get_sync (dev); + ret =pm_runtime_resume_and_get (dev);if (ret) {pm_genpd_remove_device (dev);pm_runtime_disable (dev);
Signature · 1 line
2.17.1
Stephen Boyd
maintainerRe: [PATCH v2] clk: imx: scu: Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage
Quoting Miaoqian Lin (2022-04-21 18:33:16)
Quoted 10 lines
If the device is already in a runtime PM enabled state
pm_runtime_get_sync()will return 1.Also, we need to call
pm_runtime_put_noidle()whenpm_runtime_get_sync()fails, so usepm_runtime_resume_and_get()instead. this function will handle this.Fixes 78edeb080330 ("clk: imx: scu: add runtime pm support")Signed-off-by Miaoqian Lin <[email protected]>---
Please don't send patches as replies to previous versions of the patch.
Quoted 19 lines
drivers/clk/imx/clk-scu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/imx/clk-scu.c +1
-1@@ -528,7 +528,7 @@ static int imx_clk_scu_probe(struct platform_device *pdev)pm_runtime_use_autosuspend (&pdev->dev);pm_runtime_enable (dev); - ret =pm_runtime_get_sync (dev); + ret =pm_runtime_resume_and_get (dev);if (ret) {pm_genpd_remove_device (dev);pm_runtime_disable (dev);Signature · 1 line
2.17.1
Re: [PATCH v2] clk: imx: scu: Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage
Quoted 4 lines · Stephen Boyd
Quoting Miaoqian Lin (2022-04-21 18:33:16)
Quoted 3 lines
If the device is already in a runtime PM enabled state
pm_runtime_get_sync()will return 1.
Quoted 8 lines
Quoted 7 lines
Also, we need to call
pm_runtime_put_noidle()whenpm_runtime_get_sync()fails, so usepm_runtime_resume_and_get()instead. this function will handle this.Fixes 78edeb080330 ("clk: imx: scu: add runtime pm support")Signed-off-by Miaoqian Lin <[email protected]>---
Please don't send patches as replies to previous versions of the patch.
Sorry, I thought I should keep them in one thread, to provide the context
for other people to follow up. Am I suppose to resend it?
Quoted 19 lines
Quoted 19 lines
drivers/clk/imx/clk-scu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/imx/clk-scu.c +1
-1@@ -528,7 +528,7 @@ static int imx_clk_scu_probe(struct platform_device *pdev)pm_runtime_use_autosuspend (&pdev->dev);pm_runtime_enable (dev); - ret =pm_runtime_get_sync (dev); + ret =pm_runtime_resume_and_get (dev);if (ret) {pm_genpd_remove_device (dev);pm_runtime_disable (dev);Signature · 1 line
2.17.1
Stephen Boyd
maintainerRe: [PATCH v2] clk: imx: scu: Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage
Quoting Miaoqian Lin (2022-04-21 18:59:54)
Quoted 10 lines · Stephen Boyd
Quoted 8 lines
Quoting Miaoqian Lin (2022-04-21 18:33:16)
Quoted 7 lines
If the device is already in a runtime PM enabled state
pm_runtime_get_sync()will return 1.Also, we need to call
pm_runtime_put_noidle()whenpm_runtime_get_sync()fails, so usepm_runtime_resume_and_get()instead. this function will handle this.
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
Fixes 78edeb080330 ("clk: imx: scu: add runtime pm support")Signed-off-by Miaoqian Lin <[email protected]>---
Please don't send patches as replies to previous versions of the patch.
Sorry, I thought I should keep them in one thread, to provide the context
Please link back to previous revisions with lore.
https://lore.kernel.org/r/<message-id-of-rev1>
and then add a change log below the triple dash referencing that lore link and anything that has changed since that revision.
Quoted 2 lines
for other people to follow up. Am I suppose to resend it?
Yes. Might as well practice making a changelog at the same time.