Skip to contentSkip to conversation

ASoC: SOF: Fix "no reply expected" error during firmware-boot

PATCH In review Hans de Goede 4 participants 12 messages Apr 2, 2020 – Apr 21, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ASoC: SOF: Fix "no reply expected" error during firmware-boot

At least on Canon Lake each time the SOF firmware is booted, the following error is logged in dmesg:

[   36.711803] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0

Since the DSP is powered down when not in used this happens everytime e.g. a notification plays, polluting dmesg with these false-positive errors.

Add a check to snd_sof_ipc_reply() which makes it return success when receiving an unexpected msg_id 0 during fw-boot, fixing these false-positive errors being logged.

---
 sound/soc/sof/ipc.c | 5 +++++
 1 file changed, 5 insertions(+)
sound/soc/sof/ipc.c +5 -0
index 78aa1da7c7a9..7303b3d42f12 100644
@@ -312,6 +312,11 @@ int snd_sof_ipc_reply(struct snd_sof_dev *sdev, u32 msg_id)
 {
 	struct snd_sof_ipc_msg *msg = &sdev->ipc->msg;
 
+	/* Ignore msg_id 0 being send during fw-boot */
+	if (msg->ipc_complete && sdev->fw_state == SOF_FW_BOOT_IN_PROGRESS &&
+	    msg_id == 0)
+		return 0;
+
 	if (msg->ipc_complete) {
 		dev_err(sdev->dev, "error: no reply expected, received 0x%x",
 			msg_id);
Signature · 1 line
2.26.0
#1 lore raw

PATCH 2/2 ASoC: SOF: Turn "firmware boot complete" message into a dbg message

Using a Canon Lake machine with the SOF driver causes dmesg to fill up with a ton of these messages:

[  275.902194] sof-audio-pci 0000:00:1f.3: firmware boot complete
[  351.529358] sof-audio-pci 0000:00:1f.3: firmware boot complete
[  560.049047] sof-audio-pci 0000:00:1f.3: firmware boot complete

etc.

Since the DSP is powered down when not in used this happens everytime e.g. a notification plays, polluting dmesg.

Turn this messages into a debug message, matching what the code already does for the ""booting DSP firmware" message.

---
 sound/soc/sof/loader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/sof/loader.c +1 -1
index fc4ab51bacf4..4760a9734585 100644
@@ -603,7 +603,7 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev)
 	}
 
 	if (sdev->fw_state == SOF_FW_BOOT_COMPLETE)
-		dev_info(sdev->dev, "firmware boot complete\n");
+		dev_dbg(sdev->dev, "firmware boot complete\n");
 	else
 		return -EIO; /* FW boots but fw_ready op failed */
 
Signature · 1 line
2.26.0
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] ASoC: SOF: Turn "firmware boot complete" message into a dbg message

Quoted 8 lines · Hans de Goede

Using a Canon Lake machine with the SOF driver causes dmesg to fill up with a ton of these messages:

[  275.902194] sof-audio-pci 0000:00:1f.3: firmware boot complete
[  351.529358] sof-audio-pci 0000:00:1f.3: firmware boot complete
[  560.049047] sof-audio-pci 0000:00:1f.3: firmware boot complete

etc.

Quoted 7 lines

Since the DSP is powered down when not in used this happens everytime e.g. a notification plays, polluting dmesg.

Turn this messages into a debug message, matching what the code already does for the ""booting DSP firmware" message.

Thanks Hans.

Quoted 18 lines
---
  sound/soc/sof/loader.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/sof/loader.c +1 -1
index fc4ab51bacf4..4760a9734585 100644
@@ -603,7 +603,7 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev)
  	}
 
  	if (sdev->fw_state == SOF_FW_BOOT_COMPLETE)
-		dev_info(sdev->dev, "firmware boot complete\n");
+		dev_dbg(sdev->dev, "firmware boot complete\n");
  	else
  		return -EIO; /* FW boots but fw_ready op failed */
 
maintainer
#3 lore raw

Applied "ASoC: SOF: Turn "firmware boot complete" message into a dbg message" to the asoc tree

In reply to Hans de Goede

The patch

ASoC: SOF: Turn "firmware boot complete" message into a dbg message

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

From 904f353d0e508fb4b3a3f902a02b0a028cda33a6 Mon Sep 17 00:00:00 2001
From: Hans de Goede <[email protected]>
Date: Thu, 2 Apr 2020 20:49:48 +0200
Subject: [PATCH] ASoC: SOF: Turn "firmware boot complete" message into a dbg
message

Using a Canon Lake machine with the SOF driver causes dmesg to fill up with a ton of these messages:

