All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: intel: Don't print FW version repeatedly
@ 2017-03-27  8:39 Takashi Iwai
  2017-03-27 10:06 ` Vinod Koul
  2017-03-27 11:32 ` Applied "ASoC: intel: Don't print FW version repeatedly" to the asoc tree Mark Brown
  0 siblings, 2 replies; 8+ messages in thread
From: Takashi Iwai @ 2017-03-27  8:39 UTC (permalink / raw)
  To: Mark Brown; +Cc: Liam Girdwood, Vinod Koul, alsa-devel, Pierre-Louis Bossart

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.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/intel/atom/sst/sst_ipc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/atom/sst/sst_ipc.c b/sound/soc/intel/atom/sst/sst_ipc.c
index 14c2d9d18180..20b01e02ed8f 100644
--- a/sound/soc/intel/atom/sst/sst_ipc.c
+++ b/sound/soc/intel/atom/sst/sst_ipc.c
@@ -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",
-- 
2.11.1

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

* Re: [PATCH] ASoC: intel: Don't print FW version repeatedly
  2017-03-27  8:39 [PATCH] ASoC: intel: Don't print FW version repeatedly Takashi Iwai
@ 2017-03-27 10:06 ` Vinod Koul
  2017-03-27 10:13   ` Mark Brown
  2017-03-27 11:32 ` Applied "ASoC: intel: Don't print FW version repeatedly" to the asoc tree Mark Brown
  1 sibling, 1 reply; 8+ messages in thread
From: Vinod Koul @ 2017-03-27 10:06 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Liam Girdwood, alsa-devel, Mark Brown, Pierre-Louis Bossart

On Mon, Mar 27, 2017 at 10:39:58AM +0200, Takashi Iwai wrote:
> 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

> useful.
> 
> This patch suppresses the superfluous messages by checking the
> currently loaded FW version with the previously loaded one.
> 
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
>  sound/soc/intel/atom/sst/sst_ipc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/intel/atom/sst/sst_ipc.c b/sound/soc/intel/atom/sst/sst_ipc.c
> index 14c2d9d18180..20b01e02ed8f 100644
> --- a/sound/soc/intel/atom/sst/sst_ipc.c
> +++ b/sound/soc/intel/atom/sst/sst_ipc.c
> @@ -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 :)

> +		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",
> -- 
> 2.11.1
> 

-- 
~Vinod

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

* Re: [PATCH] ASoC: intel: Don't print FW version repeatedly
  2017-03-27 10:06 ` Vinod Koul
@ 2017-03-27 10:13   ` Mark Brown
  2017-03-27 10:24     ` Takashi Iwai
  2017-03-27 10:25     ` Vinod Koul
  0 siblings, 2 replies; 8+ messages in thread
From: Mark Brown @ 2017-03-27 10:13 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Takashi Iwai, Liam Girdwood, alsa-devel, Pierre-Louis Bossart


[-- Attachment #1.1: Type: text/plain, Size: 438 bytes --]

On Mon, Mar 27, 2017 at 03:36:58PM +0530, Vinod Koul wrote:
> On Mon, Mar 27, 2017 at 10:39:58AM +0200, Takashi Iwai wrote:

> > -	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.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH] ASoC: intel: Don't print FW version repeatedly
  2017-03-27 10:13   ` Mark Brown
@ 2017-03-27 10:24     ` Takashi Iwai
  2017-03-27 10:37       ` Vinod Koul
  2017-03-27 10:25     ` Vinod Koul
  1 sibling, 1 reply; 8+ messages in thread
From: Takashi Iwai @ 2017-03-27 10:24 UTC (permalink / raw)
  To: Mark Brown; +Cc: Vinod Koul, Liam Girdwood, alsa-devel, Pierre-Louis Bossart

On Mon, 27 Mar 2017 12:13:54 +0200,
Mark Brown wrote:
> 
> On Mon, Mar 27, 2017 at 03:36:58PM +0530, Vinod Koul wrote:
> > On Mon, Mar 27, 2017 at 10:39:58AM +0200, Takashi Iwai wrote:
> 
> > > -	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

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

* Re: [PATCH] ASoC: intel: Don't print FW version repeatedly
  2017-03-27 10:13   ` Mark Brown
  2017-03-27 10:24     ` Takashi Iwai
@ 2017-03-27 10:25     ` Vinod Koul
  1 sibling, 0 replies; 8+ messages in thread
