From patchwork Fri Feb 22 11:49:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minas Harutyunyan X-Patchwork-Id: 10825771 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 30DC515AC for ; Fri, 22 Feb 2019 11:49:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BBE8319E8 for ; Fri, 22 Feb 2019 11:49:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0468C31BBF; Fri, 22 Feb 2019 11:49:50 +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 EA65931AE2 for ; Fri, 22 Feb 2019 11:49:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726560AbfBVLtr (ORCPT ); Fri, 22 Feb 2019 06:49:47 -0500 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111]:54542 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726154AbfBVLtr (ORCPT ); Fri, 22 Feb 2019 06:49:47 -0500 Received: from mailhost.synopsys.com (dc2-mailhost2.synopsys.com [10.12.135.162]) (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 A9FFB10C1414; Fri, 22 Feb 2019 03:49:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1550836186; bh=NrrXQFYk9oNa0lOOf/FRvVqL3k7s3UdWLbXiHvy/VDY=; h=Date:From:Subject:To:CC:From; b=GyOxuSqpeJ8IEVF1pgbkZt071nFqf/LJ782pFV9P3UZnc9Av2iyOGFa4/mrH8LlrN 5WB3e53/UKD66bVdOUsDqcV6T0agoiRLVN49XyVEMe5pzvkLnA8Wt8gg7rS+AXaItj M4EpiWnl71t1PPeTrzsmvqs7tPxLAXvBnn+GV1UqKMWh3R1aSxYgIaw60qz0HK7RKr wJXvKcy2Q1YWRkDrl21xgHtzxJ/eN60vs1NprXfMLvAFNtGQWedYZN20oTpo5tQNZB OK5akT+xKaO4hxSgYpT2UeJuRfbecf2Gcm5n/WFxY20Hv68jTwGpOkWHHHw/5WIqmV lOV8f+5gU33Gg== 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 64605A0090; Fri, 22 Feb 2019 11:49:40 +0000 (UTC) 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; Fri, 22 Feb 2019 03:49:25 -0800 Received: from hminas-z420 (10.13.184.20) by us01wehtc1.internal.synopsys.com (10.12.239.236) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 22 Feb 2019 03:49:24 -0800 Received: by hminas-z420 (sSMTP sendmail emulation); Fri, 22 Feb 2019 15:49:19 +0400 Date: Fri, 22 Feb 2019 15:49:19 +0400 Message-ID: <75e9fad75baf518f5b6df18c6b28c8744abed183.1550822090.git.hminas@synopsys.com> From: Minas Harutyunyan Subject: [PATCH] dwc2: gadget: Fix completed transfer size calculation in DDMA 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 Fix calculation of transfer size on completion in function dwc2_gadget_get_xfersize_ddma(). Added increment of descriptor pointer to move to next descriptor in the loop. Fixes: aa3e8bc81311 ("usb: dwc2: gadget: DDMA transfer start and complete") Signed-off-by: Minas Harutyunyan --- drivers/usb/dwc2/gadget.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 6812a8a3a98b..6cf1eaaf4456 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -2311,6 +2311,7 @@ static unsigned int dwc2_gadget_get_xfersize_ddma(struct dwc2_hsotg_ep *hs_ep) if (status & DEV_DMA_STS_MASK) dev_err(hsotg->dev, "descriptor %d closed with %x\n", i, status & DEV_DMA_STS_MASK); + desc++; } return bytes_rem;