Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2370744imm; Thu, 11 Oct 2018 09:12:03 -0700 (PDT) X-Google-Smtp-Source: ACcGV60sMpaklBY4X9Yt1B4pA7EbBLlD1CVLvuawvy6rGTU9hUQs03LmiM5mwJ2TcGXsaGIIsoDV X-Received: by 2002:a62:4151:: with SMTP id o78-v6mr2210020pfa.66.1539274323652; Thu, 11 Oct 2018 09:12:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539274323; cv=none; d=google.com; s=arc-20160816; b=cdx9c9+O3Bl2XhCfWnHcnnFzz/xM0ofv+UU3U+S0iQQHAVp7ZJsI5ueZSDxXeO5rw4 JACCQkZYNZUktZe4V5rZv6Ww86N+utK4NT8RwOcriAnCzqVUTtFBJ11RWuYjW9wlpFcR /auLhGEZwxaw0PtZkJ/VeFOEboV1BlRoEto4zh1CItiB6eeDjINZeQX80JPbPqHa5dr/ csLBnkT0rLVpslrcP6EOCjqgN1thZ/TGEWgGAj6zcFtBV5NrAeFWaHr+6PcdIIX/FS5g d7LTpr83R1vfYOTvzKi12zyMyMIspFhAhZkapeu3iOrunLAQ1pYrO4xhzvAcRTmJtcWr +9Ng== 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:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=COIBjSRXuncqLk4tKUhIGNqCFcTvMBFDYo9E7G2MXaA=; b=tEwb1KGBbt3UyZqw3e9oNUNdCYk5JDw4GP/T0KlrSZoSpJoMVe3b7lXzZ0Nhhr9mjR 1DfccF58vZjFfvfH5zOYg7qj57JQkMAsnXiqgOUOvpavIualf9/SWEQo0bIlUCo16XrQ qxqTRhO9H05kG81x/r3UWvOUGDWB61hya6iyaKvZFYiA+4x4YsiyCT9Opp+ocJE5RDy1 l2/eS2qZ24o6wtqziMl7Ed1ZyrwK79M+UaTwW7jDKIi+bP8/m3QH/ole3mOppSIgWnMy IOn/BBD61i3E9XvBFIgkftmi9LHaqH46qrL2j5rYrLQvYEKqwMGZ0HO/BNooikNuQY2M yxjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=VmfEHCy+; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8-v6si27477496pgu.370.2018.10.11.09.11.48; Thu, 11 Oct 2018 09:12:03 -0700 (PDT) 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 header.i=@ti.com header.s=ti-com-17Q1 header.b=VmfEHCy+; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730045AbeJKXiW (ORCPT + 99 others); Thu, 11 Oct 2018 19:38:22 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:46038 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726700AbeJKXiV (ORCPT ); Thu, 11 Oct 2018 19:38:21 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id w9BGALMV064528; Thu, 11 Oct 2018 11:10:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1539274222; bh=COIBjSRXuncqLk4tKUhIGNqCFcTvMBFDYo9E7G2MXaA=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=VmfEHCy+WLkQLOI3LlbBpRwIL9mVvOj6sw85p+ydFAtmo8j/YerxsxR5vIz0Z4IRj +BmxNdDm8kwAq8lGottv8mvLgEOVJHFP4xe7HozAaUNgXwPzhmNtGDvCVeooNhXOvR qv8af2k/6zf6eLe205C6cwa43GCwouB05yhGVBrg= Received: from DLEE111.ent.ti.com (dlee111.ent.ti.com [157.170.170.22]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9BGAL6D019590; Thu, 11 Oct 2018 11:10:21 -0500 Received: from DLEE109.ent.ti.com (157.170.170.41) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Thu, 11 Oct 2018 11:10:21 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Thu, 11 Oct 2018 11:10:21 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9BGALwx012576; Thu, 11 Oct 2018 11:10:21 -0500 Date: Thu, 11 Oct 2018 11:10:21 -0500 From: Bin Liu To: Paul Elder CC: , , , , , , , Subject: Re: [PATCH 4/6] usb: gadget: add functions to signal udc driver to delay status stage Message-ID: <20181011161021.GB8763@uda0271908> Mail-Followup-To: Bin Liu , Paul Elder , laurent.pinchart@ideasonboard.com, kieran.bingham@ideasonboard.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, balbi@kernel.org, stern@rowland.harvard.edu, rogerq@ti.com References: <20181010024903.1633-1-paul.elder@ideasonboard.com> <20181010024903.1633-5-paul.elder@ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20181010024903.1633-5-paul.elder@ideasonboard.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, Oct 09, 2018 at 10:49:01PM -0400, 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 it might want to is to > asynchronously validate the data of a class-specific request. > > Add a function usb_ep_delay_status to allow function drivers to choose > to delay the status stage in the request completion handler. The UDC > should then check the usb_ep->delayed_status flag and act accordingly to > delay the status stage. > > Also add a function usb_ep_send_response as a wrapper for > usb_ep->ops->send_response, whose prototype is added as well. This > function should be called by function drivers to tell the UDC what to > reply in the status stage that it has requested to be delayed. > > Signed-off-by: Paul Elder > Reviewed-by: Laurent Pinchart > --- > drivers/usb/gadget/udc/core.c | 35 +++++++++++++++++++++++++++++++++++ > include/linux/usb/gadget.h | 11 +++++++++++ > 2 files changed, 46 insertions(+) > > diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c > index af88b48c1cea..1ec5ce6b43cd 100644 > --- a/drivers/usb/gadget/udc/core.c > +++ b/drivers/usb/gadget/udc/core.c > @@ -443,6 +443,41 @@ void usb_ep_fifo_flush(struct usb_ep *ep) > } > EXPORT_SYMBOL_GPL(usb_ep_fifo_flush); > > +/** > + * usb_ep_ep_delay_status - set delay_status flag > + * @ep: the endpoint whose delay_status flag is being set > + * > + * This function instructs the UDC to delay the status stage of a control > + * request. It can only be called from the request completion handler of a > + * control request. > + */ > +void usb_ep_delay_status(struct usb_ep *ep) > +{ > + ep->delayed_status = true; > +} > +EXPORT_SYMBOL_GPL(usb_ep_delay_status); Is usb_ep_set_delay_status() better? I thought it implies get/return action if a verb is missing in the function name. Regards, -Bin.