Skip to contentSkip to conversation

ASoC: intel: Don't print FW version repeatedly

PATCH Superseded Takashi Iwai 3 participants 8 messages Mar 27, 2017

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: intel: Don't print FW version repeatedly

Intel SST driver spews an info message "FW Versoin xxxx" at each time the device gets initialized. Since it's triggered at each PM (or even runtime PM), it appears so ofetn, and rather becomes annoying than useful.

This patch suppresses the superfluous messages by checking the currently loaded FW version with the previously loaded one.

---
 sound/soc/intel/atom/sst/sst_ipc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/intel/atom/sst/sst_ipc.c +3 -1
index 14c2d9d18180..20b01e02ed8f 100644
@@ -236,7 +236,9 @@ static void process_fw_init(struct intel_sst_drv *sst_drv_ctx,
 		retval = init->result;
 		goto ret;
 	}
-	dev_info(sst_drv_ctx->dev, "FW Version %02x.%02x.%02x.%02x\n",
+	if (memcmp(&sst_drv_ctx->fw_version, &init->fw_version,
+		   sizeof(init->fw_version)))
+		dev_info(sst_drv_ctx->dev, "FW Version %02x.%02x.%02x.%02x\n",
 			init->fw_version.type, init->fw_version.major,
 			init->fw_version.minor, init->fw_version.build);
 	dev_dbg(sst_drv_ctx->dev, "Build date %s Time %s\n",
Signature · 1 line
2.11.1
#1 lore raw
Quoted 3 lines · Takashi Iwai

Intel SST driver spews an info message "FW Versoin xxxx" at each time the device gets initialized. Since it's triggered at each PM (or even runtime PM), it appears so ofetn, and rather becomes annoying than

				^^

typo

Quoted 15 lines

useful.

This patch suppresses the superfluous messages by checking the currently loaded FW version with the previously loaded one.

---
 sound/soc/intel/atom/sst/sst_ipc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/intel/atom/sst/sst_ipc.c +0 -0
index 14c2d9d18180..20b01e02ed8f 100644

sound/soc/intel/atom/sst/sst_ipc.c static void process_fw_init(struct intel_sst_drv *sst_drv_ctx, · line 240

Quoted 6 lines
sound/soc/intel/atom/sst/sst_ipc.c +2 -1
@@ -236,7 +236,9 @@ static void process_fw_init(struct intel_sst_drv *sst_drv_ctx,
 		retval = init->result;
 		goto ret;
 	}
-	dev_info(sst_drv_ctx->dev, "FW Version %02x.%02x.%02x.%02x\n",
+	if (memcmp(&sst_drv_ctx->fw_version, &init->fw_version,
+		   sizeof(init->fw_version)))

wont dev_info_once be better here? We are really not expecting a new version after suspend :)

Quoted 7 lines
sound/soc/intel/atom/sst/sst_ipc.c +1 -0
+		dev_info(sst_drv_ctx->dev, "FW Version %02x.%02x.%02x.%02x\n",
 			init->fw_version.type, init->fw_version.major,
 			init->fw_version.minor, init->fw_version.build);
 	dev_dbg(sst_drv_ctx->dev, "Build date %s Time %s\n",
Signature · 1 line
2.11.1
Signature · 1 line
~Vinod
maintainer
#2 lore raw
Quoted 8 lines · Vinod Koul

sound/soc/intel/atom/sst/sst_ipc.c static void process_fw_init(struct intel_sst_drv *sst_drv_ctx, · line 240

Quoted 3 lines · Takashi Iwai
sound/soc/intel/atom/sst/sst_ipc.c +2 -1
-	dev_info(sst_drv_ctx->dev, "FW Version %02x.%02x.%02x.%02x\n",
+	if (memcmp(&sst_drv_ctx->fw_version, &init->fw_version,
+		   sizeof(init->fw_version)))

wont dev_info_once be better here? We are really not expecting a new version after suspend :)

You are if someone upgrades their userspace.

Acked-by
#3 lore raw
Quoted 11 lines · Mark Brown
Quoted 8 lines · Vinod Koul

sound/soc/intel/atom/sst/sst_ipc.c static void process_fw_init(struct intel_sst_drv *sst_drv_ctx, · line 240

Quoted 3 lines · Takashi Iwai
sound/soc/intel/atom/sst/sst_ipc.c +2 -1
-	dev_info(sst_drv_ctx->dev, "FW Version %02x.%02x.%02x.%02x\n",
+	if (memcmp(&sst_drv_ctx->fw_version, &init->fw_version,
+		   sizeof(init->fw_version)))

wont dev_info_once be better here? We are really not expecting a new version after suspend :)

You are if someone upgrades their userspace.

Ah yes thats a good point indeed, so:

Thanks

Signature · 1 line
~Vinod
#4 lore raw
In reply to Mark Brown
Quoted 4 lines · Mark Brown
Quoted 1 line · Vinod Koul

On Mon, Mar 27, 2017 at 10:39:58AM +0200, Takashi Iwai wrote:

Quoted 8 lines
Quoted 6 lines

sound/soc/intel/atom/sst/sst_ipc.c static void process_fw_init(struct intel_sst_drv *sst_drv_ctx, · line 240

Quoted 3 lines
sound/soc/intel/atom/sst/sst_ipc.c +2 -1
-	dev_info(sst_drv_ctx->dev, "FW Version %02x.%02x.%02x.%02x\n",
+	if (memcmp(&sst_drv_ctx->fw_version, &init->fw_version,
+		   sizeof(init->fw_version)))

wont dev_info_once be better here? We are really not expecting a new version after suspend :)

You are if someone upgrades their userspace.

Right. If we want to keep the old one consistently, you should cache the firmware instead of doing request_firmware at each time.

Takashi

#5 lore raw
Quoted 10 lines · Takashi Iwai
Quoted 8 lines · Mark Brown
Quoted 5 lines · Vinod Koul
Quoted 3 lines · Takashi Iwai
sound/soc/intel/atom/sst/sst_ipc.c +2 -1
-	dev_info(sst_drv_ctx->dev, "FW Version %02x.%02x.%02x.%02x\n",
+	if (memcmp(&sst_drv_ctx->fw_version, &init->fw_version,
+		   sizeof(init->fw_version)))
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

wont dev_info_once be better here? We are really not expecting a new version after suspend :)

You are if someone upgrades their userspace.

Right. If we want to keep the old one consistently, you should cache the firmware instead of doing request_firmware at each time.

Ah great thanks for reminding, we actually do that, so we don't load from userspace all the time. That was done to get good latency and avoid 50ms ish time it used to load the firmware.

see sst_cache_and_parse_fw() so dev_info_once() would suffice here

Signature · 1 line
~Vinod
#6 lore raw
Quoted 17 lines · Vinod Koul
Quoted 15 lines · Takashi Iwai
Quoted 12 lines · Mark Brown
Quoted 8 lines · Vinod Koul

sound/soc/intel/atom/sst/sst_ipc.c static void process_fw_init(struct intel_sst_drv *sst_drv_ctx, · line 240

Quoted 3 lines · Takashi Iwai
sound/soc/intel/atom/sst/sst_ipc.c +2 -1
-	dev_info(sst_drv_ctx->dev, "FW Version %02x.%02x.%02x.%02x\n",
+	if (memcmp(&sst_drv_ctx->fw_version, &init->fw_version,
+		   sizeof(init->fw_version)))

wont dev_info_once be better here? We are really not expecting a new version after suspend :)

You are if someone upgrades their userspace.

Quoted 8 lines
Quoted 2 lines

Right. If we want to keep the old one consistently, you should cache the firmware instead of doing request_firmware at each time.

Ah great thanks for reminding, we actually do that, so we don't load from userspace all the time. That was done to get good latency and avoid 50ms ish time it used to load the firmware.

see sst_cache_and_parse_fw() so dev_info_once() would suffice here

OK, I'll respin the patch with it.

thanks,

Takashi

maintainer
#7 lore raw

Applied "ASoC: intel: Don't print FW version repeatedly" to the asoc tree

In reply to Takashi Iwai

The patch

ASoC: intel: Don't print FW version repeatedly

has been applied to the asoc tree at

git://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

Quoted 1 line

From 36d96039e710488b53256defed0fd291e0f1a34b Mon Sep 17 00:00:00 2001

From: Takashi Iwai <[email protected]>
Date: Mon, 27 Mar 2017 10:39:58 +0200
Subject: [PATCH] ASoC: intel: Don't print FW version repeatedly

Intel SST driver spews an info message "FW Versoin xxxx" at each time the device gets initialized. Since it's triggered at each PM (or even runtime PM), it appears so ofetn, and rather becomes annoying than useful.

This patch suppresses the superfluous messages by checking the currently loaded FW version with the previously loaded one.

---
 sound/soc/intel/atom/sst/sst_ipc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/intel/atom/sst/sst_ipc.c +3 -1
index 14c2d9d18180..20b01e02ed8f 100644
@@ -236,7 +236,9 @@ static void process_fw_init(struct intel_sst_drv *sst_drv_ctx,
 		retval = init->result;
 		goto ret;
 	}
-	dev_info(sst_drv_ctx->dev, "FW Version %02x.%02x.%02x.%02x\n",
+	if (memcmp(&sst_drv_ctx->fw_version, &init->fw_version,
+		   sizeof(init->fw_version)))
+		dev_info(sst_drv_ctx->dev, "FW Version %02x.%02x.%02x.%02x\n",
 			init->fw_version.type, init->fw_version.major,
 			init->fw_version.minor, init->fw_version.build);
 	dev_dbg(sst_drv_ctx->dev, "Build date %s Time %s\n",
Signature · 1 line
2.11.0