Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1872573imm; Thu, 18 Oct 2018 05:47:25 -0700 (PDT) X-Google-Smtp-Source: ACcGV61v2TywdJOJE8YkaJoTaYMfmEbTzQAX7ahNOStXmLgj604bXpKjDTaWlSfHq2Mc+mOiYgr8 X-Received: by 2002:a17:902:8b8c:: with SMTP id ay12-v6mr29839954plb.262.1539866845592; Thu, 18 Oct 2018 05:47:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539866845; cv=none; d=google.com; s=arc-20160816; b=vPUNc/3/C8J3VGWtctoOMwwez5ohT6e0BD3zITtDwwa04cGgMVXJltw8e4JvF14tlc i2e7Q3EvSN23cwmPHkhY0Akm/u0sokmW2p9Z3Vi25XVhefC7SsEi2u6k1P6GjPNCNUUy aoRFct2KD/kVnaU0eudVq7wNf23vQGT/Zt0f5kNZsv5xtWAOdUCWFT0AlvyCTykHmlvx HuNTwLc1yv/qm3CJZTT5Ro65rTRwPzwKK8NpKsUuv8n4fnrxX3aszKpUUdt/iRIyzrlK o2Vw4QwjTS4yrTmZh9GpjaBDThsxvgU+iDkCi5rnk+EK2/gkmNJQmH4W64IfqFEdvMp9 mP4Q== 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=0dRb7QaflCU71CDf5NND2FQDGjc5rSTNk3z1oh2tLTY=; b=Aq3bPT7a0xAYq7e5MInFQViv5YnziB5tZxwLQinfBOueijkAbT+xEa3VpBp+BbzosM jRm5LsAVvOL+3SK0yZ8xDkPlNj81I3zUXaI/O17Kxi6d+TLNc3XYKvbdVyEWYi75J48+ oWi1zvwntHhtPkeNZfRimKmDMG0pMFNvXIFQ/eXb+cO0GY1wKZ16vUYx570rFYpt3sF1 +3oizpp5R/nbBomFP+OyfcZfFtu4mSwZ6YTmFJUyYzo9YROM55QpkLz6ro0Dq5MR/RDo c0OWIHOxkaCr2kfSnk/UsV2yJW8eDiAcBnHAoLnCoOd95ImWb3WlYHLjPoPmMAFZRsgd +ZnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=NTVJMVqD; 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 j16-v6si20820198pgm.501.2018.10.18.05.47.08; Thu, 18 Oct 2018 05:47:25 -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=NTVJMVqD; 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 S1727189AbeJRUrL (ORCPT + 99 others); Thu, 18 Oct 2018 16:47:11 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:55400 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726417AbeJRUrL (ORCPT ); Thu, 18 Oct 2018 16:47:11 -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 w9ICkEtm061349; Thu, 18 Oct 2018 07:46:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1539866774; bh=0dRb7QaflCU71CDf5NND2FQDGjc5rSTNk3z1oh2tLTY=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=NTVJMVqDbs5AxZuf86oZ67di/gxy51Ck9KYM/XKsm+9xeBWiKG+irCeqwl6XcRShm 8qX6tJ1nZRCdn/WWePZv893fzvLgeuU7CMWAdvSLf9YyMBuNlKwNDFjCrCLGEeHVqH sdh+ojnR57ehTgz/RHSkDQHApTIecozA9tMzv++0= Received: from DFLE108.ent.ti.com (dfle108.ent.ti.com [10.64.6.29]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9ICkEBj026082; Thu, 18 Oct 2018 07:46:14 -0500 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Thu, 18 Oct 2018 07:46:14 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Thu, 18 Oct 2018 07:46:14 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9ICkEbK005709; Thu, 18 Oct 2018 07:46:14 -0500 Date: Thu, 18 Oct 2018 07:46:14 -0500 From: Bin Liu To: Laurent Pinchart CC: Paul Elder , , , , , , , Subject: Re: [PATCH 4/6] usb: gadget: add functions to signal udc driver to delay status stage Message-ID: <20181018124614.GE8763@uda0271908> Mail-Followup-To: Bin Liu , Laurent Pinchart , Paul Elder , 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> <20181011161021.GB8763@uda0271908> <3055233.Lvy0NcWSZ5@avalon> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <3055233.Lvy0NcWSZ5@avalon> 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 Laurent, On Thu, Oct 18, 2018 at 02:45:32AM +0300, Laurent Pinchart wrote: > Hi Bin, > > On Thursday, 11 October 2018 19:10:21 EEST Bin Liu wrote: > > 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. > > For what it's worth, I understand the function name as "delay the status > stage", with "delay" being a verb. Maybe the short description could be > updated accordingly. Okay, maybe it is just my own understanding problem. I thought about delay as the verb, but then notice the var is called delayed_status, then I was thinking delay_status in the function name as the flag. No worries. Regards, -Bin.