All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] ASoC: Intel: Skylake: Driver fixes
@ 2016-02-03 12:29 Vinod Koul
  2016-02-03 12:29 ` [PATCH 01/11] ASoC: Intel: Skylake: Fix the memory overwrite of tlv buffer Vinod Koul
                   ` (10 more replies)
  0 siblings, 11 replies; 25+ messages in thread
From: Vinod Koul @ 2016-02-03 12:29 UTC (permalink / raw)
  To: alsa-devel; +Cc: liam.r.girdwood, patches.audio, broonie, Vinod Koul

Now that 4.5-rc1 has audio functional with driver, time to fix some corner
cases in driver.

This series tries to fix:
o resource leakage on error cases while allocation and freeup
o wrap of delay reporting
o fix of various corner cases in topology and support of multiple
sinks/source ona pipe and without a mixer termination
o tlv buffer overwrite as suggested by Takashi
o removal of autosuspend delay
o 2 ch support on rt286 machine

Although patches are 11, the diffstat is only +59, -29

Dharageswari.R (1):
  ASoC: Intel: Skylake: Fix pipe memory allocation leak

Guneshwor Singh (2):
  ASoC: Intel: Skylake: Fix delay wrap condition
  ASoC: Intel: Skylake: Fix mcps freeup after module unbind failure

Jeeja KP (6):
  ASoC: Intel: Skylake: Fix return of skl_get_queue_index
  ASoC: Intel: Skylake: Fix the module state check condition
  ASoC: Intel: Skylake: Fix not to stop sink pipe in pga pmd event
  ASoC: Intel: Skylake: Fix bind of source with multiple sinks
  ASoC: Intel: Skylake: Add missing PRE/POST_PMU handlers for vmixer
  ASoC: Intel: Skylake: Fix stereo DMIC record

Vinod Koul (2):
  ASoC: Intel: Skylake: Fix the memory overwrite of tlv buffer
  ASoC: Intel: Skylake: Remove autosuspend delay

 sound/soc/intel/boards/skl_rt286.c     |  5 ++-
 sound/soc/intel/skylake/skl-messages.c |  6 +--
 sound/soc/intel/skylake/skl-pcm.c      |  1 +
 sound/soc/intel/skylake/skl-topology.c | 74 +++++++++++++++++++++++-----------
 sound/soc/intel/skylake/skl.c          |  2 -
 5 files changed, 59 insertions(+), 29 deletions(-)

-- 
1.9.1

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

* [PATCH 01/11] ASoC: Intel: Skylake: Fix the memory overwrite of tlv buffer
  2016-02-03 12:29 [PATCH 00/11] ASoC: Intel: Skylake: Driver fixes Vinod Koul
@ 2016-02-03 12:29 ` Vinod Koul
  2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Fix the memory overwrite of tlv buffer" to the asoc tree Mark Brown
  2016-02-03 12:29 ` [PATCH 02/11] ASoC: Intel: Skylake: Fix delay wrap condition Vinod Koul
                   ` (9 subsequent siblings)
  10 siblings, 1 reply; 25+ messages in thread
From: Vinod Koul @ 2016-02-03 12:29 UTC (permalink / raw)
  To: alsa-devel; +Cc: liam.r.girdwood, patches.audio, broonie, Vinod Koul

TLV buffer can be smaller than the module data, so update the
size of data to be copied before doing the copy.

Also TLV header consists of two unsigned ints, this is also taken
into account here and size modified to reflect this

Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/soc/intel/skylake/skl-topology.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index 4624556f486d..d1ddfdac22fe 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -916,6 +916,13 @@ static int skl_tplg_tlv_control_get(struct snd_kcontrol *kcontrol,
 		skl_get_module_params(skl->skl_sst, (u32 *)bc->params,
 				      bc->max, bc->param_id, mconfig);
 
+	/* decrement size for TLV header */
+	size -= 2 * sizeof(u32);
+
+	/* check size as we don't want to send kernel data */
+	if (size > bc->max)
+		size = bc->max;
+
 	if (bc->params) {
 		if (copy_to_user(data, &bc->param_id, sizeof(u32)))
 			return -EFAULT;
-- 
1.9.1

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

* [PATCH 02/11] ASoC: Intel: Skylake: Fix delay wrap condition
  2016-02-03 12:29 [PATCH 00/11] ASoC: Intel: Skylake: Driver fixes Vinod Koul
  2016-02-03 12:29 ` [PATCH 01/11] ASoC: Intel: Skylake: Fix the memory overwrite of tlv buffer Vinod Koul
@ 2016-02-03 12:29 ` Vinod Koul
  2016-02-04 11:24   ` Mark Brown
  2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Fix delay wrap condition" to the asoc tree Mark Brown
  2016-02-03 12:29 ` [PATCH 03/11] ASoC: Intel: Skylake: Fix mcps freeup after module unbind failure Vinod Koul
                   ` (8 subsequent siblings)
  10 siblings, 2 replies; 25+ messages in thread
From: Vinod Koul @ 2016-02-03 12:29 UTC (permalink / raw)
  To: alsa-devel
  Cc: Dharageswari.R, patches.audio, Guneshwor Singh, liam.r.girdwood,
	Vinod Koul, broonie

From: Guneshwor Singh <guneshwor.o.singh@intel.com>

When delay reported by HW is equal to buffersize, it means the
value is wrapped so we should report as 0. So add the condition
to check this while reporting the delay from LPIB.

Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
Signed-off-by: Dharageswari.R <dharageswari.r@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/soc/intel/skylake/skl-pcm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
index f3553258091a..b6e6b61d10ec 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -863,6 +863,7 @@ static int skl_get_delay_from_lpib(struct hdac_ext_bus *ebus,
 		else
 			delay += hstream->bufsize;
 	}
+	delay = (hstream->bufsize == delay) ? 0 : delay;
 
 	if (delay >= hstream->period_bytes) {
 		dev_info(bus->dev,
-- 
1.9.1

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

* [PATCH 03/11] ASoC: Intel: Skylake: Fix mcps freeup after module unbind failure
  2016-02-03 12:29 [PATCH 00/11] ASoC: Intel: Skylake: Driver fixes Vinod Koul
  2016-02-03 12:29 ` [PATCH 01/11] ASoC: Intel: Skylake: Fix the memory overwrite of tlv buffer Vinod Koul
  2016-02-03 12:29 ` [PATCH 02/11] ASoC: Intel: Skylake: Fix delay wrap condition Vinod Koul
@ 2016-02-03 12:29 ` Vinod Koul
  2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Fix mcps freeup after module unbind failure" to the asoc tree Mark Brown
  2016-02-03 12:29 ` [PATCH 04/11] ASoC: Intel: Skylake: Fix pipe memory allocation leak Vinod Koul
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 25+ messages in thread
From: Vinod Koul @ 2016-02-03 12:29 UTC (permalink / raw)
  To: alsa-devel
  Cc: liam.r.girdwood, patches.audio, broonie, Guneshwor Singh, Vinod Koul

From: Guneshwor Singh <guneshwor.o.singh@intel.com>

While cleaning resources on module pmd event, we check for return
of skl_unbind_modules(). On failure this causes leak as all modules
attached do not have resources freed.

So ignore return value of module unbind and continue freeing
resources. This makes dapm state and resources correct.

Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/soc/intel/skylake/skl-topology.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index d1ddfdac22fe..defe7eaba667 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -98,7 +98,7 @@ static bool skl_tplg_alloc_pipe_mcps(struct skl *skl,
 			"%s: module_id %d instance %d\n", __func__,
 			mconfig->id.module_id, mconfig->id.instance_id);
 		dev_err(ctx->dev,
-			"exceeds ppl memory available %d > mem %d\n",
+			"exceeds ppl mcps available %d > mem %d\n",
 			skl->resource.max_mcps, skl->resource.mcps);
 		return false;
 	}
@@ -773,10 +773,7 @@ static int skl_tplg_mixer_dapm_post_pmd_event(struct snd_soc_dapm_widget *w,
 			continue;
 		}
 
-		ret = skl_unbind_modules(ctx, src_module, dst_module);
-		if (ret < 0)
-			return ret;
-
+		skl_unbind_modules(ctx, src_module, dst_module);
 		src_module = dst_module;
 	}
 
-- 
1.9.1

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

* [PATCH 04/11] ASoC: Intel: Skylake: Fix pipe memory allocation leak
  2016-02-03 12:29 [PATCH 00/11] ASoC: Intel: Skylake: Driver fixes Vinod Koul
                   ` (2 preceding siblings ...)
  2016-02-03 12:29 ` [PATCH 03/11] ASoC: Intel: Skylake: Fix mcps freeup after module unbind failure Vinod Koul
@ 2016-02-03 12:29 ` Vinod Koul
  2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Fix pipe memory allocation leak" to the asoc tree Mark Brown
  2016-02-03 12:29 ` [PATCH 05/11] ASoC: Intel: Skylake: Fix return of skl_get_queue_index Vinod Koul
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 25+ messages in thread
From: Vinod Koul @ 2016-02-03 12:29 UTC (permalink / raw)
  To: alsa-devel
  Cc: liam.r.girdwood, patches.audio, Dharageswari.R, broonie, Vinod Koul

From: "Dharageswari.R" <dharageswari.r@intel.com>

We check and allocate pipeline resources in one shot. That causes
leaks if module creation fails later as that is not freed.

So split the resource allocation into two, first check if
resources are available and then add the resources upon
successful creation. So two new functions are added for checking
and current functions are re-purposed to only add the resources
for memory and MCPS.

Signed-off-by: Dharageswari.R <dharageswari.r@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/soc/intel/skylake/skl-topology.c | 42 +++++++++++++++++++++++-----------
 1 file changed, 29 insertions(+), 13 deletions(-)

diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index defe7eaba667..7dc804c1cdea 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -54,12 +54,9 @@ static int is_skl_dsp_widget_type(struct snd_soc_dapm_widget *w)
 
 /*
  * Each pipelines needs memory to be allocated. Check if we have free memory
- * from available pool. Then only add this to pool
- * This is freed when pipe is deleted
- * Note: DSP does actual memory management we only keep track for complete
- * pool
+ * from available pool.
  */
-static bool skl_tplg_alloc_pipe_mem(struct skl *skl,
+static bool skl_is_pipe_mem_avail(struct skl *skl,
 				struct skl_module_cfg *mconfig)
 {
 	struct skl_sst *ctx = skl->skl_sst;
@@ -74,10 +71,20 @@ static bool skl_tplg_alloc_pipe_mem(struct skl *skl,
 				"exceeds ppl memory available %d mem %d\n",
 				skl->resource.max_mem, skl->resource.mem);
 		return false;
+	} else {
+		return true;
 	}
+}
 
+/*
+ * Add the mem to the mem pool. This is freed when pipe is deleted.
+ * Note: DSP does actual memory management we only keep track for complete
+ * pool
+ */
+static void skl_tplg_alloc_pipe_mem(struct skl *skl,
+				struct skl_module_cfg *mconfig)
+{
 	skl->resource.mem += mconfig->pipe->memory_pages;
-	return true;
 }
 
 /*
@@ -85,10 +92,10 @@ static bool skl_tplg_alloc_pipe_mem(struct skl *skl,
  * quantified in MCPS (Million Clocks Per Second) required for module/pipe
  *
  * Each pipelines needs mcps to be allocated. Check if we have mcps for this
- * pipe. This adds the mcps to driver counter
- * This is removed on pipeline delete
+ * pipe.
  */
-static bool skl_tplg_alloc_pipe_mcps(struct skl *skl,
+
+static bool skl_is_pipe_mcps_avail(struct skl *skl,
 				struct skl_module_cfg *mconfig)
 {
 	struct skl_sst *ctx = skl->skl_sst;
@@ -101,10 +108,15 @@ static bool skl_tplg_alloc_pipe_mcps(struct skl *skl,
 			"exceeds ppl mcps available %d > mem %d\n",
 			skl->resource.max_mcps, skl->resource.mcps);
 		return false;
+	} else {
+		return true;
 	}
+}
 
+static void skl_tplg_alloc_pipe_mcps(struct skl *skl,
+				struct skl_module_cfg *mconfig)
+{
 	skl->resource.mcps += mconfig->mcps;
-	return true;
 }
 
 /*
@@ -411,7 +423,7 @@ skl_tplg_init_pipe_modules(struct skl *skl, struct skl_pipe *pipe)
 		mconfig = w->priv;
 
 		/* check resource available */
-		if (!skl_tplg_alloc_pipe_mcps(skl, mconfig))
+		if (!skl_is_pipe_mcps_avail(skl, mconfig))
 			return -ENOMEM;
 
 		if (mconfig->is_loadable && ctx->dsp->fw_ops.load_mod) {
@@ -435,6 +447,7 @@ skl_tplg_init_pipe_modules(struct skl *skl, struct skl_pipe *pipe)
 		ret = skl_tplg_set_module_params(w, ctx);
 		if (ret < 0)
 			return ret;
+		skl_tplg_alloc_pipe_mcps(skl, mconfig);
 	}
 
 	return 0;
@@ -477,10 +490,10 @@ static int skl_tplg_mixer_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w,
 	struct skl_sst *ctx = skl->skl_sst;
 
 	/* check resource available */
-	if (!skl_tplg_alloc_pipe_mcps(skl, mconfig))
+	if (!skl_is_pipe_mcps_avail(skl, mconfig))
 		return -EBUSY;
 
-	if (!skl_tplg_alloc_pipe_mem(skl, mconfig))
+	if (!skl_is_pipe_mem_avail(skl, mconfig))
 		return -ENOMEM;
 
 	/*
@@ -526,6 +539,9 @@ static int skl_tplg_mixer_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w,
 		src_module = dst_module;
 	}
 
+	skl_tplg_alloc_pipe_mem(skl, mconfig);
+	skl_tplg_alloc_pipe_mcps(skl, mconfig);
+
 	return 0;
 }
 
-- 
1.9.1

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

* [PATCH 05/11] ASoC: Intel: Skylake: Fix return of skl_get_queue_index
  2016-02-03 12:29 [PATCH 00/11] ASoC: Intel: Skylake: Driver fixes Vinod Koul
                   ` (3 preceding siblings ...)
  2016-02-03 12:29 ` [PATCH 04/11] ASoC: Intel: Skylake: Fix pipe memory allocation leak Vinod Koul
@ 2016-02-03 12:29 ` Vinod Koul
  2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Fix return of skl_get_queue_index" to the asoc tree Mark Brown
  2016-02-03 12:29 ` [PATCH 06/11] ASoC: Intel: Skylake: Fix the module state check condition Vinod Koul
                   ` (5 subsequent siblings)
  10 siblings, 1 reply; 25+ messages in thread
From: Vinod Koul @ 2016-02-03 12:29 UTC (permalink / raw)
  To: alsa-devel; +Cc: liam.r.girdwood, patches.audio, broonie, Vinod Koul, Jeeja KP

From: Jeeja KP <jeeja.kp@intel.com>

In unbind modules, the skl_get_queue_index() can return error
if the pin is dynamic and module is not bound yet. So instead
of returning error this check should return success as modules
is not yet bound. This will let the module be bound when connected
pipes are enabled and will bind this as well.

So change the return value to 0

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/soc/intel/skylake/skl-messages.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c
index de6dac496a0d..bb5f1d7d0cad 100644
--- a/sound/soc/intel/skylake/skl-messages.c
+++ b/sound/soc/intel/skylake/skl-messages.c
@@ -688,14 +688,14 @@ int skl_unbind_modules(struct skl_sst *ctx,
 	/* get src queue index */
 	src_index = skl_get_queue_index(src_mcfg->m_out_pin, dst_id, out_max);
 	if (src_index < 0)
-		return -EINVAL;
+		return 0;
 
 	msg.src_queue = src_index;
 
 	/* get dst queue index */
 	dst_index  = skl_get_queue_index(dst_mcfg->m_in_pin, src_id, in_max);
 	if (dst_index < 0)
-		return -EINVAL;
+		return 0;
 
 	msg.dst_queue = dst_index;
 
-- 
1.9.1

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

* [PATCH 06/11] ASoC: Intel: Skylake: Fix the module state check condition
  2016-02-03 12:29 [PATCH 00/11] ASoC: Intel: Skylake: Driver fixes Vinod Koul
                   ` (4 preceding siblings ...)
  2016-02-03 12:29 ` [PATCH 05/11] ASoC: Intel: Skylake: Fix return of skl_get_queue_index Vinod Koul
@ 2016-02-03 12:29 ` Vinod Koul
  2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Fix the module state check condition" to the asoc tree Mark Brown
  2016-02-03 12:29 ` [PATCH 07/11] ASoC: Intel: Skylake: Fix not to stop sink pipe in pga pmd event Vinod Koul
                   ` (4 subsequent siblings)
  10 siblings, 1 reply; 25+ messages in thread
From: Vinod Koul @ 2016-02-03 12:29 UTC (permalink / raw)
  To: alsa-devel; +Cc: liam.r.girdwood, patches.audio, broonie, Vinod Koul, Jeeja KP

From: Jeeja KP <jeeja.kp@intel.com>

For binding modules we should check if source or destination
module is in UNINT state. We canot bind even if one of them is
in this state.

So update the check from logical AND to logical OR and do not
bind modules for this case

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/soc/intel/skylake/skl-messages.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c
index bb5f1d7d0cad..4629372d7c8e 100644
--- a/sound/soc/intel/skylake/skl-messages.c
+++ b/sound/soc/intel/skylake/skl-messages.c
@@ -747,7 +747,7 @@ int skl_bind_modules(struct skl_sst *ctx,
 
 	skl_dump_bind_info(ctx, src_mcfg, dst_mcfg);
 
-	if (src_mcfg->m_state < SKL_MODULE_INIT_DONE &&
+	if (src_mcfg->m_state < SKL_MODULE_INIT_DONE ||
 		dst_mcfg->m_state < SKL_MODULE_INIT_DONE)
 		return 0;
 
-- 
1.9.1

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

* [PATCH 07/11] ASoC: Intel: Skylake: Fix not to stop sink pipe in pga pmd event
  2016-02-03 12:29 [PATCH 00/11] ASoC: Intel: Skylake: Driver fixes Vinod Koul
                   ` (5 preceding siblings ...)
  2016-02-03 12:29 ` [PATCH 06/11] ASoC: Intel: Skylake: Fix the module state check condition Vinod Koul
@ 2016-02-03 12:29 ` Vinod Koul
  2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Fix not to stop sink pipe in pga pmd event" to the asoc tree Mark Brown
  2016-02-03 12:29 ` [PATCH 08/11] ASoC: Intel: Skylake: Fix bind of source with multiple sinks Vinod Koul
                   ` (3 subsequent siblings)
  10 siblings, 1 reply; 25+ messages in thread
From: Vinod Koul @ 2016-02-03 12:29 UTC (permalink / raw)
  To: alsa-devel; +Cc: liam.r.girdwood, patches.audio, broonie, Vinod Koul, Jeeja KP

From: Jeeja KP <jeeja.kp@intel.com>

We should not stop the sink pipe in it's pmd handler for a mixin
module as this module may still be connected to other pipes.

This will be stopped and freed by current implementation on last
connected pipe unbind.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/soc/intel/skylake/skl-topology.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index 7dc804c1cdea..244d87c0d106 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -827,9 +827,6 @@ static int skl_tplg_pga_dapm_post_pmd_event(struct snd_soc_dapm_widget *w,
 			 * This is a connecter and if path is found that means
 			 * unbind between source and sink has not happened yet
 			 */
-			ret = skl_stop_pipe(ctx, sink_mconfig->pipe);
-			if (ret < 0)
-				return ret;
 			ret = skl_unbind_modules(ctx, src_mconfig,
 							sink_mconfig);
 		}
-- 
1.9.1

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

* [PATCH 08/11] ASoC: Intel: Skylake: Fix bind of source with multiple sinks
  2016-02-03 12:29 [PATCH 00/11] ASoC: Intel: Skylake: Driver fixes Vinod Koul
                   ` (6 preceding siblings ...)
  2016-02-03 12:29 ` [PATCH 07/11] ASoC: Intel: Skylake: Fix not to stop sink pipe in pga pmd event Vinod Koul
