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.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, 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 1FBD5C433B4 for ; Fri, 14 May 2021 07:26:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D07C461029 for ; Fri, 14 May 2021 07:26:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233059AbhENH2E (ORCPT ); Fri, 14 May 2021 03:28:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:56170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230326AbhENH2C (ORCPT ); Fri, 14 May 2021 03:28:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EB045610A7; Fri, 14 May 2021 07:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620977211; bh=9jpMY2J8KOmOqqhBNxJH1weZb9RhnwZTWAA6rqCLgiE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=o0KY2kAd/TvmUGvwrzvBgY/i0Xy/nV8Iw03RwMa0RyeU2nJsME/QnW6d7uMLUyAlQ n7R7go0A4jzNzUXDx9pUbGJ2QDFZ1WfHVu6CpVKAw6Cdt4fIUdvWNtig6r2GcFZST3 sIpD7UWEtr4dfbMBcYpOTnRFdAI6htmciOPwhedBpe8qRLcHA2GepK5YonZEdVKpdy +DO+moNEjQsTjbx56WzeKHDGEbOUC59xUH29cyw+n0k1pYLyLC56ObmP3sNrpRezPR F76NdMFHiL9UYwNEkR9AGwrlc1QqtyT+SSNfi6ogga81UVaLjoBsMeQTnOwleEAxz0 a5F+R/t2TffuA== From: Felipe Balbi To: Thinh Nguyen , Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: John Youn , stable@vger.kernel.org, Michael Grzeschik Subject: Re: [PATCH] usb: dwc3: gadget: Properly track pending and queued SG In-Reply-To: References: Date: Fri, 14 May 2021 10:26:42 +0300 Message-ID: <87eee97p3h.fsf@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Thinh Nguyen writes: > The driver incorrectly uses req->num_pending_sgs to track both the > number of pending and queued SG entries. It only prepares the next > request if the previous is done, and it doesn't update num_pending_sgs > until there is TRB completion interrupt. This may starve the controller > of more TRBs until the num_pending_sgs is decremented. > > Fix this by decrementing the num_pending_sgs after they are queued and > properly track both num_mapped_sgs and num_queued_sgs. > > Cc: > Tested-by: Michael Grzeschik > Reported-by: Michael Grzeschik > Fixes: c96e6725db9d ("usb: dwc3: gadget: Correct the logic for queuing sg= s") > Signed-off-by: Thinh Nguyen Acked-by: Felipe Balbi =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFFBAEBCAAvFiEE9DumQ60WEZ09LIErzlfNM9wDzUgFAmCeJjIRHGJhbGJpQGtl cm5lbC5vcmcACgkQzlfNM9wDzUjfYggAhR1Qjovd+cWCh12AO8upsvOKrCAqr/wH 14/noRG9JSq6tS85ATt8N94DqKoZbnr3Voqi+FU7Jeth6X8A9r7lAdOYnbnAs3dR ZqzGQl8JlBsWV2NLaAArOpr4OIpDhZpnQa3IJJP7rDxfKcFg0WOwS8Cc3up/Xrqn KQFSpdx9ioKVOc3g2qmVW5PqiMlL86xGs7oyPqjDUidrLvC94+omx0iDvYDwHImI BM61wWVaJVXmYmRPOSuyjKl0kfRKSkTXniN5Q5QVrlA459yecbXLMInlDKuyN8hk VmL8k1aBwvRh/BOLpxxPmY1UNrgZlVWhilQPXk1tI7P0CgvO1D2P4g== =NdgP -----END PGP SIGNATURE----- --=-=-=--