From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:41557 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751023AbbEIRZg (ORCPT ); Sat, 9 May 2015 13:25:36 -0400 Subject: Patch "ALSA: emux: Fix mutex deadlock at unloading" has been added to the 4.0-stable tree To: tiwai@suse.de, gregkh@linuxfoundation.org Cc: , From: Date: Sat, 09 May 2015 19:24:46 +0200 Message-ID: <143119228620782@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled ALSA: emux: Fix mutex deadlock at unloading to the 4.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: alsa-emux-fix-mutex-deadlock-at-unloading.patch and it can be found in the queue-4.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 07b0e5d49d227e3950cb13a3e8caf248ef2a310e Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 27 Apr 2015 14:50:39 +0200 Subject: ALSA: emux: Fix mutex deadlock at unloading From: Takashi Iwai commit 07b0e5d49d227e3950cb13a3e8caf248ef2a310e upstream. The emux-synth driver has a possible AB/BA mutex deadlock at unloading the emu10k1 driver: snd_emux_free() -> snd_emux_detach_seq(): mutex_lock(&emu->register_mutex) -> snd_seq_delete_kernel_client() -> snd_seq_free_client(): mutex_lock(®ister_mutex) snd_seq_release() -> snd_seq_free_client(): mutex_lock(®ister_mutex) -> snd_seq_delete_all_ports() -> snd_emux_unuse(): mutex_lock(&emu->register_mutex) Basically snd_emux_detach_seq() doesn't need a protection of emu->register_mutex as it's already being unregistered. So, we can get rid of this for avoiding the deadlock. Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/synth/emux/emux_seq.c | 2 -- 1 file changed, 2 deletions(-) --- a/sound/synth/emux/emux_seq.c +++ b/sound/synth/emux/emux_seq.c @@ -124,12 +124,10 @@ snd_emux_detach_seq(struct snd_emux *emu if (emu->voices) snd_emux_terminate_all(emu); - mutex_lock(&emu->register_mutex); if (emu->client >= 0) { snd_seq_delete_kernel_client(emu->client); emu->client = -1; } - mutex_unlock(&emu->register_mutex); } Patches currently in stable-queue which might be from tiwai@suse.de are queue-4.0/alsa-emux-fix-mutex-deadlock-at-unloading.patch queue-4.0/alsa-hda-add-mute-led-mode-control-to-thinkpad.patch queue-4.0/alsa-emu10k1-emu10k2-32-bit-dma-mode.patch queue-4.0/alsa-emux-fix-mutex-deadlock-in-oss-emulation.patch queue-4.0/alsa-hda-fix-mute-led-fixed-mode.patch queue-4.0/alsa-emu10k1-fix-card-shortname-string-buffer-overflow.patch