@ 2016-02-03 12:29 ` Vinod Koul
  2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Fix bind of source with multiple sinks" to the asoc tree Mark Brown
  2016-02-03 12:29 ` [PATCH 09/11] ASoC: Intel: Skylake: Add missing PRE/POST_PMU handlers for vmixer Vinod Koul
                   ` (2 subsequent siblings)
  10 siblings, 1 reply; 25+ messages in thread
From: Vinod Koul @ 2016-02-03 12:29 UTC (permalink / raw)
  To: alsa-devel; +Cc: liam.r.girdwood, patches.audio, broonie, Vinod Koul, Jeeja KP

From: Jeeja KP <jeeja.kp@intel.com>

skl_tplg_bind_sinks() takes only the first sink widget. This
breaks in case we have multiple sinks for a module.

So pass source widget to skl_tplg_bind_sinks() and bind for all
sinks by calling this recursively

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/soc/intel/skylake/skl-topology.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index 244d87c0d106..722a05a7f098 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -547,6 +547,7 @@ static int skl_tplg_mixer_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w,
 
 static int skl_tplg_bind_sinks(struct snd_soc_dapm_widget *w,
 				struct skl *skl,
+				struct snd_soc_dapm_widget *src_w,
 				struct skl_module_cfg *src_mconfig)
 {
 	struct snd_soc_dapm_path *p;
@@ -563,6 +564,10 @@ static int skl_tplg_bind_sinks(struct snd_soc_dapm_widget *w,
 		dev_dbg(ctx->dev, "%s: sink widget=%s\n", __func__, p->sink->name);
 
 		next_sink = p->sink;
+
+		if (!is_skl_dsp_widget_type(p->sink))
+			return skl_tplg_bind_sinks(p->sink, skl, src_w, src_mconfig);
+
 		/*
 		 * here we will check widgets in sink pipelines, so that
 		 * can be any widgets type and we are only interested if
@@ -592,7 +597,7 @@ static int skl_tplg_bind_sinks(struct snd_soc_dapm_widget *w,
 	}
 
 	if (!sink)
-		return skl_tplg_bind_sinks(next_sink, skl, src_mconfig);
+		return skl_tplg_bind_sinks(next_sink, skl, src_w, src_mconfig);
 
 	return 0;
 }
@@ -621,7 +626,7 @@ static int skl_tplg_pga_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w,
 	 * if sink is not started, start sink pipe first, then start
 	 * this pipe
 	 */
-	ret = skl_tplg_bind_sinks(w, skl, src_mconfig);
+	ret = skl_tplg_bind_sinks(w, skl, w, src_mconfig);
 	if (ret)
 		return ret;
 
-- 
1.9.1

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

* [PATCH 09/11] ASoC: Intel: Skylake: Add missing PRE/POST_PMU handlers for vmixer
  2016-02-03 12:29 [PATCH 00/11] ASoC: Intel: Skylake: Driver fixes Vinod Koul
                   ` (7 preceding siblings ...)
  2016-02-03 12:29 ` [PATCH 08/11] ASoC: Intel: Skylake: Fix bind of source with multiple sinks Vinod Koul
@ 2016-02-03 12:29 ` Vinod Koul
  2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Add missing PRE/POST_PMU handlers for vmixer" to the asoc tree Mark Brown
  2016-02-03 12:29 ` [PATCH 10/11] ASoC: Intel: Skylake: Fix stereo DMIC record Vinod Koul
  2016-02-03 12:29 ` [PATCH 11/11] ASoC: Intel: Skylake: Remove autosuspend delay Vinod Koul
  10 siblings, 1 reply; 25+ messages in thread
From: Vinod Koul @ 2016-02-03 12:29 UTC (permalink / raw)
  To: alsa-devel; +Cc: liam.r.girdwood, patches.audio, broonie, Vinod Koul, Jeeja KP

From: Jeeja KP <jeeja.kp@intel.com>

Some modules may be directly connected to a pipeline without a
mixer module. For these modules, we require PRE_PMU and POST_PMU
handler which will do bind between the pipelines, so add these
missing handlers.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/soc/intel/skylake/skl-topology.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index 722a05a7f098..50e193e9eb56 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -857,6 +857,12 @@ static int skl_tplg_vmixer_event(struct snd_soc_dapm_widget *w,
 	case SND_SOC_DAPM_PRE_PMU:
 		return skl_tplg_mixer_dapm_pre_pmu_event(w, skl);
 
+	case SND_SOC_DAPM_POST_PMU:
+		return skl_tplg_mixer_dapm_post_pmu_event(w, skl);
+
+	case SND_SOC_DAPM_PRE_PMD:
+		return skl_tplg_mixer_dapm_pre_pmd_event(w, skl);
+
 	case SND_SOC_DAPM_POST_PMD:
 		return skl_tplg_mixer_dapm_post_pmd_event(w, skl);
 	}
-- 
1.9.1

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

* [PATCH 10/11] ASoC: Intel: Skylake: Fix stereo DMIC record
  2016-02-03 12:29 [PATCH 00/11] ASoC: Intel: Skylake: Driver fixes Vinod Koul
                   ` (8 preceding siblings ...)
  2016-02-03 12:29 ` [PATCH 09/11] ASoC: Intel: Skylake: Add missing PRE/POST_PMU handlers for vmixer Vinod Koul
@ 2016-02-03 12:29 ` Vinod Koul
  2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Fix stereo DMIC record" to the asoc tree Mark Brown
  2016-02-03 12:29 ` [PATCH 11/11] ASoC: Intel: Skylake: Remove autosuspend delay Vinod Koul
  10 siblings, 1 reply; 25+ messages in thread
From: Vinod Koul @ 2016-02-03 12:29 UTC (permalink / raw)
  To: alsa-devel; +Cc: liam.r.girdwood, patches.audio, broonie, Vinod Koul, Jeeja KP

From: Jeeja KP <jeeja.kp@intel.com>

DMIC BE can have 2 or 4 channels supported. The DMIC fixup needs
to take this into account.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/soc/intel/boards/skl_rt286.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/skl_rt286.c b/sound/soc/intel/boards/skl_rt286.c
index 7396ddb427d8..2cbcbe412661 100644
--- a/sound/soc/intel/boards/skl_rt286.c
+++ b/sound/soc/intel/boards/skl_rt286.c
@@ -212,7 +212,10 @@ static int skylake_dmic_fixup(struct snd_soc_pcm_runtime *rtd,
 {
 	struct snd_interval *channels = hw_param_interval(params,
 						SNDRV_PCM_HW_PARAM_CHANNELS);
-	channels->min = channels->max = 4;
+	if (params_channels(params) == 2)
+		channels->min = channels->max = 2;
+	else
+		channels->min = channels->max = 4;
 
 	return 0;
 }
-- 
1.9.1

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

* [PATCH 11/11] ASoC: Intel: Skylake: Remove autosuspend delay
  2016-02-03 12:29 [PATCH 00/11] ASoC: Intel: Skylake: Driver fixes Vinod Koul
                   ` (9 preceding siblings ...)
  2016-02-03 12:29 ` [PATCH 10/11] ASoC: Intel: Skylake: Fix stereo DMIC record Vinod Koul
@ 2016-02-03 12:29 ` Vinod Koul
  2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Remove autosuspend delay" to the asoc tree Mark Brown
  10 siblings, 1 reply; 25+ messages in thread
From: Vinod Koul @ 2016-02-03 12:29 UTC (permalink / raw)
  To: alsa-devel
  Cc: liam.r.girdwood, patches.audio, broonie, Subhransu S. Prusty, Vinod Koul

The driver used autosuspend delay to delay going to D3. But per
HW recommendation we should go to D3 soon, so remove the delay
from driver

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/soc/intel/skylake/skl.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
index 443a15de94b5..092705e73db4 100644
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -614,8 +614,6 @@ static int skl_probe(struct pci_dev *pci,
 		goto out_unregister;
 
 	/*configure PM */
-	pm_runtime_set_autosuspend_delay(bus->dev, SKL_SUSPEND_DELAY);
-	pm_runtime_use_autosuspend(bus->dev);
 	pm_runtime_put_noidle(bus->dev);
 	pm_runtime_allow(bus->dev);
 
-- 
1.9.1

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

* Re: [PATCH 02/11] ASoC: Intel: Skylake: Fix delay wrap condition
  2016-02-03 12:29 ` [PATCH 02/11] ASoC: Intel: Skylake: Fix delay wrap condition Vinod Koul
@ 2016-02-04 11:24   ` Mark Brown
  2016-02-04 15:03     ` Vinod Koul
  2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Fix delay wrap condition" to the asoc tree Mark Brown
  1 sibling, 1 reply; 25+ messages in thread
From: Mark Brown @ 2016-02-04 11:24 UTC (permalink / raw)
  To: Vinod Koul
  Cc: liam.r.girdwood, patches.audio, alsa-devel, Dharageswari.R,
	Guneshwor Singh


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

On Wed, Feb 03, 2016 at 05:59:45PM +0530, Vinod Koul wrote:

> +	delay = (hstream->bufsize == delay) ? 0 : delay;

Please don't abuse the ternery operator, if you're not inserting it into
the middle of another expression there's no reason not to use a normal
if statement.

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

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



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

* Applied "ASoC: Intel: Skylake: Fix stereo DMIC record" to the asoc tree
  2016-02-03 12:29 ` [PATCH 10/11] ASoC: Intel: Skylake: Fix stereo DMIC record Vinod Koul
@ 2016-02-04 12:16   ` Mark Brown
  0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2016-02-04 12:16 UTC (permalink / raw)
  To: Jeeja KP, Vinod Koul, Mark Brown; +Cc: alsa-devel

The patch

   ASoC: Intel: Skylake: Fix stereo DMIC record

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 6e3ffa00424e198d2f0c628e7575c5adefeda3d7 Mon Sep 17 00:00:00 2001
From: Jeeja KP <jeeja.kp@intel.com>
Date: Wed, 3 Feb 2016 17:59:53 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Fix stereo DMIC record

DMIC BE can have 2 or 4 channels supported. The DMIC fixup needs
to take this into account.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/skl_rt286.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/skl_rt286.c b/sound/soc/intel/boards/skl_rt286.c
index 7396ddb427d8..2cbcbe412661 100644
--- a/sound/soc/intel/boards/skl_rt286.c
+++ b/sound/soc/intel/boards/skl_rt286.c
@@ -212,7 +212,10 @@ static int skylake_dmic_fixup(struct snd_soc_pcm_runtime *rtd,
 {
 	struct snd_interval *channels = hw_param_interval(params,
 						SNDRV_PCM_HW_PARAM_CHANNELS);
-	channels->min = channels->max = 4;
+	if (params_channels(params) == 2)
+		channels->min = channels->max = 2;
+	else
+		channels->min = channels->max = 4;
 
 	return 0;
 }
-- 
2.7.0.rc3

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

* Applied "ASoC: Intel: Skylake: Remove autosuspend delay" to the asoc tree
  2016-02-03 12:29 ` [PATCH 11/11] ASoC: Intel: Skylake: Remove autosuspend delay Vinod Koul
@ 2016-02-04 12:16   ` Mark Brown
  0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2016-02-04 12:16 UTC (permalink / raw)
  To: Subhransu S. Prusty, Vinod Koul, Mark Brown; +Cc: alsa-devel

The patch

   ASoC: Intel: Skylake: Remove autosuspend delay

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 38c079e230f25969e7ce3501fa967b003a2abc39 Mon Sep 17 00:00:00 2001
From: Vinod Koul <vinod.koul@intel.com>
Date: Wed, 3 Feb 2016 17:59:54 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Remove autosuspend delay

The driver used autosuspend delay to delay going to D3. But per
HW recommendation we should go to D3 soon, so remove the delay
from driver

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/skylake/skl.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
index c38bf99ced10..1d36b28d6489 100644
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -558,8 +558,6 @@ static int skl_probe(struct pci_dev *pci,
 		goto out_unregister;
 
 	/*configure PM */
-	pm_runtime_set_autosuspend_delay(bus->dev, SKL_SUSPEND_DELAY);
-	pm_runtime_use_autosuspend(bus->dev);
 	pm_runtime_put_noidle(bus->dev);
 	pm_runtime_allow(bus->dev);
 
-- 
2.7.0.rc3

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

* Applied "ASoC: Intel: Skylake: Add missing PRE/POST_PMU handlers for vmixer" to the asoc tree
  2016-02-03 12:29 ` [PATCH 09/11] ASoC: Intel: Skylake: Add missing PRE/POST_PMU handlers for vmixer Vinod Koul
@ 2016-02-04 12:16   ` Mark Brown
  0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2016-02-04 12:16 UTC (permalink / raw)
  To: Jeeja KP, Vinod Koul, Mark Brown; +Cc: alsa-devel

The patch

   ASoC: Intel: Skylake: Add missing PRE/POST_PMU handlers for vmixer

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 de1fedf25b075664320010789ede2a0f9f4de07d Mon Sep 17 00:00:00 2001
From: Jeeja KP <jeeja.kp@intel.com>
Date: Wed, 3 Feb 2016 17:59:52 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Add missing PRE/POST_PMU handlers for
 vmixer

Some modules may be directly connected to a pipeline without a
mixer module. For these modules, we require PRE_PMU and POST_PMU
handler which will do bind between the pipelines, so add these
missing handlers.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/skylake/skl-topology.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index 77a688d00fc6..489848637df5 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -857,6 +857,12 @@ static int skl_tplg_vmixer_event(struct snd_soc_dapm_widget *w,
 	case SND_SOC_DAPM_PRE_PMU:
 		return skl_tplg_mixer_dapm_pre_pmu_event(w, skl);
 
+	case SND_SOC_DAPM_POST_PMU:
+		return skl_tplg_mixer_dapm_post_pmu_event(w, skl);
+
+	case SND_SOC_DAPM_PRE_PMD:
+		return skl_tplg_mixer_dapm_pre_pmd_event(w, skl);
+
 	case SND_SOC_DAPM_POST_PMD:
 		return skl_tplg_mixer_dapm_post_pmd_event(w, skl);
 	}
-- 
2.7.0.rc3

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

* Applied "ASoC: Intel: Skylake: Fix bind of source with multiple sinks" to the asoc tree
  2016-02-03 12:29 ` [PATCH 08/11] ASoC: Intel: Skylake: Fix bind of source with multiple sinks Vinod Koul
@ 2016-02-04 12:16   ` Mark Brown
  0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2016-02-04 12:16 UTC (permalink / raw)
  To: Jeeja KP, Vinod Koul, Mark Brown; +Cc: alsa-devel

The patch

   ASoC: Intel: Skylake: Fix bind of source with multiple sinks

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 6bd4cf855698312133b7776c77ee78af865608eb Mon Sep 17 00:00:00 2001
From: Jeeja KP <jeeja.kp@intel.com>
Date: Wed, 3 Feb 2016 17:59:51 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Fix bind of source with multiple sinks

skl_tplg_bind_sinks() takes only the first sink widget. This
breaks in case we have multiple sinks for a module.

So pass source widget to skl_tplg_bind_sinks() and bind for all
sinks by calling this recursively

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/skylake/skl-topology.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index a356f3b1dd5b..77a688d00fc6 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -547,6 +547,7 @@ static int skl_tplg_mixer_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w,
 
 static int skl_tplg_bind_sinks(struct snd_soc_dapm_widget *w,
 				struct skl *skl,
+				struct snd_soc_dapm_widget *src_w,
 				struct skl_module_cfg *src_mconfig)
 {
 	struct snd_soc_dapm_path *p;
@@ -563,6 +564,10 @@ static int skl_tplg_bind_sinks(struct snd_soc_dapm_widget *w,
 		dev_dbg(ctx->dev, "%s: sink widget=%s\n", __func__, p->sink->name);
 
 		next_sink = p->sink;
+
+		if (!is_skl_dsp_widget_type(p->sink))
+			return skl_tplg_bind_sinks(p->sink, skl, src_w, src_mconfig);
+
 		/*
 		 * here we will check widgets in sink pipelines, so that
 		 * can be any widgets type and we are only interested if
@@ -592,7 +597,7 @@ static int skl_tplg_bind_sinks(struct snd_soc_dapm_widget *w,
 	}
 
 	if (!sink)
-		return skl_tplg_bind_sinks(next_sink, skl, src_mconfig);
+		return skl_tplg_bind_sinks(next_sink, skl, src_w, src_mconfig);
 
 	return 0;
 }
@@ -621,7 +626,7 @@ static int skl_tplg_pga_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w,
 	 * if sink is not started, start sink pipe first, then start
 	 * this pipe
 	 */
-	ret = skl_tplg_bind_sinks(w, skl, src_mconfig);
+	ret = skl_tplg_bind_sinks(w, skl, w, src_mconfig);
 	if (ret)
 		return ret;
 
-- 
2.7.0.rc3

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

* Applied "ASoC: Intel: Skylake: Fix not to stop sink pipe in pga pmd event" to the asoc tree
  2016-02-03 12:29 ` [PATCH 07/11] ASoC: Intel: Skylake: Fix not to stop sink pipe in pga pmd event Vinod Koul
@ 2016-02-04 12:16   ` Mark Brown
  0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2016-02-04 12:16 UTC (permalink / raw)
  To: Jeeja KP, Vinod Koul, Mark Brown; +Cc: alsa-devel

The patch

   ASoC: Intel: Skylake: Fix not to stop sink pipe in pga pmd event

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 9946f70906eebf2a305d0b189de52eec8ba39649 Mon Sep 17 00:00:00 2001
From: Jeeja KP <jeeja.kp@intel.com>
Date: Wed, 3 Feb 2016 17:59:50 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Fix not to stop sink pipe in pga pmd
 event

We should not stop the sink pipe in it's pmd handler for a mixin
module as this module may still be connected to other pipes.

This will be stopped and freed by current implementation on last
connected pipe unbind.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/skylake/skl-topology.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index efe001162204..a356f3b1dd5b 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -827,9 +827,6 @@ static int skl_tplg_pga_dapm_post_pmd_event(struct snd_soc_dapm_widget *w,
 			 * This is a connecter and if path is found that means
 			 * unbind between source and sink has not happened yet
 			 */
-			ret = skl_stop_pipe(ctx, sink_mconfig->pipe);
-			if (ret < 0)
-				return ret;
 			ret = skl_unbind_modules(ctx, src_mconfig,
 							sink_mconfig);
 		}
-- 
2.7.0.rc3

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

* Applied "ASoC: Intel: Skylake: Fix the module state check condition" to the asoc tree
  2016-02-03 12:29 ` [PATCH 06/11] ASoC: Intel: Skylake: Fix the module state check condition Vinod Koul
@ 2016-02-04 12:16   ` Mark Brown
  0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2016-02-04 12:16 UTC (permalink / raw)
  To: Jeeja KP, Vinod Koul, Mark Brown; +Cc: alsa-devel

The patch

   ASoC: Intel: Skylake: Fix the module state check condition

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 0c684c48257bc6033bdd3b942babef22d0a1852a Mon Sep 17 00:00:00 2001
From: Jeeja KP <jeeja.kp@intel.com>
Date: Wed, 3 Feb 2016 17:59:49 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Fix the module state check condition

For binding modules we should check if source or destination
module is in UNINT state. We canot bind even if one of them is
in this state.

So update the check from logical AND to logical OR and do not
bind modules for this case

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/skylake/skl-messages.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c
index bb5f1d7d0cad..4629372d7c8e 100644
--- a/sound/soc/intel/skylake/skl-messages.c
+++ b/sound/soc/intel/skylake/skl-messages.c
@@ -747,7 +747,7 @@ int skl_bind_modules(struct skl_sst *ctx,
 
 	skl_dump_bind_info(ctx, src_mcfg, dst_mcfg);
 
-	if (src_mcfg->m_state < SKL_MODULE_INIT_DONE &&
+	if (src_mcfg->m_state < SKL_MODULE_INIT_DONE ||
 		dst_mcfg->m_state < SKL_MODULE_INIT_DONE)
 		return 0;
 
-- 
2.7.0.rc3

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

* Applied "ASoC: Intel: Skylake: Fix return of skl_get_queue_index" to the asoc tree
  2016-02-03 12:29 ` [PATCH 05/11] ASoC: Intel: Skylake: Fix return of skl_get_queue_index Vinod Koul
@ 2016-02-04 12:16   ` Mark Brown
  0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2016-02-04 12:16 UTC (permalink / raw)
  To: Jeeja KP, Vinod Koul, Mark Brown; +Cc: alsa-devel

The patch

   ASoC: Intel: Skylake: Fix return of skl_get_queue_index

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 9cf3049e21e4e6873aae45df19c11f7243e2f03f Mon Sep 17 00:00:00 2001
From: Jeeja KP <jeeja.kp@intel.com>
Date: Wed, 3 Feb 2016 17:59:48 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Fix return of skl_get_queue_index

In unbind modules, the skl_get_queue_index() can return error
if the pin is dynamic and module is not bound yet. So instead
of returning error this check should return success as modules
is not yet bound. This will let the module be bound when connected
pipes are enabled and will bind this as well.

So change the return value to 0

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/skylake/skl-messages.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c
index de6dac496a0d..bb5f1d7d0cad 100644
--- a/sound/soc/intel/skylake/skl-messages.c
+++ b/sound/soc/intel/skylake/skl-messages.c
@@ -688,14 +688,14 @@ int skl_unbind_modules(struct skl_sst *ctx,
 	/* get src queue index */
 	src_index = skl_get_queue_index(src_mcfg->m_out_pin, dst_id, out_max);
 	if (src_index < 0)
-		return -EINVAL;
+		return 0;
 
 	msg.src_queue = src_index;
 
 	/* get dst queue index */
 	dst_index  = skl_get_queue_index(dst_mcfg->m_in_pin, src_id, in_max);
 	if (dst_index < 0)
-		return -EINVAL;
+		return 0;
 
 	msg.dst_queue = dst_index;
 
-- 
2.7.0.rc3

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

* Applied "ASoC: Intel: Skylake: Fix pipe memory allocation leak" to the asoc tree
  2016-02-03 12:29 ` [PATCH 04/11] ASoC: Intel: Skylake: Fix pipe memory allocation leak Vinod Koul
@ 2016-02-04 12:16   ` Mark Brown
  0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2016-02-04 12:16 UTC (permalink / raw)
  To: Dharageswari.R, Vinod Koul, Mark Brown; +Cc: alsa-devel

The patch

   ASoC: Intel: Skylake: Fix pipe memory allocation leak

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 9ba8ffef9635c11102bc42d0f2d0a4213de273d5 Mon Sep 17 00:00:00 2001
From: "Dharageswari.R" <dharageswari.r@intel.com>
Date: Wed, 3 Feb 2016 17:59:47 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Fix pipe memory allocation leak

We check and allocate pipeline resources in one shot. That causes
leaks if module creation fails later as that is not freed.

So split the resource allocation into two, first check if
resources are available and then add the resources upon
successful creation. So two new functions are added for checking
and current functions are re-purposed to only add the resources
for memory and MCPS.

Signed-off-by: Dharageswari.R <dharageswari.r@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/skylake/skl-topology.c | 42 +++++++++++++++++++++++-----------
 1 file changed, 29 insertions(+), 13 deletions(-)

diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index 86d5323e9184..efe001162204 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -54,12 +54,9 @@ static int is_skl_dsp_widget_type(struct snd_soc_dapm_widget *w)
 
 /*
  * Each pipelines needs memory to be allocated. Check if we have free memory
- * from available pool. Then only add this to pool
- * This is freed when pipe is deleted
- * Note: DSP does actual memory management we only keep track for complete
- * pool
+ * from available pool.
  */
-static bool skl_tplg_alloc_pipe_mem(struct skl *skl,
+static bool skl_is_pipe_mem_avail(struct skl *skl,
 				struct skl_module_cfg *mconfig)
 {
 	struct skl_sst *ctx = skl->skl_sst;
@@ -74,10 +71,20 @@ static bool skl_tplg_alloc_pipe_mem(struct skl *skl,
 				"exceeds ppl memory available %d mem %d\n",
 				skl->resource.max_mem, skl->resource.mem);
 		return false;
+	} else {
+		return true;
 	}
+}
 
+/*
+ * Add the mem to the mem pool. This is freed when pipe is deleted.
+ * Note: DSP does actual memory management we only keep track for complete
+ * pool
+ */
+static void skl_tplg_alloc_pipe_mem(struct skl *skl,
+				struct skl_module_cfg *mconfig)
+{
 	skl->resource.mem += mconfig->pipe->memory_pages;
-	return true;
 }
 
 /*
@@ -85,10 +92,10 @@ static bool skl_tplg_alloc_pipe_mem(struct skl *skl,
  * quantified in MCPS (Million Clocks Per Second) required for module/pipe
  *
  * Each pipelines needs mcps to be allocated. Check if we have mcps for this
- * pipe. This adds the mcps to driver counter
- * This is removed on pipeline delete
+ * pipe.
  */
-static bool skl_tplg_alloc_pipe_mcps(struct skl *skl,
+
+static bool skl_is_pipe_mcps_avail(struct skl *skl,
 				struct skl_module_cfg *mconfig)
 {
 	struct skl_sst *ctx = skl->skl_sst;
@@ -101,10 +108,15 @@ static bool skl_tplg_alloc_pipe_mcps(struct skl *skl,
 			"exceeds ppl mcps available %d > mem %d\n",
 			skl->resource.max_mcps, skl->resource.mcps);
 		return false;
+	} else {
+		return true;
 	}
+}
 
+static void skl_tplg_alloc_pipe_mcps(struct skl *skl,
+				struct skl_module_cfg *mconfig)
+{
 	skl->resource.mcps += mconfig->mcps;
-	return true;
 }
 
 /*
@@ -411,7 +423,7 @@ skl_tplg_init_pipe_modules(struct skl *skl, struct skl_pipe *pipe)
 		mconfig = w->priv;
 
 		/* check resource available */
-		if (!skl_tplg_alloc_pipe_mcps(skl, mconfig))
+		if (!skl_is_pipe_mcps_avail(skl, mconfig))
 			return -ENOMEM;
 
 		if (mconfig->is_loadable && ctx->dsp->fw_ops.load_mod) {
@@ -435,6 +447,7 @@ skl_tplg_init_pipe_modules(struct skl *skl, struct skl_pipe *pipe)
 		ret = skl_tplg_set_module_params(w, ctx);
 		if (ret < 0)
 			return ret;
+		skl_tplg_alloc_pipe_mcps(skl, mconfig);
 	}
 
 	return 0;
@@ -477,10 +490,10 @@ static int skl_tplg_mixer_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w,
 	struct skl_sst *ctx = skl->skl_sst;
 
 	/* check resource available */
-	if (!skl_tplg_alloc_pipe_mcps(skl, mconfig))
+	if (!skl_is_pipe_mcps_avail(skl, mconfig))
 		return -EBUSY;
 
-	if (!skl_tplg_alloc_pipe_mem(skl, mconfig))
+	if (!skl_is_pipe_mem_avail(skl, mconfig))
 		return -ENOMEM;
 
 	/*
@@ -526,6 +539,9 @@ static int skl_tplg_mixer_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w,
 		src_module = dst_module;
 	}
 
+	skl_tplg_alloc_pipe_mem(skl, mconfig);
+	skl_tplg_alloc_pipe_mcps(skl, mconfig);
+
 	return 0;
 }
 
-- 
2.7.0.rc3

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

* Applied "ASoC: Intel: Skylake: Fix mcps freeup after module unbind failure" to the asoc tree
  2016-02-03 12:29 ` [PATCH 03/11] ASoC: Intel: Skylake: Fix mcps freeup after module unbind failure Vinod Koul
@ 2016-02-04 12:16   ` Mark Brown
  0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2016-02-04 12:16 UTC (permalink / raw)
  To: Guneshwor Singh, Vinod Koul, Mark Brown; +Cc: alsa-devel

The patch

   ASoC: Intel: Skylake: Fix mcps freeup after module unbind failure

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 7ca42f5ac5e0d8011086bcfa00e85aede42f0b78 Mon Sep 17 00:00:00 2001
From: Guneshwor Singh <guneshwor.o.singh@intel.com>
Date: Wed, 3 Feb 2016 17:59:46 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Fix mcps freeup after module unbind
 failure

While cleaning resources on module pmd event, we check for return
of skl_unbind_modules(). On failure this causes leak as all modules
attached do not have resources freed.

So ignore return value of module unbind and continue freeing
resources. This makes dapm state and resources correct.

Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/skylake/skl-topology.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index c67e3acb8102..86d5323e9184 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -98,7 +98,7 @@ static bool skl_tplg_alloc_pipe_mcps(struct skl *skl,
 			"%s: module_id %d instance %d\n", __func__,
 			mconfig->id.module_id, mconfig->id.instance_id);
 		dev_err(ctx->dev,
-			"exceeds ppl memory available %d > mem %d\n",
+			"exceeds ppl mcps available %d > mem %d\n",
 			skl->resource.max_mcps, skl->resource.mcps);
 		return false;
 	}
@@ -773,10 +773,7 @@ static int skl_tplg_mixer_dapm_post_pmd_event(struct snd_soc_dapm_widget *w,
 			continue;
 		}
 
-		ret = skl_unbind_modules(ctx, src_module, dst_module);
-		if (ret < 0)
-			return ret;
-
+		skl_unbind_modules(ctx, src_module, dst_module);
 		src_module = dst_module;
 	}
 
-- 
2.7.0.rc3

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

* Applied "ASoC: Intel: Skylake: Fix delay wrap condition" to the asoc tree
  2016-02-03 12:29 ` [PATCH 02/11] ASoC: Intel: Skylake: Fix delay wrap condition Vinod Koul
  2016-02-04 11:24   ` Mark Brown
@ 2016-02-04 12:16   ` Mark Brown
  1 sibling, 0 replies; 25+ messages in thread
From: Mark Brown @ 2016-02-04 12:16 UTC (permalink / raw)
  To: Guneshwor Singh, Dharageswari.R, Vinod Koul, Mark Brown; +Cc: alsa-devel

The patch

   ASoC: Intel: Skylake: Fix delay wrap condition

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 ee564d489cc47b1b6043bbe7e95464306d112cf5 Mon Sep 17 00:00:00 2001
From: Guneshwor Singh <guneshwor.o.singh@intel.com>
Date: Wed, 3 Feb 2016 17:59:45 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Fix delay wrap condition

When delay reported by HW is equal to buffersize, it means the
value is wrapped so we should report as 0. So add the condition
to check this while reporting the delay from LPIB.

Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
Signed-off-by: Dharageswari.R <dharageswari.r@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/skylake/skl-pcm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
index b89ae6f7c096..f9297dc4b25f 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -829,6 +829,7 @@ static int skl_get_delay_from_lpib(struct hdac_ext_bus *ebus,
 		else
 			delay += hstream->bufsize;
 	}
+	delay = (hstream->bufsize == delay) ? 0 : delay;
 
 	if (delay >= hstream->period_bytes) {
 		dev_info(bus->dev,
-- 
2.7.0.rc3

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

* Applied "ASoC: Intel: Skylake: Fix the memory overwrite of tlv buffer" to the asoc tree
  2016-02-03 12:29 ` [PATCH 01/11] ASoC: Intel: Skylake: Fix the memory overwrite of tlv buffer Vinod Koul
@ 2016-02-04 12:16   ` Mark Brown
  0 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2016-02-04 12:16 UTC (permalink / raw)
  To: Vinod Koul, Mark Brown; +Cc: alsa-devel

The patch

   ASoC: Intel: Skylake: Fix the memory overwrite of tlv buffer

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 41556f68d1dd0b6bbf311a220523b034d2a040e7 Mon Sep 17 00:00:00 2001
From: Vinod Koul <vinod.koul@intel.com>
Date: Wed, 3 Feb 2016 17:59:44 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Fix the memory overwrite of tlv buffer

TLV buffer can be smaller than the module data, so update the
size of data to be copied before doing the copy.

Also TLV header consists of two unsigned ints, this is also taken
into account here and size modified to reflect this

Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/skylake/skl-topology.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index c7816d52ad08..c67e3acb8102 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -916,6 +916,13 @@ static int skl_tplg_tlv_control_get(struct snd_kcontrol *kcontrol,
 		skl_get_module_params(skl->skl_sst, (u32 *)bc->params,
 				      bc->max, bc->param_id, mconfig);
 
+	/* decrement size for TLV header */
+	size -= 2 * sizeof(u32);
+
+	/* check size as we don't want to send kernel data */
+	if (size > bc->max)
+		size = bc->max;
+
 	if (bc->params) {
 		if (copy_to_user(data, &bc->param_id, sizeof(u32)))
 			return -EFAULT;
-- 
2.7.0.rc3

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

* Re: [PATCH 02/11] ASoC: Intel: Skylake: Fix delay wrap condition
  2016-02-04 11:24   ` Mark Brown
@ 2016-02-04 15:03     ` Vinod Koul
  0 siblings, 0 replies; 25+ messages in thread
From: Vinod Koul @ 2016-02-04 15:03 UTC (permalink / raw)
  To: Mark Brown
  Cc: liam.r.girdwood, patches.audio, alsa-devel, Dharageswari.R,
	Guneshwor Singh


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

On Thu, Feb 04, 2016 at 11:24:36AM +0000, Mark Brown wrote:
> On Wed, Feb 03, 2016 at 05:59:45PM +0530, Vinod Koul wrote:
> 
> > +	delay = (hstream->bufsize == delay) ? 0 : delay;
> 
> Please don't abuse the ternery operator, if you're not inserting it into
> the middle of another expression there's no reason not to use a normal
> if statement.

Ah okay. Sure I will send an update to modify this

Thanks
-- 
~Vinod

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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



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

end of thread, other threads:[~2016-02-04 15:00 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-03 12:29 [PATCH 00/11] ASoC: Intel: Skylake: Driver fixes Vinod Koul
2016-02-03 12:29 ` [PATCH 01/11] ASoC: Intel: Skylake: Fix the memory overwrite of tlv buffer Vinod Koul
2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Fix the memory overwrite of tlv buffer" to the asoc tree Mark Brown
2016-02-03 12:29 ` [PATCH 02/11] ASoC: Intel: Skylake: Fix delay wrap condition Vinod Koul
2016-02-04 11:24   ` Mark Brown
2016-02-04 15:03     ` Vinod Koul
2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Fix delay wrap condition" to the asoc tree Mark Brown
2016-02-03 12:29 ` [PATCH 03/11] ASoC: Intel: Skylake: Fix mcps freeup after module unbind failure Vinod Koul
2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Fix mcps freeup after module unbind failure" to the asoc tree Mark Brown
2016-02-03 12:29 ` [PATCH 04/11] ASoC: Intel: Skylake: Fix pipe memory allocation leak Vinod Koul
2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Fix pipe memory allocation leak" to the asoc tree Mark Brown
2016-02-03 12:29 ` [PATCH 05/11] ASoC: Intel: Skylake: Fix return of skl_get_queue_index Vinod Koul
2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Fix return of skl_get_queue_index" to the asoc tree Mark Brown
2016-02-03 12:29 ` [PATCH 06/11] ASoC: Intel: Skylake: Fix the module state check condition Vinod Koul
2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Fix the module state check condition" to the asoc tree Mark Brown
2016-02-03 12:29 ` [PATCH 07/11] ASoC: Intel: Skylake: Fix not to stop sink pipe in pga pmd event Vinod Koul
2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Fix not to stop sink pipe in pga pmd event" to the asoc tree Mark Brown
2016-02-03 12:29 ` [PATCH 08/11] ASoC: Intel: Skylake: Fix bind of source with multiple sinks Vinod Koul
2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Fix bind of source with multiple sinks" to the asoc tree Mark Brown
2016-02-03 12:29 ` [PATCH 09/11] ASoC: Intel: Skylake: Add missing PRE/POST_PMU handlers for vmixer Vinod Koul
2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Add missing PRE/POST_PMU handlers for vmixer" to the asoc tree Mark Brown
2016-02-03 12:29 ` [PATCH 10/11] ASoC: Intel: Skylake: Fix stereo DMIC record Vinod Koul
2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Fix stereo DMIC record" to the asoc tree Mark Brown
2016-02-03 12:29 ` [PATCH 11/11] ASoC: Intel: Skylake: Remove autosuspend delay Vinod Koul
2016-02-04 12:16   ` Applied "ASoC: Intel: Skylake: Remove autosuspend delay" 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.