[  275.902194] sof-audio-pci 0000:00:1f.3: firmware boot complete
[  351.529358] sof-audio-pci 0000:00:1f.3: firmware boot complete
[  560.049047] sof-audio-pci 0000:00:1f.3: firmware boot complete

etc.

Since the DSP is powered down when not in used this happens everytime e.g. a notification plays, polluting dmesg.

Turn this messages into a debug message, matching what the code already does for the ""booting DSP firmware" message.

---
 sound/soc/sof/loader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/sof/loader.c +1 -1
index 1f2e0be812bd..64af08293daa 100644
@@ -597,7 +597,7 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev)
 	}
 
 	if (sdev->fw_state == SOF_FW_BOOT_COMPLETE)
-		dev_info(sdev->dev, "firmware boot complete\n");
+		dev_dbg(sdev->dev, "firmware boot complete\n");
 	else
 		return -EIO; /* FW boots but fw_ready op failed */
 
Signature · 1 line
2.20.1
#4 lore raw
In reply to Hans de Goede
Quoted 8 lines · Hans de Goede

At least on Canon Lake each time the SOF firmware is booted, the following error is logged in dmesg:

[   36.711803] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0

Since the DSP is powered down when not in used this happens everytime e.g. a notification plays, polluting dmesg with these false-positive errors.

What kernel are you using Hans? I thought this was solved with

8354d9b44530b ("ASoC: SOF: Intel: hda-loader: clear the IPC ack bit after FW_PURGE done")

Set DONE bit after the FW_PURGE IPC is polled successfully, to clear the interrupt and avoid the arrival of the confusing unexpected ipc.

Quoted 26 lines

Add a check to snd_sof_ipc_reply() which makes it return success when receiving an unexpected msg_id 0 during fw-boot, fixing these false-positive errors being logged.

---
  sound/soc/sof/ipc.c | 5 +++++
  1 file changed, 5 insertions(+)
