diff options
| author | 2026-07-23 15:00:51 +0200 | |
|---|---|---|
| committer | 2026-09-01 07:12:49 -0400 | |
| commit | a1c8d531c694e193dc48ef2428877d5ea2e35134 (patch) | |
| tree | c01b135d4a4a12e886aeb7687b822629cbfa0abb /scripts/Makefile.thinlto | |
| parent | clk: zynqmp: Make sure clk_init_data is fully initialized (diff) | |
clk: fix self-consuming provider module pinning
clk_hw_get_clk() lets a provider get a struct clk for one of its own
struct clk_hw.
When a struct clk is created, the module usage count of the provider
is unconditionally increased. For a self-consuming provider, this means
it pins itself and the module can never be unloaded.
Increasing the module usage count should only be done when the consumer
lives in a different module from the provider. Use THIS_MODULE to
capture caller's module and increase the module usage count accordingly.
It is OK for consumer-only APIs such as clk_get() or of_clk_get() to
pass a NULL owner. As a result, any provider module will get pinned,
same as before.
Fixes: 30d6f8c15d2c ("clk: add api to get clk consumer from clk_hw")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
