Re: [PATCH v2] ASoC: tegra: Add error logging for probe and callback failures
From: Mark Brown
Date: Mon Mar 23 2026 - 17:42:51 EST
On Mon, Mar 23, 2026 at 10:12:42AM +0000, Sheetal wrote:
> Add error logging across probe and runtime error paths in Tegra audio
> drivers to improve debuggability. Use dev_err_probe() in all probe
> error paths as a defensive measure against future API changes that
> may return -EPROBE_DEFER. Use dev_err() for runtime callback paths.
> Skip redundant logging where the underlying API already reports errors.
> diff --git a/sound/soc/tegra/tegra210_ahub.c b/sound/soc/tegra/tegra210_ahub.c
> index 43a45f785d5b..4626dd0a4d55 100644
> --- a/sound/soc/tegra/tegra210_ahub.c
> +++ b/sound/soc/tegra/tegra210_ahub.c
> @@ -64,8 +64,11 @@ static int tegra_ahub_put_value_enum(struct snd_kcontrol *kctl,
> unsigned int i, bit_pos, reg_idx = 0, reg_val = 0;
> int change = 0;
>
> - if (item[0] >= e->items)
> + if (item[0] >= e->items) {
> + dev_err(cmpnt->dev, "invalid MUX item: %u >= %u\n",
> + item[0], e->items);
> return -EINVAL;
> + }
>
This one can be triggered directly from userspace so it's better to be
slient, otherwise people can spam the logs.
> index 6d3a2b76fd61..d9318aaaf32e 100644
> --- a/sound/soc/tegra/tegra210_mixer.c
> +++ b/sound/soc/tegra/tegra210_mixer.c
> @@ -253,6 +253,9 @@ static int tegra210_mixer_set_audio_cif(struct tegra210_mixer *mixer,
> audio_bits = TEGRA_ACIF_BITS_32;
> break;
> default:
> + dev_err(regmap_get_device(mixer->regmap),
> + "unsupported format for MIXER CIF: %d\n",
> + params_format(params));
> return -EINVAL;
> }
Not your bug but the driver claims to support _S8 format and this
function doesn't actually implement it so we end up with another path
where userspace can spam dev_err() as a result of this.
Attachment:
signature.asc
Description: PGP signature