Skip to contentSkip to conversation

ASoC: intel: Fix PM and non-atomic crash in bytcr drivers

PATCH In review Takashi Iwai 4 participants 7 messages Apr 24, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: intel: Fix PM and non-atomic crash in bytcr drivers

The FE setups of Intel SST bytcr_rt5640 and bytcr_rt5651 drivers carry the ignore_suspend flag, and this prevents the suspend/resume working properly while the stream is running, since SST core code has the check of the running streams and returns -EBUSY. Drop these superfluous flags for fixing the behavior.

Also, the bytcr_rt5640 driver lacks of nonatomic flag in some FE definitions, which leads to the kernel Oops at suspend/resume like:

  BUG: scheduling while atomic: systemd-sleep/3144/0x00000003
  Call Trace:
   dump_stack+0x5c/0x7a
   __schedule_bug+0x55/0x70
   __schedule+0x63c/0x8c0
   schedule+0x3d/0x90
   schedule_timeout+0x16b/0x320
   ? del_timer_sync+0x50/0x50
   ? sst_wait_timeout+0xa9/0x170 [snd_intel_sst_core]
   ? sst_wait_timeout+0xa9/0x170 [snd_intel_sst_core]
   ? remove_wait_queue+0x60/0x60
   ? sst_prepare_and_post_msg+0x275/0x960 [snd_intel_sst_core]
   ? sst_pause_stream+0x9b/0x110 [snd_intel_sst_core]
   ....

This patch addresses these appropriately, too.

---
 sound/soc/intel/boards/bytcr_rt5640.c | 4 ++--
 sound/soc/intel/boards/bytcr_rt5651.c | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)
