Re: [PATCH v6 11/11] ASoC: renesas: fsi: Add SPU clock control in hw_startup/shutdown
From: Bui Duc Phuc
Date: Tue Jun 09 2026 - 23:02:42 EST
Hi Mark,
Thank you for your reviews.
> > static int fsi_hw_shutdown(struct fsi_priv *fsi,
> > struct device *dev)
> > {
> > + int ret;
> > /* stop master clock */
> > - if (fsi_is_clk_master(fsi))
> > - return fsi_clk_disable(dev, fsi);
> > + if (fsi_is_clk_master(fsi)) {
> > + ret = fsi_clk_disable(dev, fsi);
> > + if (ret)
> > + return ret;
> > + }
> > + /* stop spu bus bridge clock */
> > + clk_disable(fsi->master->clk_spu);
>
> ...but the matching disable is skipped if !fsi_is_clk_master().
I understand your point now.
The reason I originally implemented it that way was that I was
concerned about a potential system hang
if hw_shutdown() failed while the SPU clock had already been disabled.
At the moment, it is still unclear
to me whether any further register accesses could occur after
hw_shutdown() returns an error.
However, I agree that maintaining a balanced enable/disable sequence
is more important here.
Therefore, I will modify the code as follows:
+ int ret = 0;
+ if (fsi_is_clk_master(fsi))
+ ret = fsi_clk_disable(dev, fsi);
+ /* stop spu bus bridge clock */
+ clk_disable(fsi->master->clk_spu);
+ return ret;
If we later find that a system hang still occurs in the master case,
I will investigate and address that issue separately.
Best regards,
Phuc