Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932420Ab0BQO3l (ORCPT ); Wed, 17 Feb 2010 09:29:41 -0500 Received: from cantor2.suse.de ([195.135.220.15]:50283 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753043Ab0BQO3j (ORCPT ); Wed, 17 Feb 2010 09:29:39 -0500 Date: Wed, 17 Feb 2010 15:29:37 +0100 Message-ID: From: Takashi Iwai To: Ed Tomlinson Cc: "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: Re: [LOCKDEP] 33-rc8 Running aplay with pulse as the default In-Reply-To: <201002170816.33209.edt@aei.ca> References: <201002160819.21595.edt@aei.ca> <201002170816.33209.edt@aei.ca> User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.1 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3576 Lines: 107 At Wed, 17 Feb 2010 08:16:32 -0500, Ed Tomlinson wrote: > > On Tuesday 16 February 2010 08:37:46 Takashi Iwai wrote: > > > Thanks for the patch. It helps in that it eliminates the opps but lockdep still triggers and aplay still fails. > > > Here is the new traceback. > > > > Hmm, fixing this isn't so trivial. The same problem occurs on other > > subsystems like NFS over years. And it's still there, AFAIK. > > The mmap mutex appears suddenly in the strange code path at close. > > > > The patch below might fix, but I'm not 100% sure whether this has no > > side effect. > > > > Anyway, I doubt very much it being a regression. There is no change > > in ALSA core side, and also in V4L em28xx code. Maybe the lockdep > > wasn't triggered by some reason. And, this lockdep warning is almost > > harmless... > > Takashi, > > The second patch eliminating the lock causes oppes every time (one follows just in case > its helpful). Are you sure? The patch should causes a compile error, so you must have patched manually in a wrong place ;) Try the patch below (again untested, though). thanks, Takashi --- diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c index bd78338..c51e623 100644 --- a/drivers/media/video/em28xx/em28xx-audio.c +++ b/drivers/media/video/em28xx/em28xx-audio.c @@ -301,23 +301,12 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream) /* Sets volume, mute, etc */ dev->mute = 0; - mutex_lock(&dev->lock); ret = em28xx_audio_analog_set(dev); - mutex_unlock(&dev->lock); if (ret < 0) goto err; runtime->hw = snd_em28xx_hw_capture; - if (dev->alt == 0 && dev->adev.users == 0) { - int errCode; - dev->alt = 7; - errCode = usb_set_interface(dev->udev, 0, 7); - dprintk("changing alternate number to 7\n"); - } - - mutex_lock(&dev->lock); dev->adev.users++; - mutex_unlock(&dev->lock); snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); dev->adev.capture_pcm_substream = substream; @@ -336,7 +325,6 @@ static int snd_em28xx_pcm_close(struct snd_pcm_substream *substream) dprintk("closing device\n"); dev->mute = 1; - mutex_lock(&dev->lock); dev->adev.users--; em28xx_audio_analog_set(dev); if (substream->runtime->dma_area) { @@ -344,7 +332,6 @@ static int snd_em28xx_pcm_close(struct snd_pcm_substream *substream) vfree(substream->runtime->dma_area); substream->runtime->dma_area = NULL; } - mutex_unlock(&dev->lock); return 0; } @@ -352,6 +339,7 @@ static int snd_em28xx_pcm_close(struct snd_pcm_substream *substream) static int snd_em28xx_hw_capture_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params) { + struct em28xx *dev = snd_pcm_substream_chip(substream); unsigned int channels, rate, format; int ret; @@ -366,6 +354,14 @@ static int snd_em28xx_hw_capture_params(struct snd_pcm_substream *substream, /* TODO: set up em28xx audio chip to deliver the correct audio format, current default is 48000hz multiplexed => 96000hz mono which shouldn't matter since analogue TV only supports mono */ + + if (dev->alt == 0 && dev->adev.users == 1) { + int errCode; + dev->alt = 7; + errCode = usb_set_interface(dev->udev, 0, 7); + dprintk("changing alternate number to 7\n"); + } + return 0; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/