Skip to content

Commit

Permalink
ASoC: meson: axg-tdm-interface: Fix formatters in trigger"
Browse files Browse the repository at this point in the history
commit c26830b upstream.

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

Fixes: bf5e488 ("ASoC: meson: axg-tdm-interface: manage formatters in trigger")
Reported-by: Dmitry Shmidt <dimitrysh@google.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20220421155725.2589089-1-narmstrong@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
superna9999 authored and gregkh committed May 12, 2022
1 parent f04d89b commit 58d5cd2
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions sound/soc/meson/axg-tdm-interface.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 58d5cd2

Please sign in to comment.