Patch "clk: Remove prepare_lock hold assertion in __clk_release()" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

    clk: Remove prepare_lock hold assertion in __clk_release()

to the 5.4-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-remove-prepare_lock-hold-assertion-in-__clk_rele.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 836f92339f535bcc6297a6e4ebffa62b8414daab
Author: Stephen Boyd <sboyd@xxxxxxxxxx>
Date:   Mon Mar 25 11:41:55 2024 -0700

    clk: Remove prepare_lock hold assertion in __clk_release()
    
    [ 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@xxxxxxxxxx>
    Reviewed-by: Douglas Anderson <dianders@xxxxxxxxxxxx>
    Signed-off-by: Stephen Boyd <sboyd@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240325184204.745706-2-sboyd@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 67051ca60920a..85a043e8a9d57 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -3883,8 +3883,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);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux