Skip to contentSkip to conversation

clk: sunxi-ng: sun6i-rtc: Mark rtc-32k as critical

PATCH Applied Samuel Holland 2 participants 3 messages Apr 11, 2022 – Apr 24, 2022

Subsystems (2)
lore
Share & tools
lore

Samuel Holland

author maintainer
#0 lore raw

PATCH 1/1 clk: sunxi-ng: sun6i-rtc: Mark rtc-32k as critical

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

---

 drivers/clk/sunxi-ng/ccu-sun6i-rtc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/clk/sunxi-ng/ccu-sun6i-rtc.c +1 -0
index 8a10bade7e0d..3d9c9ce5a3db 100644
@@ -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 = {
Signature · 1 line
2.35.1
maintainer Acked-by on v1 1/1
#1 lore raw

Dne ponedeljek, 11. april 2022 ob 07:00:59 CEST je Samuel Holland napisal(a):

Quoted 11 lines

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

Best regards,
Jernej

drivers/clk/sunxi-ng/ccu-

Quoted 6 lines

---

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

sun6i-rtc.c

drivers/clk/sunxi-ng/ccu-sun6i-rtc.c static struct clk_init_data rtc_32k_init_data = { · line 243

Quoted 7 lines

index 8a10bade7e0d..3d9c9ce5a3db 100644

drivers/clk/sunxi-ng/ccu-sun6i-rtc.c +0 -0
@@ -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 */

Quoted 8 lines
drivers/clk/sunxi-ng/ccu-sun6i-rtc.c +1 -0
+	.flags		= CLK_IS_CRITICAL,
 };
 
 static struct ccu_mux rtc_32k_clk = {
Signature · 1 line
2.35.1
maintainer Applied
#2 lore raw
In reply to Samuel Holland

Dne ponedeljek, 11. april 2022 ob 07:00:59 CEST je Samuel Holland napisal(a):

Quoted 11 lines

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

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

Best regards,
Jernej