From patchwork Tue Dec 14 10:36:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 5047 Return-path: Envelope-to: mchehab@gaivota Delivery-date: Tue, 14 Dec 2010 08:39:52 -0200 Received: from mchehab by gaivota with local (Exim 4.72) (envelope-from ) id 1PSSIR-0004lm-Rv for mchehab@gaivota; Tue, 14 Dec 2010 08:39:52 -0200 Received: from casper.infradead.org [85.118.1.10] by gaivota with IMAP (fetchmail-6.3.17) for (single-drop); Tue, 14 Dec 2010 08:39:51 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PSSGa-00075X-Qb; Tue, 14 Dec 2010 10:37:57 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754687Ab0LNKhU (ORCPT + 1 other); Tue, 14 Dec 2010 05:37:20 -0500 Received: from mail-bw0-f45.google.com ([209.85.214.45]:52717 "EHLO mail-bw0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754312Ab0LNKhL (ORCPT ); Tue, 14 Dec 2010 05:37:11 -0500 Received: by bwz16 with SMTP id 16so585044bwz.4 for ; Tue, 14 Dec 2010 02:37:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=f9SsMWsU74gdbL1pELmuXzcO0WglVDdQiYP0+kwGbEE=; b=KDkMXGFL1hxAt/e3TCtI+6ceuytDMoSq88D0dgKSrKMD3+ryFe+tI/e2CdGUcpEuS4 EGvkq6DLZcwKo/Nsxp5QsKhTb/uPXx3wK3VH3XCmeVG81rPLNII22rT9xdqEBxaJXXZu nH/rqmyhhJ9pIStZPles2TUyMSFl+5N9Rkouc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=YgaguaQXQS0mmQXBjAkIFWL6pj1CXdY6oZsBQwolnoyrWP5NqerOeuG5QwglR6ghFo 57pCzVcbvy7ZnetFai7tvusf8XCUoh0mbjBzrOZmyGZhaKg8w+WJHWUAInsoexreRvCZ PA9avWJhijRLJtjZz+AP0usiLQ+dgyhJsBec4= Received: by 10.204.100.70 with SMTP id x6mr4826021bkn.0.1292323030001; Tue, 14 Dec 2010 02:37:10 -0800 (PST) Received: from bicker ([41.138.6.25]) by mx.google.com with ESMTPS id j5sm602986bka.16.2010.12.14.02.37.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 14 Dec 2010 02:37:08 -0800 (PST) Date: Tue, 14 Dec 2010 13:36:58 +0300 From: Dan Carpenter To: Sergej Pupykin Cc: Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: Re: [patch v2] [media] bttv: take correct lock in bttv_open() Message-ID: <20101214103658.GL1620@bicker> References: <20101210033304.GX10623@bicker> <4D01D4BE.1080000@gmail.com> <20101212165812.GG10623@bicker> <4D054FE9.80000@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4D054FE9.80000@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Mauro Carvalho Chehab On Mon, Dec 13, 2010 at 01:42:49AM +0300, Sergej Pupykin wrote: > mutex_lock(&btv->lock); > *fh = btv->init; > mutex_unlock(&btv->lock); > > Probably it is overkill and may be incorrect, but it starts working. > Mauro would be the one to know for sure. > Also I found another issue: tvtime hangs on exit in D-state, so it > looks like there is a problem near bttv_release function or > something like this. Speaking of other bugs in this driver, I submitted a another fix that hasn't been merged yet. I've attached it. Don't know if it's related at all to the other bug you noticed but it can't hurt. regards, dan carpenter From error27@gmail.com Thu Nov 18 07:19:15 2010 Date: Thu, 18 Nov 2010 06:55:59 +0300 From: Dan Carpenter To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] [media] bt8xx: missing unlock in bttv_overlay() MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 Status: RO There is a missing unlock here. This was introduced as part of BKL removal in c37db91fd0d4 "V4L/DVB: bttv: fix driver lock and remove explicit calls to BKL" Signed-off-by: Dan Carpenter diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index 3da6e80..aca755c 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c @@ -2779,16 +2779,14 @@ static int bttv_overlay(struct file *file, void *f, unsigned int on) mutex_lock(&fh->cap.vb_lock); /* verify args */ if (unlikely(!btv->fbuf.base)) { - mutex_unlock(&fh->cap.vb_lock); - return -EINVAL; - } - if (unlikely(!fh->ov.setup_ok)) { + retval = -EINVAL; + } else if (unlikely(!fh->ov.setup_ok)) { dprintk("bttv%d: overlay: !setup_ok\n", btv->c.nr); retval = -EINVAL; } + mutex_unlock(&fh->cap.vb_lock); if (retval) return retval; - mutex_unlock(&fh->cap.vb_lock); } if (!check_alloc_btres_lock(btv, fh, RESOURCE_OVERLAY))