ALSA: pcm: Allow aborting mutex lock at OSS read/write loops
commit0b9c7ed68db295f82e91654ba3ff3ee1346c358d
authorTakashi Iwai <tiwai@suse.de>
Mon, 8 Jan 2018 13:03:53 +0000 (8 14:03 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Jan 2018 08:45:20 +0000 (17 09:45 +0100)
treee5022f14205a829cfe10428fe6a4873721f5a2c7
parent28ac4032652f7dcc65637bfa3f0c539ac6c772de
ALSA: pcm: Allow aborting mutex lock at OSS read/write loops

commit 900498a34a3ac9c611e9b425094c8106bdd7dc1c upstream.

PCM OSS read/write loops keep taking the mutex lock for the whole
read/write, and this might take very long when the exceptionally high
amount of data is given.  Also, since it invokes with mutex_lock(),
the concurrent read/write becomes unbreakable.

This patch tries to address these issues by replacing mutex_lock()
with mutex_lock_interruptible(), and also splits / re-takes the lock
at each read/write period chunk, so that it can switch the context
more finely if requested.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/core/oss/pcm_oss.c