From patchwork Wed Jun 20 15:21:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Sewior X-Patchwork-Id: 10477705 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DC949600F6 for ; Wed, 20 Jun 2018 15:21:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE1BD28E7D for ; Wed, 20 Jun 2018 15:21:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C100B28F48; Wed, 20 Jun 2018 15:21:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D59B28F47 for ; Wed, 20 Jun 2018 15:21:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754101AbeFTPV0 (ORCPT ); Wed, 20 Jun 2018 11:21:26 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:60679 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753885AbeFTPVZ (ORCPT ); Wed, 20 Jun 2018 11:21:25 -0400 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1fVevC-0007VN-Gb; Wed, 20 Jun 2018 17:21:22 +0200 Date: Wed, 20 Jun 2018 17:21:22 +0200 From: Sebastian Andrzej Siewior To: Laurent Pinchart Cc: linux-media@vger.kernel.org, Mauro Carvalho Chehab , linux-usb@vger.kernel.org, tglx@linutronix.de Subject: [PATCH 27/27 v2] media: uvcvideo: use usb_fill_int_urb() for the ->intarval value Message-ID: <20180620152122.ebstiwvdpbhgsbrs@linutronix.de> References: <20180620110105.19955-1-bigeasy@linutronix.de> <3925059.Md1u3KRT1n@avalon> <20180620132144.5cdu2ydlqre4ijg6@linutronix.de> <18211658.4PQ3SEps0f@avalon> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <18211658.4PQ3SEps0f@avalon> User-Agent: NeoMutt/20180512 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP uvc_init_video_isoc() assigns urb->interval = p->desc.bInterval; for the interval. This is correct for FS/LS. For HS/SS the bInterval value is using a logarithmic encoding. The usb_fill_int_urb() function takes this into account while settings the ->interval member. ->start_frame is set to -1 on init and should be filled by the HC on completion of the URB. Use usb_fill_int_urb() to fill the members of the struct urb. Cc: Laurent Pinchart Cc: Mauro Carvalho Chehab Signed-off-by: Sebastian Andrzej Siewior --- drivers/media/usb/uvc/uvc_video.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c index a88b2e51a666..79e7a827ed44 100644 --- a/drivers/media/usb/uvc/uvc_video.c +++ b/drivers/media/usb/uvc/uvc_video.c @@ -1619,21 +1619,19 @@ static int uvc_init_video_isoc(struct uvc_streaming *stream, return -ENOMEM; } - urb->dev = stream->dev->udev; - urb->context = stream; - urb->pipe = usb_rcvisocpipe(stream->dev->udev, - ep->desc.bEndpointAddress); + usb_fill_int_urb(urb, stream->dev->udev, + usb_rcvisocpipe(stream->dev->udev, + ep->desc.bEndpointAddress), + stream->urb_buffer[i], size, + uvc_video_complete, stream, + ep->desc.bInterval); #ifndef CONFIG_DMA_NONCOHERENT urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP; urb->transfer_dma = stream->urb_dma[i]; #else urb->transfer_flags = URB_ISO_ASAP; #endif - urb->interval = ep->desc.bInterval; - urb->transfer_buffer = stream->urb_buffer[i]; - urb->complete = uvc_video_complete; urb->number_of_packets = npackets; - urb->transfer_buffer_length = size; for (j = 0; j < npackets; ++j) { urb->iso_frame_desc[j].offset = j * psize;