Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp472244imu; Fri, 11 Jan 2019 03:46:40 -0800 (PST) X-Google-Smtp-Source: ALg8bN5nzKh0NJRdW2cAeVJuuo5DJyGZUcRbx8OebC+LcX4adm5onSBEsq7mdxKK0dGtGGxpM19B X-Received: by 2002:a63:2e88:: with SMTP id u130mr13302975pgu.9.1547207200906; Fri, 11 Jan 2019 03:46:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547207200; cv=none; d=google.com; s=arc-20160816; b=JKmXjXpQQVu8XiBrX2pzc87c3OB/UfGHmRyZtcXMrS2ia1j4xNXwkaqh8KuCGJ1W1N cG8iaKJmRqa7RIRkSTOHQmKo2ZnabQhekROPwjHwK+rMnDYZ82HoxSydbhc1lYPgTWL9 HnoNHW4CG5mt8M3+DTJ8RSxfo0fdI0r3tGCcYpzGNosyJjio5+1xSQ0pnijswQHkhQ9D gciwmB/htQ1Y5LW/amOvLWAqYUsmMNHAxIcFIPykiX9/IMgrOLS9jz7sA1g99NqudnA7 f07AP/c9uYH5V6Wabph8RX/Pj4i0zqmtWS5HHAfJXiugmpZTHu5H71KdcVfAXTsX8C22 hQNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=gMLQcUh8jWXk+CToaS66DcZICaBTQjh7dPSAgQVnCps=; b=Y0OWlJGuis6QMeb9eGzwdAZUgBxTCWRqrFyN9SDQlJ8wpyvW4fymECX56fbKKNFLmA evrrN/nzsqOYnF8bOuRcPWKuMGw8RElhqpzEawDnlEpUFGkbGj1D1dOxt5Vv9+icZSGy qbMzKG2jomxx6IdDhyf/Apn6wZ+hD0c9xZmMcZvVwuJ+8nyN+xCYQHa4+pcH7hD94wlJ 7MHXKbW8ZjvgRkJjbFfF8VsGKVUkB4WmgHcznML8IQIWceFx+ivUFSP45+rU1OG1+CV0 jNRRmCWNoRVsHMuALvX6WHSnOoUcMyKxrew5zn2iQgKO48OpVu7Pc0teAv620kf1TkvG cBRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=lArhwKKS; 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 y13si8765286pgj.157.2019.01.11.03.46.25; Fri, 11 Jan 2019 03:46:40 -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; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=lArhwKKS; 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 S1729878AbfAKIXv (ORCPT + 99 others); Fri, 11 Jan 2019 03:23:51 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:60412 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728682AbfAKIXv (ORCPT ); Fri, 11 Jan 2019 03:23:51 -0500 Received: from localhost.localdomain (unknown [96.44.9.117]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 947B8547; Fri, 11 Jan 2019 09:23:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1547195028; bh=bEB1oYi+scrgN1ZJyJRgkEbLbXQItSsxMVr+gMQfUgQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lArhwKKSHe6KwBEednGNsaGZQxO7fnoZFjj2RS8eTd8zzHwKhAwr+/weF/33OD8Co Rqc0wbQ2QcAt5wRHvpD7u8wdm1T9g0bvYYejiP+YEQSvUM7y5trdEHGgksX24N2edK idMWT8wj1DAb4TtdQjDJT855wk+2RZXNuSxRN8Eg= Date: Fri, 11 Jan 2019 03:23:40 -0500 From: Paul Elder To: Alan Stern Cc: laurent.pinchart@ideasonboard.com, kieran.bingham@ideasonboard.com, b-liu@ti.com, rogerq@ti.com, balbi@kernel.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 4/6] usb: gadget: add mechanism to specify an explicit status stage Message-ID: <20190111082340.GB32268@localhost.localdomain> References: <20190109070856.27460-5-paul.elder@ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Paul