Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp716095imu; Fri, 11 Jan 2019 07:53:19 -0800 (PST) X-Google-Smtp-Source: ALg8bN60MSWjlLStz49AVvuLaE7nCACO4JQFBKE22RTWr6j4hihEdaq0FL0fD5yxbZgx229kD2WQ X-Received: by 2002:a62:2f06:: with SMTP id v6mr15275489pfv.216.1547221999022; Fri, 11 Jan 2019 07:53:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547221999; cv=none; d=google.com; s=arc-20160816; b=yLMp37AINoPt09dLf7AF2gbaQMvlUhvheeKJUuOcRdRaaFShOWsHa4K8u1BXA2Twxz IOI09lQgoEq0B5ZrwBCZF3K+63SXwZpF7LUgVnqPYCbINAh6qCwUtjRO33iypp3R5Z2L 0SAy+7NtjS9o265/vEBh9PTsmfCdpTxSzBMbP63jiXJut8UUYpqCG0QeMjMns3xO4lXk favN1NtRziM9fxE3LW3RXNHveKo9b/2YrS2yykn5NNMaqxkVLpN2oou6F4tyN24wie7L 7UxWado7+IDkWG96Zg+QW/6MX+/YOTHN0ya0G+lg+mnjvGnl2c+T6Qb4C6G724J2eMim lD/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=NGrLSUi9jrIYQ2XR4GCfCLKqLf/2bAauZ3kthWAXjBk=; b=tdGNu6H710qed07sOiJAjb48JUYpoLNR7QczQLGOcF6VamH9G98gj8LsTagKfHDsRH mqPywBMEWcB0/L8abDXWpRXmSPASqdVzNlvZ0bECCVpNDimxlQtG4iMncMlU4T1XTvlx NtekhXWnw2U7Aq8sx7HO4IT4pL3DoU2wWSMqsu2Mcr0vfEspZLHgqG4nlW0Lk5CGrPZy A1OtOjxJ9jksSLmvJ8wQ/wujJSabbffvOVK7ah5DbYLeCDgnqmQxWH44FRdAYrObj8ov xq/umsa6kMftZVD8S6sPkGtQT9pjNFP+2+i+C0xts0c1WsIT2TY8ZqyJ3j2OzAi7FXF/ Bk8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e21si72171342pgg.571.2019.01.11.07.53.02; Fri, 11 Jan 2019 07:53:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732686AbfAKPuM (ORCPT + 99 others); Fri, 11 Jan 2019 10:50:12 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:44136 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1730850AbfAKPuM (ORCPT ); Fri, 11 Jan 2019 10:50:12 -0500 Received: (qmail 3848 invoked by uid 2102); 11 Jan 2019 10:50:11 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 11 Jan 2019 10:50:11 -0500 Date: Fri, 11 Jan 2019 10:50:11 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Paul Elder cc: laurent.pinchart@ideasonboard.com, , , , , , , Subject: Re: [PATCH v5 4/6] usb: gadget: add mechanism to specify an explicit status stage In-Reply-To: <20190111082340.GB32268@localhost.localdomain> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 11 Jan 2019, Paul Elder wrote: > On Wed, Jan 09, 2019 at 02:06:31PM -0500, Alan Stern wrote: > > On Wed, 9 Jan 2019, Paul Elder wrote: > > > > > A usb gadget function driver may or may not want to delay the status > > > stage of a control OUT request. An instance where it might want to is to > > > asynchronously validate the data of a class-specific request. > > > > > > A function driver that wants an explicit status stage should set the > > > newly added explicit_status flag of the usb_request corresponding to the > > > data stage. Later on, the function driver can explicitly complete the > > > status stage by enqueueing a usb_request for ACK, or calling > > > usb_ep_set_halt() for STALL. > > > > > > To support both explicit and implicit status stages, a UDC driver must > > > call the newly added usb_gadget_control_complete function right before > > > calling usb_gadget_giveback_request. To support the explicit status > > > stage, it might then check what stage the usb_request was queued in, and > > > for control IN ACK the host's zero-length data packet, or for control > > > OUT send a zero-length DATA1 ACK packet. > > > > > > Signed-off-by: Paul Elder > > > v4 Acked-by: Alan Stern > > > v1 Reviewed-by: Laurent Pinchart > > > > This looks good and has passed my tests so far. > > Good! Thank you :) > > > Can you check your uvc > > changes using dummy_hcd with the patch below? > > I'm not sure what to make of the test results. I get the same results > with or without the patch. Which I guess makes sense... in dummy_queue, > this is getting hit when the uvc function driver tries to complete the > delayed status: > > req = usb_request_to_dummy_request(_req); > if (!_req || !list_empty(&req->queue) || !_req->complete) > return -EINVAL; > > So the delayed/explicit status stage is never completed, afaict. I presume you are hitting the !list_empty(&req->queue) test, yes? The other two tests are trivial. Triggering the !list_empty() test means the request has already been submitted and not yet completed. This probably indicates there is a bug in the uvc function driver code. Alan Stern