clk: Don't hold prepare_lock when calling kref_put()
authorStephen Boyd <sboyd@kernel.org>
Mon, 25 Mar 2024 18:41:56 +0000 (11:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 May 2024 09:50:55 +0000 (11:50 +0200)
commit4d36b9b7ec4ff93a72b3b507c3c7511301298f05
tree7d9cc6f411150cc72086d75596b403d524ba5b90
parent7ca04b83c1097c17323a91a1479e801646dd5161
clk: Don't hold prepare_lock when calling kref_put()

[ Upstream commit 6f63af7511e7058f3fa4ad5b8102210741c9f947 ]

We don't need to hold the prepare_lock when dropping a ref on a struct
clk_core. The release function is only freeing memory and any code with
a pointer reference has already unlinked anything pointing to the
clk_core. This reduces the holding area of the prepare_lock a bit.

Note that we also don't call free_clk() with the prepare_lock held.
There isn't any reason to do that.

Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20240325184204.745706-3-sboyd@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/clk.c