Message ID | 20240116055816.1169821-2-quic_prashk@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-27022-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:42cf:b0:101:a8e8:374 with SMTP id q15csp73251dye; Mon, 15 Jan 2024 22:06:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IHiiX+Ax2sJ1iNPFf6CETv8+PxcoVA4dg4kV9BlBE/RAH7ikxf7820jVmfgBFnjHlpOkVLM X-Received: by 2002:aa7:d445:0:b0:559:b648:b954 with SMTP id q5-20020aa7d445000000b00559b648b954mr14731edr.47.1705385164710; Mon, 15 Jan 2024 22:06:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705385164; cv=none; d=google.com; s=arc-20160816; b=Wb7uaw3sy3z9DzYVnvRXlwTbtVBpV2hjkehMahHPAh38fZ/QLyaFZicqKRwmwvda9Q nUUO6aI0n/5WN92D5B/mB8IiaS7p9cs6+JRTnA+xyVH9z81O6LIPGxRhtR5x1uDDZOHW TU2CxD/K7RRI/kz86oiYXvZ3fsD7llQd97Ecf/btpPiQLLHAxL4RE+u08QylXRV7vfqE UY3AbI3csqnGplyASAQLTrb/rRwk10F5sVo+NRVXSs3lTKEn5wM5OK7OfdZ3beVLiQJY /RdS+qYuTlamfEoQ1LD0TxZkChxwuv9Dm0jU1v3YEVE4I4nayf1DqdLRg5Im/AfOjYwc fDtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=31uYYg2J8ljpZFOYIMAcRu4KvmIGupqy2vCDVVnuVsY=; fh=a0yd45FnuQlrViILFfYdcM2GyvvZerrOtLrtiY6M2Bw=; b=F3fTZ1PpUxkOWpVQobT2d1Wsv4pxkbpIdv+Aysx2gNZ1RSoGpymjVyDXJhOGzzluIe X7jzyhEyn8AU00zKQcrJpFEIBI497pYklHIv28iYIeGARBOV0GovErjWRRszifMCV91e 9+JRJtMFPDJaJ3L6//jzGhnq22JWhj7y8LQ1wnYm5WmHtMX3oxurXeBvGK8PU1nisogu mypKGBg6HriTu67tVPu+cPSEyKD6kMhskmb/9qtx/lr+neYCwzqSYfz5S9zCJGEGNQ+C X0c6Y0Txp3KANJSVp5Ncy42Fef014CvI88sVxB4KIWNDADadUsBTHBhElz+A0BD28Ejp 23ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=FIXj3Pl0; spf=pass (google.com: domain of linux-kernel+bounces-27022-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27022-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id fd2-20020a056402388200b005597f92d6b4si535662edb.325.2024.01.15.22.06.04 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 22:06:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-27022-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=FIXj3Pl0; spf=pass (google.com: domain of linux-kernel+bounces-27022-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27022-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D85EF1F23F87 for <ouuuleilei@gmail.com>; Tue, 16 Jan 2024 05:59:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B5B2611197; Tue, 16 Jan 2024 05:58:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="FIXj3Pl0" Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A23B4101EB; Tue, 16 Jan 2024 05:58:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40G45blO030540; Tue, 16 Jan 2024 05:58:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=31uYYg2J8ljpZFOYIMAcRu4KvmIGupqy2vCDVVnuVsY=; b=FI Xj3Pl0xlF48cEI7T/BcOIcW/ANuOlch+fvAYC0FI7a5voMgVWn13R9OlgeXgOROz DzQ/nAsbjMTM6C5lvVGt83LH8WA1qnq9RbtpMUOWFs+7/aDSHX6EORGTZfoj9oYr fm+ozf18MeTUOQs2uub5xEeqxU2SklfaCD4QlEFG0P9QJorzwvKe8v1GJwu3teUt EiKrnFkxJS24kT0e804BK16TqgaZQx+L8+08NQGXxohENZQqUl4PcTPylFZpFeS5 133s8onhgjJ1gRALcJCjHoiK+EYPpbahNTCBIMoPTqUSOsuS6QKfn2mCvG09aYMA b8LvLbjK+jxhBbHyV6kQ== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vn8e9s6h6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Jan 2024 05:58:33 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40G5wW9c008963 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Jan 2024 05:58:32 GMT Received: from hu-prashk-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 15 Jan 2024 21:58:29 -0800 From: Prashanth K <quic_prashk@quicinc.com> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Thinh Nguyen <Thinh.Nguyen@synopsys.com>, Mathias Nyman <mathias.nyman@intel.com> CC: Hans de Goede <hdegoede@redhat.com>, <linux-kernel@vger.kernel.org>, <linux-usb@vger.kernel.org>, Prashanth K <quic_prashk@quicinc.com>, <stable@vger.kernel.org> Subject: [PATCH v3 1/2] usb: dwc3: host: Set XHCI_SG_TRB_CACHE_SIZE_QUIRK Date: Tue, 16 Jan 2024 11:28:15 +0530 Message-ID: <20240116055816.1169821-2-quic_prashk@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240116055816.1169821-1-quic_prashk@quicinc.com> References: <20240116055816.1169821-1-quic_prashk@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: idkoulMzQGxx6ksLtlxSwtdjvqaw6ijg X-Proofpoint-ORIG-GUID: idkoulMzQGxx6ksLtlxSwtdjvqaw6ijg X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_01,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 priorityscore=1501 phishscore=0 mlxlogscore=999 suspectscore=0 impostorscore=0 mlxscore=0 bulkscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401160044 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788225954233610627 X-GMAIL-MSGID: 1788225954233610627 |
Series |
Set XHCI_SG_TRB_CACHE_SIZE_QUIRK for DWC3 devices
|
|
Commit Message
Prashanth K
Jan. 16, 2024, 5:58 a.m. UTC
Upstream commit bac1ec551434 ("usb: xhci: Set quirk for
XHCI_SG_TRB_CACHE_SIZE_QUIRK") introduced a new quirk in XHCI
which fixes XHC timeout, which was seen on synopsys XHCs while
using SG buffers. But the support for this quirk isn't present
in the DWC3 layer.
We will encounter this XHCI timeout/hung issue if we run iperf
loopback tests using RTL8156 ethernet adaptor on DWC3 targets
with scatter-gather enabled. This gets resolved after enabling
the XHCI_SG_TRB_CACHE_SIZE_QUIRK. This patch enables it using
the xhci device property since its needed for DWC3 controller.
In Synopsys DWC3 databook,
Table 9-3: xHCI Debug Capability Limitations
Chained TRBs greater than TRB cache size: The debug capability
driver must not create a multi-TRB TD that describes smaller
than a 1K packet that spreads across 8 or more TRBs on either
the IN TR or the OUT TR.
Cc: <stable@vger.kernel.org> #5.11
Signed-off-by: Prashanth K <quic_prashk@quicinc.com>
---
drivers/usb/dwc3/host.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Comments
On Tue, Jan 16, 2024, Prashanth K wrote: > Upstream commit bac1ec551434 ("usb: xhci: Set quirk for > XHCI_SG_TRB_CACHE_SIZE_QUIRK") introduced a new quirk in XHCI > which fixes XHC timeout, which was seen on synopsys XHCs while > using SG buffers. But the support for this quirk isn't present > in the DWC3 layer. > > We will encounter this XHCI timeout/hung issue if we run iperf > loopback tests using RTL8156 ethernet adaptor on DWC3 targets > with scatter-gather enabled. This gets resolved after enabling > the XHCI_SG_TRB_CACHE_SIZE_QUIRK. This patch enables it using > the xhci device property since its needed for DWC3 controller. > > In Synopsys DWC3 databook, > Table 9-3: xHCI Debug Capability Limitations > Chained TRBs greater than TRB cache size: The debug capability > driver must not create a multi-TRB TD that describes smaller > than a 1K packet that spreads across 8 or more TRBs on either > the IN TR or the OUT TR. > > Cc: <stable@vger.kernel.org> #5.11 > Signed-off-by: Prashanth K <quic_prashk@quicinc.com> > --- > drivers/usb/dwc3/host.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c > index 61f57fe5bb78..43230915323c 100644 > --- a/drivers/usb/dwc3/host.c > +++ b/drivers/usb/dwc3/host.c > @@ -61,7 +61,7 @@ static int dwc3_host_get_irq(struct dwc3 *dwc) > > int dwc3_host_init(struct dwc3 *dwc) > { > - struct property_entry props[4]; > + struct property_entry props[5]; > struct platform_device *xhci; > int ret, irq; > int prop_idx = 0; > @@ -89,6 +89,8 @@ int dwc3_host_init(struct dwc3 *dwc) > > memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props)); > > + props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-sg-trb-cache-size-quirk"); > + > if (dwc->usb3_lpm_capable) > props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb3-lpm-capable"); > > -- > 2.25.1 > Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Thanks, Thinh
diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c index 61f57fe5bb78..43230915323c 100644 --- a/drivers/usb/dwc3/host.c +++ b/drivers/usb/dwc3/host.c @@ -61,7 +61,7 @@ static int dwc3_host_get_irq(struct dwc3 *dwc) int dwc3_host_init(struct dwc3 *dwc) { - struct property_entry props[4]; + struct property_entry props[5]; struct platform_device *xhci; int ret, irq; int prop_idx = 0; @@ -89,6 +89,8 @@ int dwc3_host_init(struct dwc3 *dwc) memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props)); + props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-sg-trb-cache-size-quirk"); + if (dwc->usb3_lpm_capable) props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb3-lpm-capable");