Commit edac894389f9c9de2a1368c78809c824b343f3a5
1 parent
20608731f4
Exists in
master
and in
20 other branches
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>
Showing 1 changed file with 4 additions and 1 deletions Side-by-side Diff
sound/drivers/aloop.c
... | ... | @@ -286,12 +286,14 @@ |
286 | 286 | loopback_active_notify(dpcm); |
287 | 287 | break; |
288 | 288 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: |
289 | + case SNDRV_PCM_TRIGGER_SUSPEND: | |
289 | 290 | spin_lock(&cable->lock); |
290 | 291 | cable->pause |= stream; |
291 | 292 | loopback_timer_stop(dpcm); |
292 | 293 | spin_unlock(&cable->lock); |
293 | 294 | break; |
294 | 295 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: |
296 | + case SNDRV_PCM_TRIGGER_RESUME: | |
295 | 297 | spin_lock(&cable->lock); |
296 | 298 | dpcm->last_jiffies = jiffies; |
297 | 299 | cable->pause &= ~stream; |
... | ... | @@ -563,7 +565,8 @@ |
563 | 565 | static struct snd_pcm_hardware loopback_pcm_hardware = |
564 | 566 | { |
565 | 567 | .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), | |
567 | 570 | .formats = (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE | |
568 | 571 | SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE | |
569 | 572 | SNDRV_PCM_FMTBIT_FLOAT_LE | SNDRV_PCM_FMTBIT_FLOAT_BE), |