Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp260832rdb; Mon, 15 Jan 2024 21:59:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGSI7+TjIFjDWE/sgnGR+SlJhO5yOSebngdUSILVqzqNG1+D3j39wHpZe3vJp4CBpRcE0Q9 X-Received: by 2002:ad4:5be8:0:b0:681:6533:416f with SMTP id k8-20020ad45be8000000b006816533416fmr1835852qvc.125.1705384740874; Mon, 15 Jan 2024 21:59:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705384740; cv=none; d=google.com; s=arc-20160816; b=tvhN+BrCArfl+aW3fR+eK5hvfMNSeH8PipWV1OPRPqgHBG1Mg1u4SVemGdpNYY3qHw KA37Cd1AVw3DeOR1hDq/YiUHCybYE1S86b8U0NAMO0ZEfnl44jiYdSkXUKzP4E4iwn03 Cenmeg/+W/3rrFllKaT3RVXmWxJisCfLwYWc91JoNHFgFqnzI4PMfY5KAz0/sCNJmx0q 3c/h1sul4asWardrWjofSUbxGQ1Zo+TMBkX5I6hmbfsvX3qrstqPAEUVIH5pTi/r3BLT gMEI9q4Y5bN+dM7OivM1v/oDZVuIc4VJsStylhNNBXMvk/g8NfGE4qjaWyfuQMQAbeP6 a2ew== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27022-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id b8-20020a0cc988000000b0067fc4a628f6si9270493qvk.198.2024.01.15.21.59.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 21:59:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-27022-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27022-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 9F1191C22B47 for ; Tue, 16 Jan 2024 05:59:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D57CD10A30; Tue, 16 Jan 2024 05:58:40 +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 To: Greg Kroah-Hartman , Thinh Nguyen , Mathias Nyman CC: Hans de Goede , , , Prashanth K , 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: List-Subscribe: List-Unsubscribe: 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 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: #5.11 Signed-off-by: Prashanth K --- 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