Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp482654pxj; Fri, 28 May 2021 08:17:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzm0tZqaq+6TYMJJrs4Brn0WYcMuocVhCYrmyLZGmcB2Qm64WAe9JnBjHFL12F9/IQFNq02 X-Received: by 2002:a05:6402:10c9:: with SMTP id p9mr10438171edu.370.1622215052298; Fri, 28 May 2021 08:17:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622215052; cv=none; d=google.com; s=arc-20160816; b=mH8oCINeLOVSgIfCVrs+eJzl3PIEXVanSh/Tw1wHVbjywgYBSTtC0vy/a/o+l06/Sk s6qgHc2DeMG3PS/7SU4W3QQcpItI9j6NA9ngHPi5cAka9vTpnnC7sHVnBMMcqkqL5Z24 Ev6mmiA3+JFEy9xvQVIPXRPcbTckU3Aun+KJCZSovYZR7+IZHbHlsqx3xm+u9Hw/tBCm VZZ3zeetFzeHOfw3X4dSMlwixPZScz92coaoFqpsoWGBVMtU+m8B9Udgf7sEWwflKqSG +A6JhdDmdKDZgqAs+B/vlXQe5d/GVKyIQC8Sd6siYmfxtzJUbmYep7dx3XrcLsLKn7qE vDkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Cq5Q8dx8UEze46exJihUGs129jgvQ6eY4RFXyUlCTGQ=; b=AQgrtaam80iquUohRacUanCpu2pA0FvLC+IEFbuCh3MFrOMCcPK4YxFxuKOEgB+cba vburfOIYFSb1BqSF9rvDvM4vnP2FqZfqNaQXgpI/zRPQ55oeedJ/fec1RJkTSzEvnZRW heO1LZb90OnQA4Vs9rOCfVLz1IYdyithI06OkCBB2b9lkXYxSWhizP4O8jl2Xu2pAr57 MtmMP30TvCxV7CcBD0GR1kNwBWCy6ZW3XUrlN5VKQevijCZDXYO49anzvoQYz0+06hdM FX3SiVZlf//BivqN2P+28FJCgBjyE3svCowRhXCovDTgsriqGkbbfOT7nx7q0DCtdFE1 i1eQ== 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 la26si5091563ejb.524.2021.05.28.08.16.59; Fri, 28 May 2021 08:17:32 -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 S236295AbhE1OGb (ORCPT + 99 others); Fri, 28 May 2021 10:06:31 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:27687 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229740AbhE1OGb (ORCPT ); Fri, 28 May 2021 10:06:31 -0400 Received: (Authenticated sender: thomas.petazzoni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 3735C240016; Fri, 28 May 2021 14:04:54 +0000 (UTC) From: Thomas Petazzoni To: Bin Liu , Greg Kroah-Hartman , Tony Lindgren Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, alexandre.belloni@bootlin.com, Thomas Petazzoni , stable@vger.kernel.org Subject: [PATCH] usb: musb: fix MUSB_QUIRK_B_DISCONNECT_99 handling Date: Fri, 28 May 2021 16:04:46 +0200 Message-Id: <20210528140446.278076-1-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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