Skip to contentSkip to conversation

Patch "clk: Respect CLK_OPS_PARENT_ENABLE during recalc" has been added to the 6.19-stable tree

DISCUSSION Nicolas Frattaroli 2 participants 2 messages Feb 23 – Feb 25 1 message not in the archive Stable branch

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 7 lines · On Saturday, 21 February 2026 17:03:09 Central European Standard Time Sasha…

This is a note to let you know that I've just added the patch titled

clk: Respect CLK_OPS_PARENT_ENABLE during recalc

to the 6.19-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

Quoted 6 lines

The filename of the patch is:
clk-respect-clk_ops_parent_enable-during-recalc.patch
and it can be found in the queue-6.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Drop this, it introduces a regression and has been reverted in [1]

Quoted 66 lines

commit 17b0f85bf6339d9e275389fa4ba8c9d2014a1bb7

Author: Nicolas Frattaroli <[email protected]>
Date:   Mon Dec 15 11:23:58 2025 +0100

clk: Respect CLK_OPS_PARENT_ENABLE during recalc

[ Upstream commit 669917676e93fca5ea3c66fc9539830312bec58e ]

When CLK_OPS_PARENT_ENABLE was introduced, it guarded various clock operations, such as setting the rate or switching parents. However, another operation that can and often does touch actual hardware state is recalc_rate, which may also be affected by such a dependency.

Add parent enables/disables where the recalc_rate op is called directly.

Fixes fc8726a2c021 ("clk: core: support clocks which requires parents enable (part 2)")
Fixes a4b3518d146f ("clk: core: support clocks which requires parents enable (part 1)")
drivers/clk/clk.c +13 -0
index 85d2f2481acf3..1b0f9d567f48e 100644
@@ -1921,7 +1921,14 @@ static unsigned long clk_recalc(struct clk_core *core,
 	unsigned long rate = parent_rate;
 
 	if (core->ops->recalc_rate && !clk_pm_runtime_get(core)) {
+		if (core->flags & CLK_OPS_PARENT_ENABLE)
+			clk_core_prepare_enable(core->parent);
+
 		rate = core->ops->recalc_rate(core->hw, parent_rate);
+
+		if (core->flags & CLK_OPS_PARENT_ENABLE)
+			clk_core_disable_unprepare(core->parent);
+
 		clk_pm_runtime_put(core);
 	}
 	return rate;
@@ -4031,6 +4038,9 @@ static int __clk_core_init(struct clk_core *core)
 	 */
 	clk_core_update_duty_cycle_nolock(core);
 
+	if (core->flags & CLK_OPS_PARENT_ENABLE)
+		clk_core_prepare_enable(core->parent);
+
 	/*
 	 * Set clk's rate.  The preferred method is to use .recalc_rate.  For
 	 * simple clocks and lazy developers the default fallback is to use the
@@ -4046,6 +4056,9 @@ static int __clk_core_init(struct clk_core *core)
 		rate = 0;
 	core->rate = core->req_rate = rate;
 
+	if (core->flags & CLK_OPS_PARENT_ENABLE)
+		clk_core_disable_unprepare(core->parent);
+
 	/*
 	 * Enable CLK_IS_CRITICAL clocks so newly added critical clocks
 	 * don't get accidentally disabled when walking the orphan tree and
maintainer
#2 lore raw
Quoted 12 lines · Nicolas Frattaroli
Quoted 11 lines · On Saturday, 21 February 2026 17:03:09 Central European Standard Time Sasha…

This is a note to let you know that I've just added the patch titled

clk: Respect CLK_OPS_PARENT_ENABLE during recalc

to the 6.19-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
clk-respect-clk_ops_parent_enable-during-recalc.patch
and it can be found in the queue-6.19 subdirectory.

Quoted 6 lines
Quoted 2 lines

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Drop this, it introduces a regression and has been reverted in [1]

Now dropped, thanks.

greg kh