Skip to content
  • Takashi Iwai's avatar
    ALSA: pcm: Fix power lock unbalance via OSS emulation · bcab3a6e
    Takashi Iwai authored
    PCM OSS emulation issues the drain ioctl without power lock.  It used
    to work in the earlier kernels as the power lock was taken inside
    snd_pcm_drain() itself.  But since 68b4acd3 ("ALSA: pcm: Apply
    power lock globally to common ioctls"), the power lock is taken
    outside the function.  Due to that change, the call via OSS emulation
    leads to the unbalanced power lock, thus it deadlocks.
    
    As a quick fix, just take the power lock before snd_pcm_drain() call
    for OSS emulation path.  A better cleanup will follow later.
    
    Fixes: 68b4acd3
    
     ("ALSA: pcm: Apply power lock globally to common ioctls")
    Reported-and-tested-by: default avatarMarkus Trippelsdorf <markus@trippelsdorf.de>
    Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    bcab3a6e