Re: [PATCH v2 06/10] ASoC: fsl_sai: Warn if TE/RE does not clear on disable

From: Mark Brown

Date: Fri Nov 06 2026 - 09:23:30 EST


> fsl_sai_config_disable() polls TE/RE with an open-coded loop and
> continues silently if the bit does not clear within 1ms. Also, if
> regmap_read() fails, the loop condition evaluates xcsr uninitialized.

> /* TERE will remain set till the end of current frame */
> - do {
> - udelay(10);
> - regmap_read(sai->regmap, FSL_SAI_xCSR(tx, ofs), &xcsr);
> - } while (--count && xcsr & FSL_SAI_CSR_TERE);
> + ret = regmap_read_poll_timeout_atomic(sai->regmap, FSL_SAI_xCSR(tx, ofs),
> + xcsr, !(xcsr & FSL_SAI_CSR_TERE),
> + 10, 1000);
> + if (ret == -ETIMEDOUT)
> + dev_warn(&sai->pdev->dev, "%cx not disabled at frame end\n",

There wasn't a warning before...

> + else if (ret)
> + dev_err(&sai->pdev->dev, "failed to read %cSCR : %d\n",

%cCSR.

--
Mark Brown <broonie@xxxxxxxxxx>