Re: [PATCH v2] ASoC: cs35l56: Fix probe deadlock waiting for SoundWire enumeration

Mark Brown <[email protected]>
Newsgroups org.kernel.vger.linux-sound,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Thu, Aug 13, 2026 at 06:37:01PM +0100, Richard Fitzgerald wrote:
> Defer all the parts of cs35l56_component_probe() that require register
> access to a work item. This is to prevent a deadlock where
> cs35l56_component_probe() is waiting for init_completion to be signaled
> but is blocking the code that would signal it.

>  static void cs35l56_wait_dsp_ready(struct cs35l56_private *cs35l56)
>  {
>  	/* Wait for patching to complete */
> +	flush_work(&cs35l56->deferred_component_init_work);
>  	flush_work(&cs35l56->dsp_work);
>  }
>  

This can be called from asoc_sdw_cs_spk_rtd_init() when limiting the
volume, that's still synchronous while setting up the card - the main
Speaker Volume control uses cs35l56_dspwait_{get,put}_volsw() and when
we set up the volume limit we at least read the current volume.  The
deferred work will block on init_completion and error out if that times
out but init_completion is still signalled in the callback that's
blocked waiting for probe().

AFAICT we always try to limit the volume for these speakers?

I think the component registration needs to be moved out of probe into a
work item...
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmp+FcQACgkQJNaLcl1U
h9CS/Qf/XYQvGd45WR6Fw5gxVsmZd5wKzy5yoxl5Kte4buKeCq5PJkkhrxuQJMoK
UOXh+lwu/+ZnD6/emF4zsRW7lwcTRPjT19695Rn5iLxa+eSA1OaPlBQGmXza4pXW
QO2L12p1Gt/mORtZGgRjDO+I5yQRTAro17CNak/I2QPDhvbtT34zTtlzJ9RCEmBy
8dEFfsOURSNpfAyeFktnMzs6oCb5MHYOruWtFwEnXYY11q119ulRVLJr59+wJ4XA
arE1gvSiyn5+gjemxaDteeAQihALRK3OZbe5YhJAxcZ7zvJ7lyTWHB+8LU5K4TbF
5R5ddvADslniJceCuQch44bizRfQFg==
=c3DO
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.