[PATCH] clk: tenstorrent: Fix refcount leak on shared gate clk enable failure

Drew Fustini fustini at kernel.org
Thu Sep 24 19:09:33 PDT 2026


On Thu, Sep 24, 2026 at 10:31:51AM -0500, Anirudh Srinivasan wrote:
> atlantis_clk_gate_shared_enable() increments the refcount for the number
> of clks requesting the shared gate clk to be enabled always. It should
> only do this when the enable for the gate took effect in hardware. It's
> possible to end up in a situation where the gate enable failed, but the
> refcount is incremented anyway, so subsequent requests by other clks
> that share the same refcount get ignored and the gate enable is never
> retried.
> 
> Update this function so that the refcount is not incremented when the
> gate clk enable fails in hardware.
> 
> Reported-by: Sashiko <sashiko-bot at kernel.org>
> Link: https://sashiko.dev/#/patchset/AS8P251MB00013BD9A093C06D2D60E10EC8B42%40AS8P251MB0001.EURP251.PROD.OUTLOOK.COM
> Fixes: 23c8ebc95284 ("clk: tenstorrent: Add Atlantis clock controller driver")
> Signed-off-by: Anirudh Srinivasan <asrinivasan at oss.tenstorrent.com>
> ---
>  drivers/clk/tenstorrent/atlantis-prcm.c | 19 +++++++++----------
>  1 file changed, 9 insertions(+), 10 deletions(-)

Reviewed-by: Drew Fustini (Tenstorrent) <fustini at kernel.org>

I will apply this to tenstorrent-clk-for-next.

Thanks,
Drew



More information about the linux-riscv mailing list