Re: [PATCH] clk: tenstorrent: Fix refcount leak on shared gate clk enable failure
From: Drew Fustini
Date: Tue Sep 29 2026 - 15:58:05 EST
On Thu, Sep 24, 2026 at 07:09:33PM -0700, Drew Fustini wrote:
> 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@xxxxxxxxxx>
> > 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@xxxxxxxxxxxxxxxxxxx>
> > ---
> > drivers/clk/tenstorrent/atlantis-prcm.c | 19 +++++++++----------
> > 1 file changed, 9 insertions(+), 10 deletions(-)
>
> Reviewed-by: Drew Fustini (Tenstorrent) <fustini@xxxxxxxxxx>
>
> I will apply this to tenstorrent-clk-for-next.
Applied to tenstorrent-clk-for-next:
3f0655b51eb0 clk: tenstorrent: Fix refcount leak on shared gate clk enable failure
Thanks,
Drew