Re: [PATCH] rtc: pcf85063: disable the clkout output by default
From: Alexandre Belloni
Date: Wed Aug 26 2026 - 02:48:25 EST
On 26/08/2026 06:13:08+0000, Sverdlin, Alexander wrote:
> Hi Alexandre,
>
> On Tue, 2026-08-25 at 23:07 +0200, Alexandre Belloni wrote:
> > > > > The PCF85063 powers up with its CLKOUT pin driving the 32.768 kHz. While
> > > > > it's possible to request a specific default frequency in the DT via
> > > > > assigned-clocks/assigned-clock-rates on the RTC node itself, even without
> > > > > a real consumer referencing the clock, there is no such possibility to
> > > > > disable the clock output by default.
> > > >
> > > > Are you sure about this? The CCF should disable the clock if it is not
> > > > used.
> > >
> > > There is late_initcall_sync(clk_disable_unused) (marked __init), but for the
> > > clock providers registered later, say, via modules, there is no such mechanism.
> > > And I double-checked this putting some debug prints into the driver,
> > > nothing from struct clk_ops is being called without a consumer in DT.
> > >
> >
> > Right, so what about the patch attached which seems to work fine with my
> > rv3032.
>
> The patch would work for me as well, will you publish it officially?
>
Yes, that's the plan.
> BTW, it's racy, if __clk_register() would be called between
>
> clk_disable_unused();
>
> ... and...
>
> WRITE_ONCE(clk_disable_unused_done, true);
>
> ... the workqueue will not be scheduled. But overall it's a nice idea!
I'm not sure you can actually load modules before late_initcall_sync
finishes.
>
> Maybe we just need to drop late_initcall_sync() entirely, this would simplify
> the things a bit?
I'll let this to the (new) clk maintainers.
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com