From patchwork Thu Nov 2 08:24:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Rossi X-Patchwork-Id: 160806 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp201029vqu; Thu, 2 Nov 2023 01:25:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF0qrSKpurBf8GYF18Jm4QXHNqNuIu9jp8F+goByz5qw/TnRaukY1ax9CWIzsucJQj0Ix2x X-Received: by 2002:a17:90a:34d:b0:280:c576:31b9 with SMTP id 13-20020a17090a034d00b00280c57631b9mr3568717pjf.38.1698913523484; Thu, 02 Nov 2023 01:25:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698913523; cv=none; d=google.com; s=arc-20160816; b=YT5VmEPK5WsMWzDhtYPI13AWF9snwEJ08IedH4GUYg9R+mYp5bQgkCOsk+TDDz8Z09 hMLd91nzSwfNxAJ5g5n/OL+PU9DkUmSpYN96PMagtf+NAr4mGE6ouFvgdFN+VxU3TtYa CL7HP/e8ffmzNcFYc1ZvUHG+51Er9ip4pOWJEiemfB99Hiz7Z1PmYGel1qsB8VaLUGRW Hx8YytzOoDxuz6hwIN2HFyo8U37H4Wv9cRR0+j2IFRQe08mywiXcV50nH3cV156yRIMr R1Vz6+Ux4T+IOyLYIjEmdau7eRt5KvYk0wX9rlaaWmqkY+vYorEKZ8LdLF5s+Jb0DnW2 hUxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding:subject :cc:to:from:message-id:date:dkim-signature; bh=xBUQuJ95bR9IExrTX27aZhd9vx5/8o/0coGqo9/0lKA=; fh=BWK30tBKOFX9rDk1n6AEv7QlzqGsZrIu9p5tOVtZLoY=; b=HBSVlzFjr9/HgKYp+fHVbWMkCSkwg5UcmIeHnCAwOUY2dVE8Od4dkGTD6zKDueFG21 T0suGGciRVzzq/yUrKdsxV53C7kTfgyYNbI+s8dlxEK+7I94tStVnBntzP2QJXjicNkG HFhCt6+a+C5ugESqiqC2J6OVXR9ddfx1ZcE/2zaQtOahqbyNcVifskDiXXLlObyBKqq3 L4rYdXqDaAmLQa14f7FQ1PZKeYXDaqUmc//wHbJ5wzJ/VbtRIhXX0a5Q1LEqHDPOuFbD PWiywCeqYWYExXYcsKtS8UKgu7tzVb4VvUXrIyB7RdP1v880yw1sGwHQ5n/sFX5O5Oto 1XXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nathanrossi.com header.s=google header.b=XN76D0qf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nathanrossi.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id v2-20020a17090a898200b002800c1493c5si2395864pjn.29.2023.11.02.01.25.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 01:25:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@nathanrossi.com header.s=google header.b=XN76D0qf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nathanrossi.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 23C258069D97; Thu, 2 Nov 2023 01:25:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344988AbjKBIYc (ORCPT + 35 others); Thu, 2 Nov 2023 04:24:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234827AbjKBIYa (ORCPT ); Thu, 2 Nov 2023 04:24:30 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EA1F18E for ; Thu, 2 Nov 2023 01:24:20 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-517ab9a4a13so518782a12.1 for ; Thu, 02 Nov 2023 01:24:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nathanrossi.com; s=google; t=1698913460; x=1699518260; darn=vger.kernel.org; h=mime-version:content-transfer-encoding:subject:cc:to:from :message-id:date:from:to:cc:subject:date:message-id:reply-to; bh=xBUQuJ95bR9IExrTX27aZhd9vx5/8o/0coGqo9/0lKA=; b=XN76D0qf9qccoBYsNGY9TQmgd/fXtxErtOrsHLuW0Z1cD43uSSYaOY/KnaukFxA4VI U+nAMP34XlJdo2exH7QJJILqse/XLIyZ9ZLzzahDSKpSX89RHBuOf83SNv6OqNRPLQiO 4EU3bP++84VJUugbGYHv7GbD1aOTBqGRanOzFy5G6ojtPDK3doF2OiWUWY8Vt5oVgTEC /qIYAHEUiofVniLWzHEj5D81FZccXDeeMFINXnaqBDQxhIB1HVK8UhuGtod9WOdI87GJ YMur4m3NmmWiloW+Rv9tNZeDwI4MQ0o7QMFm92zaaIoJcAiB1DkxVPhr5h0MKImcEJXY xE7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698913460; x=1699518260; 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=xBUQuJ95bR9IExrTX27aZhd9vx5/8o/0coGqo9/0lKA=; b=adtTBwOIa3ciFTa5KuKskoWs4aa2Md5HJOdhvNWjjFeLtijj77wQ8GAuIZPwrMsbud +QAzf2m/eZN6F2qkx/DQ0cG6sHuDYZUvYTKJIsGVDM5JnQelWFY20i0yYgq00U7P7T12 8jWWLFjjbhGpZedTaySeAlb/J9Kfu0g1vj/9Gq5rCvI7ftZjV9Zt1j3QLcy90I+gTYPn rKuUyNocgg3xWnqF+9xLFKs1/gZC52h9ybE0xWxT5XigCn6nCmwFKgIT9MdIR+Y8MrUD 6r70/Wa+nnPE/j6nJdTVSE9tml1q4gploatoxN7fn6AOrGsKTpFItCnRcD9WYGAxbgcN 6bKA== X-Gm-Message-State: AOJu0YxuUqotvsiNw5yya/ZthXQdo1IfqtMLqNhv407As9BtieQYZ+Bt DaeSK6pLfBVPu9bAAA6AW47zgQ== X-Received: by 2002:a05:6a21:6d9c:b0:162:4f45:b415 with SMTP id wl28-20020a056a216d9c00b001624f45b415mr23597403pzb.51.1698913459805; Thu, 02 Nov 2023 01:24:19 -0700 (PDT) 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 20-20020a17090a199400b0027d0adf653bsm2172484pji.7.2023.11.02.01.24.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 01:24:19 -0700 (PDT) Date: Thu, 02 Nov 2023 08:24:06 +0000 Message-Id: <20231102082406.1555227-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 , Li Jun , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Subject: [PATCH] arm64: dts: imx8mp: imx8mq: Add parkmode-disable-ss-quirk on DWC3 MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 02 Nov 2023 01:25:14 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781439946652002066 X-GMAIL-MSGID: 1781439946652002066 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 Signed-off-by: Nathan Rossi Reviewed-by: Fabio Estevam --- arch/arm64/boot/dts/freescale/imx8mp.dtsi | 2 ++ arch/arm64/boot/dts/freescale/imx8mq.dtsi | 2 ++ 2 files changed, 4 insertions(+) --- 2.42.0 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"; };