All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: SOF: Fix probe point getter
@ 2020-03-09 14:21 Cezary Rojewski
  2020-03-09 16:58 ` Pierre-Louis Bossart
  2020-03-10 13:51 ` Applied "ASoC: SOF: Fix probe point getter" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Cezary Rojewski @ 2020-03-09 14:21 UTC (permalink / raw)
  To: alsa-devel; +Cc: Cezary Rojewski, broonie, pierre-louis.bossart, lgirdwood

Firmware API changes which introduced 'num_elems' param in several probe
structs such as sof_ipc_probe_dma_add_params also impacted getter for
both, DMA and probe points. All struct handlers except for
sof_ipc_probe_info_params have been updated. Align said handler too to
calculate payload size correctly.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Fixes: f3b433e4699f ("ASoC: SOF: Implement Probe IPC API")
---
 sound/soc/sof/probe.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sof/probe.c b/sound/soc/sof/probe.c
index 2b2f3dcfc7e9..c38169fe00c5 100644
--- a/sound/soc/sof/probe.c
+++ b/sound/soc/sof/probe.c
@@ -95,13 +95,17 @@ static int sof_ipc_probe_info(struct snd_sof_dev *sdev, unsigned int cmd,
 	if (!reply->num_elems)
 		goto exit;
 
-	bytes = reply->num_elems * sizeof(reply->dma[0]);
+	if (cmd == SOF_IPC_PROBE_DMA_INFO)
+		bytes = sizeof(reply->dma[0]);
+	else
+		bytes = sizeof(reply->desc[0]);
+	bytes *= reply->num_elems;
 	*params = kmemdup(&reply->dma[0], bytes, GFP_KERNEL);
 	if (!*params) {
 		ret = -ENOMEM;
 		goto exit;
 	}
-	*num_params = msg.num_elems;
+	*num_params = reply->num_elems;
 
 exit:
 	kfree(reply);
-- 
2.17.1


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

* Re: [PATCH] ASoC: SOF: Fix probe point getter
  2020-03-09 14:21 [PATCH] ASoC: SOF: Fix probe point getter Cezary Rojewski
@ 2020-03-09 16:58 ` Pierre-Louis Bossart
  2020-03-10 13:51 ` Applied "ASoC: SOF: Fix probe point getter" to the asoc tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Pierre-Louis Bossart @ 2020-03-09 16:58 UTC (permalink / raw)
  To: Cezary Rojewski, alsa-devel; +Cc: broonie, lgirdwood



On 3/9/20 9:21 AM, Cezary Rojewski wrote:
> Firmware API changes which introduced 'num_elems' param in several probe
> structs such as sof_ipc_probe_dma_add_params also impacted getter for
> both, DMA and probe points. All struct handlers except for
> sof_ipc_probe_info_params have been updated. Align said handler too to
> calculate payload size correctly.
> 
> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>

Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

Thanks Cezary!

> Fixes: f3b433e4699f ("ASoC: SOF: Implement Probe IPC API") > ---
>   sound/soc/sof/probe.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/sof/probe.c b/sound/soc/sof/probe.c
> index 2b2f3dcfc7e9..c38169fe00c5 100644
> --- a/sound/soc/sof/probe.c
> +++ b/sound/soc/sof/probe.c
> @@ -95,13 +95,17 @@ static int sof_ipc_probe_info(struct snd_sof_dev *sdev, unsigned int cmd,
>   	if (!reply->num_elems)
>   		goto exit;
>   
> -	bytes = reply->num_elems * sizeof(reply->dma[0]);
> +	if (cmd == SOF_IPC_PROBE_DMA_INFO)
> +		bytes = sizeof(reply->dma[0]);
> +	else
> +		bytes = sizeof(reply->desc[0]);
> +	bytes *= reply->num_elems;
>   	*params = kmemdup(&reply->dma[0], bytes, GFP_KERNEL);
>   	if (!*params) {
>   		ret = -ENOMEM;
>   		goto exit;
>   	}
> -	*num_params = msg.num_elems;
> +	*num_params = reply->num_elems;
>   
>   exit:
>   	kfree(reply);
> 

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

* Applied "ASoC: SOF: Fix probe point getter" to the asoc tree
  2020-03-09 14:21 [PATCH] ASoC: SOF: Fix probe point getter Cezary Rojewski
  2020-03-09 16:58 ` Pierre-Louis Bossart
@ 2020-03-10 13:51 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2020-03-10 13:51 UTC (permalink / raw)
  To: Cezary Rojewski; +Cc: alsa-devel, Mark Brown, lgirdwood, Pierre-Louis Bossart

The patch

   ASoC: SOF: Fix probe point getter

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 a3b7343e3f8c4c74516df41827b6d81905e346a1 Mon Sep 17 00:00:00 2001
From: Cezary Rojewski <cezary.rojewski@intel.com>
Date: Mon, 9 Mar 2020 15:21:24 +0100
Subject: [PATCH] ASoC: SOF: Fix probe point getter

Firmware API changes which introduced 'num_elems' param in several probe
structs such as sof_ipc_probe_dma_add_params also impacted getter for
both, DMA and probe points. All struct handlers except for
sof_ipc_probe_info_params have been updated. Align said handler too to
calculate payload size correctly.

Fixes: f3b433e4699f ("ASoC: SOF: Implement Probe IPC API")
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200309142124.29262-1-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/sof/probe.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sof/probe.c b/sound/soc/sof/probe.c
index 2b2f3dcfc7e9..c38169fe00c5 100644
--- a/sound/soc/sof/probe.c
+++ b/sound/soc/sof/probe.c
@@ -95,13 +95,17 @@ static int sof_ipc_probe_info(struct snd_sof_dev *sdev, unsigned int cmd,
 	if (!reply->num_elems)
 		goto exit;
 
-	bytes = reply->num_elems * sizeof(reply->dma[0]);
+	if (cmd == SOF_IPC_PROBE_DMA_INFO)
+		bytes = sizeof(reply->dma[0]);
+	else
+		bytes = sizeof(reply->desc[0]);
+	bytes *= reply->num_elems;
 	*params = kmemdup(&reply->dma[0], bytes, GFP_KERNEL);
 	if (!*params) {
 		ret = -ENOMEM;
 		goto exit;
 	}
-	*num_params = msg.num_elems;
+	*num_params = reply->num_elems;
 
 exit:
 	kfree(reply);
-- 
2.20.1


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

end of thread, other threads:[~2020-03-10 13:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-09 14:21 [PATCH] ASoC: SOF: Fix probe point getter Cezary Rojewski
2020-03-09 16:58 ` Pierre-Louis Bossart
2020-03-10 13:51 ` Applied "ASoC: SOF: Fix probe point getter" 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.