aboutsummaryrefslogtreecommitdiffstats
path: root/queue-6.1/clk-remove-prepare_lock-hold-assertion-in-__clk_rele.patch
diff options
context:
space:
mode:
Diffstat (limited to 'queue-6.1/clk-remove-prepare_lock-hold-assertion-in-__clk_rele.patch')
-rw-r--r--queue-6.1/clk-remove-prepare_lock-hold-assertion-in-__clk_rele.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/queue-6.1/clk-remove-prepare_lock-hold-assertion-in-__clk_rele.patch b/queue-6.1/clk-remove-prepare_lock-hold-assertion-in-__clk_rele.patch
new file mode 100644
index 0000000000..283c78b81b
--- /dev/null
+++ b/queue-6.1/clk-remove-prepare_lock-hold-assertion-in-__clk_rele.patch
@@ -0,0 +1,44 @@
+From 6e017f56842ea4ec4b8cc6d1c0610098a3001b67 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 25 Mar 2024 11:41:55 -0700
+Subject: clk: Remove prepare_lock hold assertion in __clk_release()
+
+From: Stephen Boyd <sboyd@kernel.org>
+
+[ Upstream commit 8358a76cfb47c9a5af627a0c4e7168aa14fa25f6 ]
+
+Removing this assertion lets us move the kref_put() call outside the
+prepare_lock section. We don't need to hold the prepare_lock here to
+free memory and destroy the clk_core structure. We've already unlinked
+the clk from the clk tree and by the time the release function runs
+nothing holds a reference to the clk_core anymore so anything with the
+pointer can't access the memory that's being freed anyway. Way back in
+commit 496eadf821c2 ("clk: Use lockdep asserts to find missing hold of
+prepare_lock") we didn't need to have this assertion either.
+
+Fixes: 496eadf821c2 ("clk: Use lockdep asserts to find missing hold of prepare_lock")
+Cc: Krzysztof Kozlowski <krzk@kernel.org>
+Reviewed-by: Douglas Anderson <dianders@chromium.org>
+Signed-off-by: Stephen Boyd <sboyd@kernel.org>
+Link: https://lore.kernel.org/r/20240325184204.745706-2-sboyd@kernel.org
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/clk/clk.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
+index 9004e07182259..ad40913d80a8b 100644
+--- a/drivers/clk/clk.c
++++ b/drivers/clk/clk.c
+@@ -4230,8 +4230,6 @@ static void __clk_release(struct kref *ref)
+ {
+ struct clk_core *core = container_of(ref, struct clk_core, ref);
+
+- lockdep_assert_held(&prepare_lock);
+-
+ clk_core_free_parent_map(core);
+ kfree_const(core->name);
+ kfree(core);
+--
+2.43.0
+