summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@freescale.com>2015-08-21 13:01:17 +0800
committerNitin Garg <nitin.garg@freescale.com>2015-09-17 09:24:18 -0500
commit932363be7655b19e2b2f07799e186708ac43efc9 (patch)
tree2e54b80e280a8a5390672b1024fd7d9f18fc260b /sound
parent897a5298b10c32f2ec15b8c2660e272e458c2cf6 (diff)
MLK-11392-1 ASoC: fsl_sai: Move pm runtime enable/disable out trigger function
When building kernel with CONFIG_DEBUG_ATOMIC_SLEEP=y, there will be kernel dump. BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:954 in_atomic(): 1, irqs_disabled(): 128, pid: 705, name: aplay CPU: 0 PID: 705 Comm: aplay Not tainted 3.10.53-02755-gbee6071 #1472 [<80013f4c>] (unwind_backtrace+0x0/0xf8) from [<800119c0>] (show_stack+0x10/0x14) [<800119c0>] (show_stack+0x10/0x14) from [<8031fd68>] (__pm_runtime_resume+0x88/0x90) [<8031fd68>] (__pm_runtime_resume+0x88/0x90) from [<80509ba8>] (fsl_sai_trigger+0x98/0x300) [<80509ba8>] (fsl_sai_trigger+0x98/0x300) from [<804fef9c>] (soc_pcm_trigger+0x90/0xa0) [<804fef9c>] (soc_pcm_trigger+0x90/0xa0) from [<804eae60>] (snd_pcm_do_start+0x2c/0x30) [<804eae60>] (snd_pcm_do_start+0x2c/0x30) from [<804eaad8>] (snd_pcm_action_single+0x38/0x78) [<804eaad8>] (snd_pcm_action_single+0x38/0x78) from [<804eada8>] (snd_pcm_action_lock_irq+0x84/0xa4) [<804eada8>] (snd_pcm_action_lock_irq+0x84/0xa4) from [<804eba58>] (snd_pcm_common_ioctl1+0x16c/0xd68) [<804eba58>] (snd_pcm_common_ioctl1+0x16c/0xd68) from [<804ecc8c>] (snd_pcm_playback_ioctl1+0x158/0x4d0) [<804ecc8c>] (snd_pcm_playback_ioctl1+0x158/0x4d0) from [<800d5bb8>] (do_vfs_ioctl+0x80/0x624) [<800d5bb8>] (do_vfs_ioctl+0x80/0x624) from [<800d6198>] (SyS_ioctl+0x3c/0x5c) [<800d6198>] (SyS_ioctl+0x3c/0x5c) from [<8000e200>] (ret_fast_syscall+0x0/0x30) Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> (cherry picked from commit 99095f3362bc53eb414dabbbe7da5778f3d54f25)
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/fsl/fsl_sai.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index e7e8db1c8f3a..6cdfed77d91e 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -479,7 +479,6 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd,
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
- pm_runtime_get_sync(cpu_dai->dev);
regmap_update_bits(sai->regmap, FSL_SAI_xCSR(tx),
FSL_SAI_CSR_FRDE, FSL_SAI_CSR_FRDE);
@@ -531,7 +530,6 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd,
regmap_write(sai->regmap, FSL_SAI_TCSR, 0);
regmap_write(sai->regmap, FSL_SAI_RCSR, 0);
}
- pm_runtime_put_sync(cpu_dai->dev);
break;
default:
return -EINVAL;
@@ -553,6 +551,8 @@ static int fsl_sai_startup(struct snd_pcm_substream *substream,
else
sai->is_stream_opened[tx] = true;
+ pm_runtime_get_sync(cpu_dai->dev);
+
ret = clk_prepare_enable(sai->bus_clk);
if (ret) {
dev_err(dev, "failed to enable bus clock: %d\n", ret);
@@ -581,6 +581,7 @@ static void fsl_sai_shutdown(struct snd_pcm_substream *substream,
regmap_update_bits(sai->regmap, FSL_SAI_xCR3(tx), FSL_SAI_CR3_TRCE, 0);
clk_disable_unprepare(sai->bus_clk);
sai->is_stream_opened[tx] = false;
+ pm_runtime_put_sync(cpu_dai->dev);
}
}