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 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 A5C12C4332F for ; Mon, 6 Nov 2023 02:15: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:MIME-Version:Subject:Cc:To:From: Message-Id:Date: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=GH14xj7N4RlCgqqR/If42tkY+YMRrMaWN/KgUrfyAfY=; b=ta1 H77HgP+BNZiFRj07+Cs5j3fqbhrN0IvraVbQnMlxH36KKxfH3ZYkoRoHOk/UpGoHiBk21nJJgFght 5eGvtiLf+sbh1xppZgHZySrqEfu1zYlTLHOQTlkc4yvVuwOTQ7QP5O6sg3gk1U582CwROyP+eSKt9 ktxExiC1mHWJ5l5tXe1WlZR9lxH+I4iFU9YOeu38N8ef39xH8QWMP+076HA/Ig87dApBA923MKE60 UZQuLbkynbl1TGneT0YZvmNAKyAfik/a5C6h/WAEzV8eqbxk5okDWFzaf5iKOFSXpQ30l3sEBoGtp Bq13+cSL3dDNHFAFPDHyhPeFRQtMhhg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qzp8n-00FkLr-1t; Mon, 06 Nov 2023 02:15:01 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qzp8k-00FkLJ-1B for linux-arm-kernel@lists.infradead.org; Mon, 06 Nov 2023 02:15:00 +0000 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6b77ab73c6fso3145139b3a.1 for ; Sun, 05 Nov 2023 18:14:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nathanrossi.com; s=google; t=1699236897; x=1699841697; darn=lists.infradead.org; h=mime-version:content-transfer-encoding:subject:cc:to:from :message-id:date:from:to:cc:subject:date:message-id:reply-to; bh=ws+jU834Z5pTFjaSqg7/r2pohlZD9LFdAotisTHBmcI=; b=Xpdv5MpUDxiRe3Jx6E9FuiiZy4X9LiObDxxzSmZXhL5BzAqf3CzwFcnnxr33nWsjbR AlQRVm42r6gZH9as05mERJ7WNPxstYDqxk0S9Wt2Cx8QqZuz3edVuDEQMJjXArFdWXFr tbwr8ychacs+SJIf8/8qUT4cU039kk9JYC92OHYOfknjcp4MTtRwY3eUMvXXOyoiBYx2 9tDmwnmVhiMkuyv9a2pecovxlrlEaZjK3sb8zHwy0eJkEdMtZVhMpjTkrQTnIITEJqyD vOvWMKu9zzH8AccOmYFpBoa1bH3Wn0duHIENWQbvr6aO/TJrAvKj95EkbeLzpu1fVcg+ u/Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699236897; x=1699841697; h=mime-version:content-transfer-encoding:subject:cc:to:from :message-id:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ws+jU834Z5pTFjaSqg7/r2pohlZD9LFdAotisTHBmcI=; b=Zt7HJBalG2UpY0npM/Nn4vcbNZ5BldV5cCVoEKibH4W4/HFZpqHSKKwiP3espl088Y KDXItS1ifv8A1Rytmh7LenjHAidrqZrDpqzpTbLcw1wiCQOMbm++ggegRCAoasyZOEzI DuY/jQ8nHmIdeRMcpghD1GL3g8EPS5X5bICCo/QVcjeuKFHiarA4x/EJiAE80Xnq9TXQ 6+OFvhGnVjuzzfrjTK7YgAbpXoQkzfMRfUC8+XJ6pYErYZeTUA4Hd/QWrZxpns0a+Apl Q5YUcnSFGO6ou49Ypr8R8W8IHUK1mngSHhiGogjalXl2q5Zv+KioIMEAhZinZIHqGVXK gutw== X-Gm-Message-State: AOJu0Yz0MMDj0m9LFcc/7d/ji4+G1AyGfM3u5lUHRTLV0rTtovOWO8Ij C6ev0P99TADZU9RZ3vktKwU7iA== X-Google-Smtp-Source: AGHT+IHR2nhzPl6lt4YYapmqhrLBMX6QH5ic7OLG3JGF8/stq+pN8h2t4zePr3+UKE9bM02bEaIXgw== X-Received: by 2002:a05:6a20:1446:b0:13f:13cb:bc50 with SMTP id a6-20020a056a20144600b0013f13cbbc50mr13293588pzi.25.1699236896754; Sun, 05 Nov 2023 18:14:56 -0800 (PST) Received: from [127.0.1.1] (117-20-68-32.751444.bne.nbn.aussiebb.net. [117.20.68.32]) by smtp.gmail.com with UTF8SMTPSA id d185-20020a6336c2000000b005b4b70738e5sm4534743pga.8.2023.11.05.18.14.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 18:14:56 -0800 (PST) Date: Mon, 06 Nov 2023 02:14:36 +0000 Message-Id: <20231106021436.1917894-1-nathan@nathanrossi.com> From: Nathan Rossi To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Nathan Rossi , Nathan Rossi , Fabio Estevam , Li Jun , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , NXP Linux Team Subject: [PATCH v2] arm64: dts: imx8mp: imx8mq: Add parkmode-disable-ss-quirk on DWC3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231105_181458_448377_242B2DF9 X-CRM114-Status: GOOD ( 20.47 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Nathan Rossi The i.MX8MP and i.MX8MQ devices both use the same DWC3 controller and are both affected by a known issue with the controller due to specific behaviour when park mode is enabled in SuperSpeed host mode operation. Under heavy USB traffic from multiple endpoints the controller will sometimes incorrectly process transactions such that some transactions are lost, or the controller may hang when processing transactions. When the controller hangs it does not recover. This issue is documented partially within the linux-imx vendor kernel which references a Synopsys STAR number 9001415732 in commits [1] and additional details in [2]. Those commits provide some additional controller internal implementation specifics around the incorrect behaviour of the SuperSpeed host controller operation when park mode is enabled. The summary of this issue is that the host controller can incorrectly enter/exit park mode such that part of the controller is in a state which behaves as if in park mode even though it is not. In this state the controller incorrectly calculates the number of TRBs available which results in incorrect access of the internal caches causing the overwrite of pending requests in the cache which should have been processed but are ignored. This can cause the controller to drop the requests or hang waiting for the pending state of the dropped requests. The workaround for this issue is to disable park mode for SuperSpeed operation of the controller through the GUCTL1[17] bit. This is already available as a quirk for the DWC3 controller and can be enabled via the 'snps,parkmode-disable-ss-quirk' device tree property. It is possible to replicate this failure on an i.MX8MP EVK with a USB Hub connecting 4 SuperSpeed USB flash drives. Performing continuous small read operations (dd if=/dev/sd... of=/dev/null bs=16) on the block devices will result in device errors initially and will eventually result in the controller hanging. [13240.896936] xhci-hcd xhci-hcd.0.auto: WARN Event TRB for slot 4 ep 2 with no TDs queued? [13240.990708] usb 2-1.3: reset SuperSpeed USB device number 5 using xhci-hcd [13241.015582] sd 2:0:0:0: [sdc] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=DRIVER_OK cmd_age=0s [13241.025198] sd 2:0:0:0: [sdc] tag#0 CDB: opcode=0x28 28 00 00 00 03 e0 00 01 00 00 [13241.032949] I/O error, dev sdc, sector 992 op 0x0:(READ) flags 0x80700 phys_seg 25 prio class 2 [13272.150710] usb 2-1.2: reset SuperSpeed USB device number 4 using xhci-hcd [13272.175469] sd 1:0:0:0: [sdb] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x03 driverbyte=DRIVER_OK cmd_age=31s [13272.185365] sd 1:0:0:0: [sdb] tag#0 CDB: opcode=0x28 28 00 00 00 03 e0 00 01 00 00 [13272.193385] I/O error, dev sdb, sector 992 op 0x0:(READ) flags 0x80700 phys_seg 18 prio class 2 [13434.846556] xhci-hcd xhci-hcd.0.auto: xHCI host not responding to stop endpoint command [13434.854592] xhci-hcd xhci-hcd.0.auto: xHCI host controller not responding, assume dead [13434.862553] xhci-hcd xhci-hcd.0.auto: HC died; cleaning up [1] https://github.com/nxp-imx/linux-imx/commit/97a5349d936b08cf301730b59e4e8855283f815c [2] https://github.com/nxp-imx/linux-imx/commit/b4b5cbc5a12d7c3b920d1d7cba0ada3379e4e42b Fixes: fb8587a2c165 ("arm64: dtsi: imx8mp: add usb nodes") Fixes: ad37549cb5dc ("arm64: dts: imx8mq: add USB nodes") Signed-off-by: Nathan Rossi Reviewed-by: Fabio Estevam --- Changes in v2: - Added Fixes to commit message --- arch/arm64/boot/dts/freescale/imx8mp.dtsi | 2 ++ arch/arm64/boot/dts/freescale/imx8mq.dtsi | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi index c9a610ba48..1264da6012 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi @@ -2072,6 +2072,7 @@ usb_dwc3_0: usb@38100000 { phys = <&usb3_phy0>, <&usb3_phy0>; phy-names = "usb2-phy", "usb3-phy"; snps,gfladj-refclk-lpm-sel-quirk; + snps,parkmode-disable-ss-quirk; }; }; @@ -2114,6 +2115,7 @@ usb_dwc3_1: usb@38200000 { phys = <&usb3_phy1>, <&usb3_phy1>; phy-names = "usb2-phy", "usb3-phy"; snps,gfladj-refclk-lpm-sel-quirk; + snps,parkmode-disable-ss-quirk; }; }; diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi index 4b1ce9fc17..c6dc3ba0d4 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi @@ -1649,6 +1649,7 @@ usb_dwc3_0: usb@38100000 { phys = <&usb3_phy0>, <&usb3_phy0>; phy-names = "usb2-phy", "usb3-phy"; power-domains = <&pgc_otg1>; + snps,parkmode-disable-ss-quirk; status = "disabled"; }; @@ -1680,6 +1681,7 @@ usb_dwc3_1: usb@38200000 { phys = <&usb3_phy1>, <&usb3_phy1>; phy-names = "usb2-phy", "usb3-phy"; power-domains = <&pgc_otg2>; + snps,parkmode-disable-ss-quirk; status = "disabled"; }; --- 2.42.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel