From patchwork Wed Apr 13 19:24:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Vacura X-Patchwork-Id: 561424 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22ADDC433EF for ; Wed, 13 Apr 2022 19:24:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238290AbiDMT1C (ORCPT ); Wed, 13 Apr 2022 15:27:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238269AbiDMT06 (ORCPT ); Wed, 13 Apr 2022 15:26:58 -0400 Received: from mail1.bemta33.messagelabs.com (mail1.bemta33.messagelabs.com [67.219.247.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01F1A488A7; Wed, 13 Apr 2022 12:24:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=motorola.com; s=Selector; t=1649877873; i=@motorola.com; bh=BA0XI/pY4GAqU+H82UiMPh8CZ4CTNm1Fwle+HxTdIKk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding; b=c9zMeUlyBIthifOIOb+QCShAIDN7d5h3USKGQZEAypv2QuU4Zq2SR3U7hAFZHXDc9 XM7v8l1IJF6I7fKapIKhfbsS6yQ/Hms//GI+at+uTZa6cdP7Xi+3mgLytDZwx6/FQK uzqaHbeyfAuPwtlAoNpjgXlW0ubRKQ15/rC7k6cWS7lpDQksPYWW6i6B/StZI82Gfl 8/Es6Zhvr6Ve9wNk2fXLMbhr6NXuGSlSA/Q5S0iDlh5ocGbOqmb0fjNmSauT7OEbGr ExPiB4WlLbDU+a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LUmK3570qFw5RYijMS DbWYi4oTARCYCRxAAwAA X-Env-Sender: w36195@motorola.com X-Msg-Ref: server-2.tower-715.messagelabs.com!1649877872!29433!1 X-Originating-IP: [104.232.228.21] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.85.8; banners=-,-,- X-VirusChecked: Checked Received: (qmail 31032 invoked from network); 13 Apr 2022 19:24:32 -0000 Received: from unknown (HELO va32lpfpp01.lenovo.com) (104.232.228.21) by server-2.tower-715.messagelabs.com with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 13 Apr 2022 19:24:32 -0000 Received: from ilclmmrp01.lenovo.com (ilclmmrp01.mot.com [100.65.83.165]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by va32lpfpp01.lenovo.com (Postfix) with ESMTPS id 4Kdswc3Qsdzf6nb; Wed, 13 Apr 2022 19:24:32 +0000 (UTC) Received: from p1g3.. (unknown [10.45.4.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: w36195) by ilclmmrp01.lenovo.com (Postfix) with ESMTPSA id 4Kdswc0t4XzbvDf; Wed, 13 Apr 2022 19:24:32 +0000 (UTC) From: Dan Vacura To: linux-usb@vger.kernel.org Cc: Michael Grzeschik , Dan Vacura , Laurent Pinchart , Felipe Balbi , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: [PATCH] usb: gadget: uvc: remove pause flag use Date: Wed, 13 Apr 2022 14:24:02 -0500 Message-Id: <20220413192402.26063-1-w36195@motorola.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The pause flag doesn't appear to serve a purpose as it is possible for the pump worker thread to not be running when new buffers are queued. Before the following change was introduced: "43cd0023872e usb: gadget: uvc_video: add worker to handle the frame pumping", the pause flag status was discarded and never returned. This masked a current issues of the userspace receiving non-zero values (considered unsuccessful) and prevents trace_v4l2_qbuf() from being called. Signed-off-by: Dan Vacura --- drivers/usb/gadget/function/uvc_queue.c | 15 +-------------- drivers/usb/gadget/function/uvc_queue.h | 1 - 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/usb/gadget/function/uvc_queue.c b/drivers/usb/gadget/function/uvc_queue.c index d852ac9e47e7..8fd2f4a3dc4c 100644 --- a/drivers/usb/gadget/function/uvc_queue.c +++ b/drivers/usb/gadget/function/uvc_queue.c @@ -185,18 +185,7 @@ int uvcg_query_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf) int uvcg_queue_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf) { - unsigned long flags; - int ret; - - ret = vb2_qbuf(&queue->queue, NULL, buf); - if (ret < 0) - return ret; - - spin_lock_irqsave(&queue->irqlock, flags); - ret = (queue->flags & UVC_QUEUE_PAUSED) != 0; - queue->flags &= ~UVC_QUEUE_PAUSED; - spin_unlock_irqrestore(&queue->irqlock, flags); - return ret; + return vb2_qbuf(&queue->queue, NULL, buf); } /* @@ -362,8 +351,6 @@ struct uvc_buffer *uvcg_queue_head(struct uvc_video_queue *queue) if (!list_empty(&queue->irqqueue)) buf = list_first_entry(&queue->irqqueue, struct uvc_buffer, queue); - else - queue->flags |= UVC_QUEUE_PAUSED; return buf; } diff --git a/drivers/usb/gadget/function/uvc_queue.h b/drivers/usb/gadget/function/uvc_queue.h index 05360a0767f6..42aaf8b227dd 100644 --- a/drivers/usb/gadget/function/uvc_queue.h +++ b/drivers/usb/gadget/function/uvc_queue.h @@ -43,7 +43,6 @@ struct uvc_buffer { #define UVC_QUEUE_DISCONNECTED (1 << 0) #define UVC_QUEUE_DROP_INCOMPLETE (1 << 1) -#define UVC_QUEUE_PAUSED (1 << 2) struct uvc_video_queue { struct vb2_queue queue;