Re: [PATCH v3 1/3] ASoC: codecs: add SN624x SDCA SoundWire driver
Mark Brown <[email protected]>
| Newsgroups | org.kernel.vger.linux-sound |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Aug 14, 2026 at 10:56:48AM +0800, Qianghua Wang wrote:
> Add a SoundWire SDCA driver for Senary SN624x multi-function codecs
> (jack, speaker amp, and DMIC). Program SDCA SampleFreqIndex in
> hw_params, keep SDCA jack IRQs masked with poll-based detection, and
> extend the Senary MAINTAINERS entry for the new codec files only.
This looks mostly fine but you have some issues around when runtime PM
is enabled.
> + ret = devm_snd_soc_register_component(dev,
> + &soc_sdca_dev_sn624x, sn624x_sdca_dai,
> + ARRAY_SIZE(sn624x_sdca_dai));
> + if (ret < 0)
> + return ret;
> +
> + pm_runtime_set_autosuspend_delay(dev, 3000);
> + pm_runtime_use_autosuspend(dev);
> + pm_runtime_mark_last_busy(dev);
> + pm_runtime_enable(dev);
The component is registered before we enable runtime PM, this means that
things like jack detection that try to use runtime PM could get run
before it gets enabled which will result in bugs with mismatched counts
or missing references.
> +static void sn624x_sdca_sdw_remove(struct sdw_slave *slave)
> +{
> + struct sn624x_sdca_priv *sn624x = dev_get_drvdata(&slave->dev);
> +
> + SN624X_DBG(&slave->dev, "SoundWire driver remove\n");
> + cancel_delayed_work_sync(&sn624x->jack_detect_work);
> + sn624x_jack_rpm_put(sn624x);
> + if (sn624x->first_hw_init)
> + pm_runtime_disable(&slave->dev);
> + mutex_destroy(&sn624x->disable_irq_lock);
> +}
The runtime PM enable is unconditional in the probe.
Since fixing these would be relatively small changes code wise I'll push
this into CI, assuming it goes OK there I'll apply so the driver makes
the merge window - please send incremental fixes for this and anything
else that gets noticed.
signature.asc
(application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmp/TSgACgkQJNaLcl1U h9D/fgf+JvcFq3Yv0DNKW90Gf+ob0drv5OEs91KNgaJnwVxLEPkKg0rzQl9kD5KJ rwomcq3KFoWlf+8+lO46361x1xwh5k4ErY+SBHQJYZUX49fcsT8+6aiNXs8mSjPz hRvuUVxVmAEbBhL9cn/F7tC6zYbbP7BbD3ZP5KIzkIhhzrrplgSUOovrQ3qJIrvn CfiOTuzN7YIf3QvRPEaGl5weMNIHy87YbgA1tuxYT4HQAnOcivCEZc7MparF4YW0 gsighsa1U+n7/deRlq+2O29RFbKjmo1gYJLnuLTZ1dU09QQwJpOnk8XB6yEs6oW2 Lr5EYFSMhf2cgH7031s+QNyxMq4E+w== =Pndl -----END PGP SIGNATURE-----