public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.de>
To: Dave Jones <davej@redhat.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>
Subject: Re: lockdep trace when unplugging usb audio (.39rc4)
Date: Wed, 20 Apr 2011 12:32:44 +0200	[thread overview]
Message-ID: <201104201232.44320.oneukum@suse.de> (raw)
In-Reply-To: <20110419180745.GA438@redhat.com>

[-- Attachment #1: Type: Text/Plain, Size: 152 bytes --]

Am Dienstag, 19. April 2011, 20:07:45 schrieb Dave Jones:
> I get this trace when I unplug my NuForce uDAC.

Please test this patch.

	Regards
		Oliver

[-- Attachment #2: 0001-usb-audio-fix-potential-deadlock-on-unplug.patch --]
[-- Type: text/x-patch, Size: 1246 bytes --]

From 24d036ccb418d7cfa5a821d5a70b3d3da2d63bb3 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oliver@neukum.org>
Date: Wed, 20 Apr 2011 12:29:22 +0200
Subject: [PATCH] usb-audio:fix potential deadlock on unplug

Decrease the scope of a lock to fix a deadlock

Signed-off-by: Oliver Neukum <oneukum@suse.de>
---
 sound/usb/card.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/sound/usb/card.c b/sound/usb/card.c
index a90662a..1d3d9f0 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -554,6 +554,7 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr)
 	mutex_lock(&chip->shutdown_mutex);
 	chip->shutdown = 1;
 	chip->num_interfaces--;
+	mutex_unlock(&chip->shutdown_mutex);
 	if (chip->num_interfaces <= 0) {
 		snd_card_disconnect(card);
 		/* release the pcm resources */
@@ -569,11 +570,9 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr)
 			snd_usb_mixer_disconnect(p);
 		}
 		usb_chip[chip->index] = NULL;
-		mutex_unlock(&chip->shutdown_mutex);
 		mutex_unlock(&register_mutex);
 		snd_card_free_when_closed(card);
 	} else {
-		mutex_unlock(&chip->shutdown_mutex);
 		mutex_unlock(&register_mutex);
 	}
 }
-- 
1.7.1


  reply	other threads:[~2011-04-20 10:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-19 18:07 lockdep trace when unplugging usb audio (.39rc4) Dave Jones
2011-04-20 10:32 ` Oliver Neukum [this message]
2011-04-20 10:43   ` Takashi Iwai
2011-04-21 17:31 ` Maciej Rutecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201104201232.44320.oneukum@suse.de \
    --to=oneukum@suse.de \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox