From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:43856 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946267AbbHGVOg (ORCPT ); Fri, 7 Aug 2015 17:14:36 -0400 Subject: Patch "ALSA: pcm: Fix lockdep warning with nonatomic PCM ops" has been added to the 4.1-stable tree To: tiwai@suse.de Cc: , From: Date: Fri, 07 Aug 2015 14:14:34 -0700 Message-ID: <143898207415665@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: pcm: Fix lockdep warning with nonatomic PCM ops to the 4.1-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-pcm-fix-lockdep-warning-with-nonatomic-pcm-ops.patch and it can be found in the queue-4.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 67756e3191c90e7c0b94b8b2fb63de255b6cd337 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 17 Jul 2015 15:22:33 +0200 Subject: ALSA: pcm: Fix lockdep warning with nonatomic PCM ops From: Takashi Iwai commit 67756e3191c90e7c0b94b8b2fb63de255b6cd337 upstream. With the nonatomic PCM ops, the system may spew lockdep warnings like: ============================================= [ INFO: possible recursive locking detected ] 4.2.0-rc1-jeejaval3 #12 Not tainted --------------------------------------------- aplay/4029 is trying to acquire lock: (snd_pcm_link_rwsem){.+.+.+}, at: [] snd_pcm_stream_lock+0x43/0x60 but task is already holding lock: (snd_pcm_link_rwsem){.+.+.+}, at: [] snd_pcm_action_nonatomic+0x29/0x80 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(snd_pcm_link_rwsem); lock(snd_pcm_link_rwsem); Although this is false-positive as the rwsem is taken always as read-only for these code paths, it's certainly annoying to see this at any occasion. A simple fix is to use down_read_nested() in snd_pcm_stream_lock() that can be called inside another lock. Reported-by: Vinod Koul Reported-by: Jeeja Kp Tested-by: Jeeja Kp Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/core/pcm_native.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -85,7 +85,7 @@ static DECLARE_RWSEM(snd_pcm_link_rwsem) void snd_pcm_stream_lock(struct snd_pcm_substream *substream) { if (substream->pcm->nonatomic) { - down_read(&snd_pcm_link_rwsem); + down_read_nested(&snd_pcm_link_rwsem, SINGLE_DEPTH_NESTING); mutex_lock(&substream->self_group.mutex); } else { read_lock(&snd_pcm_link_rwlock); Patches currently in stable-queue which might be from tiwai@suse.de are queue-4.1/alsa-line6-fix-ebusy-error-during-active-monitoring.patch queue-4.1/alsa-hda-add-new-amd-pci-ids-with-proper-driver-caps.patch queue-4.1/alsa-usb-audio-add-midi-support-for-steinberg-mi2-mi4.patch queue-4.1/alsa-hda-apply-fixup-for-another-toshiba-satellite-s50d.patch queue-4.1/alsa-pcm-fix-lockdep-warning-with-nonatomic-pcm-ops.patch queue-4.1/alsa-hda-add-new-gpu-codec-id-0x10de007d-to-snd-hda.patch queue-4.1/alsa-usb-audio-add-db-range-mapping-for-some-devices.patch queue-4.1/alsa-hda-add-headset-mic-support-for-acer-aspire-v5-573g.patch queue-4.1/alsa-hda-apply-a-fixup-to-dell-vostro-5480.patch queue-4.1/alsa-hda-fix-macbook-pro-5-2-quirk.patch queue-4.1/alsa-hda-add-headset-mic-pin-quirk-for-a-dell-device.patch