Re: [PATCH v2 2/6] ASoC: renesas: fsi: Fix hang by enabling SPU clock
From: Kuninori Morimoto
Date: Thu Apr 16 2026 - 20:42:52 EST
Hi Bui
> Regarding spu_count, Iʼm not entirely sure, but if we increment it
> even on failure,
> the counter might become unbalanced and clk_prepare_enable() may not
> be retried on the next call.
> Would it be better to increment spu_count only on success to keep the
> state consistent?
It depens on how you create the error case :)
I don't mind super much about detail of it.
> Since fsi_hw_startup() and fsi_hw_shutdown() are called from fsi_dai_trigger(),
> I think this runs in an atomic context, but please correct me if I'm wrong.
> If so, is it safe to call clk_prepare_enable() under guard(spinlock_irqsave)?
> Since clk_prepare() can sleep, Iʼm wondering if this could potentially
> cause a "scheduling while atomic" issue.
>
> Would it make more sense to move clk_prepare() to init time (in new
> fsi_clk_init() ),
> and only use clk_enable() / clk_disable() in the trigger path?
I don't remember detail of SH-Mobile clock driver, but yes.
Thank you for your help !!
Best regards
---
Kuninori Morimoto