All of lore.kernel.org
 help / color / mirror / Atom feed
From: cezary.rojewski@intel.com
To: alsa-devel@alsa-project.org
Cc: pierre-louis.bossart@linux.intel.com,
	Cezary Rojewski <cezary.rojewski@intel.com>,
	lgirdwood@gmail.com, tiwai@suse.com, broonie@kernel.org,
	Kamil Lulko <kamilx.lulko@intel.com>
Subject: [PATCH 7/7] ASoC: Intel: Skylake: Strip T and L from TLV IPCs
Date: Thu, 13 Jun 2019 21:04:36 +0200	[thread overview]
Message-ID: <20190613190436.20156-8-cezary.rojewski@intel.com> (raw)
In-Reply-To: <20190613190436.20156-1-cezary.rojewski@intel.com>

From: Kamil Lulko <kamilx.lulko@intel.com>

cAVS modules do not require Type and Length header within the
set_module_params IPC. This is also true for Vendor modules. The
userspace (like tinymix) always appends this header to TLV controls
which are used for set_module_params. Simply assume this header is
always present in the payload and omit it from the IPC.

Signed-off-by: Kamil Lulko <kamilx.lulko@intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
---
 sound/soc/intel/skylake/skl-topology.c | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index c69d999d7bf1..76e971b8536a 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -1492,22 +1492,18 @@ static int skl_tplg_tlv_control_set(struct snd_kcontrol *kcontrol,
 	struct skl *skl = get_skl_ctx(w->dapm->dev);
 
 	if (ac->params) {
+		/*
+		 * Widget data is expected to be stripped of T and L
+		 */
+		size -= 2 * sizeof(unsigned int);
+		data += 2;
+
 		if (size > ac->max)
 			return -EINVAL;
-
 		ac->size = size;
-		/*
-		 * if the param_is is of type Vendor, firmware expects actual
-		 * parameter id and size from the control.
-		 */
-		if (ac->param_id == SKL_PARAM_VENDOR_ID) {
-			if (copy_from_user(ac->params, data, size))
-				return -EFAULT;
-		} else {
-			if (copy_from_user(ac->params,
-					   data + 2, size))
-				return -EFAULT;
-		}
+
+		if (copy_from_user(ac->params, data, size))
+			return -EFAULT;
 
 		if (w->power)
 			return skl_set_module_params(skl->skl_sst,
-- 
2.17.1

  parent reply	other threads:[~2019-06-13 19:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-13 19:04 [PATCH 0/7] ASoC: Intel: Skylake: Critical IPC fixes and flow adjustments cezary.rojewski
2019-06-13 19:04 ` [PATCH 1/7] ASoC: Intel: Skylake: Fix incorrect capture position reporting cezary.rojewski
2019-06-13 19:04 ` [PATCH 2/7] ASoC: Intel: Skylake: Use recommended SDxFMT programming sequence cezary.rojewski
2019-06-13 19:04 ` [PATCH 3/7] ASoC: Intel: Skylake: Read HIPCT extension before clearing DONE bit cezary.rojewski
2019-06-26 11:32   ` Applied "ASoC: Intel: Skylake: Read HIPCT extension before clearing DONE bit" to the asoc tree Mark Brown
2019-06-13 19:04 ` [PATCH 4/7] ASoC: Intel: Fix race condition in IPC rx list cezary.rojewski
2019-06-26 11:32   ` Applied "ASoC: Intel: Fix race condition in IPC rx list" to the asoc tree Mark Brown
2019-06-13 19:04 ` [PATCH 5/7] ASoC: Intel: Common: Fix NULL dereference in tx_wait_done cezary.rojewski
2019-06-26 11:32   ` Applied "ASoC: Intel: Common: Fix NULL dereference in tx_wait_done" to the asoc tree Mark Brown
2019-06-13 19:04 ` [PATCH 6/7] ASoC: Intel: Skylake: Reset pipeline before its deletion cezary.rojewski
2019-06-13 19:04 ` cezary.rojewski [this message]
2019-06-26 11:32   ` Applied "ASoC: Intel: Skylake: Strip T and L from TLV IPCs" to the asoc tree Mark Brown
2019-06-25 10:53 ` [PATCH 0/7] ASoC: Intel: Skylake: Critical IPC fixes and flow adjustments Mark Brown
2019-06-25 13:10   ` Pierre-Louis Bossart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190613190436.20156-8-cezary.rojewski@intel.com \
    --to=cezary.rojewski@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kamilx.lulko@intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.