sound/soc/intel/boards/bytcr_rt5640.c +2 -2
index 5c7219fb3aa8..9e2a3404a836 100644
@@ -621,7 +621,7 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = {
 		.codec_dai_name = "snd-soc-dummy-dai",
 		.codec_name = "snd-soc-dummy",
 		.platform_name = "sst-mfld-platform",
-		.ignore_suspend = 1,
+		.nonatomic = true,
 		.dynamic = 1,
 		.dpcm_playback = 1,
 		.dpcm_capture = 1,
@@ -634,7 +634,6 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = {
 		.codec_dai_name = "snd-soc-dummy-dai",
 		.codec_name = "snd-soc-dummy",
 		.platform_name = "sst-mfld-platform",
-		.ignore_suspend = 1,
 		.nonatomic = true,
 		.dynamic = 1,
 		.dpcm_playback = 1,
@@ -661,6 +660,7 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = {
 						| SND_SOC_DAIFMT_CBS_CFS,
 		.be_hw_params_fixup = byt_rt5640_codec_fixup,
 		.ignore_suspend = 1,
+		.nonatomic = true,
 		.dpcm_playback = 1,
 		.dpcm_capture = 1,
 		.init = byt_rt5640_init,
sound/soc/intel/boards/bytcr_rt5651.c +0 -2
index 3186f015939f..8164bec63bf1 100644
@@ -235,7 +235,6 @@ static struct snd_soc_dai_link byt_rt5651_dais[] = {
 		.codec_dai_name = "snd-soc-dummy-dai",
 		.codec_name = "snd-soc-dummy",
 		.platform_name = "sst-mfld-platform",
-		.ignore_suspend = 1,
 		.nonatomic = true,
 		.dynamic = 1,
 		.dpcm_playback = 1,
@@ -249,7 +248,6 @@ static struct snd_soc_dai_link byt_rt5651_dais[] = {
 		.codec_dai_name = "snd-soc-dummy-dai",
 		.codec_name = "snd-soc-dummy",
 		.platform_name = "sst-mfld-platform",
-		.ignore_suspend = 1,
 		.nonatomic = true,
 		.dynamic = 1,
 		.dpcm_playback = 1,
Signature · 1 line
2.11.1
Acked-by on v1 1/1
#1 lore raw
Quoted 24 lines · Takashi Iwai

The FE setups of Intel SST bytcr_rt5640 and bytcr_rt5651 drivers carry the ignore_suspend flag, and this prevents the suspend/resume working properly while the stream is running, since SST core code has the check of the running streams and returns -EBUSY. Drop these superfluous flags for fixing the behavior.

Also, the bytcr_rt5640 driver lacks of nonatomic flag in some FE definitions, which leads to the kernel Oops at suspend/resume like:

  BUG: scheduling while atomic: systemd-sleep/3144/0x00000003
  Call Trace:
   dump_stack+0x5c/0x7a
   __schedule_bug+0x55/0x70
   __schedule+0x63c/0x8c0
   schedule+0x3d/0x90
   schedule_timeout+0x16b/0x320
   ? del_timer_sync+0x50/0x50
   ? sst_wait_timeout+0xa9/0x170 [snd_intel_sst_core]
   ? sst_wait_timeout+0xa9/0x170 [snd_intel_sst_core]
   ? remove_wait_queue+0x60/0x60
   ? sst_prepare_and_post_msg+0x275/0x960 [snd_intel_sst_core]
   ? sst_pause_stream+0x9b/0x110 [snd_intel_sst_core]
   ....
Quoted 1 line

This patch addresses these appropriately, too.

Signature · 1 line
~Vinod
maintainer
#2 lore raw

Applied "ASoC: intel: Fix PM and non-atomic crash in bytcr drivers" to the asoc tree

In reply to Takashi Iwai

The patch

ASoC: intel: Fix PM and non-atomic crash in bytcr drivers

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 22ae4057173ebf48020d5a713242bd9de9e64b46 Mon Sep 17 00:00:00 2001

From: Takashi Iwai <[email protected]>
Date: Mon, 24 Apr 2017 14:09:55 +0200
Subject: [PATCH] ASoC: intel: Fix PM and non-atomic crash in bytcr drivers

The FE setups of Intel SST bytcr_rt5640 and bytcr_rt5651 drivers carry the ignore_suspend flag, and this prevents the suspend/resume working properly while the stream is running, since SST core code has the check of the running streams and returns -EBUSY. Drop these superfluous flags for fixing the behavior.

Also, the bytcr_rt5640 driver lacks of nonatomic flag in some FE definitions, which leads to the kernel Oops at suspend/resume like:

  BUG: scheduling while atomic: systemd-sleep/3144/0x00000003
  Call Trace:
   dump_stack+0x5c/0x7a
   __schedule_bug+0x55/0x70
   __schedule+0x63c/0x8c0
   schedule+0x3d/0x90
   schedule_timeout+0x16b/0x320
   ? del_timer_sync+0x50/0x50
   ? sst_wait_timeout+0xa9/0x170 [snd_intel_sst_core]
   ? sst_wait_timeout+0xa9/0x170 [snd_intel_sst_core]
   ? remove_wait_queue+0x60/0x60
   ? sst_prepare_and_post_msg+0x275/0x960 [snd_intel_sst_core]
   ? sst_pause_stream+0x9b/0x110 [snd_intel_sst_core]
   ....

This patch addresses these appropriately, too.

---
 sound/soc/intel/boards/bytcr_rt5640.c | 4 ++--
 sound/soc/intel/boards/bytcr_rt5651.c | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)
sound/soc/intel/boards/bytcr_rt5640.c +2 -2
index 0ac32788f216..b1f0ccb64a6a 100644
@@ -625,7 +625,7 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = {
 		.codec_dai_name = "snd-soc-dummy-dai",
 		.codec_name = "snd-soc-dummy",
 		.platform_name = "sst-mfld-platform",
-		.ignore_suspend = 1,
+		.nonatomic = true,
 		.dynamic = 1,
 		.dpcm_playback = 1,
 		.dpcm_capture = 1,
@@ -638,7 +638,6 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = {
 		.codec_dai_name = "snd-soc-dummy-dai",
 		.codec_name = "snd-soc-dummy",
 		.platform_name = "sst-mfld-platform",
-		.ignore_suspend = 1,
 		.nonatomic = true,
 		.dynamic = 1,
 		.dpcm_playback = 1,
@@ -665,6 +664,7 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = {
 						| SND_SOC_DAIFMT_CBS_CFS,
 		.be_hw_params_fixup = byt_rt5640_codec_fixup,
 		.ignore_suspend = 1,
+		.nonatomic = true,
 		.dpcm_playback = 1,
 		.dpcm_capture = 1,
 		.init = byt_rt5640_init,
sound/soc/intel/boards/bytcr_rt5651.c +0 -2
index 3186f015939f..8164bec63bf1 100644
@@ -235,7 +235,6 @@ static struct snd_soc_dai_link byt_rt5651_dais[] = {
 		.codec_dai_name = "snd-soc-dummy-dai",
 		.codec_name = "snd-soc-dummy",
 		.platform_name = "sst-mfld-platform",
-		.ignore_suspend = 1,
 		.nonatomic = true,
 		.dynamic = 1,
 		.dpcm_playback = 1,
@@ -249,7 +248,6 @@ static struct snd_soc_dai_link byt_rt5651_dais[] = {
 		.codec_dai_name = "snd-soc-dummy-dai",
 		.codec_name = "snd-soc-dummy",
 		.platform_name = "sst-mfld-platform",
-		.ignore_suspend = 1,
 		.nonatomic = true,
 		.dynamic = 1,
 		.dpcm_playback = 1,
Signature · 1 line
2.11.0
#3 lore raw
In reply to Takashi Iwai
Quoted 8 lines · Takashi Iwai

The FE setups of Intel SST bytcr_rt5640 and bytcr_rt5651 drivers carry the ignore_suspend flag, and this prevents the suspend/resume working properly while the stream is running, since SST core code has the check of the running streams and returns -EBUSY. Drop these superfluous flags for fixing the behavior.

Also, the bytcr_rt5640 driver lacks of nonatomic flag in some FE definitions, which leads to the kernel Oops at suspend/resume like:

This patch also fixes the known bug that reboot had to be forced on some BYT platforms with a manual restart when the audio driver was enabled. Thanks Takashi!

Quoted 74 lines
   BUG: scheduling while atomic: systemd-sleep/3144/0x00000003
   Call Trace:
    dump_stack+0x5c/0x7a
    __schedule_bug+0x55/0x70
    __schedule+0x63c/0x8c0
    schedule+0x3d/0x90
    schedule_timeout+0x16b/0x320
    ? del_timer_sync+0x50/0x50
    ? sst_wait_timeout+0xa9/0x170 [snd_intel_sst_core]
    ? sst_wait_timeout+0xa9/0x170 [snd_intel_sst_core]
    ? remove_wait_queue+0x60/0x60
    ? sst_prepare_and_post_msg+0x275/0x960 [snd_intel_sst_core]
    ? sst_pause_stream+0x9b/0x110 [snd_intel_sst_core]
    ....

This patch addresses these appropriately, too.

---
  sound/soc/intel/boards/bytcr_rt5640.c | 4 ++--
  sound/soc/intel/boards/bytcr_rt5651.c | 2 --
  2 files changed, 2 insertions(+), 4 deletions(-)
sound/soc/intel/boards/bytcr_rt5640.c +2 -2
index 5c7219fb3aa8..9e2a3404a836 100644
@@ -621,7 +621,7 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = {
  		.codec_dai_name = "snd-soc-dummy-dai",
  		.codec_name = "snd-soc-dummy",
  		.platform_name = "sst-mfld-platform",
-		.ignore_suspend = 1,
+		.nonatomic = true,
  		.dynamic = 1,
  		.dpcm_playback = 1,
  		.dpcm_capture = 1,
@@ -634,7 +634,6 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = {
  		.codec_dai_name = "snd-soc-dummy-dai",
  		.codec_name = "snd-soc-dummy",
  		.platform_name = "sst-mfld-platform",
-		.ignore_suspend = 1,
  		.nonatomic = true,
  		.dynamic = 1,
  		.dpcm_playback = 1,
@@ -661,6 +660,7 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = {
  						| SND_SOC_DAIFMT_CBS_CFS,
  		.be_hw_params_fixup = byt_rt5640_codec_fixup,
  		.ignore_suspend = 1,
+		.nonatomic = true,
  		.dpcm_playback = 1,
  		.dpcm_capture = 1,
  		.init = byt_rt5640_init,
sound/soc/intel/boards/bytcr_rt5651.c +0 -2
index 3186f015939f..8164bec63bf1 100644
@@ -235,7 +235,6 @@ static struct snd_soc_dai_link byt_rt5651_dais[] = {
  		.codec_dai_name = "snd-soc-dummy-dai",
  		.codec_name = "snd-soc-dummy",
  		.platform_name = "sst-mfld-platform",
-		.ignore_suspend = 1,
  		.nonatomic = true,
  		.dynamic = 1,
  		.dpcm_playback = 1,
@@ -249,7 +248,6 @@ static struct snd_soc_dai_link byt_rt5651_dais[] = {
  		.codec_dai_name = "snd-soc-dummy-dai",
  		.codec_name = "snd-soc-dummy",
  		.platform_name = "sst-mfld-platform",
-		.ignore_suspend = 1,
  		.nonatomic = true,
  		.dynamic = 1,
  		.dpcm_playback = 1,
#4 lore raw
Quoted 10 lines · Pierre-Louis Bossart
Quoted 6 lines · Takashi Iwai

The FE setups of Intel SST bytcr_rt5640 and bytcr_rt5651 drivers carry the ignore_suspend flag, and this prevents the suspend/resume working properly while the stream is running, since SST core code has the check of the running streams and returns -EBUSY. Drop these superfluous flags for fixing the behavior.

Quoted 6 lines
Quoted 2 lines

Also, the bytcr_rt5640 driver lacks of nonatomic flag in some FE definitions, which leads to the kernel Oops at suspend/resume like:

This patch also fixes the known bug that reboot had to be forced on some BYT platforms with a manual restart when the audio driver was enabled.
Thanks Takashi!

While we're at it: could you submit the UCM profiles as alsa-lib upstream? At least the ones for the drivers that are in the current kernel should be merged.

If there are multiple board-specific UCMs for the same driver, we can use now card's longname (generated from DMI string) as the primary source, while keeping the $DRIVER/$DRIVER.conf as the fallback.

thanks,

Takashi

#5 lore raw
Quoted 19 lines · Takashi Iwai
Quoted 10 lines · Pierre-Louis Bossart
Quoted 6 lines · Takashi Iwai

The FE setups of Intel SST bytcr_rt5640 and bytcr_rt5651 drivers carry the ignore_suspend flag, and this prevents the suspend/resume working properly while the stream is running, since SST core code has the check of the running streams and returns -EBUSY. Drop these superfluous flags for fixing the behavior.

Quoted 6 lines
Quoted 2 lines

Also, the bytcr_rt5640 driver lacks of nonatomic flag in some FE definitions, which leads to the kernel Oops at suspend/resume like:

This patch also fixes the known bug that reboot had to be forced on some BYT platforms with a manual restart when the audio driver was enabled.
Thanks Takashi!

Quoted 7 lines

While we're at it: could you submit the UCM profiles as alsa-lib upstream? At least the ones for the drivers that are in the current kernel should be merged.

If there are multiple board-specific UCMs for the same driver, we can use now card's longname (generated from DMI string) as the primary source, while keeping the $DRIVER/$DRIVER.conf as the fallback.

Well I've lost track of which git repo UCM files should be in, both the license and the update rate of alsa-lib are problematic for configuration files. We also talked about some include capabilities to avoid copy/paste but I can't recall having seen them upstream. I also haven't had time to test the long name on my devices.

#6 lore raw
Quoted 25 lines · Pierre-Louis Bossart
Quoted 23 lines · Takashi Iwai
Quoted 10 lines · Pierre-Louis Bossart
Quoted 6 lines · Takashi Iwai

The FE setups of Intel SST bytcr_rt5640 and bytcr_rt5651 drivers carry the ignore_suspend flag, and this prevents the suspend/resume working properly while the stream is running, since SST core code has the check of the running streams and returns -EBUSY. Drop these superfluous flags for fixing the behavior.

Quoted 6 lines
Quoted 2 lines

Also, the bytcr_rt5640 driver lacks of nonatomic flag in some FE definitions, which leads to the kernel Oops at suspend/resume like:

This patch also fixes the known bug that reboot had to be forced on some BYT platforms with a manual restart when the audio driver was enabled.
Thanks Takashi!

While we're at it: could you submit the UCM profiles as alsa-lib upstream? At least the ones for the drivers that are in the current kernel should be merged.

Quoted 7 lines
Quoted 3 lines

If there are multiple board-specific UCMs for the same driver, we can use now card's longname (generated from DMI string) as the primary source, while keeping the $DRIVER/$DRIVER.conf as the fallback.

Well I've lost track of which git repo UCM files should be in, both the license and the update rate of alsa-lib are problematic for configuration files.

The split to another repo is planned but doesn't happen yet. I guess we'll do it after 1.1.4 release. So far, you can submit the existing files just to alsa-lib as is unless you want inevitably another license.

Quoted 2 lines

We also talked about some include capabilities to avoid copy/paste but I can't recall having seen them upstream.

Hm, it's basically always possible as an alsa-lib config feasture, but never used. We can work on it later once after gathering the similar profiles.

Quoted 1 line

I also haven't had time to test the long name on my devices.

That's OK, we can begin with the basic ones such as bytcr_rt5640.conf. The longname stuff is new and will be available at first in 3.12, so it's a feature in near future.

thanks,

Takashi