Re: [PATCH v3 1/3] clk: allow a clk_hw to be registered again after unregistering it

From: Brian Masney

Date: Thu Dec 03 2026 - 19:48:46 EST


On Thu, Dec 03, 2026 at 05:42:18PM +0000, Joshua Covington wrote:
> On Thu, Dec 03, 2026 at 05:36:41PM +0100, Jerome Brunet wrote:
> > I'm not too the sure the WARN() condition is needed though.
> > It is very late for such a consistency check and what it is checking should
> > be guaranteed by the registration code, no ? Can't we just skip the check ?
>
> Right. I took the check over from Brian's proposal, and it never
> triggered in my testing, neither in the KUnit runs nor on the CM5.
>
> __clk_register() sets both pointers and clears them again if the
> registration fails, so for the clk returned by the registration the
> check always passes. The only case it would catch is if
> clk_unregister() is being called with some other clk of the same clock,
> e.g. one from clk_hw_get_clk(), which clk_unregister() has never checked
> for either.
>
> Brian, unless you had a specific case in mind for it, I will drop it in
> v4 and clear hw->core and hw->clk unconditionally.

Yes that sounds good.

Brian