ALSA: pcm: Fix power lock unbalance via OSS emulation
authorTakashi Iwai <tiwai@suse.de>
Wed, 30 Aug 2017 12:50:07 +0000 (14:50 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 30 Aug 2017 13:10:12 +0000 (15:10 +0200)
commitbcab3a6e64a9647e022b46182c9687a8c3aa9d11
tree0f8fb5ae4e57b0858333a86e7412d02de6a5999e
parent9ce76511b67be8fbcdff36b7e1662e3887bb7377
ALSA: pcm: Fix power lock unbalance via OSS emulation

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 68b4acd32249 ("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: 68b4acd32249 ("ALSA: pcm: Apply power lock globally to common ioctls")
Reported-and-tested-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/pcm_native.c