Home Home > GIT Browse > openSUSE-15.1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-01-10 20:40:18 +0100
committerTakashi Iwai <tiwai@suse.de>2019-01-11 08:35:10 +0100
commitda5f0b78def2ee2b4e7936a84d22c43507094d87 (patch)
tree14d451a0d5223453a6214f2b77e59eb2f9c12696
parent3729b66262372b47a7878721c1183609541391d7 (diff)
ALSA: seq: Use no intrruptible mutex_lock (bsc#1121278).
-rw-r--r--patches.drivers/ALSA-seq-Use-no-intrruptible-mutex_lock.patch94
-rw-r--r--series.conf1
2 files changed, 95 insertions, 0 deletions
diff --git a/patches.drivers/ALSA-seq-Use-no-intrruptible-mutex_lock.patch b/patches.drivers/ALSA-seq-Use-no-intrruptible-mutex_lock.patch
new file mode 100644
index 0000000000..bf0c629a3a
--- /dev/null
+++ b/patches.drivers/ALSA-seq-Use-no-intrruptible-mutex_lock.patch
@@ -0,0 +1,94 @@
+From 04702e8d0092832eaeeacc6b1bfbf81a66f242c9 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Wed, 1 Aug 2018 16:42:29 +0200
+Subject: [PATCH] ALSA: seq: Use no intrruptible mutex_lock
+Git-commit: 04702e8d0092832eaeeacc6b1bfbf81a66f242c9
+Patch-mainline: v4.19-rc1
+References: bsc#1121278
+
+All usages of mutex in ALSA sequencer core would take too long, hence
+we don't have to care about the user interruption that makes things
+complicated. Let's replace them with simpler mutex_lock().
+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ sound/core/seq/seq_clientmgr.c | 26 +++++++-------------------
+ 1 file changed, 7 insertions(+), 19 deletions(-)
+
+diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
+index a0b768e2f697..92e6524a3a9d 100644
+--- a/sound/core/seq/seq_clientmgr.c
++++ b/sound/core/seq/seq_clientmgr.c
+@@ -311,10 +311,9 @@ static int snd_seq_open(struct inode *inode, struct file *file)
+ if (err < 0)
+ return err;
+
+- if (mutex_lock_interruptible(&register_mutex))
+- return -ERESTARTSYS;
++ mutex_lock(&register_mutex);
+ client = seq_create_client1(-1, SNDRV_SEQ_DEFAULT_EVENTS);
+- if (client == NULL) {
++ if (!client) {
+ mutex_unlock(&register_mutex);
+ return -ENOMEM; /* failure code */
+ }
+@@ -1704,10 +1703,7 @@ static int snd_seq_ioctl_get_queue_timer(struct snd_seq_client *client,
+ if (queue == NULL)
+ return -EINVAL;
+
+- if (mutex_lock_interruptible(&queue->timer_mutex)) {
+- queuefree(queue);
+- return -ERESTARTSYS;
+- }
++ mutex_lock(&queue->timer_mutex);
+ tmr = queue->timer;
+ memset(timer, 0, sizeof(*timer));
+ timer->queue = queue->queue;
+@@ -1741,10 +1737,7 @@ static int snd_seq_ioctl_set_queue_timer(struct snd_seq_client *client,
+ q = queueptr(timer->queue);
+ if (q == NULL)
+ return -ENXIO;
+- if (mutex_lock_interruptible(&q->timer_mutex)) {
+- queuefree(q);
+- return -ERESTARTSYS;
+- }
++ mutex_lock(&q->timer_mutex);
+ tmr = q->timer;
+ snd_seq_queue_timer_close(timer->queue);
+ tmr->type = timer->type;
+@@ -2180,8 +2173,7 @@ int snd_seq_create_kernel_client(struct snd_card *card, int client_index,
+ if (card == NULL && client_index >= SNDRV_SEQ_GLOBAL_CLIENTS)
+ return -EINVAL;
+
+- if (mutex_lock_interruptible(&register_mutex))
+- return -ERESTARTSYS;
++ mutex_lock(&register_mutex);
+
+ if (card) {
+ client_index += SNDRV_SEQ_GLOBAL_CLIENTS
+@@ -2522,19 +2514,15 @@ int __init snd_sequencer_device_init(void)
+ snd_device_initialize(&seq_dev, NULL);
+ dev_set_name(&seq_dev, "seq");
+
+- if (mutex_lock_interruptible(&register_mutex))
+- return -ERESTARTSYS;
+-
++ mutex_lock(&register_mutex);
+ err = snd_register_device(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0,
+ &snd_seq_f_ops, NULL, &seq_dev);
++ mutex_unlock(&register_mutex);
+ if (err < 0) {
+- mutex_unlock(&register_mutex);
+ put_device(&seq_dev);
+ return err;
+ }
+
+- mutex_unlock(&register_mutex);
+-
+ return 0;
+ }
+
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index ffe936771d..0018f4833b 100644
--- a/series.conf
+++ b/series.conf
@@ -34876,6 +34876,7 @@
patches.drivers/ALSA-seq-Minor-cleanup-of-MIDI-event-parser-helpers.patch
patches.drivers/ALSA-seq-Remove-dead-codes.patch
patches.drivers/ALSA-seq-Fix-leftovers-at-probe-error-path.patch
+ patches.drivers/ALSA-seq-Use-no-intrruptible-mutex_lock.patch
patches.drivers/ALSA-usb-audio-Fix-invalid-use-of-sizeof-in-parse_ua.patch
patches.drivers/ALSA-hda-realtek-Add-mute-LED-quirk-for-HP-Spectre-x.patch
patches.drivers/ALSA-hda-ca0132-Create-mmio-gpio-function-to-make-co.patch