From patchwork Mon Oct 14 14:17:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 11188843 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C5C961390 for ; Mon, 14 Oct 2019 14:17:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A69A32133F for ; Mon, 14 Oct 2019 14:17:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="eY5Ijx4Q" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732606AbfJNORY (ORCPT ); Mon, 14 Oct 2019 10:17:24 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:33013 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732457AbfJNORX (ORCPT ); Mon, 14 Oct 2019 10:17:23 -0400 Received: by mail-wr1-f67.google.com with SMTP id b9so19984945wrs.0 for ; Mon, 14 Oct 2019 07:17:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wMvLKdMW2yszyQrYkGsmywM/YMlu6KRc8iq2yfQBOJU=; b=eY5Ijx4QWTlhlQGgOpdrVKEgjA20rWFw2eiZwRKaJUwJG/7aYuLbxNjxklme848/FJ bZIENnbseJ8mKmmwXVSzonk7Ng1vb6vhsbHBsJNqNAmUllpNX8AX1ucQG8nUQtVatNSn sFOIgOQ9gV9zZjtGU0jIjQTaRE9DBPg+HEMIyXkmO2VTK/khiMwWsvhrac4wYFbgq+Z3 vE5xtZZ0RJ1pMA7JuOvXzAaOGtggmD2NXmqcdm4f6tWycPkf8RLCBBUsj+BrcLeomLtJ mR19XkB+Lfc1ufptniAr2amT/joX/dioGuQbWLAGoXf3f64nUyhxO6JQtw6i4rFn3BMz quqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wMvLKdMW2yszyQrYkGsmywM/YMlu6KRc8iq2yfQBOJU=; b=o9D+W+uVymU5fr/4uxVI5y2XBgTrOEJRcI0PMmm2zFINHPxhDe7D2y/+UDLe3oFd1h UvkwbrNMgr3zrQMGvWujM5ip+jpO4MfXkAWBjrSPEREEm/v93RPjY+kE/XlATe/r5s7Y MSkWERABUZIyUvEjkp8ihxyrLwOeZ8ljHJGcdPW03WPr9yq48m6LLjTD7BSf2OI6M48t rwYa3nOEatmoQlc/I8cBcRgCJB7Vq/dUC05s358Wc09AiM8wS+D2EbmZDDcBW4th6OPY 6CmPiaeZK/2XhnVd6PaxHhcy0ikEPO2IwAKV0RpJQC0JuT//XtcLhvamefoT3kW9uhsz NW0w== X-Gm-Message-State: APjAAAUbTqs/nwUD5l6+5IPPFyjI7XUxSKsTiLH2cKL3zlPgLmCku17b 1n9+RRdW7TqaNM74rSl9CH6XZQ== X-Google-Smtp-Source: APXvYqxYpJiFTdR6oysIP3BylyvjHRtG6AcTsX9/NO35uydOOjXlwBQ3nkYdCfVqNkSILXSLfHU1UA== X-Received: by 2002:adf:8526:: with SMTP id 35mr300767wrh.266.1571062641346; Mon, 14 Oct 2019 07:17:21 -0700 (PDT) Received: from bender.baylibre.local (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id t83sm42708624wmt.18.2019.10.14.07.17.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2019 07:17:20 -0700 (PDT) From: Neil Armstrong To: balbi@kernel.org, khilman@baylibre.com, devicetree@vger.kernel.org Cc: Neil Armstrong , linux-usb@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dongjin Kim , Jianxin Pan , Tim Subject: [PATCH 1/3] doc: dt: bindings: usb: dwc3: Update entries for disabling SS instances in park mode Date: Mon, 14 Oct 2019 16:17:16 +0200 Message-Id: <20191014141718.22603-2-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20191014141718.22603-1-narmstrong@baylibre.com> References: <20191014141718.22603-1-narmstrong@baylibre.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org This patch updates the documentation with the information related to the quirks that needs to be added for disabling all SuperSpeed XHCi instances in park mode. CC: Dongjin Kim Cc: Jianxin Pan Reported-by: Tim Signed-off-by: Neil Armstrong Acked-by: Rob Herring --- Documentation/devicetree/bindings/usb/dwc3.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt index 66780a47ad85..c977a3ba2f35 100644 --- a/Documentation/devicetree/bindings/usb/dwc3.txt +++ b/Documentation/devicetree/bindings/usb/dwc3.txt @@ -75,6 +75,8 @@ Optional properties: from P0 to P1/P2/P3 without delay. - snps,dis-tx-ipgap-linecheck-quirk: when set, disable u2mac linestate check during HS transmit. + - snps,parkmode-disable-ss-quirk: when set, all SuperSpeed bus instances in + park mode are disabled. - snps,dis_metastability_quirk: when set, disable metastability workaround. CAUTION: use only if you are absolutely sure of it. - snps,is-utmi-l1-suspend: true when DWC3 asserts output signal From patchwork Mon Oct 14 14:17:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 11188837 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0CF5E1390 for ; Mon, 14 Oct 2019 14:17:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E08B52089C for ; Mon, 14 Oct 2019 14:17:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="bn3ZspUJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732625AbfJNORZ (ORCPT ); Mon, 14 Oct 2019 10:17:25 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:51283 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732506AbfJNORY (ORCPT ); Mon, 14 Oct 2019 10:17:24 -0400 Received: by mail-wm1-f67.google.com with SMTP id 7so17489846wme.1 for ; Mon, 14 Oct 2019 07:17:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6RXqG5Af/3T765Lcjtvbk/UObYQwmVYQ6qNsUxXclLs=; b=bn3ZspUJJ5UmMi0EdqwKTRnQu9xyBbhCz62kjUH/dRTv/U+R0Vv2f7jH6o/xm9oWt7 GrZzedImYwuSI/KfxNoprRt4yCQuF3UKoP8Qyte/eFQvbYUERKNpyuIDyDSrn4Nf5c/J sPDIrLKFSBrSPjHmjXTpBgDfnouc4tTux3Zdn1x4CX9W/+rgvyuEJu/eJ/H8FcsJE/Yx DZiuFmFpzQnvr5rzX4WRfc1Aaj4zKxFSkitfhirUs0RH6UJc2rGjH0aPkUGhozrJyn5K ce0OpYUP7iW9vepZyOLcc6bmxKYLOud9NWkFOtWHK6f378JF9mEZyWwI1oBz2h/KvqR1 6HaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6RXqG5Af/3T765Lcjtvbk/UObYQwmVYQ6qNsUxXclLs=; b=dJmzcFreezo8Y8o2UOKrutdJXSa3+ihBFSR2vm1yDHALmP+ZeHBn2YoKOhHvE56G2L iaGO1UPHW7ga2q27d3HpMVltqoMxgNuX7bp+UBhZ8MI9nLbBwEcqcie1MCx6OSSuacRO cRS9sfeRuh4dnITCfHF8abhb0uwjDTFh7+xuzcOeciFhr4E/v0/tqSG7EI3Hl8lEn+Pl yArtmKEy1pg4U4pOsSiSOwCnYb/olkOmOgnEkW44kklZkGTxRkGdlw3RT7Ly11VO7s+r aWDKDFa4Ba0H5ne3qX3PWeaSvI2+GICUUlog0hXo9CBWFmgdsvDQabj+rM6fROG+HJBt VYZA== X-Gm-Message-State: APjAAAWZVq1BYmWE5jMu7k/GIehiAyUyu49dJ6gbrSJOL0tYn84MUX02 wrLDcyhRsxbPt+g6dTtkw4jRJtkv6Kgp5A== X-Google-Smtp-Source: APXvYqw4IO9MRxbqhVYZiKfAMyWhC/RNKtuMVM/wLlGtJnmTIO2XZbkFlL27avwMAb+BYU5bynNS9Q== X-Received: by 2002:a7b:c947:: with SMTP id i7mr15599951wml.53.1571062642161; Mon, 14 Oct 2019 07:17:22 -0700 (PDT) Received: from bender.baylibre.local (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id t83sm42708624wmt.18.2019.10.14.07.17.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2019 07:17:21 -0700 (PDT) From: Neil Armstrong To: balbi@kernel.org, khilman@baylibre.com Cc: Neil Armstrong , linux-usb@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dongjin Kim , Jianxin Pan , Tim Subject: [PATCH 2/3] usb: dwc3: gadget: Add support for disabling SS instances in park mode Date: Mon, 14 Oct 2019 16:17:17 +0200 Message-Id: <20191014141718.22603-3-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20191014141718.22603-1-narmstrong@baylibre.com> References: <20191014141718.22603-1-narmstrong@baylibre.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org In certain circumstances, the XHCI SuperSpeed instance in park mode can fail to recover, thus on Amlogic G12A/G12B/SM1 SoCs when there is high load on the single XHCI SuperSpeed instance, the controller can crash like: xhci-hcd xhci-hcd.0.auto: xHCI host not responding to stop endpoint command. xhci-hcd xhci-hcd.0.auto: Host halt failed, -110 xhci-hcd xhci-hcd.0.auto: xHCI host controller not responding, assume dead xhci-hcd xhci-hcd.0.auto: xHCI host not responding to stop endpoint command. hub 2-1.1:1.0: hub_ext_port_status failed (err = -22) xhci-hcd xhci-hcd.0.auto: HC died; cleaning up usb 2-1.1-port1: cannot reset (err = -22) Setting the PARKMODE_DISABLE_SS bit in the DWC3_USB3_GUCTL1 mitigates the issue. The bit is described as : "When this bit is set to '1' all SS bus instances in park mode are disabled" CC: Dongjin Kim Cc: Jianxin Pan Reported-by: Tim Signed-off-by: Neil Armstrong --- drivers/usb/dwc3/core.c | 5 +++++ drivers/usb/dwc3/core.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 999ce5e84d3c..a36cf33330fb 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -993,6 +993,9 @@ static int dwc3_core_init(struct dwc3 *dwc) if (dwc->dis_tx_ipgap_linecheck_quirk) reg |= DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS; + if (dwc->parkmode_disable_ss_quirk) + reg |= DWC3_GUCTL1_PARKMODE_DISABLE_SS; + dwc3_writel(dwc->regs, DWC3_GUCTL1, reg); } @@ -1303,6 +1306,8 @@ static void dwc3_get_properties(struct dwc3 *dwc) "snps,dis-del-phy-power-chg-quirk"); dwc->dis_tx_ipgap_linecheck_quirk = device_property_read_bool(dev, "snps,dis-tx-ipgap-linecheck-quirk"); + dwc->parkmode_disable_ss_quirk = device_property_read_bool(dev, + "snps,parkmode-disable-ss-quirk"); dwc->tx_de_emphasis_quirk = device_property_read_bool(dev, "snps,tx_de_emphasis_quirk"); diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 1c8b349379af..5fb557f24d38 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -249,6 +249,7 @@ #define DWC3_GUCTL_HSTINAUTORETRY BIT(14) /* Global User Control 1 Register */ +#define DWC3_GUCTL1_PARKMODE_DISABLE_SS BIT(17) #define DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS BIT(28) #define DWC3_GUCTL1_DEV_L1_EXIT_BY_HW BIT(24) @@ -1022,6 +1023,8 @@ struct dwc3_scratchpad_array { * change quirk. * @dis_tx_ipgap_linecheck_quirk: set if we disable u2mac linestate * check during HS transmit. + * @parkmode_disable_ss_quirk: set if we need to disable all SuperSpeed + * instances in park mode. * @tx_de_emphasis_quirk: set if we enable Tx de-emphasis quirk * @tx_de_emphasis: Tx de-emphasis value * 0 - -6dB de-emphasis @@ -1213,6 +1216,7 @@ struct dwc3 { unsigned dis_u2_freeclk_exists_quirk:1; unsigned dis_del_phy_power_chg_quirk:1; unsigned dis_tx_ipgap_linecheck_quirk:1; + unsigned parkmode_disable_ss_quirk:1; unsigned tx_de_emphasis_quirk:1; unsigned tx_de_emphasis:2; From patchwork Mon Oct 14 14:17:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 11188841 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 353CD1575 for ; Mon, 14 Oct 2019 14:17:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 160AA2133F for ; Mon, 14 Oct 2019 14:17:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="qw+2kp/+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732630AbfJNOR0 (ORCPT ); Mon, 14 Oct 2019 10:17:26 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:51169 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732601AbfJNORZ (ORCPT ); Mon, 14 Oct 2019 10:17:25 -0400 Received: by mail-wm1-f65.google.com with SMTP id 5so17497806wmg.0 for ; Mon, 14 Oct 2019 07:17:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WhPSwUwjAsJRbhdmE0cVGRUouZ5x8oaruQHda5jd55I=; b=qw+2kp/+fl6kXsLl22YjrO0TyQy+b2qOG96cAr18nh3mIUcQO2wxOniKBJRga3bv6p 9gVO175nSljYfUAcAjw9jxTI1QDAAsmlRxihaiHD0ltMTQcWkjfZASaKg7Zrg0rKzyc5 kFWR35CpMP10S6rBiE0sZlidqw2c81x70/pVS9YXFWxXbQfXDv3Z/TWitlohxBSSLH0I P34TlcmfOwb0nOjj/iyY8JJLUbbJhcr7bPt+yGE4VFH0VxHjbSW13cTO9VLCyNOU4x1F GyW1IX/y5/Gt5n10NogGoISQkc3ykn+ouY3KCXlxf+UvVSWFnjKjQKKwexoQVmbk7g8u mwwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WhPSwUwjAsJRbhdmE0cVGRUouZ5x8oaruQHda5jd55I=; b=D20g9AWuZc7DnWsIPIpoMLxWim7okHcM4wNfvyGpbiGvj1b/DDGOKyAu+oMXM8bxFh 1Z8KtBvtDiinoLpEvEmuWe+HFglvqy2vlk5xJwBanvPeFts2W3XrfLliSaJ9Hil0RgVJ B8ZZWsTIE+DA5Ai8GZW/D3c03eD3za1t17nbYq+M85rxuwneXnToNePYDV8KAvihrJ01 MYY9D/BqmyvKu1EC0z3C1PjB807JmzlcPodyIfTg1cvoOsBQGZukcnG85XUqh5JlouJu J5NvZS7QRi9GghbJ6DKmrc4AThvdxGMbQU+jjQ/mAMGe9BGUWLjEAIrxeuEscsxK9qEI QUVQ== X-Gm-Message-State: APjAAAXA3FLinWE7X4Rx/NE0dHQyJlQTtw3hUZktb8XJ9FWtSTTGzvOG rY4UBnGEYv+guvGvKDfHAzMAeQ== X-Google-Smtp-Source: APXvYqwyLKkJs7kEVRKHW2iMVF8t8Y3SI49VubmuzAmVzLaKXolT83XHyMDU/m35t26Bb9WZbO3Sjg== X-Received: by 2002:a1c:c90f:: with SMTP id f15mr15817487wmb.125.1571062643202; Mon, 14 Oct 2019 07:17:23 -0700 (PDT) Received: from bender.baylibre.local (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id t83sm42708624wmt.18.2019.10.14.07.17.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2019 07:17:22 -0700 (PDT) From: Neil Armstrong To: balbi@kernel.org, khilman@baylibre.com Cc: Neil Armstrong , linux-usb@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dongjin Kim , Jianxin Pan , Tim Subject: [PATCH 3/3] arm64: dts: g12-common: add parkmode_disable_ss_quirk on DWC3 controller Date: Mon, 14 Oct 2019 16:17:18 +0200 Message-Id: <20191014141718.22603-4-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20191014141718.22603-1-narmstrong@baylibre.com> References: <20191014141718.22603-1-narmstrong@baylibre.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org When high load on the DWC3 SuperSpee port, the controller crashed as: [ 221.141621] xhci-hcd xhci-hcd.0.auto: xHCI host not responding to stop endpoint command. [ 221.157631] xhci-hcd xhci-hcd.0.auto: Host halt failed, -110 [ 221.157635] xhci-hcd xhci-hcd.0.auto: xHCI host controller not responding, assume dead [ 221.159901] xhci-hcd xhci-hcd.0.auto: xHCI host not responding to stop endpoint command. [ 221.159961] hub 2-1.1:1.0: hub_ext_port_status failed (err = -22) [ 221.160076] xhci-hcd xhci-hcd.0.auto: HC died; cleaning up [ 221.165946] usb 2-1.1-port1: cannot reset (err = -22) Setting the parkmode_disable_ss_quirk quirk fixes the issue. CC: Dongjin Kim Cc: Jianxin Pan Reported-by: Tim Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi index 3f39e020f74e..4b002e799e5c 100644 --- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi @@ -2381,6 +2381,7 @@ dr_mode = "host"; snps,dis_u2_susphy_quirk; snps,quirk-frame-length-adjustment; + snps,parkmode-disable-ss-quirk; }; };