From patchwork Wed Sep 23 21:06:57 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Isely X-Patchwork-Id: 49603 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8NL6xtk019807 for ; Wed, 23 Sep 2009 21:06:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752337AbZIWVGy (ORCPT ); Wed, 23 Sep 2009 17:06:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751983AbZIWVGy (ORCPT ); Wed, 23 Sep 2009 17:06:54 -0400 Received: from cnc.isely.net ([64.81.146.143]:52278 "EHLO cnc.isely.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751767AbZIWVGx (ORCPT ); Wed, 23 Sep 2009 17:06:53 -0400 Received: from cnc.isely.net (cnc.isely.net [::ffff:192.168.23.2]) (IDENT: isely, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by cnc.isely.net with esmtp; Wed, 23 Sep 2009 16:06:57 -0500 id 00000000001261BC.000000004ABA8DF1.000006A8 Date: Wed, 23 Sep 2009 16:06:57 -0500 (CDT) From: Mike Isely To: Dean Anderson cc: linux-media@vger.kernel.org, Mauro Carvalho Chehab , Mike Isely Subject: [PATCH] s2255drv: Don't conditionalize video buffer completion on waiting processes Message-ID: User-Agent: Alpine 1.10 (DEB 962 2008-03-14) Mime-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org # HG changeset patch # User Mike Isely # Date 1253739604 18000 # Node ID 522a74147753ba59c7f45e368439928090a286f2 # Parent e349075171ddf939381fad432c23c1269abc4899 s2255drv: Don't conditionalize video buffer completion on waiting processes From: Mike Isely The s2255 driver had logic which aborted processing of a video frame if there was no process waiting on the video buffer in question. That simply doesn't work when the application is doing things in an asynchronous manner. If the application went to the trouble to queue the buffer in the first place, then the driver should always attempt to complete it - even if the application at that moment has its attention turned elsewhere. Applications which always blocked waiting for I/O on the capture device would not have been affected by this. Applications which *mostly* blocked waiting for I/O on the capture device probably only would have been somewhat affected (frame lossage, at a rate which goes up as the application blocks less). Applications which never blocked on the capture device (e.g. polling only) however would never have been able to receive any video frames, since in that case this "is anyone waiting on this?" check on the buffer never would have evalutated true. This patch just deletes that harmful check against the buffer's wait queue. Priority: high Signed-off-by: Mike Isely diff -r e349075171dd -r 522a74147753 linux/drivers/media/video/s2255drv.c --- a/linux/drivers/media/video/s2255drv.c Mon Sep 21 10:42:22 2009 -0500 +++ b/linux/drivers/media/video/s2255drv.c Wed Sep 23 16:00:04 2009 -0500 @@ -599,11 +599,6 @@ buf = list_entry(dma_q->active.next, struct s2255_buffer, vb.queue); - if (!waitqueue_active(&buf->vb.done)) { - /* no one active */ - rc = -1; - goto unlock; - } list_del(&buf->vb.queue); do_gettimeofday(&buf->vb.ts); dprintk(100, "[%p/%d] wakeup\n", buf, buf->vb.i);