Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp586469pxj; Fri, 28 May 2021 10:30:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybfKA10m1/zf5AGkcbx3UPzOMOLrFtF1br/akqpBfUgv6uA0JXswZP0eDJKW775vVv4edY X-Received: by 2002:a05:6638:32a8:: with SMTP id f40mr9560623jav.84.1622223056493; Fri, 28 May 2021 10:30:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622223056; cv=none; d=google.com; s=arc-20160816; b=VuS5wHrcCi6wktLmybQSCNXTqGAdALnQORD4jdYvU8cPziz2ARpaGM6WyCoSkkcIr5 WSmW9LLlcIOC9SBqu+U3jn8S+rqKnJQJ373YPygg+d0/F4PCMfPBmEB1knsxTp1R6w8y AKxL7rSyF5ZI1X+hyxPOcn3uJeoKCFyyuQhw6iCWPfbJnKksi18L+ZxScAx32I7a1ZZm mavZiIEe8u2n7XQS2HewsYFv7hs+vIC/DAKE6avuwbVlydcr4eqUtHCPMeD1a69rFari 0IPTnjtwfOQSuvsK2y7MCga45k669KZ+C/VEsivcMxG5DsOOvXih6g67TQ844Qpu3wyG BmLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=hwR2njdzI/z+SjZRh4eLjm+z/ekPpds5/D6KucRhQDc=; b=xBYr9ylg0ygOc1K1gXSPjtMlLpSvdyj5rP2nZ3Su2r7zoWF4ShvJT4XEfAYuB2ua3O RbsKiJb7V2iADHmXj8I1ri3y2U4gIHlEqYFRRRayj9vowooT51vWM3KaCRaMZbTzFP2l SZrg+HKjYg23ckd8EyQJcZM/yw1hH5AKz+j0bP4lVofmwBdCEjOM+PMKz6In/NJoSPH1 hUpeAdOsXb/Aman5RqiutcFv1G4gPdWJTpaBYP7EKUEPVuC89/1ltOqe+SVfZQiKXxEE JGQ4xluW6BDS01xnx4LjjUwRunPILRMTCvdpBHWXFmflqpdAgtDY8+1Ic3zDPy4RoQoi 10ag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j11si5897704ila.145.2021.05.28.10.30.43; Fri, 28 May 2021 10:30:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235316AbhE1Pg5 (ORCPT + 99 others); Fri, 28 May 2021 11:36:57 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:51399 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230201AbhE1Pgy (ORCPT ); Fri, 28 May 2021 11:36:54 -0400 Received: (Authenticated sender: alexandre.belloni@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id CDA4E200006; Fri, 28 May 2021 15:35:17 +0000 (UTC) Date: Fri, 28 May 2021 17:35:17 +0200 From: Alexandre Belloni To: Thomas Petazzoni Cc: Bin Liu , Greg Kroah-Hartman , Tony Lindgren , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] usb: musb: fix MUSB_QUIRK_B_DISCONNECT_99 handling Message-ID: References: <20210528140446.278076-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210528140446.278076-1-thomas.petazzoni@bootlin.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/05/2021 16:04:46+0200, Thomas Petazzoni wrote: > In commit 92af4fc6ec33 ("usb: musb: Fix suspend with devices > connected for a64"), the logic to support the > MUSB_QUIRK_B_DISCONNECT_99 quirk was modified to only conditionally > schedule the musb->irq_work delayed work. > > This commit badly breaks ECM Gadget on AM335X. Indeed, with this > commit, one can observe massive packet loss: > > $ ping 192.168.0.100 > ... > 15 packets transmitted, 3 received, 80% packet loss, time 14316ms > > Reverting this commit brings back a properly functioning ECM > Gadget. An analysis of the commit seems to indicate that a mistake was > made: the previous code was not falling through into the > MUSB_QUIRK_B_INVALID_VBUS_91, but now it is, unless the condition is > taken. > > Changing the logic to be as it was before the problematic commit *and* > only conditionally scheduling musb->irq_work resolves the regression: > > $ ping 192.168.0.100 > ... > 64 packets transmitted, 64 received, 0% packet loss, time 64475ms > > Fixes: 92af4fc6ec33 ("usb: musb: Fix suspend with devices connected for a64") > Signed-off-by: Thomas Petazzoni Tested-by: Alexandre Belloni > Cc: stable@vger.kernel.org > --- > drivers/usb/musb/musb_core.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c > index 8f09a387b773..4c8f0112481f 100644 > --- a/drivers/usb/musb/musb_core.c > +++ b/drivers/usb/musb/musb_core.c > @@ -2009,9 +2009,8 @@ static void musb_pm_runtime_check_session(struct musb *musb) > schedule_delayed_work(&musb->irq_work, > msecs_to_jiffies(1000)); > musb->quirk_retries--; > - break; > } > - fallthrough; > + break; > case MUSB_QUIRK_B_INVALID_VBUS_91: > if (musb->quirk_retries && !musb->flush_irq_work) { > musb_dbg(musb, > -- > 2.31.1 > -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com