linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtc: stm32: add missed clk_disable_unprepare in error path of resume
@ 2019-12-05 16:06 Chuhong Yuan
  2019-12-06  8:19 ` Amelie DELAUNAY
  2019-12-10 13:29 ` Alexandre Belloni
  0 siblings, 2 replies; 3+ messages in thread
From: Chuhong Yuan @ 2019-12-05 16:06 UTC (permalink / raw)
  Cc: Alessandro Zummo, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue, linux-rtc, linux-stm32, linux-arm-kernel,
	linux-kernel, Chuhong Yuan

The resume() forgets to call clk_disable_unprepare() when failed.
Add the missed call to fix it.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 drivers/rtc/rtc-stm32.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c
index 781cabb2afca..d774aa18f57a 100644
--- a/drivers/rtc/rtc-stm32.c
+++ b/drivers/rtc/rtc-stm32.c
@@ -897,8 +897,11 @@ static int stm32_rtc_resume(struct device *dev)
 	}
 
 	ret = stm32_rtc_wait_sync(rtc);
-	if (ret < 0)
+	if (ret < 0) {
+		if (rtc->data->has_pclk)
+			clk_disable_unprepare(rtc->pclk);
 		return ret;
+	}
 
 	if (device_may_wakeup(dev))
 		return disable_irq_wake(rtc->irq_alarm);
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] rtc: stm32: add missed clk_disable_unprepare in error path of resume
  2019-12-05 16:06 [PATCH] rtc: stm32: add missed clk_disable_unprepare in error path of resume Chuhong Yuan
@ 2019-12-06  8:19 ` Amelie DELAUNAY
  2019-12-10 13:29 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Amelie DELAUNAY @ 2019-12-06  8:19 UTC (permalink / raw)
  To: Chuhong Yuan
  Cc: linux-rtc, Alessandro Zummo, Alexandre Belloni, Alexandre Torgue,
	linux-kernel, Maxime Coquelin, linux-stm32, linux-arm-kernel

On 12/5/19 5:06 PM, Chuhong Yuan wrote:
> The resume() forgets to call clk_disable_unprepare() when failed.
> Add the missed call to fix it.
> 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
>   drivers/rtc/rtc-stm32.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c
> index 781cabb2afca..d774aa18f57a 100644
> --- a/drivers/rtc/rtc-stm32.c
> +++ b/drivers/rtc/rtc-stm32.c
> @@ -897,8 +897,11 @@ static int stm32_rtc_resume(struct device *dev)
>   	}
>   
>   	ret = stm32_rtc_wait_sync(rtc);
> -	if (ret < 0)
> +	if (ret < 0) {
> +		if (rtc->data->has_pclk)
> +			clk_disable_unprepare(rtc->pclk);
>   		return ret;
> +	}
>   
>   	if (device_may_wakeup(dev))
>   		return disable_irq_wake(rtc->irq_alarm);
> 

Reviewed-by: Amelie Delaunay <amelie.delaunay@st.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] rtc: stm32: add missed clk_disable_unprepare in error path of resume
  2019-12-05 16:06 [PATCH] rtc: stm32: add missed clk_disable_unprepare in error path of resume Chuhong Yuan
  2019-12-06  8:19 ` Amelie DELAUNAY
@ 2019-12-10 13:29 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2019-12-10 13:29 UTC (permalink / raw)
  To: Chuhong Yuan
  Cc: Alessandro Zummo, Maxime Coquelin, Alexandre Torgue, linux-rtc,
	linux-stm32, linux-arm-kernel, linux-kernel

On 06/12/2019 00:06:55+0800, Chuhong Yuan wrote:
> The resume() forgets to call clk_disable_unprepare() when failed.
> Add the missed call to fix it.
> 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
>  drivers/rtc/rtc-stm32.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
Applied, thanks.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-10 13:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-05 16:06 [PATCH] rtc: stm32: add missed clk_disable_unprepare in error path of resume Chuhong Yuan
2019-12-06  8:19 ` Amelie DELAUNAY
2019-12-10 13:29 ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).