diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-02-04 04:28:15 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-02-04 04:28:15 -0500 |
commit | edac894389f9c9de2a1368c78809c824b343f3a5 (patch) | |
tree | 88c91a906d79a63a035a3dfe9bda2e167ef67890 /sound/drivers | |
parent | 20608731f479d48be6bcb88e727f360ddf98ddaf (diff) |
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>
Diffstat (limited to 'sound/drivers')
-rw-r--r-- | sound/drivers/aloop.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c index 3d822328d383..64d534710b51 100644 --- a/sound/drivers/aloop.c +++ b/sound/drivers/aloop.c | |||
@@ -286,12 +286,14 @@ static int loopback_trigger(struct snd_pcm_substream *substream, int cmd) | |||
286 | loopback_active_notify(dpcm); | 286 | loopback_active_notify(dpcm); |
287 | break; | 287 | break; |
288 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: | 288 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: |
289 | case SNDRV_PCM_TRIGGER_SUSPEND: | ||
289 | spin_lock(&cable->lock); | 290 | spin_lock(&cable->lock); |
290 | cable->pause |= stream; | 291 | cable->pause |= stream; |
291 | loopback_timer_stop(dpcm); | 292 | loopback_timer_stop(dpcm); |
292 | spin_unlock(&cable->lock); | 293 | spin_unlock(&cable->lock); |
293 | break; | 294 | break; |
294 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: | 295 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: |
296 | case SNDRV_PCM_TRIGGER_RESUME: | ||
295 | spin_lock(&cable->lock); | 297 | spin_lock(&cable->lock); |
296 | dpcm->last_jiffies = jiffies; | 298 | dpcm->last_jiffies = jiffies; |
297 | cable->pause &= ~stream; | 299 | cable->pause &= ~stream; |
@@ -563,7 +565,8 @@ static snd_pcm_uframes_t loopback_pointer(struct snd_pcm_substream *substream) | |||
563 | static struct snd_pcm_hardware loopback_pcm_hardware = | 565 | static struct snd_pcm_hardware loopback_pcm_hardware = |
564 | { | 566 | { |
565 | .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP | | 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 | .formats = (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE | | 570 | .formats = (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE | |
568 | SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE | | 571 | SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE | |
569 | SNDRV_PCM_FMTBIT_FLOAT_LE | SNDRV_PCM_FMTBIT_FLOAT_BE), | 572 | SNDRV_PCM_FMTBIT_FLOAT_LE | SNDRV_PCM_FMTBIT_FLOAT_BE), |