From: Vinod Koul @ 2017-03-27 10:25 UTC (permalink / raw)
  To: Mark Brown; +Cc: Takashi Iwai, Liam Girdwood, alsa-devel, Pierre-Louis Bossart

On Mon, Mar 27, 2017 at 11:13:54AM +0100, Mark Brown wrote:
> On Mon, Mar 27, 2017 at 03:36:58PM +0530, Vinod Koul wrote:
> > On Mon, Mar 27, 2017 at 10:39:58AM +0200, Takashi Iwai wrote:
> 
> > > -	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:

Acked-by: Vinod Koul <vinod.koul@intel.com>

Thanks
-- 
~Vinod

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

* Re: [PATCH] ASoC: intel: Don't print FW version repeatedly
  2017-03-27 10:24     ` Takashi Iwai
@ 2017-03-27 10:37       ` Vinod Koul
  2017-03-27 12:10         ` Takashi Iwai
  0 siblings, 1 reply; 8+ messages in thread
From: Vinod Koul @ 2017-03-27 10:37 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Liam Girdwood, alsa-devel, Mark Brown, Pierre-Louis Bossart

On Mon, Mar 27, 2017 at 12:24:20PM +0200, Takashi Iwai wrote:
> On Mon, 27 Mar 2017 12:13:54 +0200,
> Mark Brown wrote:
> > 
> > On Mon, Mar 27, 2017 at 03:36:58PM +0530, Vinod Koul wrote:
> > > On Mon, Mar 27, 2017 at 10:39:58AM +0200, Takashi Iwai wrote:
> > 
> > > > -	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.

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

-- 
~Vinod

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

* Applied "ASoC: intel: Don't print FW version repeatedly" to the asoc tree
  2017-03-27  8:39 [PATCH] ASoC: intel: Don't print FW version repeatedly Takashi Iwai
  2017-03-27 10:06 ` Vinod Koul
@ 2017-03-27 11:32 ` Mark Brown
  1 sibling, 0 replies; 8+ messages in thread
From: Mark Brown @ 2017-03-27 11:32 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Vinod Koul, Liam Girdwood, alsa-devel, Mark Brown, Pierre-Louis Bossart

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

>From 36d96039e710488b53256defed0fd291e0f1a34b Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
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.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/atom/sst/sst_ipc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/atom/sst/sst_ipc.c b/sound/soc/intel/atom/sst/sst_ipc.c
index 14c2d9d18180..20b01e02ed8f 100644
--- a/sound/soc/intel/atom/sst/sst_ipc.c
+++ b/sound/soc/intel/atom/sst/sst_ipc.c
@@ -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",
-- 
2.11.0

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

* Re: [PATCH] ASoC: intel: Don't print FW version repeatedly
  2017-03-27 10:37       ` Vinod Koul
@ 2017-03-27 12:10         ` Takashi Iwai
  0 siblings, 0 replies; 8+ messages in thread
From: Takashi Iwai @ 2017-03-27 12:10 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Liam Girdwood, alsa-devel, Mark Brown, Pierre-Louis Bossart

On Mon, 27 Mar 2017 12:37:12 +0200,
Vinod Koul wrote:
> 
> On Mon, Mar 27, 2017 at 12:24:20PM +0200, Takashi Iwai wrote:
> > On Mon, 27 Mar 2017 12:13:54 +0200,
> > Mark Brown wrote:
> > > 
> > > On Mon, Mar 27, 2017 at 03:36:58PM +0530, Vinod Koul wrote:
> > > > On Mon, Mar 27, 2017 at 10:39:58AM +0200, Takashi Iwai wrote:
> > > 
> > > > > -	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.
> 
> 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

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

end of thread, other threads:[~2017-03-27 12:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-27  8:39 [PATCH] ASoC: intel: Don't print FW version repeatedly Takashi Iwai
2017-03-27 10:06 ` Vinod Koul
2017-03-27 10:13   ` Mark Brown
2017-03-27 10:24     ` Takashi Iwai
2017-03-27 10:37       ` Vinod Koul
2017-03-27 12:10         ` Takashi Iwai
2017-03-27 10:25     ` Vinod Koul
2017-03-27 11:32 ` Applied "ASoC: intel: Don't print FW version repeatedly" to the asoc tree 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.