Re: [PATCH v5 1/3] ASoC: tac5xx2-sdw: add soundwire based codec driver
From: Holalu Yogendra, Niranjan
Date: Wed Apr 08 2026 - 09:43:29 EST
> On 22:01-20260407, Mark Brown wrote:
> Subject: Re: [PATCH v5 1/3] ASoC: tac5xx2-sdw: add soundwire based codec driver
>
> On Tue, Apr 07, 2026 at 03:18:27PM +0530, Niranjan H Y wrote:
>
> > +static s32 tac_load_and_cache_firmware(struct tac5xx2_prv *tac_dev)
> > +{
...
> > + ret = request_firmware(&fmw, tac_dev->fw_binaryname, tac_dev-
> >dev);
>
> This is happening in the SoundWire bus callback - if request_firmware()
> ends up being slow (eg, a userspace helper faffing) we might block other
> things on the bus.
I'll move this to probe and use request_firmware_nowait() to prepare
the firmware in background.
> > +
> > + if (first) {
> > + /* Set default value to CS:11 */
> > + tac_dev->cx11_value = 1;
> > + regmap_write(tac_dev->regmap,
> > + SDW_SDCA_CTL(TAC_FUNCTION_ID_SM,
> > + TAC_SDCA_ENT_CX11,
> > +
> TAC_SDCA_CTL_CX_CLK_SEL, 0),
> > + tac_dev->cx11_value);
>
> This looks like it could race with tac_cx11_put() - they both write
> cx11_value but the control could be modifying it. I can imagine that
> happening if userspace starts and is setting config while the SoundWire
> bus is coming on line.
I will drop the userspace control as Pierre suggested. The CX11 clock
selector will be set to the default value (CS:11) during initialization,
eliminating the race condition. The device functions correctly with this
fixed configuration for smart mic based on my testing.
Regards
Niranjan