From patchwork Sun Aug 21 12:32:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Rankin X-Patchwork-Id: 279 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Sun, 21 Aug 2011 12:32:23 +0000 Received: from casper.infradead.org [85.118.1.10] by gaivota with IMAP (fetchmail-6.3.20) for (single-drop); Sun, 21 Aug 2011 05:32:36 -0700 (PDT) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Qv7CR-0006Ek-21; Sun, 21 Aug 2011 12:32:23 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754354Ab1HUMcO (ORCPT + 1 other); Sun, 21 Aug 2011 08:32:14 -0400 Received: from nm3-vm0.bt.bullet.mail.ird.yahoo.com ([212.82.108.88]:34460 "HELO nm3-vm0.bt.bullet.mail.ird.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754307Ab1HUMcN (ORCPT ); Sun, 21 Aug 2011 08:32:13 -0400 Received: from [212.82.108.231] by nm3.bt.bullet.mail.ird.yahoo.com with NNFMP; 21 Aug 2011 12:32:12 -0000 Received: from [212.82.108.226] by tm4.bt.bullet.mail.ird.yahoo.com with NNFMP; 21 Aug 2011 12:32:12 -0000 Received: from [127.0.0.1] by omp1003.bt.mail.ird.yahoo.com with NNFMP; 21 Aug 2011 12:32:12 -0000 X-Yahoo-Newman-Id: 411473.54839.bm@omp1003.bt.mail.ird.yahoo.com Received: (qmail 43833 invoked from network); 21 Aug 2011 12:32:12 -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=DXXo6DEL0rRRdHrdb0NvxfgrOHYSFxGjEYBx4byKO4jtZP6bXdEuMbKBZPDftqgSaB3l2rdGMpBqpy9CJDMDWXl/I6YiNWBlRAaTyH9V6MqSlNNyQk+g8nqNQcnMPXrVoXOBY7Yubse4uCmOFO6iM6B+AvNWfOvPwZlHW8Gk7T8= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1313929932; bh=ybo6uBp3dS4J3yjlNRATOG9lPj9+ksAP/W84FCL090w=; 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=KyRS09WMvxuUyCmIWZaaQxP6QxV1HxuSYq5iWb+opvZj+dQDQ85lCk0ZpqVWtR80QTKhDibjT+FSLZDLg9O0rvX9ypaMjVSGIMVzFhqnxSxlxTLJaJgRSyAkDvY8HPBIQnNWwp6khHA93qgcYbzoov9wScZwhd8wpulej9RL8Gk= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: UTi4lZ4VM1m4dVf4ZqxfyHNW5PtDn50x3AXfq337VBnjAfZ 9.f3BkRqwr.HBDdBzNMPIlyoOv.O6GY4x5fp2YpHy.3Mxgz0JqVB6_U7.PRR tZiqanvnfK3PEQtZGjyOTcBN34LOxdzObLF6Njbocp6ct1z4hWYQwT3739fx _1Cz3FnZgh4UZaep5lEvguEUAis7H8IfMKK_Np6zJSa4LLzrsEsNJFYLJWeY iYclwU7G2GOfitVoXZMt5ggMqQP9_KcK7NDWAZPIIy_rTjwT2_wNGL08rZmr XG.Pt5ufxCopllJD3CSmukxTXm_0JCdWeUKtr1Sy2zTCjik.WeXI6U_dj.aL HjVtMyj7C7UHueQWLpfsxyQTikH82lLQI4GDkp3vFasshXIFRwjsD_CkenrZ 5YpI- X-Yahoo-SMTP: dMK34oyswBBlfKesWTI5ovDjFOUFE6shtILt.ZXnUEjQHhWq Received: from wellhouse.underworld (rankincj@86.182.224.62 with login) by smtp820.mail.ukl.yahoo.com with SMTP; 21 Aug 2011 12:32:11 +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 p7LCW8UF013980 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 21 Aug 2011 13:32:10 +0100 Message-ID: <4E50FAC7.6080807@yahoo.com> Date: Sun, 21 Aug 2011 13:32:07 +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: Re: [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 It occurred to me this morning that since we're no longer supposed to be holding the device lock when taking the device list lock, then the em28xx_usb_disconnect() function needs changing too. 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-21 13:16:43.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); @@ -3191,10 +3193,10 @@ em28xx_release_resources(dev); } - em28xx_close_extension(dev); - mutex_unlock(&dev->lock); + em28xx_close_extension(dev); + if (!dev->users) { kfree(dev->alt_max_pkt_size); kfree(dev);