From: Peter Ujfalusi Date: Mon, 15 Dec 2025 13:29:40 +0000 (+0200) Subject: ASoC: SOF: control: skip rpm calls in ext_volatile_get if not implemented X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c77ff200f59103ecdee60c00818a43cee38a6b8;p=thirdparty%2Fkernel%2Flinux.git ASoC: SOF: control: skip rpm calls in ext_volatile_get if not implemented Test earlier for the existence of ext_volatile_get callback and if it is missing, skip the rpm calls to avoid needles DSP power on. No change in functionality, we just skip the DSP power on in the unlikely case when the ext_volatile _get is not supported and yet the topology adds such control. Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Liam Girdwood Link: https://patch.msgid.link/20251215132946.2155-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/sof/control.c b/sound/soc/sof/control.c index a3fd1d523c094..9582ab5f1113c 100644 --- a/sound/soc/sof/control.c +++ b/sound/soc/sof/control.c @@ -187,14 +187,18 @@ int snd_sof_bytes_ext_volatile_get(struct snd_kcontrol *kcontrol, unsigned int _ const struct sof_ipc_tplg_ops *tplg_ops = sof_ipc_get_ops(sdev, tplg); int ret, err; + /* ignore the ext_volatile_get call if the callbacks are not provided */ + if (!tplg_ops || !tplg_ops->control || + !tplg_ops->control->bytes_ext_volatile_get) + return 0; + ret = pm_runtime_resume_and_get(scomp->dev); if (ret < 0 && ret != -EACCES) { dev_err_ratelimited(scomp->dev, "%s: failed to resume %d\n", __func__, ret); return ret; } - if (tplg_ops && tplg_ops->control && tplg_ops->control->bytes_ext_volatile_get) - ret = tplg_ops->control->bytes_ext_volatile_get(scontrol, binary_data, size); + ret = tplg_ops->control->bytes_ext_volatile_get(scontrol, binary_data, size); err = pm_runtime_put_autosuspend(scomp->dev); if (err < 0)