Skip to content

Commit edac894

Browse files
committed
ALSA: aloop: Fix Oops while PM resume
snd-aloop driver has no proper PM implementation, thus the PM resume may trigger Oops due to leftover timer instance. This patch adds the missing suspend/resume implementation. Reported-and-tested-by: El boulangero <elboulangero@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 2060873 commit edac894

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sound/drivers/aloop.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,14 @@ static int loopback_trigger(struct snd_pcm_substream *substream, int cmd)
286286
loopback_active_notify(dpcm);
287287
break;
288288
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
289+
case SNDRV_PCM_TRIGGER_SUSPEND:
289290
spin_lock(&cable->lock);
290291
cable->pause |= stream;
291292
loopback_timer_stop(dpcm);
292293
spin_unlock(&cable->lock);
293294
break;
294295
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
296+
case SNDRV_PCM_TRIGGER_RESUME:
295297
spin_lock(&cable->lock);
296298
dpcm->last_jiffies = jiffies;
297299
cable->pause &= ~stream;
@@ -563,7 +565,8 @@ static snd_pcm_uframes_t loopback_pointer(struct snd_pcm_substream *substream)
563565
static struct snd_pcm_hardware loopback_pcm_hardware =
564566
{
565567
.info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP |
566-
SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_PAUSE),
568+
SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_PAUSE |
569+
SNDRV_PCM_INFO_RESUME),
567570
.formats = (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE |
568571
SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE |
569572
SNDRV_PCM_FMTBIT_FLOAT_LE | SNDRV_PCM_FMTBIT_FLOAT_BE),

0 commit comments

Comments
 (0)