From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760701AbZF2QJw (ORCPT ); Mon, 29 Jun 2009 12:09:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758313AbZF2QJr (ORCPT ); Mon, 29 Jun 2009 12:09:47 -0400 Received: from cantor2.suse.de ([195.135.220.15]:37160 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755468AbZF2QJr (ORCPT ); Mon, 29 Jun 2009 12:09:47 -0400 Date: Mon, 29 Jun 2009 18:09:49 +0200 Message-ID: From: Takashi Iwai To: Jiri Slaby Cc: perex@perex.cz, akpm@linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] OSS: mpu401, fix deadlock In-Reply-To: <1246291414-3563-1-git-send-email-jirislaby@gmail.com> References: <1246291414-3563-1-git-send-email-jirislaby@gmail.com> User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 Emacs/22.3 (x86_64-suse-linux-gnu) MULE/5.0 (SAKAKI) 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 At Mon, 29 Jun 2009 18:03:34 +0200, Jiri Slaby wrote: > > If somebody cares about oss at all. ... or want to save somebody else's time to find out the same bug :) > -- > mpu401_chk_version is called with a spin lock already held. Don't take it > again. > > Signed-off-by: Jiri Slaby Applied now. Thanks. Takashi > --- > sound/oss/mpu401.c | 16 +++------------- > 1 files changed, 3 insertions(+), 13 deletions(-) > > diff --git a/sound/oss/mpu401.c b/sound/oss/mpu401.c > index 6c0a770..1b2316f 100644 > --- a/sound/oss/mpu401.c > +++ b/sound/oss/mpu401.c > @@ -926,31 +926,21 @@ static struct midi_operations mpu401_midi_operations[MAX_MIDI_DEV]; > static void mpu401_chk_version(int n, struct mpu_config *devc) > { > int tmp; > - unsigned long flags; > > devc->version = devc->revision = 0; > > - spin_lock_irqsave(&devc->lock,flags); > - if ((tmp = mpu_cmd(n, 0xAC, 0)) < 0) > - { > - spin_unlock_irqrestore(&devc->lock,flags); > + tmp = mpu_cmd(n, 0xAC, 0); > + if (tmp < 0) > return; > - } > if ((tmp & 0xf0) > 0x20) /* Why it's larger than 2.x ??? */ > - { > - spin_unlock_irqrestore(&devc->lock,flags); > return; > - } > devc->version = tmp; > > - if ((tmp = mpu_cmd(n, 0xAD, 0)) < 0) > - { > + if ((tmp = mpu_cmd(n, 0xAD, 0)) < 0) { > devc->version = 0; > - spin_unlock_irqrestore(&devc->lock,flags); > return; > } > devc->revision = tmp; > - spin_unlock_irqrestore(&devc->lock,flags); > } > > int attach_mpu401(struct address_info *hw_config, struct module *owner) > -- > 1.6.3.2 >