Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3231579imm; Mon, 10 Sep 2018 13:14:45 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbCumIMLMe9Nsjalx/BwIwiXIO5XKY8AgCj1vzl/EAQBrAxJpU7TvM7c6gUI0hrF1zxgKkB X-Received: by 2002:a63:4283:: with SMTP id p125-v6mr24586454pga.142.1536610485040; Mon, 10 Sep 2018 13:14:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536610485; cv=none; d=google.com; s=arc-20160816; b=dpBCssQbbwA2/34wfD1tpb8+KQcT9y3Lo4X+pdze6E1mahiJhua5GUA1oyxruehT/2 o7sRT3HH+vf7VLqfU4CaVJpgv2OWzj2MVHBpsAR4T1UOTqBy0GKEWRJtetM9RbDcPzkt mD/BSykBEsE3Z66oVtyPvhJWzrL1IPeeIAmv7jUxUP4DZRUnrJ8UCOILy9WuLauMglIm tDn7M4UL69oESrm7xlY4TNZh/KPjInIQHo5zFPqJntvDWqsm0TIy7cU5cjmAstmrlQSz Bid9H+JcjyuF+fd8MPq1KmF1a7Qjt6V2t+hKvdgZn3DZ6k6g/FY3Z7rGgyV7y2JdbOja UjpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=B1mkQAI62DbdFNNTYlBukyMXwlmBNaVKhyTDcSV9w3Q=; b=t9ZVNCkasFLwY0YyAL7jGl6klo+exjl77NvRCyGWWeWHgq+8OLmkWS0gzXB2dgZyUg PlF/+z0d7UCwUySye04BIquOZywPzhAfHtFaNbyr/mzHbh+550ufkWO02bs+p1vXSEB+ VTkjAk1BAjv7dBneWynA6mf3JjZVrrZf2BpMnnJqyMO9oJ26lwbse0XVA0bdNgWihrlk nf4EyPnSZNy9U2tyVdvFxyFh4zE8OuWnWPh+Wt84cwDfLecOOe4jpzq2AmvL1D41sYHV a2JcAFVlifY3xP8DsTUP7hiugUJBqm+JmRilo5ygxsngw1wxvJ5Vvl65iSAQx2m6dAWc YLtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=WcUI2rKa; 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=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si18140821pfx.293.2018.09.10.13.14.26; Mon, 10 Sep 2018 13:14:45 -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=@synopsys.com header.s=mail header.b=WcUI2rKa; 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=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726740AbeIKBJi (ORCPT + 99 others); Mon, 10 Sep 2018 21:09:38 -0400 Received: from smtprelay.synopsys.com ([198.182.60.111]:42852 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726112AbeIKBJh (ORCPT ); Mon, 10 Sep 2018 21:09:37 -0400 Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by smtprelay.synopsys.com (Postfix) with ESMTP id B4DCD10C0964; Mon, 10 Sep 2018 13:13:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1536610432; bh=orpESdXNZeZGLYTJDOJWXjAVWW08m5AbEkNLwsdh0SU=; h=From:To:CC:Subject:Date:References:From; b=WcUI2rKaEnPTrpoT17AJxyBQqfS7CFnT0+y27pWkz5HzkSY8rPt8WEZOfWvmSt9U1 +AdabqT8/SiNEHkJ1xV5if2IGkPZC5/5guk61XDoBct4v8RBwKCtKyt7OUdTv2dtjI G9avrPWgfqid499s2EHNcaANynJPuIcLs9FKl1jrr7SZen+saYkmv5xYX4C67m1N5Y zcxk7swtaAWZQtaKy0YmSXjgiTgo4oK0etdLIfu0BMKAbZy2Ivi0S4bk5RK1E2KW+t 3FwiQPX+X1opFdKEUkCXViFC5wX+/HfLTtzRefm2ko+r3H9+6Q/WS/DJkxCgNfutaJ WrkoYHuqjCX/w== Received: from us01wehtc1.internal.synopsys.com (us01wehtc1-vip.internal.synopsys.com [10.12.239.236]) by mailhost.synopsys.com (Postfix) with ESMTP id 90DCD3876; Mon, 10 Sep 2018 13:13:52 -0700 (PDT) Received: from us01wembx1.internal.synopsys.com ([169.254.1.253]) by us01wehtc1.internal.synopsys.com ([::1]) with mapi id 14.03.0361.001; Mon, 10 Sep 2018 13:13:52 -0700 From: Thinh Nguyen To: Anurag Kumar Vulisha , "balbi@kernel.org" , "gregkh@linuxfoundation.org" CC: "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Thinh.Nguyen@synopsys.com" , "v.anuragkumar@gmail.com" Subject: Re: [PATCH v4 6/8] usb: dwc3: check for requests in started list for stream capable endpoints Thread-Topic: [PATCH v4 6/8] usb: dwc3: check for requests in started list for stream capable endpoints Thread-Index: AQHUR4UYRgxFEofqUUKoe+A6FKwC1w== Date: Mon, 10 Sep 2018 20:13:51 +0000 Message-ID: <30102591E157244384E984126FC3CB4F544ADE8E@us01wembx1.internal.synopsys.com> References: <1536418986-16609-1-git-send-email-anurag.kumar.vulisha@xilinx.com> <1536418986-16609-7-git-send-email-anurag.kumar.vulisha@xilinx.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.13.184.20] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Anurag,=0A= =0A= On 9/8/2018 8:03 AM, Anurag Kumar Vulisha wrote:=0A= > For stream capable endpoints, uas layer can queue mulpile requests on=0A= > single ep with different stream ids. So, there can be multiple pending=0A= > requests waiting to be transferred. This patch changes the code to check= =0A= > for any pending requests waiting to be transferred on ep started_list and= =0A= > calls __dwc3_gadget_kick_transfer() if any.=0A= =0A= Whenever a function driver queues a request, then=0A= __dwc3_gadget_kick_transfer() will be called right? What case exactly is=0A= this for? Scatter gathering? If so, then we probably need further=0A= explanation. (e.g. Why wait to call __dwc3_gadget_kick_transfer() on=0A= XferComplete event rather than sending a START_TRANSFER command for=0A= every prepared TRB whenever we do __dwc3_gadget_kick_transfer()?).=0A= =0A= Thanks,=0A= Thinh=0A= =0A= >=0A= > Signed-off-by: Anurag Kumar Vulisha =0A= > Reviewed-by: Thinh Nguyen =0A= > ---=0A= > Changes in v4:=0A= > 1. None=0A= >=0A= > Changes in v3:=0A= > 1. None=0A= >=0A= > Changes in v2:=0A= > 1. None=0A= > ---=0A= > drivers/usb/dwc3/gadget.c | 3 +++=0A= > 1 file changed, 3 insertions(+)=0A= >=0A= > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c=0A= > index 97bfdf0..c50cad8 100644=0A= > --- a/drivers/usb/dwc3/gadget.c=0A= > +++ b/drivers/usb/dwc3/gadget.c=0A= > @@ -2433,6 +2433,9 @@ static void dwc3_gadget_endpoint_transfer_in_progre= ss(struct dwc3_ep *dep,=0A= > =0A= > dwc3_gadget_ep_cleanup_completed_requests(dep, event, status);=0A= > =0A= > + if (dep->stream_capable && !list_empty(&dep->started_list))=0A= > + __dwc3_gadget_kick_transfer(dep);=0A= > +=0A= > if (stop) {=0A= > dwc3_stop_active_transfer(dep, true);=0A= > dep->flags =3D DWC3_EP_ENABLED;=0A= =0A= =0A=