From patchwork Thu Nov 8 02:24:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 10673385 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 93E0113A4 for ; Thu, 8 Nov 2018 02:24:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A62F2D6FB for ; Thu, 8 Nov 2018 02:24:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E7622D6FD; Thu, 8 Nov 2018 02:24:24 +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 64CC72D6FB for ; Thu, 8 Nov 2018 02:24:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728527AbeKHL5c (ORCPT ); Thu, 8 Nov 2018 06:57:32 -0500 Received: from smtprelay.synopsys.com ([198.182.60.111]:60546 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726684AbeKHL5c (ORCPT ); Thu, 8 Nov 2018 06:57:32 -0500 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id E788A10C0C92; Wed, 7 Nov 2018 18:24:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1541643861; bh=Z9TQWERK29SfirxDYngYE52gimBm6FJqcnjnu5dosjI=; h=Date:From:Subject:To:CC:From; b=azJCPjmPSj97o6MTQN2WZEwLzQEI/gQpsikbgwX9R79gm/BPM661sVseZPgc40Zec 2odiDMG+LBMcpZOeW051j23s+Vzolkg+/qpHu4jqN1ivficWg8pU3a1sEibjmtaNPt kr1+YiBmU0cegKy3u2dMKtdpXnpREihgYL9xgF+gOInoxrK5q14XSxqqL9d7ppNdiu 2rzKhEIvjDWaUReKaUemcjVpydjNvWeT8MU96yD/UYBOBHqixHA4U9m7P430d/5w5p j8qmS0FOznSDy1+3X331os/Tn4B0zwyTNDU3MiqpjW+kdOQAAEz4nC0p1499lpx47H 6EDYRRjNbeSdQ== Received: from US01WXQAHTC1.internal.synopsys.com (us01wxqahtc1.internal.synopsys.com [10.12.238.230]) by mailhost.synopsys.com (Postfix) with ESMTP id BC9C354C7; Wed, 7 Nov 2018 18:24:21 -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:24:21 -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:24:20 -0800 Received: by te-lab16 (sSMTP sendmail emulation); Wed, 07 Nov 2018 18:24:20 -0800 Date: Wed, 7 Nov 2018 18:24:20 -0800 Message-ID: <58c23ee62fabb5753ce9ea7fc1e93743a5b7781c.1541643786.git.thinhn@synopsys.com> From: Thinh Nguyen Subject: [PATCH 1/2] usb: gadget: Add start_frame to usb_request To: Felipe Balbi , Greg Kroah-Hartman , CC: 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 Similar to URB's start_frame, add a field start_frame to the usb_request to report the scheduled (micro)frame number of an isochronous transfer. This option is useful for debugging purposes. Signed-off-by: Thinh Nguyen --- include/linux/usb/gadget.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index e5cd84a0f84a..ed9dbbce55ee 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -50,6 +50,7 @@ struct usb_ep; * @short_not_ok: When reading data, makes short packets be * treated as errors (queue stops advancing till cleanup). * @dma_mapped: Indicates if request has been mapped to DMA (internal) + * @start_frame: the reported (micro)frame of the scheduled isoc transfer * @complete: Function called when request completes, so this request and * its buffer may be re-used. The function will always be called with * interrupts disabled, and it must not sleep. @@ -107,6 +108,8 @@ struct usb_request { unsigned short_not_ok:1; unsigned dma_mapped:1; + int start_frame; /* ISO ONLY */ + void (*complete)(struct usb_ep *ep, struct usb_request *req); void *context; From patchwork Thu Nov 8 02:24:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 10673387 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 8E99215E9 for ; Thu, 8 Nov 2018 02:24:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E2ED2D6FB for ; Thu, 8 Nov 2018 02:24:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F41F2D6FD; Thu, 8 Nov 2018 02:24:29 +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 1988C2D6FB for ; Thu, 8 Nov 2018 02:24:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728581AbeKHL5i (ORCPT ); Thu, 8 Nov 2018 06:57:38 -0500 Received: from smtprelay.synopsys.com ([198.182.60.111]:60560 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726684AbeKHL5i (ORCPT ); Thu, 8 Nov 2018 06:57:38 -0500 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 431D410C06E4; Wed, 7 Nov 2018 18:24:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1541643868; bh=2gN3OlChqwosh53vh6rtYeoyUSVw2vAQdQE73sodKW0=; h=Date:In-Reply-To:References:From:Subject:To:CC:From; b=OYFDLHCE9EXU0qSdOv/Lv4anxaVuinQueS8GEhZuIVnNBdR6VWByF/SVWCX5U9fkR AWOBMq5uim7BNer4rDliNlpnvX4To5xgq+HJGmGKz74HlvyPG8n01Edq4KCo8Vptto XvvhSGXN8ZfiSMHpv2KBgURlNf2JzVhBJfTs4ZxJmQirdT1POmyG1MmFQbwokKsVy6 wxJnqlT5JTQOM9uaKcNk6ngJhSqbuCwTT659638GG/Z3ZEOcsPvOxp06B+udJORxIl Mpdobnru+5dtRp/trKm6HZHZQlmxPeVX0B92NjbClUnIgj6kkMIUrTuaNaHenibXDj ypqaN3U5Iwx2A== Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) by mailhost.synopsys.com (Postfix) with ESMTP id 3221454F0; Wed, 7 Nov 2018 18:24:28 -0800 (PST) Received: from US01WEHTC1.internal.synopsys.com (10.12.239.236) by US01WEHTC3.internal.synopsys.com (10.15.84.232) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 7 Nov 2018 18:24:28 -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:24:26 -0800 Received: by te-lab16 (sSMTP sendmail emulation); Wed, 07 Nov 2018 18:24:26 -0800 Date: Wed, 7 Nov 2018 18:24:26 -0800 Message-ID: <9b885d62d87b297abd9832723d230d9d7f206eff.1541643786.git.thinhn@synopsys.com> In-Reply-To: <58c23ee62fabb5753ce9ea7fc1e93743a5b7781c.1541643786.git.thinhn@synopsys.com> References: <58c23ee62fabb5753ce9ea7fc1e93743a5b7781c.1541643786.git.thinhn@synopsys.com> From: Thinh Nguyen Subject: [PATCH 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 --- 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..34540b661592 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2254,6 +2254,10 @@ static int dwc3_gadget_ep_reclaim_completed_trb(struct dwc3_ep *dep, if (chain && (trb->ctrl & DWC3_TRB_CTRL_HWO)) trb->ctrl &= ~DWC3_TRB_CTRL_HWO; + /* Report scheduled frame number for isoc transfers */ + if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) + req->request.start_frame = dep->frame_number; + /* * If we're dealing with unaligned size OUT transfer, we will be left * with one TRB pending in the ring. We need to manually clear HWO bit