From patchwork Sat Aug 20 22:38:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Rankin X-Patchwork-Id: 1083032 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7KMcDnD004782 for ; Sat, 20 Aug 2011 22:38:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755180Ab1HTWiH (ORCPT ); Sat, 20 Aug 2011 18:38:07 -0400 Received: from nm4-vm0.bt.bullet.mail.ukl.yahoo.com ([217.146.182.229]:39179 "HELO nm4-vm0.bt.bullet.mail.ukl.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1755153Ab1HTWiG (ORCPT ); Sat, 20 Aug 2011 18:38:06 -0400 Received: from [217.146.183.195] by nm4.bt.bullet.mail.ukl.yahoo.com with NNFMP; 20 Aug 2011 22:38:04 -0000 Received: from [217.146.183.205] by tm1.bt.bullet.mail.ukl.yahoo.com with NNFMP; 20 Aug 2011 22:38:04 -0000 Received: from [127.0.0.1] by omp1003.bt.mail.ukl.yahoo.com with NNFMP; 20 Aug 2011 22:38:04 -0000 X-Yahoo-Newman-Id: 182008.19567.bm@omp1003.bt.mail.ukl.yahoo.com Received: (qmail 13767 invoked from network); 20 Aug 2011 22:38:04 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=DKIM-Signature:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type; b=eI1FNHP+ii4Ojx8KN0mGVy3vowRJ7/DSUKTLQGlCAsvL5gRFgqGQ8Q1OCPH/49GTm3Mc+ZvHz0ejkj1Fghjtwlkmdkq5ornpci+S3ENQYQuNd+84apafwMeJMGVXGKzQ3MarwPitI163N+rdnq7F3AtjEZm90JWrEQIVxIy1csQ= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1313879884; bh=78MV754U4MM7X0MDbYtNvliz1vSbvpydy4wulBJ6v4A=; h=X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type; b=bD5IzGqzhX+SCQ6KcA4sTjB8snC0/KMNb6240pvRtYJ0bwrD9alstMLY+xZYzWGWrQtqltlPqN2Rm8d/m3LE0JlbCvnJtIXZwBDiBqTuhQ5rEWkRsJ+hTLRDL3SBnc8Ftvp09rB5UIAf4ALRdU+d63/B1S2nE96SnV9sXKwr1ac= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 03jc9YQVM1kw2CtGF1MTODDkeY3Wq3398DIm.j3j8eA9zwU TszZwgKYRq05kIRDlkUwi5bTT1hu.c.mzLp4.zEPVkOG032UhE5eOE8vAf6V kcjRr9uhhvlqn.U0R8b6kEwpZei8XSYTMGjDseSXfbM7pltxko4rj0OyFxn0 Z2oyblKH2mB0US5Za7kTgGSx7bp5cP2kcar1G_oUvPiJ_aN7B0KU6tCdfS2I lt1aGlr7VYiURCZfQE1Ggi90t.rSWeH2N3rkUfD.yq1sswUalXCiJ0Y66eON k5uzmmZzdhunIZZ3KKtXmB5gCeo6o.QULvWNJ131o9I1JmG3qkBuVt380Aot 3xFLt6gLw7F00KwYD7BEfq0RehXRI5Bjlcm8cjgtx6N3yPjEAgXUmtOyX5iK bUBU- X-Yahoo-SMTP: dMK34oyswBBlfKesWTI5ovDjFOUFE6shtILt.ZXnUEjQHhWq Received: from wellhouse.underworld (rankincj@86.179.35.212 with login) by smtp815.mail.ukl.yahoo.com with SMTP; 20 Aug 2011 22:38:03 +0000 GMT Received: from volcano.underworld (volcano.underworld [192.168.0.3]) by wellhouse.underworld (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p7KMc0gp012527 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 20 Aug 2011 23:38:02 +0100 Message-ID: <4E503748.1090309@yahoo.com> Date: Sat, 20 Aug 2011 23:38:00 +0100 From: Chris Rankin User-Agent: Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20110707 Thunderbird/5.0 MIME-Version: 1.0 To: Mauro Carvalho Chehab CC: Devin Heitmueller , linux-media@vger.kernel.org, Antti Palosaari Subject: [PATCH 1/1] EM28xx - fix deadlock when unplugging and replugging a DVB adapter References: <1313851233.95109.YahooMailClassic@web121704.mail.ne1.yahoo.com> <4E4FCC8D.3070305@redhat.com> In-Reply-To: <4E4FCC8D.3070305@redhat.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 20 Aug 2011 22:38:27 +0000 (UTC) Here's the new patch for the deadlock problem, which releases the device mutex before calling em28xx_init_extension() and then reacquires it afterwards. The locking in dvb_init() is now left alone. Signed-off-by: Chris Rankin --- linux-3.0/drivers/media/video/em28xx/em28xx-cards.c.orig 2011-08-19 00:45:48.000000000 +0100 +++ linux-3.0/drivers/media/video/em28xx/em28xx-cards.c 2011-08-20 23:28:39.000000000 +0100 @@ -2929,7 +2929,9 @@ goto fail_reg_analog_devices; } + mutex_unlock(&dev->lock); em28xx_init_extension(dev); + mutex_lock(&dev->lock); /* Save some power by putting tuner to sleep */ v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);