ASoC: Intel: Skylake: Wov optimizations
Subsystems (3)
cover ASoC: Intel: Skylake: Wov optimizations
This series starts with two minor fixes on driver to fix a memory leak and one NULL pointer exception and then adds power optimization to driver for WOV case by suspending the stream DMA and keeping only DSP pipe and endpoint On during that case
Dharageswari.R (2):
ASoC: Intel: Skylake: Fix the NULL pointer exception in dsp_clean up
ASoC: Intel: Skylake: Prevent sending Set DMA Control IPC if the
widget is "On"
Jeeja KP (2):
ASoC: Intel: Skylake: Suspend PCMs when marked as active suspend
ASoC: Intel: Boards: remove ignore_suspend for WoV streams
Mousumi Jana (1):
ASoC: Intel: Skylake: Fix memory leak during init instance
sound/soc/intel/boards/skl_nau88l25_max98357a.c | 1 - sound/soc/intel/boards/skl_nau88l25_ssm4567.c | 1 - sound/soc/intel/boards/skl_rt286.c | 1 - sound/soc/intel/skylake/skl-messages.c | 2 +- sound/soc/intel/skylake/skl-pcm.c | 32 ++++++++++++++++--------- sound/soc/intel/skylake/skl-sst-dsp.c | 2 -- sound/soc/intel/skylake/skl-sst.c | 4 ++++ 7 files changed, 26 insertions(+), 17 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/5 ASoC: Intel: Skylake: Fix the NULL pointer exception in dsp_clean up
From: "Dharageswari.R" <[email protected]>
If request firmware fails at init, the code loader DMA allocation can be NULL, so check for boot complete before freeing up these resources
--- sound/soc/intel/skylake/skl-sst-dsp.c | 2 -- sound/soc/intel/skylake/skl-sst.c | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-)
sound/soc/intel/skylake/skl-sst-dsp.c +0 -2
@@ -336,8 +336,6 @@ void skl_dsp_free(struct sst_dsp *dsp)skl_ipc_int_disable (dsp);free_irq (dsp->irq, dsp); - dsp->cl_dev.ops.cl_cleanup_controller (dsp); -skl_cldma_int_disable (dsp);skl_ipc_op_int_disable (dsp);skl_ipc_int_disable (dsp);
sound/soc/intel/skylake/skl-sst.c +4 -0
@@ -463,6 +463,10 @@ void skl_sst_dsp_cleanup(struct device *dev, struct skl_sst *ctx)skl_clear_module_table (ctx->dsp);skl_ipc_free (&ctx->ipc); ctx->dsp->ops->free (ctx->dsp); +if (ctx->boot_complete) { + ctx->dsp->cl_dev.ops.cl_cleanup_controller (ctx->dsp); +skl_cldma_int_disable (ctx->dsp); + } }EXPORT_SYMBOL_GPL (skl_sst_dsp_cleanup);
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Fix the NULL pointer exception in dsp_clean up" to the asoc tree
The patch
ASoC: Intel: Skylake: Fix the NULL pointer exception in dsp_clean up
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
95536d8c29985167e745ff0d8c7cd7dcf4318e6bMon Sep 17 00:00:00 2001
From: "Dharageswari.R" <[email protected]>
Date: Thu, 28 Apr 2016 18:45:25 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Fix the NULL pointer exception in
dsp_clean up
If request firmware fails at init, the code loader DMA allocation can be NULL, so check for boot complete before freeing up these resources
--- sound/soc/intel/skylake/skl-sst-dsp.c | 2 -- sound/soc/intel/skylake/skl-sst.c | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-)
sound/soc/intel/skylake/skl-sst-dsp.c +0 -2
@@ -336,8 +336,6 @@ void skl_dsp_free(struct sst_dsp *dsp)skl_ipc_int_disable (dsp);free_irq (dsp->irq, dsp); - dsp->cl_dev.ops.cl_cleanup_controller (dsp); -skl_cldma_int_disable (dsp);skl_ipc_op_int_disable (dsp);skl_ipc_int_disable (dsp);
sound/soc/intel/skylake/skl-sst.c +4 -0
@@ -454,6 +454,10 @@ void skl_sst_dsp_cleanup(struct device *dev, struct skl_sst *ctx)skl_clear_module_table (ctx->dsp);skl_ipc_free (&ctx->ipc); ctx->dsp->ops->free (ctx->dsp); +if (ctx->boot_complete) { + ctx->dsp->cl_dev.ops.cl_cleanup_controller (ctx->dsp); +skl_cldma_int_disable (ctx->dsp); + } }EXPORT_SYMBOL_GPL (skl_sst_dsp_cleanup);
Signature · 1 line
2.8.1
PATCH 2/5 ASoC: Intel: Skylake: Fix memory leak during init instance
In reply to Vinod KoulFrom: Mousumi Jana <[email protected]>
param_data variable is allocated during set module format of init instance is not getting freed and hence can cause a memory leak. So free it up.
--- sound/soc/intel/skylake/skl-messages.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/skylake/skl-messages.c +1 -1
@@ -864,7 +864,7 @@ int skl_init_module(struct skl_sst *ctx,return ret; } mconfig->m_state =SKL_MODULE_INIT_DONE ; - +kfree (param_data);return ret; }
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Fix memory leak during init instance" to the asoc tree
The patch
ASoC: Intel: Skylake: Fix memory leak during init instance
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
76222d6dd2e64c895735ab271ecc8b0df568981dMon Sep 17 00:00:00 2001
From: Mousumi Jana <[email protected]>
Date: Thu, 28 Apr 2016 18:45:26 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Fix memory leak during init instance
param_data variable is allocated during set module format of init instance is not getting freed and hence can cause a memory leak. So free it up.
--- sound/soc/intel/skylake/skl-messages.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/skylake/skl-messages.c +1 -1
@@ -864,7 +864,7 @@ int skl_init_module(struct skl_sst *ctx,return ret; } mconfig->m_state =SKL_MODULE_INIT_DONE ; - +kfree (param_data);return ret; }
Signature · 1 line
2.8.1
PATCH 3/5 ASoC: Intel: Skylake: Prevent sending Set DMA Control IPC if the widget is "On"
In reply to Vinod KoulFrom: "Dharageswari.R" <[email protected]>
If widget of a playback or capture DAI is already On, then no need not send the Set DMA Control IPC message to firmware.
--- sound/soc/intel/skylake/skl-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/skylake/skl-pcm.c +1 -1
@@ -213,7 +213,7 @@ static int skl_be_prepare(struct snd_pcm_substream *substream,struct skl_sst *ctx = skl->skl_sst;struct skl_module_cfg *mconfig; -if ((dai->playback_active >1 ) || (dai->capture_active >1 )) +if (dai->playback_widget->power || dai->capture_widget->power)return 0 ; mconfig =skl_tplg_be_get_cpr_module (dai, substream->stream);
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Prevent sending Set DMA Control IPC if the widget is "On"" to the asoc tree
The patch
ASoC: Intel: Skylake: Prevent sending Set DMA Control IPC if the widget is "On"
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
1a13b1fafffd41c12a7068c4aa74f5a1d2210a07Mon Sep 17 00:00:00 2001
From: "Dharageswari.R" <[email protected]>
Date: Thu, 28 Apr 2016 18:45:27 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Prevent sending Set DMA Control IPC if
the widget is "On"
If widget of a playback or capture DAI is already On, then no need not send the Set DMA Control IPC message to firmware.
--- sound/soc/intel/skylake/skl-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/skylake/skl-pcm.c +1 -1
@@ -213,7 +213,7 @@ static int skl_be_prepare(struct snd_pcm_substream *substream,struct skl_sst *ctx = skl->skl_sst;struct skl_module_cfg *mconfig; -if ((dai->playback_active >1 ) || (dai->capture_active >1 )) +if (dai->playback_widget->power || dai->capture_widget->power)return 0 ; mconfig =skl_tplg_be_get_cpr_module (dai, substream->stream);
Signature · 1 line
2.8.1
PATCH 4/5 ASoC: Intel: Skylake: Suspend PCMs when marked as active suspend
In reply to Vinod KoulFrom: Jeeja KP <[email protected]>
For 'ignore_suspend' cases we need to keep DSP and pipes On, but can suspend the stream and pause the DMA as we are not rendering data during the suspended time.
For this we can check the dai widget ignore_suspend flag in trigger suspend/resume, and start and stop the host DMA and host copier pipelines.
--- sound/soc/intel/skylake/skl-pcm.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-)
sound/soc/intel/skylake/skl-pcm.c +20 -10
@@ -402,23 +402,33 @@ static int skl_pcm_trigger(struct snd_pcm_substream *substream, int cmd,struct skl_module_cfg *mconfig;struct hdac_ext_bus *ebus =get_bus_ctx (substream);struct hdac_ext_stream *stream =get_hdac_ext_stream (substream); +struct snd_soc_dapm_widget *w;int ret; mconfig =skl_tplg_fe_get_cpr_module (dai, substream->stream);if (!mconfig)return -EIO ; +if (substream->stream ==SNDRV_PCM_STREAM_PLAYBACK ) + w = dai->playback_widget; +else + w = dai->capture_widget; +switch (cmd) {case SNDRV_PCM_TRIGGER_RESUME : -skl_pcm_prepare (substream, dai); -/* -* enable DMA Resume enable bit for the stream, set the dpib -* & lpib position to resune before starting the DMA -*/ -snd_hdac_ext_stream_drsm_enable (ebus, true, -hdac_stream (stream)->index); -snd_hdac_ext_stream_set_dpibr (ebus, stream, stream->dpib); -snd_hdac_ext_stream_set_lpib (stream, stream->lpib); +if (!w->ignore_suspend) { +skl_pcm_prepare (substream, dai); +/* +* enable DMA Resume enable bit for the stream, set the +* dpib & lpib position to resume before starting the +* DMA +*/ +snd_hdac_ext_stream_drsm_enable (ebus, true, +hdac_stream (stream)->index); +snd_hdac_ext_stream_set_dpibr (ebus, stream, + stream->dpib); +snd_hdac_ext_stream_set_lpib (stream, stream->lpib); + }case SNDRV_PCM_TRIGGER_START :case SNDRV_PCM_TRIGGER_PAUSE_RELEASE :
@@ -448,7 +458,7 @@ static int skl_pcm_trigger(struct snd_pcm_substream *substream, int cmd,return ret; ret =skl_decoupled_trigger (substream, cmd); -if (cmd ==SNDRV_PCM_TRIGGER_SUSPEND ) { +if ((cmd ==SNDRV_PCM_TRIGGER_SUSPEND ) && !w->ignore_suspend) {/* save the dpib and lpib positions */ stream->dpib = readl(ebus->bus.remap_addr + AZX_REG_VS_SDXDPIB_XBASE +
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Suspend PCMs when marked as active suspend" to the asoc tree
The patch
ASoC: Intel: Skylake: Suspend PCMs when marked as active suspend
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
9a655db0201ef523683d700cb3f4508c08bc9d8cMon Sep 17 00:00:00 2001
From: Jeeja KP <[email protected]>
Date: Thu, 28 Apr 2016 18:45:28 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Suspend PCMs when marked as active
suspend
For 'ignore_suspend' cases we need to keep DSP and pipes On, but can suspend the stream and pause the DMA as we are not rendering data during the suspended time.
For this we can check the dai widget ignore_suspend flag in trigger suspend/resume, and start and stop the host DMA and host copier pipelines.
--- sound/soc/intel/skylake/skl-pcm.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-)
sound/soc/intel/skylake/skl-pcm.c +20 -10
@@ -402,23 +402,33 @@ static int skl_pcm_trigger(struct snd_pcm_substream *substream, int cmd,struct skl_module_cfg *mconfig;struct hdac_ext_bus *ebus =get_bus_ctx (substream);struct hdac_ext_stream *stream =get_hdac_ext_stream (substream); +struct snd_soc_dapm_widget *w;int ret; mconfig =skl_tplg_fe_get_cpr_module (dai, substream->stream);if (!mconfig)return -EIO ; +if (substream->stream ==SNDRV_PCM_STREAM_PLAYBACK ) + w = dai->playback_widget; +else + w = dai->capture_widget; +switch (cmd) {case SNDRV_PCM_TRIGGER_RESUME : -skl_pcm_prepare (substream, dai); -/* -* enable DMA Resume enable bit for the stream, set the dpib -* & lpib position to resune before starting the DMA -*/ -snd_hdac_ext_stream_drsm_enable (ebus, true, -hdac_stream (stream)->index); -snd_hdac_ext_stream_set_dpibr (ebus, stream, stream->dpib); -snd_hdac_ext_stream_set_lpib (stream, stream->lpib); +if (!w->ignore_suspend) { +skl_pcm_prepare (substream, dai); +/* +* enable DMA Resume enable bit for the stream, set the +* dpib & lpib position to resume before starting the +* DMA +*/ +snd_hdac_ext_stream_drsm_enable (ebus, true, +hdac_stream (stream)->index); +snd_hdac_ext_stream_set_dpibr (ebus, stream, + stream->dpib); +snd_hdac_ext_stream_set_lpib (stream, stream->lpib); + }case SNDRV_PCM_TRIGGER_START :case SNDRV_PCM_TRIGGER_PAUSE_RELEASE :
@@ -448,7 +458,7 @@ static int skl_pcm_trigger(struct snd_pcm_substream *substream, int cmd,return ret; ret =skl_decoupled_trigger (substream, cmd); -if (cmd ==SNDRV_PCM_TRIGGER_SUSPEND ) { +if ((cmd ==SNDRV_PCM_TRIGGER_SUSPEND ) && !w->ignore_suspend) {/* save the dpib and lpib positions */ stream->dpib = readl(ebus->bus.remap_addr + AZX_REG_VS_SDXDPIB_XBASE +
Signature · 1 line
2.8.1
PATCH 5/5 ASoC: Intel: Boards: remove ignore_suspend for WoV streams
In reply to Vinod KoulFrom: Jeeja KP <[email protected]>
On WoV we can suspend the DMA and keep the DSP pipelines only On, so remove the ignore_suspend for WoV streams but keep them for WoV endpoints.
This helps in achieving better power by suspending DMAs
--- sound/soc/intel/boards/skl_nau88l25_max98357a.c | 1 - sound/soc/intel/boards/skl_nau88l25_ssm4567.c | 1 - sound/soc/intel/boards/skl_rt286.c | 1 - 3 files changed, 3 deletions(-)
sound/soc/intel/boards/skl_nau88l25_max98357a.c +0 -1
@@ -434,7 +434,6 @@ static struct snd_soc_dai_link skylake_dais[] = { .platform_name = "0000:00:1f.3", .init = NULL, .dpcm_capture = 1, - .ignore_suspend = 1, .nonatomic = 1, .dynamic = 1, .ops = &skylaye_refcap_ops,
sound/soc/intel/boards/skl_nau88l25_ssm4567.c +0 -1
@@ -482,7 +482,6 @@ static struct snd_soc_dai_link skylake_dais[] = { .platform_name = "0000:00:1f.3", .init = NULL, .dpcm_capture = 1, - .ignore_suspend = 1, .nonatomic = 1, .dynamic = 1, .ops = &skylaye_refcap_ops,
sound/soc/intel/boards/skl_rt286.c +0 -1
@@ -338,7 +338,6 @@ static struct snd_soc_dai_link skylake_rt286_dais[] = { .platform_name = "0000:00:1f.3", .init = NULL, .dpcm_capture = 1, - .ignore_suspend = 1, .nonatomic = 1, .dynamic = 1, },
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Boards: remove ignore_suspend for WoV streams" to the asoc tree
The patch
ASoC: Intel: Boards: remove ignore_suspend for WoV streams
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
551f4bc86807637098786c78afb78418ada4aa1fMon Sep 17 00:00:00 2001
From: Jeeja KP <[email protected]>
Date: Thu, 28 Apr 2016 18:45:29 +0530
Subject: [PATCH] ASoC: Intel: Boards: remove ignore_suspend for WoV streams
On WoV we can suspend the DMA and keep the DSP pipelines only On, so remove the ignore_suspend for WoV streams but keep them for WoV endpoints.
This helps in achieving better power by suspending DMAs
--- sound/soc/intel/boards/skl_nau88l25_max98357a.c | 1 - sound/soc/intel/boards/skl_nau88l25_ssm4567.c | 1 - sound/soc/intel/boards/skl_rt286.c | 1 - 3 files changed, 3 deletions(-)
sound/soc/intel/boards/skl_nau88l25_max98357a.c +0 -1
@@ -391,7 +391,6 @@ static struct snd_soc_dai_link skylake_dais[] = { .platform_name = "0000:00:1f.3", .init = NULL, .dpcm_capture = 1, - .ignore_suspend = 1, .nonatomic = 1, .dynamic = 1, .ops = &skylaye_refcap_ops,
sound/soc/intel/boards/skl_nau88l25_ssm4567.c +0 -1
@@ -440,7 +440,6 @@ static struct snd_soc_dai_link skylake_dais[] = { .platform_name = "0000:00:1f.3", .init = NULL, .dpcm_capture = 1, - .ignore_suspend = 1, .nonatomic = 1, .dynamic = 1, .ops = &skylaye_refcap_ops,
sound/soc/intel/boards/skl_rt286.c +0 -1
@@ -317,7 +317,6 @@ static struct snd_soc_dai_link skylake_rt286_dais[] = { .platform_name = "0000:00:1f.3", .init = NULL, .dpcm_capture = 1, - .ignore_suspend = 1, .nonatomic = 1, .dynamic = 1, },
Signature · 1 line
2.8.1