From patchwork Tue Mar 12 09:27:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minas Harutyunyan X-Patchwork-Id: 10848885 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 30CD71515 for ; Tue, 12 Mar 2019 09:27:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1964D29451 for ; Tue, 12 Mar 2019 09:27:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A8FF2947F; Tue, 12 Mar 2019 09:27:58 +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 A15B729451 for ; Tue, 12 Mar 2019 09:27:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725887AbfCLJ14 (ORCPT ); Tue, 12 Mar 2019 05:27:56 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111]:42382 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725844AbfCLJ14 (ORCPT ); Tue, 12 Mar 2019 05:27:56 -0400 Received: from mailhost.synopsys.com (dc8-mailhost1.synopsys.com [10.13.135.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtprelay.synopsys.com (Postfix) with ESMTPS id 11C9210C218D; Tue, 12 Mar 2019 02:27:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1552382876; bh=vpw1ExMwa/BowIxGnfhypRPJUgvHp6o64QBmNqrhSyk=; h=Date:From:Subject:To:CC:From; b=S0qYX2efmcEmOSxAq5L6KAgc/nmQyqOMDR+CjslM9786Sm+PD6I6Yj/iJDVGxOybU p8pwGftbWYefzZrFByFynXz4UkhSYDG3I5IfPf57uIzAVw+g5yCCVODDHihWjQ3UMw xvzP7lBInnCxcjT3WiHU6EOIS7fV9eyg/SrzPGnu+sOl3m/uqLByVGDSYgkZITezdA GAfb0TUz0EseI4njLk8eVLZwdAgMerE4YnS+7lHVX5fOPCj80YBde9ndSh5L7HizJN q/f4bc1FOpmhHC8jdQWI1kqQSvCyNQuGctt58sMksTRPuLbKWCqTfO/OFxbeHtx5UC L1LlF5T21r/qA== Received: from US01WXQAHTC1.internal.synopsys.com (us01wxqahtc1.internal.synopsys.com [10.12.238.230]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mailhost.synopsys.com (Postfix) with ESMTPS id 00257A005D; Tue, 12 Mar 2019 09:27:55 +0000 (UTC) Received: from US01WEHTC2.internal.synopsys.com (10.12.239.238) by US01WXQAHTC1.internal.synopsys.com (10.12.238.230) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 12 Mar 2019 02:27:55 -0700 Received: from hminas-z420 (10.13.184.20) by US01WEHTC2.internal.synopsys.com (10.12.239.238) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 12 Mar 2019 02:27:51 -0700 Received: by hminas-z420 (sSMTP sendmail emulation); Tue, 12 Mar 2019 13:27:46 +0400 Date: Tue, 12 Mar 2019 13:27:46 +0400 Message-ID: <5b2622f12cb88519089e533f30444588c9f4bb13.1552382749.git.hminas@synopsys.com> From: Minas Harutyunyan Subject: [PATCH] usb: dwc2: Set actual frame number for completed ISOC transfer To: Felipe Balbi , Greg Kroah-Hartman , Minas Harutyunyan , CC: John Youn 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 On ISOC transfer completion, in DDMA mode, set actual frame number returning to function driver in usb_request. Due to core limitation, returning frame number is 11-bit wide. Signed-off-by: Minas Harutyunyan --- drivers/usb/dwc2/gadget.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 6812a8a3a98b..7e05032fbd87 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -2157,6 +2157,11 @@ static void dwc2_gadget_complete_isoc_request_ddma(struct dwc2_hsotg_ep *hs_ep) */ if (!hs_ep->dir_in && ureq->length & 0x3) ureq->actual += 4 - (ureq->length & 0x3); + + /* Set actual frame number for completed transfers */ + ureq->frame_number = + (desc_sts & DEV_DMA_ISOC_FRNUM_MASK) >> + DEV_DMA_ISOC_FRNUM_SHIFT; } dwc2_hsotg_complete_request(hsotg, hs_ep, hs_req, 0);