sound/soc/sof/ipc.c +5 -0
index 78aa1da7c7a9..7303b3d42f12 100644
@@ -312,6 +312,11 @@ int snd_sof_ipc_reply(struct snd_sof_dev *sdev, u32 msg_id)
  {
  	struct snd_sof_ipc_msg *msg = &sdev->ipc->msg;
 
+	/* Ignore msg_id 0 being send during fw-boot */
+	if (msg->ipc_complete && sdev->fw_state == SOF_FW_BOOT_IN_PROGRESS &&
+	    msg_id == 0)
+		return 0;
+
  	if (msg->ipc_complete) {
  		dev_err(sdev->dev, "error: no reply expected, received 0x%x",
  			msg_id);
#5 lore raw

Hi,

Quoted 6 lines · Pierre-Louis Bossart
Quoted 3 lines · Hans de Goede

At least on Canon Lake each time the SOF firmware is booted, the following error is logged in dmesg:

Quoted 7 lines
Quoted 5 lines

[   36.711803] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0

Since the DSP is powered down when not in used this happens everytime e.g. a notification plays, polluting dmesg with these false-positive errors.

What kernel are you using Hans? I thought this was solved with

5.6.0

Quoted 3 lines

8354d9b44530b ("ASoC: SOF: Intel: hda-loader: clear the IPC ack bit after FW_PURGE done") > Set DONE bit after the FW_PURGE IPC is polled successfully, to clear the interrupt and avoid the arrival of the confusing unexpected ipc.

That commit is not in Torvald's tree yet, but it is in broonie/sound.git, I've cherry picked it into my local tree and reverted my own fix.

Unfortunately even with that patch cherry picked the errors my patch silences still happen.

Regards,

Hans

Quoted 26 lines
Quoted 25 lines

Add a check to snd_sof_ipc_reply() which makes it return success when receiving an unexpected msg_id 0 during fw-boot, fixing these false-positive errors being logged.

---
  sound/soc/sof/ipc.c | 5 +++++

  1 file changed, 5 insertions(+)
sound/soc/sof/ipc.c +5 -0
index 78aa1da7c7a9..7303b3d42f12 100644
@@ -312,6 +312,11 @@ int snd_sof_ipc_reply(struct snd_sof_dev *sdev, u32 msg_id)
   {
       struct snd_sof_ipc_msg *msg = &sdev->ipc->msg;
+    /* Ignore msg_id 0 being send during fw-boot */
+    if (msg->ipc_complete && sdev->fw_state == SOF_FW_BOOT_IN_PROGRESS &&
+        msg_id == 0)
+        return 0;
+
       if (msg->ipc_complete) {
           dev_err(sdev->dev, "error: no reply expected, received 0x%x",
               msg_id);
 
#6 lore raw
Quoted 23 lines · Hans de Goede

Hi,

Quoted 6 lines · Pierre-Louis Bossart
Quoted 3 lines · Hans de Goede

At least on Canon Lake each time the SOF firmware is booted, the following error is logged in dmesg:

Quoted 7 lines
Quoted 5 lines

[   36.711803] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0

Since the DSP is powered down when not in used this happens everytime e.g. a notification plays, polluting dmesg with these false-positive errors.

What kernel are you using Hans? I thought this was solved with

5.6.0

Quoted 3 lines

8354d9b44530b ("ASoC: SOF: Intel: hda-loader: clear the IPC ack bit after FW_PURGE done") > Set DONE bit after the FW_PURGE IPC is polled successfully, to clear the interrupt and avoid the arrival of the confusing unexpected ipc.

Quoted 6 lines

That commit is not in Torvald's tree yet, but it is in broonie/sound.git, I've cherry picked it into my local tree and reverted my own fix.

Unfortunately even with that patch cherry picked the errors my patch silences still happen.

Ok, we'll look into it. Give us a couple of days on this one, thanks!

maintainer
#7 lore raw
Quoted 10 lines · Pierre-Louis Bossart
Quoted 6 lines · Hans de Goede

That commit is not in Torvald's tree yet, but it is in broonie/sound.git, I've cherry picked it into my local tree and reverted my own fix.

Unfortunately even with that patch cherry picked the errors my patch silences still happen.

Ok, we'll look into it. Give us a couple of days on this one, thanks!

It's been more than a few days now...

#8 lore raw
Quoted 7 lines · Mark Brown
Quoted 5 lines · Pierre-Louis Bossart
Quoted 3 lines · Hans de Goede

That commit is not in Torvald's tree yet, but it is in broonie/sound.git, I've cherry picked it into my local tree and reverted my own fix.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Unfortunately even with that patch cherry picked the errors my patch silences still happen.

Ok, we'll look into it. Give us a couple of days on this one, thanks!

It's been more than a few days now...

Sorry about the delay, on my side I don't see this anymore in my ApolloLake or CML tests. Kai, can you confirm for HDaudio platforms?

reviewer
#9 lore raw

Hey,

Quoted 6 lines · Pierre-Louis Bossart
Quoted 3 lines
Quoted 3 lines · Hans de Goede
Quoted 2 lines

Unfortunately even with that patch cherry picked the errors my patch silences still happen.

Sorry about the delay, on my side I don't see this anymore in my ApolloLake or CML tests. Kai, can you confirm for HDaudio platforms?

I tested on a set of HDA platforms and I could not trigger the "no reply expected" errors. Tested with sof-dev (Mark's latest tree but staged SOF patches) that has the "ASoC: SOF: Intel: hda-loader: clear the IPC ack bit after FW_PURGE" patch.

If I revert this patch, the error trace comes back immediately, so this definitely helps to the trace spam at least in these cases.

There could of course be some relation to FW version. So if someone can still get the error trace, the FW version and platform used would be interesting information.

Br, Kai

#10 lore raw

Hi,

Quoted 16 lines · Kai Vehmanen

Hey,

Quoted 6 lines · Pierre-Louis Bossart
Quoted 3 lines
Quoted 3 lines · Hans de Goede
Quoted 2 lines

Unfortunately even with that patch cherry picked the errors my patch silences still happen.

Sorry about the delay, on my side I don't see this anymore in my ApolloLake or CML tests. Kai, can you confirm for HDaudio platforms?

I tested on a set of HDA platforms and I could not trigger the "no reply expected" errors. Tested with sof-dev (Mark's latest tree but staged SOF patches) that has the "ASoC: SOF: Intel: hda-loader: clear the IPC ack bit after FW_PURGE" patch.

Quoted 6 lines

If I revert this patch, the error trace comes back immediately, so this definitely helps to the trace spam at least in these cases.

There could of course be some relation to FW version. So if someone can still get the error trace, the FW version and platform used would be interesting information.

I've retested with 5.7-rc2 (previous testing was on 5.6-rc# + the "ASoC: SOF: Intel: hda-loader: clear the IPC ack bit after FW_PURGE" patch) and I'm no longer seeing this. So I guess fixing this also needed some other patches which have now landed in 5.7.

So this is resolved now and my patch for this can be dropped.

Regards,

Hans

#11 lore raw
Quoted 7 lines

I've retested with 5.7-rc2 (previous testing was on 5.6-rc# + the "ASoC: SOF: Intel: hda-loader: clear the IPC ack bit after FW_PURGE" patch) and I'm no longer seeing this. So I guess fixing this also needed some other patches which have now landed in 5.7.

So this is resolved now and my patch for this can be dropped.

Thanks for confirming Hans. We followed-up on your suggestion and demoted additional error messages to avoid polluting the logs.