linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: sunxi-ng: sun6i-rtc: Mark rtc-32k as critical
@ 2022-04-11  5:00 Samuel Holland
  2022-04-11 15:24 ` Jernej Škrabec
  2022-04-24 21:24 ` Jernej Škrabec
  0 siblings, 2 replies; 3+ messages in thread
From: Samuel Holland @ 2022-04-11  5:00 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec
  Cc: Andre Przywara, Samuel Holland, Alexandre Belloni,
	Michael Turquette, Stephen Boyd, linux-arm-kernel, linux-clk,
	linux-kernel, linux-sunxi

Because some newer hardware variants have multiple possible parents for
the RTC's timekeeping clock, this driver models it as a "rtc-32k" clock.
However, it does not add any consumer for this clock. This causes the
common clock framework to disable it, preventing RTC time access.

Since the RTC's timekeeping clock should always be enabled, regardless
of which drivers are loaded, let's mark this clock as critical instead
of adding a consumer in the RTC driver.

Fixes: d91612d7f01a ("clk: sunxi-ng: Add support for the sun6i RTC clocks")
Signed-off-by: Samuel Holland <samuel@sholland.org>
---

 drivers/clk/sunxi-ng/ccu-sun6i-rtc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c b/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c
index 8a10bade7e0d..3d9c9ce5a3db 100644
--- a/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c
+++ b/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c
@@ -241,6 +241,7 @@ static struct clk_init_data rtc_32k_init_data = {
 	.ops		= &ccu_mux_ops,
 	.parent_hws	= rtc_32k_parents,
 	.num_parents	= ARRAY_SIZE(rtc_32k_parents), /* updated during probe */
+	.flags		= CLK_IS_CRITICAL,
 };
 
 static struct ccu_mux rtc_32k_clk = {
-- 
2.35.1


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

* Re: [PATCH] clk: sunxi-ng: sun6i-rtc: Mark rtc-32k as critical
  2022-04-11  5:00 [PATCH] clk: sunxi-ng: sun6i-rtc: Mark rtc-32k as critical Samuel Holland
@ 2022-04-11 15:24 ` Jernej Škrabec
  2022-04-24 21:24 ` Jernej Škrabec
  1 sibling, 0 replies; 3+ messages in thread
From: Jernej Škrabec @ 2022-04-11 15:24 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland
  Cc: Andre Przywara, Samuel Holland, Alexandre Belloni,
	Michael Turquette, Stephen Boyd, linux-arm-kernel, linux-clk,
	linux-kernel, linux-sunxi

Dne ponedeljek, 11. april 2022 ob 07:00:59 CEST je Samuel Holland napisal(a):
> Because some newer hardware variants have multiple possible parents for
> the RTC's timekeeping clock, this driver models it as a "rtc-32k" clock.
> However, it does not add any consumer for this clock. This causes the
> common clock framework to disable it, preventing RTC time access.
> 
> Since the RTC's timekeeping clock should always be enabled, regardless
> of which drivers are loaded, let's mark this clock as critical instead
> of adding a consumer in the RTC driver.
> 
> Fixes: d91612d7f01a ("clk: sunxi-ng: Add support for the sun6i RTC clocks")
> Signed-off-by: Samuel Holland <samuel@sholland.org>

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej

> ---
> 
>  drivers/clk/sunxi-ng/ccu-sun6i-rtc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c b/drivers/clk/sunxi-ng/ccu-
sun6i-rtc.c
> index 8a10bade7e0d..3d9c9ce5a3db 100644
> --- a/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c
> +++ b/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c
> @@ -241,6 +241,7 @@ static struct clk_init_data rtc_32k_init_data = {
>  	.ops		= &ccu_mux_ops,
>  	.parent_hws	= rtc_32k_parents,
>  	.num_parents	= ARRAY_SIZE(rtc_32k_parents), /* updated 
during probe */
> +	.flags		= CLK_IS_CRITICAL,
>  };
>  
>  static struct ccu_mux rtc_32k_clk = {
> -- 
> 2.35.1
> 
> 



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

* Re: [PATCH] clk: sunxi-ng: sun6i-rtc: Mark rtc-32k as critical
  2022-04-11  5:00 [PATCH] clk: sunxi-ng: sun6i-rtc: Mark rtc-32k as critical Samuel Holland
  2022-04-11 15:24 ` Jernej Škrabec
@ 2022-04-24 21:24 ` Jernej Škrabec
  1 sibling, 0 replies; 3+ messages in thread
From: Jernej Škrabec @ 2022-04-24 21:24 UTC (permalink / raw)
  To: Chen-Yu Tsai, Samuel Holland
  Cc: Andre Przywara, Samuel Holland, Alexandre Belloni,
	Michael Turquette, Stephen Boyd, linux-arm-kernel, linux-clk,
	linux-kernel, linux-sunxi

Dne ponedeljek, 11. april 2022 ob 07:00:59 CEST je Samuel Holland napisal(a):
> Because some newer hardware variants have multiple possible parents for
> the RTC's timekeeping clock, this driver models it as a "rtc-32k" clock.
> However, it does not add any consumer for this clock. This causes the
> common clock framework to disable it, preventing RTC time access.
> 
> Since the RTC's timekeeping clock should always be enabled, regardless
> of which drivers are loaded, let's mark this clock as critical instead
> of adding a consumer in the RTC driver.
> 
> Fixes: d91612d7f01a ("clk: sunxi-ng: Add support for the sun6i RTC clocks")
> Signed-off-by: Samuel Holland <samuel@sholland.org>

Applied to sunxi/fixes-for-5.18, thanks!

Best regards,
Jernej



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

end of thread, other threads:[~2022-04-24 21:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-11  5:00 [PATCH] clk: sunxi-ng: sun6i-rtc: Mark rtc-32k as critical Samuel Holland
2022-04-11 15:24 ` Jernej Škrabec
2022-04-24 21:24 ` Jernej Škrabec

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).