From patchwork Wed Apr 26 19:24:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 13224906 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2F7FBC7618E for ; Wed, 26 Apr 2023 19:25:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Message-Id:MIME-Version:Subject: Date:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ux30K+BlMA/hYThmngdVftT+WIsLfzORw6FMXywVn1A=; b=FmX7//vBSEYqcw 3L0/7RD37Frudna77cmgbPSc2FbY6IVd09enxhvQLUvQOFsaiHBrunSs2NPyWLMoIYaN3Tsh1oVUR YkHwvJfzbXoTrsKbdfcc/jocMDK7eDbfiyPNIyc1kmEkwyVn+HP9EjOzWUBI4WvVz0P4D1FwHXayA bOmoxXa2Ikjfo1xYGNGUNqV6y44QG6qDDXXUR8MpxDLW5JYtP87ndSbEuzezLdm4G3V+mwJMPR0Ay qn397M5JGgUzHun0PfXgf8F5uy7xqkZ9CSVhCSfLb2pIkhMLUVPB0KXMnN25bzl0ogFiFc4ZDXva7 Z6YvYZ2PFc98mjGlZqyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1prkkp-004hIn-2O; Wed, 26 Apr 2023 19:24:39 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1prkkm-004hHl-1M for linux-arm-kernel@lists.infradead.org; Wed, 26 Apr 2023 19:24:38 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3f1958d3a53so60518555e9.0 for ; Wed, 26 Apr 2023 12:24:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1682537073; x=1685129073; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=623I+b9sj9JQHMoE8gUBonB4YWYfafGdl6RvYOXiA9s=; b=txkwhL2liSvbgv2V/br5OZELzu6PxeKpE67gU/OpfSZOLRPr0Q4IV/1S3HnN8lZxEB ULpXoOzuVoXSeHCYF68J/dRTwZmz+IVYElEolOaUDHtcxkLXqj6+IvkayBKFSIAFU4Cp Cj5tlC/+5zaEq08fnKxONhIGkLIlq+eUak7jnRM0QfKTF3Q521FOP1ObWWn8JWtjgHZT 5YcQnB8aF+8t67t/8ISkHQy+Wb2BIvnvRly7vLpGjbQg82slREEwpsVsnd0eS6Bg6v2u XynQPcxW3uibdKTUncqjLaGbT6tgNC7YGI8ux5ZLDPpwboRld+QuiKDSuGlsw8iWee/9 BaFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682537073; x=1685129073; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=623I+b9sj9JQHMoE8gUBonB4YWYfafGdl6RvYOXiA9s=; b=XzfOJazq+F+IjpDdefisby7HWhkuROptycLOc3QOCOj+aDksyOnNhSSG76WsZXXL5C bw4VtImsn0fx5/xbfO+Bivcp/Dz44+oZ02oKIi3xiWLcdQE5VHyZWLXk5wHJ1hq+Kkdl OcOZyP9woktgGyjdAkVzog7Rp3otcoeCPMq1W6GTuPRhC2AZj2M9SJfvcG/wU/fPqsPn ZyEVL3ttniQys9XaKIrcsOENq7yYjBa3oUFViz2H7ukT6YWnFp1JHj7vQTQfSShsniZT ctaWjt6HoZ+PH+u4f7P45t9X3atlKYkbiAxcyA+qHk5D5t8CLN1bK//1fqLvTPdHk837 MlZw== X-Gm-Message-State: AAQBX9c8uNKkEZXK2eoddbNNilXos9btpyL+GhAsoXlU8vafnBs5ssOH tJQbnjxCzetmU6dE6e0qaStNEQ== X-Google-Smtp-Source: AKy350b61s1hT/fGboWfJrsEyVqrqX9zy/B/kQ0qe65IuuQ1Z++YEaoBMpkDWIvqEtn+zzLVEq47Sw== X-Received: by 2002:a7b:cb47:0:b0:3f0:967e:2cfb with SMTP id v7-20020a7bcb47000000b003f0967e2cfbmr14555881wmj.36.1682537072613; Wed, 26 Apr 2023 12:24:32 -0700 (PDT) Received: from [127.0.1.1] (158.22.5.93.rev.sfr.net. [93.5.22.158]) by smtp.googlemail.com with ESMTPSA id m6-20020a05600c4f4600b003ee5fa61f45sm22482137wmq.3.2023.04.26.12.24.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 12:24:31 -0700 (PDT) From: amergnat@baylibre.com Date: Wed, 26 Apr 2023 21:24:20 +0200 Subject: [PATCH] usb: mtu3: Don't check the USB3 status bits if the max speed is USB2 MIME-Version: 1.0 Message-Id: <20230426-usb-mtu3-improvement-v1-1-1cf02434b478@baylibre.com> X-B4-Tracking: v=1; b=H4sIAGN6SWQC/23OSw6CMBSF4a2Qjr0WqFJwK8ZBHxe5gz7SlsaEs HfBscN/8J2cjWVMhJk9mo0lrJQp+CO6S8PMovwbgezRrG970d76AdaswZVVALmYQkWHvoCUdhq lxXmakR1Uq4ygk/JmOfEaeR2uApLpeAmRDHdlFMOd/xs7fUw40+d36/na9y9zOhGspgAAAA== To: Chunfeng Yun , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Alexandre Bailon , Fabien Parent , Alexandre Mergnat X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1260; i=amergnat@baylibre.com; h=from:subject:message-id; bh=lnjx8kcqUDfgilr0fGyRB+NAq/rLS5pv35XuHVTlGDc=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBkSXpvI7p5QNlCaGzZG7dVJB/7HfFq9BIZoExjwmkv 080ExUCJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCZEl6bwAKCRArRkmdfjHURY+HD/ 4hwG+Mdt3GhTLAJLObbayoktgbVLjxIFDSoY/xq48qazZ9BPkPhY2Qte2zfBbTjYjy8rJ2mBsSiRB0 eZ1CCWQSwaCsiT//hW2xlKAjSPb4k5ceRUF0HssuEtBokGnZMK95x5J+FcEiS5OwRnd/BDc/Xx/cHE 0UoYi5hMJUiUtJA0yQzSRmwL1k7c7mTZrM3v60qAU2/EV1V04OdQUOifGw2d2BaY4WGRhEyiu2C8gM NyiCGqXNsvHTLKdQsNQ1YXFi8g8NIT3NNzAmLAd8W8RjnRCP8i3icnvygNKzm6mDY5JEtgbdSt3u9L NUKgxtJ6UF7TQNEb8BjY1aAS0aGyKRJ5O936nOq0HY0oIMKqWqSD4vk3GTugAIkWGSjtFKp3qS/gp2 9imZjJlZtyK8jMF0N1frygUANSKcqd/1oIS0qSB7YgR6yPv99JJEqzxHyr1QfPLbZPfklU1lRbAASZ I1v1/PZROhA8SSc5FRGiceKuOJ+v25kBk92Jjs0oPwraLRVxDPqCTBd8nFyslj+Hc4QocqgNpCi7I+ /unp2jqRGVoo9iEh3kZp/AJ2CNPySp9rCsfeZo1xX2c4PBb1eBvrCnv9eXhl+VUTadHPpgipqHFcHU PvCjX56Zf08oS7nE6mMbS0m1gESio5CeRG0Ps3FhjWsOBc4c1KvLuT1kjIDA== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230426_122436_455565_1E2312C2 X-CRM114-Status: GOOD ( 13.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Alexandre Bailon If the IP is U3, the driver will check some USB3 status bits. This could fail if only USB2 is used. This only check these bits if USB operate at USB3 speed. Signed-off-by: Alexandre Bailon Signed-off-by: Fabien Parent Signed-off-by: Alexandre Mergnat --- This patch is ported from downstream. Without this fix, USB doesn't work if USB2 protocol is used first. --- drivers/usb/mtu3/mtu3_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6 change-id: 20230426-usb-mtu3-improvement-77d987def9fe Best regards, diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_core.c index a3a6282893d0..00dba871aff8 100644 --- a/drivers/usb/mtu3/mtu3_core.c +++ b/drivers/usb/mtu3/mtu3_core.c @@ -100,7 +100,7 @@ static int mtu3_device_enable(struct mtu3 *mtu) mtu3_clrbits(ibase, U3D_SSUSB_IP_PW_CTRL2, SSUSB_IP_DEV_PDN); - if (mtu->u3_capable) { + if (mtu->u3_capable && mtu->max_speed >= USB_SPEED_SUPER) { check_clk = SSUSB_U3_MAC_RST_B_STS; mtu3_clrbits(ibase, SSUSB_U3_CTRL(0), (SSUSB_U3_PORT_DIS | SSUSB_U3_PORT_PDN |