All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Revert "ASoC: meson: axg-tdm-interface: manage formatters in trigger"
@ 2022-04-21 15:57 ` Neil Armstrong
  0 siblings, 0 replies; 28+ messages in thread
From: Neil Armstrong @ 2022-04-21 15:57 UTC (permalink / raw)
  To: jbrunet, broonie
  Cc: alsa-devel, linux-arm-kernel, linux-amlogic, linux-kernel,
	Neil Armstrong, Dmitry Shmidt

This reverts commit bf5e4887eeddb48480568466536aa08ec7f179a5 because
the following and required commit e138233e56e9829e65b6293887063a1a3ccb2d68
causes the following system crash when using audio:
 BUG: sleeping function called from invalid context at kernel/locking/mutex.c:282

Reported-by: Dmitry Shmidt <dimitrysh@google.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 sound/soc/meson/axg-tdm-interface.c | 26 +++++---------------------
 1 file changed, 5 insertions(+), 21 deletions(-)

diff --git a/sound/soc/meson/axg-tdm-interface.c b/sound/soc/meson/axg-tdm-interface.c
index 0c31934a9630..e076ced30025 100644
--- a/sound/soc/meson/axg-tdm-interface.c
+++ b/sound/soc/meson/axg-tdm-interface.c
@@ -351,29 +351,13 @@ static int axg_tdm_iface_hw_free(struct snd_pcm_substream *substream,
 	return 0;
 }
 
-static int axg_tdm_iface_trigger(struct snd_pcm_substream *substream,
-				 int cmd,
+static int axg_tdm_iface_prepare(struct snd_pcm_substream *substream,
 				 struct snd_soc_dai *dai)
 {
-	struct axg_tdm_stream *ts =
-		snd_soc_dai_get_dma_data(dai, substream);
-
-	switch (cmd) {
-	case SNDRV_PCM_TRIGGER_START:
-	case SNDRV_PCM_TRIGGER_RESUME:
-	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
-		axg_tdm_stream_start(ts);
-		break;
-	case SNDRV_PCM_TRIGGER_SUSPEND:
-	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
-	case SNDRV_PCM_TRIGGER_STOP:
-		axg_tdm_stream_stop(ts);
-		break;
-	default:
-		return -EINVAL;
-	}
+	struct axg_tdm_stream *ts = snd_soc_dai_get_dma_data(dai, substream);
 
-	return 0;
+	/* Force all attached formatters to update */
+	return axg_tdm_stream_reset(ts);
 }
 
 static int axg_tdm_iface_remove_dai(struct snd_soc_dai *dai)
@@ -413,8 +397,8 @@ static const struct snd_soc_dai_ops axg_tdm_iface_ops = {
 	.set_fmt	= axg_tdm_iface_set_fmt,
 	.startup	= axg_tdm_iface_startup,
 	.hw_params	= axg_tdm_iface_hw_params,
+	.prepare	= axg_tdm_iface_prepare,
 	.hw_free	= axg_tdm_iface_hw_free,
-	.trigger	= axg_tdm_iface_trigger,
 };
 
 /* TDM Backend DAIs */
-- 
2.25.1


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

end of thread, other threads:[~2022-04-22  8:28 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-21 15:57 [PATCH 1/2] Revert "ASoC: meson: axg-tdm-interface: manage formatters in trigger" Neil Armstrong
2022-04-21 15:57 ` Neil Armstrong
2022-04-21 15:57 ` Neil Armstrong
2022-04-21 15:57 ` Neil Armstrong
2022-04-21 15:57 ` [PATCH 2/2] Revert "ASoC: meson: axg-card: make links nonatomic" Neil Armstrong
2022-04-21 15:57   ` Neil Armstrong
2022-04-21 15:57   ` Neil Armstrong
2022-04-21 15:57   ` Neil Armstrong
2022-04-21 16:17 ` [PATCH 1/2] Revert "ASoC: meson: axg-tdm-interface: manage formatters in trigger" Jerome Brunet
2022-04-21 16:17   ` Jerome Brunet
2022-04-21 16:17   ` Jerome Brunet
2022-04-21 16:17   ` Jerome Brunet
2022-04-21 16:58 ` Mark Brown
2022-04-21 16:58   ` Mark Brown
2022-04-21 16:58   ` Mark Brown
2022-04-21 16:58   ` Mark Brown
2022-04-21 17:20 ` Mark Brown
2022-04-21 17:20   ` Mark Brown
2022-04-21 17:20   ` Mark Brown
2022-04-21 17:20   ` Mark Brown
2022-04-22  8:26   ` Neil Armstrong
2022-04-22  8:26     ` Neil Armstrong
2022-04-22  8:26     ` Neil Armstrong
2022-04-22  8:26     ` Neil Armstrong
2022-04-21 19:18 ` Mark Brown
2022-04-21 19:18   ` Mark Brown
2022-04-21 19:18   ` Mark Brown
2022-04-21 19:18   ` 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.