From patchwork Thu Nov 8 02:47:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 10673391 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8DA5B14BD for ; Thu, 8 Nov 2018 02:47:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D9DF2BCAD for ; Thu, 8 Nov 2018 02:47:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6ED952BF84; Thu, 8 Nov 2018 02:47:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0ED4A2BCAD for ; Thu, 8 Nov 2018 02:47:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728703AbeKHMUd (ORCPT ); Thu, 8 Nov 2018 07:20:33 -0500 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111]:32868 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728556AbeKHMUc (ORCPT ); Thu, 8 Nov 2018 07:20:32 -0500 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 3483210C0817; Wed, 7 Nov 2018 18:47:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1541645238; bh=vWynKbKWCmx6pgWNjMAF+vpmfht2AEALDBUch+txaFg=; h=Date:In-Reply-To:References:From:Subject:To:CC:From; b=ThGO8WQbQPHoLtXODbhvMUUde7RRJ8U8wq5nu1oLL2ChI5g5Zd/vRfO3ZjwAuZL9F WfJA+mS6C5/Y6eH1DHDlZj1D7ndD7dBlataMO2fEknHTp8VDdaOkdyL+6Z6IjL4GIn qAd+UdTWHm8lzCtT6bABZewFvVg6YbYVmEqYfawDV8LfOuNyWvEgUKdYjmxvoNeGee Ft7HFk2bWslF62/9MIj40kbCDkOdBN6yronE9KYYRLcObytXYLxbAI3ibRYs+iBQJM LeD3nmSzamqv6NCU3wBgfH2CZSZ91+oCKIp2IlQbFWBHdcN0a5bMko0J3/8RQ5Hl+w 8HXptSJS3PY/w== Received: from US01WXQAHTC1.internal.synopsys.com (us01wxqahtc1.internal.synopsys.com [10.12.238.230]) by mailhost.synopsys.com (Postfix) with ESMTP id 23A255642; Wed, 7 Nov 2018 18:47:18 -0800 (PST) Received: from US01WEHTC1.internal.synopsys.com (10.12.239.236) by US01WXQAHTC1.internal.synopsys.com (10.12.238.230) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 7 Nov 2018 18:47:17 -0800 Received: from te-lab16 (10.13.184.20) by us01wehtc1.internal.synopsys.com (10.12.239.236) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 7 Nov 2018 18:47:16 -0800 Received: by te-lab16 (sSMTP sendmail emulation); Wed, 07 Nov 2018 18:47:16 -0800 Date: Wed, 7 Nov 2018 18:47:16 -0800 Message-ID: <84f7883818b412fcb42b6705d4d6ad14adfd0eb9.1541645048.git.thinhn@synopsys.com> In-Reply-To: <58c23ee62fabb5753ce9ea7fc1e93743a5b7781c.1541645048.git.thinhn@synopsys.com> References: <58c23ee62fabb5753ce9ea7fc1e93743a5b7781c.1541645048.git.thinhn@synopsys.com> From: Thinh Nguyen Subject: [PATCH v2 2/2] usb: dwc3: gadget: Report isoc scheduled frame number To: Felipe Balbi , Greg Kroah-Hartman , CC: John Youn , Thinh Nguyen MIME-Version: 1.0 X-Originating-IP: [10.13.184.20] Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Report the scheduled frame number of an isochronous request. Signed-off-by: Thinh Nguyen --- Change in v2: - Capture frame number at request cleanup drivers/usb/dwc3/gadget.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 679c12e14522..5e5e799699de 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2345,6 +2345,10 @@ static int dwc3_gadget_ep_cleanup_completed_request(struct dwc3_ep *dep, req->request.actual = req->request.length - req->remaining; + /* Report scheduled frame number for isoc transfers */ + if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) + req->request.start_frame = dep->frame_number; + if (!dwc3_gadget_ep_request_completed(req) && req->num_pending_sgs) { __dwc3_gadget_kick_transfer(dep);