All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: lower "no backend DAIs enabled for ... Port" log severity
@ 2023-08-04 13:26 Hans de Goede
  2023-08-04 14:06 ` Pierre-Louis Bossart
  2023-08-07 21:34 ` Mark Brown
  0 siblings, 2 replies; 10+ messages in thread
From: Hans de Goede @ 2023-08-04 13:26 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown; +Cc: Hans de Goede, alsa-devel

If SNDRV_PCM_IOCTL_PREPARE is called when  the mixer settings linking
frontend and backend have not been setup yet this results in
e.g. the following errors getting logged:

[   43.244549]  Baytrail Audio Port: ASoC: no backend DAIs enabled for Baytrail Audio Port
[   43.244744]  Baytrail Audio Port: ASoC: error at dpcm_fe_dai_prepare on Baytrail Audio Port: -22

pipewire triggers this leading to 96 repeats of this in the log
after the user has logged into a GNOME session.

IMHO userspace should not be able to get the kernel to spam dmesg like
this. Lower the severity of the "no backend DAIs enabled" log message
for dai-s with the dynamic flag set to avoid this.

And also changes _soc_pcm_ret() to not log for -EINVAL errors, to fix
the other error. Userspace passing wrong parameters should not lead
to dmesg messages.

Link: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3407
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 sound/soc/soc-pcm.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 8896227e4fb7..fdc1a1c654d6 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -38,6 +38,7 @@ static inline int _soc_pcm_ret(struct snd_soc_pcm_runtime *rtd,
 	switch (ret) {
 	case -EPROBE_DEFER:
 	case -ENOTSUPP:
+	case -EINVAL:
 		break;
 	default:
 		dev_err(rtd->dev,
@@ -2466,7 +2467,11 @@ static int dpcm_fe_dai_prepare(struct snd_pcm_substream *substream)
 
 	/* there is no point preparing this FE if there are no BEs */
 	if (list_empty(&fe->dpcm[stream].be_clients)) {
-		dev_err(fe->dev, "ASoC: no backend DAIs enabled for %s\n",
+		if (fe->dai_link->dynamic)
+			dev_dbg(fe->dev, "ASoC: no backend DAIs enabled for %s\n",
+				fe->dai_link->name);
+		else
+			dev_err(fe->dev, "ASoC: no backend DAIs enabled for %s\n",
 				fe->dai_link->name);
 		ret = -EINVAL;
 		goto out;
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-08-07 21:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-04 13:26 [PATCH] ASoC: lower "no backend DAIs enabled for ... Port" log severity Hans de Goede
2023-08-04 14:06 ` Pierre-Louis Bossart
2023-08-04 14:42   ` Takashi Iwai
2023-08-04 15:08     ` Hans de Goede
2023-08-04 15:28       ` Pierre-Louis Bossart
2023-08-04 15:15     ` Mark Brown
2023-08-04 15:40       ` Takashi Iwai
2023-08-04 15:50         ` Mark Brown
2023-08-04 15:57           ` Takashi Iwai
2023-08-07 21:34 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.