Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2659771pxj; Mon, 14 Jun 2021 04:16:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCTK6z7C/1N4RTJSCzCskX2S47BxW1pP0gwYw/gHhBzhBpYZBkKgs6qXXG9PnVOcoGVhNE X-Received: by 2002:a50:eb92:: with SMTP id y18mr16366227edr.249.1623669366490; Mon, 14 Jun 2021 04:16:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623669366; cv=none; d=google.com; s=arc-20160816; b=KDjc/b7zITKPNZ8zUuvo+WI9ZaYanzyisI+6KkeH3nteRWvrUDAsmOTITXWM1RnTnQ 8UYqV1Sqa1CAdY0E9DnnnzjGgvVYdU1gqHlOJVCUPr0hPhUn8eD5oV2GMow8Y/g2/Gqj Y4iaZRCwWEAAS4FQxFmiYq2Dmh+IKhJvXi4hj7rYtUqzlna/DTBOh6B1yC0C4SmAjrxv KisoZHorOFqjwYdpnG8gWufV7L/SUgyY5nhVpCNKBx0Vt6kHVEu3f+rSdatWFhw9+8BJ LdTXP52X3wxt3/xVFjKkzdkboaRfKiQPb2fBU1veb0aXMU8wKEZpPXzPePEPpxyK08Hd c8Bg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DYyFvHo/Fa6kLctEOj7SOj/KpjMSeCa0NtQPSROnyfM=; b=l5BWIivO5ktdhRwAEWx1zGMWaErl0zT1hTTV/7GGxJj6LhSsPIKMcxphkzCC1AGD0P CJmAv8NHw/zNaPH4eGmvUQ3zH8ApSGMVaGUxMDF8ubWSfLirslcM25qOc9/BlfUef/HZ Sn0ovLmw6D7/UpiAXofy9ewGGZOVoSI6dAVHtwepABPi8U+L9VlWYTKunXL2AcSl3ttR SGuM7qNyXUrjhwHv1/hqH8QWxFLNq8qTMeZL5dQ3dTGo7Q4RD7TfrWDy5qhMfsQo8OZG EsoBA5OgdtuHvRb4cmiyAl+oY+JGWge5QxDDWgwzyp2i+msXxzkwlYHOiYkM69IlTjHb C1rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=G1x5M+lO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id yd14si9147062ejb.245.2021.06.14.04.15.43; Mon, 14 Jun 2021 04:16:06 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=G1x5M+lO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235758AbhFNLOs (ORCPT + 99 others); Mon, 14 Jun 2021 07:14:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:39160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234688AbhFNLCu (ORCPT ); Mon, 14 Jun 2021 07:02:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1AB7E61445; Mon, 14 Jun 2021 10:44:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623667450; bh=SFqTcPLp68F4X8oUQPz8AjYKwnZ3gBqyHspDLVrGtfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G1x5M+lOSarbckwswfYLFYIihfXQK99PG/w5u0HH93x9v8pglPVbcKo120UVAu4vY VixdzeI28/uHOr+CNrzyROsD30Z5fgnPySIA5AjeOPvV5FU/Fenxv5FGCLxHQ6nME8 9PXMi1772oUydGBR0Tf2+39FfOiX0vEUNbiXODYc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexandre Belloni , Drew Fustini , Tony Lindgren , Thomas Petazzoni Subject: [PATCH 5.10 075/131] usb: musb: fix MUSB_QUIRK_B_DISCONNECT_99 handling Date: Mon, 14 Jun 2021 12:27:16 +0200 Message-Id: <20210614102655.575358948@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210614102652.964395392@linuxfoundation.org> References: <20210614102652.964395392@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Petazzoni commit b65ba0c362be665192381cc59e3ac3ef6f0dd1e1 upstream. 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") Cc: stable@vger.kernel.org Tested-by: Alexandre Belloni Tested-by: Drew Fustini Acked-by: Tony Lindgren Signed-off-by: Thomas Petazzoni Link: https://lore.kernel.org/r/20210528140446.278076-1-thomas.petazzoni@bootlin.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/musb/musb_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -2009,9 +2009,8 @@ static void musb_pm_runtime_check_sessio 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,