From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 163BBC0044D for ; Mon, 16 Mar 2020 07:40:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D4B1D20679 for ; Mon, 16 Mar 2020 07:40:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584344442; bh=SLJnRJInQOainNM/1nFZo6oOux3tPsFtH2P3Pu1By+0=; h=Subject:To:From:Date:List-ID:From; b=NgInfhhMEXtw76fUsRWr0ELRxuTvv/oaAedav2hfYBVC7J6QL9z1F9pNcu6ew6pgd wGBDawwFBvfs+/54koG40u3AqLCcX3GpVM5yo/0FLBGE3OJ1q/ZFw04fCnB2pxrOFD gRtju+/03I1vKudfDP1MShXa6a0SVI+wB2rwa/p8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729937AbgCPHkm (ORCPT ); Mon, 16 Mar 2020 03:40:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:53172 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729582AbgCPHkm (ORCPT ); Mon, 16 Mar 2020 03:40:42 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 61AF720674; Mon, 16 Mar 2020 07:40:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584344441; bh=SLJnRJInQOainNM/1nFZo6oOux3tPsFtH2P3Pu1By+0=; h=Subject:To:From:Date:From; b=sMZFuIrFBI4hjulYfMnSbyIAivJ9EhaigusuQpfx0ewcgiFplWzeBnpB44gCaFoel 5Va2Jemf70pYKK332MlwZELc23vWI593KOMOFWSHOojYaGPV0tsN5iqHcbBAvhoW6a PvSgt/cB/RdZ+w9Ht3VcfktInHuj6Ftwdiv+BmAI= Subject: patch "usb: dwc3: gadget: Wrap around when skip TRBs" added to usb-next To: Thinh.Nguyen@synopsys.com, balbi@kernel.org, stable@vger.kernel.org, thinhn@synopsys.com From: Date: Mon, 16 Mar 2020 08:40:04 +0100 Message-ID: <1584344404194248@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is a note to let you know that I've just added the patch titled usb: dwc3: gadget: Wrap around when skip TRBs to my usb git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git in the usb-next branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will also be merged in the next major kernel release during the merge window. If you have any questions about this process, please let me know. >From 2dedea035ae82c5af0595637a6eda4655532b21e Mon Sep 17 00:00:00 2001 From: Thinh Nguyen Date: Thu, 5 Mar 2020 13:24:01 -0800 Subject: usb: dwc3: gadget: Wrap around when skip TRBs When skipping TRBs, we need to account for wrapping around the ring buffer and not modifying some invalid TRBs. Without this fix, dwc3 won't be able to check for available TRBs. Cc: stable Fixes: 7746a8dfb3f9 ("usb: dwc3: gadget: extract dwc3_gadget_ep_skip_trbs()") Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index b032e62fff0f..4d3c79d90a6e 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1521,7 +1521,7 @@ static void dwc3_gadget_ep_skip_trbs(struct dwc3_ep *dep, struct dwc3_request *r for (i = 0; i < req->num_trbs; i++) { struct dwc3_trb *trb; - trb = req->trb + i; + trb = &dep->trb_pool[dep->trb_dequeue]; trb->ctrl &= ~DWC3_TRB_CTRL_HWO; dwc3_ep_inc_deq(dep); } -- 2.25.1