iio: adc: add missing clk_disable_unprepare() in rzg2l_adc_pm_runtime_resume()
Subsystems (2)
PATCH 1/1 iio: adc: add missing clk_disable_unprepare() in rzg2l_adc_pm_runtime_resume()
Add clk_disable_unprepare() on error path in rzg2l_adc_pm_runtime_resume().
--- drivers/iio/adc/rzg2l_adc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/iio/adc/rzg2l_adc.c +3 -1
@@ -570,8 +570,10 @@ static int __maybe_unused rzg2l_adc_pm_runtime_resume(struct device *dev)return ret; ret =clk_prepare_enable (adc->adclk); -if (ret) +if (ret) { +clk_disable_unprepare (adc->pclk);return ret; + }rzg2l_adc_pwr (adc, true);
Signature · 1 line
2.25.1
Quoted 2 lines · Yang Yingliang
Add
clk_disable_unprepare()on error path inrzg2l_adc_pm_runtime_resume().
...
drivers/iio/adc/rzg2l_adc.c static int __maybe_unused rzg2l_adc_pm_runtime_resume(struct device *dev) · line 576
Quoted 6 lines
ret = clk_prepare_enable(adc->adclk);drivers/iio/adc/rzg2l_adc.c +3
-1-if (ret) +if (ret) { +clk_disable_unprepare (adc->pclk);return ret; + }
Huh?!
Signature · 2 lines
With Best Regards, Andy Shevchenko
Hi,
Quoted 11 lines · Andy Shevchenko
Quoted 1 line · Yang Yingliang
Add
clk_disable_unprepare()on error path inrzg2l_adc_pm_runtime_resume()....
drivers/iio/adc/rzg2l_adc.c static int __maybe_unused rzg2l_adc_pm_runtime_resume(struct device *dev) · line 576
Quoted 6 lines
ret = clk_prepare_enable(adc->adclk);drivers/iio/adc/rzg2l_adc.c +3
-1-if (ret) +if (ret) { +clk_disable_unprepare (adc->pclk);return ret; + }Huh?!
The pclk need be disabled, when enable adclk failed.
^ ^^
Quoted 1 line
Quoted 11 lines · Yang Yingliang
Quoted 10 lines · Andy Shevchenko
Quoted 1 line · Yang Yingliang
Add
clk_disable_unprepare()on error path inrzg2l_adc_pm_runtime_resume()....
Quoted 6 lines
ret = clk_prepare_enable(adc->adclk);drivers/iio/adc/rzg2l_adc.c +3
-1-if (ret) +if (ret) { +clk_disable_unprepare (adc->pclk);return ret; + }
Quoted 3 lines
Quoted 1 line
Huh?!
The pclk need be disabled, when enable adclk failed.
^ ^^
Indeed. I'm wondering if those clocks behave like a bulk or any combination is possible on a working case?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Jonathan Cameron
maintainerQuoted 12 lines · On Fri, 20 Aug 2021 12:17:46 +0300 Andy Shevchenko <[email protected]>…
Quoted 11 lines · Yang Yingliang
Quoted 10 lines · Andy Shevchenko
Quoted 1 line · Yang Yingliang
Add
clk_disable_unprepare()on error path inrzg2l_adc_pm_runtime_resume()....
Quoted 6 lines
ret = clk_prepare_enable(adc->adclk);drivers/iio/adc/rzg2l_adc.c +3
-1-if (ret) +if (ret) { +clk_disable_unprepare (adc->pclk);return ret; + }
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Huh?!
The pclk need be disabled, when enable adclk failed.
^ ^^Indeed. I'm wondering if those clocks behave like a bulk or any combination is possible on a working case?
They are handled independently in other parts of the driver, so bulk setting is going to be a mess.
Quoted 1 line
Sa, Nuno
reviewerQuoted 16 lines
From: Andy Shevchenko <[email protected]>
Sent: Thursday, August 19, 2021 7:21 PM
To: Yang Yingliang <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH -next] iio: adc: add missingclk_disable_unprepare()inrzg2l_adc_pm_runtime_resume()Quoted 2 lines · Yang Yingliang
Add
clk_disable_unprepare()on error path in
rzg2l_adc_pm_runtime_resume()....
Quoted 9 lines
drivers/iio/adc/rzg2l_adc.c static int __maybe_unused rzg2l_adc_pm_runtime_resume(struct device *dev) · line 576
Quoted 6 lines
ret = clk_prepare_enable(adc->adclk);drivers/iio/adc/rzg2l_adc.c +3
-1-if (ret) +if (ret) { +clk_disable_unprepare (adc->pclk);return ret; + }Huh?!
Had the same reaction when looked at this patch. Look at the clock names :).
- Nuno Sá
Hi Yang,
Thank you for the patch.
Quoted 7 lines
-----Original Message-----
From: Yang Yingliang <[email protected]>
Sent: 19 August 2021 14:24
To: [email protected]; [email protected]
Cc: Prabhakar Mahadev Lad <[email protected]>; [email protected]
Subject: [PATCH -next] iio: adc: add missingclk_disable_unprepare()inrzg2l_adc_pm_runtime_resume()
Quoted 8 lines
Add
clk_disable_unprepare()on error path inrzg2l_adc_pm_runtime_resume().Reported-by Hulk Robot <[email protected]>Signed-off-by Yang Yingliang <[email protected]>--- drivers/iio/adc/rzg2l_adc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
With subject line changed to, iio: adc: rzg2l_adc: add missing clk_disable_unprepare() in rzg2l_adc_pm_runtime_resume()
Cheers,
Prabhakar
Quoted 18 lines
drivers/iio/adc/rzg2l_adc.c index renamed from drivers/iio/adc/rzg2l_adc.c +0
-0
9996d5eef289..c38f43ea624f100644drivers/iio/adc/rzg2l_adc.c +3
-2@@ -570,8 +570,10 @@ static int __maybe_unused rzg2l_adc_pm_runtime_resume(struct device *dev)return ret; ret =clk_prepare_enable (adc->adclk); -if (ret) +if (ret) { +clk_disable_unprepare (adc->pclk);return ret; + }rzg2l_adc_pwr (adc, true); --2.25.1
Jonathan Cameron
maintainerQuoted 19 lines · On Fri, 20 Aug 2021 14:04:15 +0000 Prabhakar Mahadev Lad…
Hi Yang,
Thank you for the patch.
Quoted 7 lines
-----Original Message-----
From: Yang Yingliang <[email protected]>
Sent: 19 August 2021 14:24
To: [email protected]; [email protected]
Cc: Prabhakar Mahadev Lad <[email protected]>; [email protected]
Subject: [PATCH -next] iio: adc: add missingclk_disable_unprepare()inrzg2l_adc_pm_runtime_resume()Quoted 8 lines
Add
clk_disable_unprepare()on error path inrzg2l_adc_pm_runtime_resume().Reported-by Hulk Robot <[email protected]>Signed-off-by Yang Yingliang <[email protected]>--- drivers/iio/adc/rzg2l_adc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 3 lines
With subject line changed to, iio: adc:
rzg2l_adc: add missingclk_disable_unprepare()inrzg2l_adc_pm_runtime_resume()Reviewed-by Lad Prabhakar <[email protected]>
Patch title updated as suggested and applied to the fixes-togreg branch of iio.git which will go upstream sometime after rc1.
Thanks,
Jonathan
Quoted 23 lines
Cheers,
PrabhakarQuoted 18 lines
drivers/iio/adc/rzg2l_adc.c index renamed from drivers/iio/adc/rzg2l_adc.c +0
-0
9996d5eef289..c38f43ea624f100644drivers/iio/adc/rzg2l_adc.c +3
-2@@ -570,8 +570,10 @@ static int __maybe_unused rzg2l_adc_pm_runtime_resume(struct device *dev)return ret; ret =clk_prepare_enable (adc->adclk); -if (ret) +if (ret) { +clk_disable_unprepare (adc->pclk);return ret; + }rzg2l_adc_pwr (adc, true); --2.25.1