From patchwork Thu Apr 30 15:29:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dean Anderson X-Patchwork-Id: 21074 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 n3UFTmrN005452 for ; Thu, 30 Apr 2009 15:29:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751868AbZD3P3p (ORCPT ); Thu, 30 Apr 2009 11:29:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757984AbZD3P3o (ORCPT ); Thu, 30 Apr 2009 11:29:44 -0400 Received: from mail11a.verio-web.com ([204.202.242.23]:2860 "HELO mail11a.verio-web.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751868AbZD3P3o (ORCPT ); Thu, 30 Apr 2009 11:29:44 -0400 Received: from mx39.stngva01.us.mxservers.net (204.202.242.107) by mail11a.verio-web.com (RS ver 1.0.95vs) with SMTP id 2-0198075382 for ; Thu, 30 Apr 2009 11:29:42 -0400 (EDT) Received: from unknown [161.58.148.76] (EHLO mmm1118.verio-web.com) by va1-mx39.stngva01.us.mxservers.net (mxl_mta-3.1.0-05) with ESMTP id 6e3c9f94.2773797792.550875.00-005.va1-mx39.stngva01.us.mxservers.net (envelope-from ); Thu, 30 Apr 2009 11:29:42 -0400 (EDT) Received: (qmail 36288 invoked from network); 30 Apr 2009 15:29:41 -0000 Received: from unknown (HELO ?10.140.5.9?) (66.15.212.169) by with SMTP; 30 Apr 2009 15:29:41 -0000 Date: Thu, 30 Apr 2009 08:29:38 -0700 (PDT) From: "Dean A." Subject: patch: s2255drv: urb completion routine fixes To: linux-media@vger.kernel.org, video4linux-list@redhat.com, mchehab@infradead.org Message-ID: MIME-Version: 1.0 Content-Disposition: INLINE X-Spam: [F=0.2000000000; S=0.200(2009020301); MH=0.500(2009043018)] X-MAIL-FROM: X-SOURCE-IP: [161.58.148.76] X-SF-Loop: 1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dean Anderson Error count in read pipe completion corrected. URB not resubmitted if shutting down. URB not freed in completion routine if new urb_submit_fails. (URB is freed on shutdown). Signed-off-by: Dean Anderson --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- v4l-dvb-83712d149893/linux/drivers/media/video/s2255drv.c.orig 2009-04-30 07:34:34.000000000 -0700 +++ v4l-dvb-83712d149893/linux/drivers/media/video/s2255drv.c 2009-04-30 07:27:10.000000000 -0700 @@ -2240,8 +2240,10 @@ static void read_pipe_completion(struct return; } status = purb->status; - if (status != 0) { - dprintk(2, "read_pipe_completion: err\n"); + /* if shutting down, do not resubmit, exit immediately */ + if (status == -ESHUTDOWN) { + dprintk(2, "read_pipe_completion: err shutdown\n"); + pipe_info->err_count++; return; } @@ -2250,9 +2252,13 @@ static void read_pipe_completion(struct return; } - s2255_read_video_callback(dev, pipe_info); + if (status == 0) + s2255_read_video_callback(dev, pipe_info); + else { + pipe_info->err_count++; + dprintk(1, "s2255drv: failed URB %d\n", status); + } - pipe_info->err_count = 0; pipe = usb_rcvbulkpipe(dev->udev, dev->read_endpoint); /* reuse urb */ usb_fill_bulk_urb(pipe_info->stream_urb, dev->udev, @@ -2264,7 +2270,6 @@ static void read_pipe_completion(struct if (pipe_info->state != 0) { if (usb_submit_urb(pipe_info->stream_urb, GFP_KERNEL)) { dev_err(&dev->udev->dev, "error submitting urb\n"); - usb_free_urb(pipe_info->stream_urb); } } else { dprintk(2, "read pipe complete state 0\n");