From patchwork Thu Sep 5 07:03:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Laszczak X-Patchwork-Id: 13791904 Received: from mx0a-0014ca01.pphosted.com (mx0a-0014ca01.pphosted.com [208.84.65.235]) (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 CC17F193070; Thu, 5 Sep 2024 07:58:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=208.84.65.235 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725523138; cv=fail; b=UZGZVQ9zRC5Rr4oO7DilsIHM2PUj7t6p4Bw513Sr34UUUhkOxZ/9e6t0wNquLufw+BkA38J/YRumHirYFUHl6U7UMYEoeRfQHIuyL14Yrw5x65j92PbgACzDeK5BhEaxiAxcdNrVvZ1Lrl4yeMEkJYNTDs2u046zzRDvKUS7B1s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725523138; c=relaxed/simple; bh=PcqrmKbu0DUNH3A+QKwO8dc2ydopc1rTjA5D1CfZ+k0=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=tFOgMIkSh87+m0EMfm+UHamy3GZJAW26/UFvE3sym8lDDlNzXEqiOquBxRNUwb334M1wDPsbeQOmnyU8+EooyeE85Xnw6zwK+VQENU4HOZSJ8YlXAfGMN2YaOeFi8xn34X2KgpCR67MiTk8Hk61RA1nRWeeDuUg9npJG1Hm9GUQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cadence.com; spf=pass smtp.mailfrom=cadence.com; dkim=pass (2048-bit key) header.d=cadence.com header.i=@cadence.com header.b=JsNVlbxg; dkim=pass (1024-bit key) header.d=cadence.com header.i=@cadence.com header.b=ev192y27; arc=fail smtp.client-ip=208.84.65.235 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cadence.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cadence.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cadence.com header.i=@cadence.com header.b="JsNVlbxg"; dkim=pass (1024-bit key) header.d=cadence.com header.i=@cadence.com header.b="ev192y27" Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 484LtcEq005333; Thu, 5 Sep 2024 00:03:31 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=proofpoint; bh=OMl7bGZOIQhrWGDNvwDF1W+AqPyJQTeLY0wX+xCW1po=; b=JsNVlbxgkUbh OpLO6cI6gyvh2xWXfVykQZVwkD2CE0h2ErhjW376BniJx9LFkoguOYI9VePwbLJy Y9oc5JMzCx62O+eeTdt8St4qRC6832T2vUpTqjkkh9lOQVBq9A6pLcDkGntSAmSV D1uH4YI59NXeZ2MWF6qzY5tJYhSUwccdrMz5Y7WAH1AczWONWuwndATNguNl40sw inKMnJBxVwHqEw6Vvf1iQWDwUUJWmK1B+bntuRKsfhUKWriTL3ber7lDNdu7Ak2S Z6eo2mKDnekHJsSMX+2FB9pzZDHiMWFm287mkctsEljSYJfKpEy5Auu9mxGP9DCY 3MInJlqKdQ== Received: from bn1pr04cu002.outbound.protection.outlook.com (mail-eastus2azlp17010004.outbound.protection.outlook.com [40.93.12.4]) by mx0a-0014ca01.pphosted.com (PPS) with ESMTPS id 41byqtgunn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 05 Sep 2024 00:03:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pVitRc4UV9sT3Y48Y3Ut6Yp4JAWZc/Oq77HWNdGQ6g9Gj1nfKQU8+lELzC3A7HPGJ3JbVkIYWmYfKyg4SCStR6a4aR5J5Y87hDuk0Kx7baPB1rFdSjRlWSP/iiTj6iM7ILp+tRRKdUl2k0vuh9e5R4rM8ahOeYNXo23hs4NxkK6MoZvoJlb+LngXG8hn3kX4ZQQz4riMTiAkzmlqiaXJoNLaZXF0i77dSdwUSDNFlMbx6g/f3uXXHI6rmQmDrkx17hLX6eQXzkjrXAY5N2sHH4H66BCRNvdomS+3toxS5TfBMC1buPc6W88KtpWTCYqRlPu3u0KZq3AngYDy/fJtRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OMl7bGZOIQhrWGDNvwDF1W+AqPyJQTeLY0wX+xCW1po=; b=uBs7syT/bDxL4Q6g7jCKSfLJU9f4ILwLS7m6gljlbR3CqbnH1KYg5rPXX6fi821LaOOg32WADCHXVk7I8VQCKy+3H4BPARqdNzHkTUBJgxqlmNcxcTWhPZM3VQsvApwJKDnpW8jLlSzmqso+nc7M/5CpKK9UFwGEcg4XM9OMsKStuvpxs/bJ4x7vnfJ7tMQTgmFxGu9NL4PrmrtDhqw15/iwS4o+HlhsRPY1IIttjzn93TkpQGlu8xu/Mtmr15XUmQKOnRHwOTONjTGnP8xrYK9Fu9XTlq2K67B1PEFzesVctCUbUcus58MhJ8TX8yjN4z0KYvZ4YOdvg7P5X+5uiw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cadence.com; dmarc=pass action=none header.from=cadence.com; dkim=pass header.d=cadence.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OMl7bGZOIQhrWGDNvwDF1W+AqPyJQTeLY0wX+xCW1po=; b=ev192y27sHhL5pTZK8sdpKJj1KIZm8DTU9GAQMG5UQbdIpC62j8uzFCNAOiYywVaaO+MidmslkvDOyXWZ9yOusPZ0eoTu+sak0iNCx6/nBCU2gRrx1qKKvhRiQeNvZCa2iuyQy2u7a3WN4OD+g2azYKZjOaxBjesVPzxzF5zevw= Received: from PH7PR07MB9538.namprd07.prod.outlook.com (2603:10b6:510:203::19) by BL0PR07MB8210.namprd07.prod.outlook.com (2603:10b6:208:1cc::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.25; Thu, 5 Sep 2024 07:03:28 +0000 Received: from PH7PR07MB9538.namprd07.prod.outlook.com ([fe80::5dbd:49e3:4dc:ccc7]) by PH7PR07MB9538.namprd07.prod.outlook.com ([fe80::5dbd:49e3:4dc:ccc7%4]) with mapi id 15.20.7918.024; Thu, 5 Sep 2024 07:03:28 +0000 From: Pawel Laszczak To: "mathias.nyman@intel.com" CC: "gregkh@linuxfoundation.org" , "peter.chen@kernel.org" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Pawel Laszczak , "stable@vger.kernel.org" Subject: [PATCH v3] usb: xhci: fix loss of data on Cadence xHC Thread-Topic: [PATCH v3] usb: xhci: fix loss of data on Cadence xHC Thread-Index: AQHa/2G1gUFHsnwWjk2GJAFNv3diAg== Date: Thu, 5 Sep 2024 07:03:28 +0000 Message-ID: References: <20240905065716.305332-1-pawell@cadence.com> In-Reply-To: <20240905065716.305332-1-pawell@cadence.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-dg-ref: PG1ldGE+PGF0IGFpPSIwIiBubT0iYm9keS50eHQiIHA9ImM6XHVzZXJzXHBhd2VsbFxhcHBkYXRhXHJvYW1pbmdcMDlkODQ5YjYtMzJkMy00YTQwLTg1ZWUtNmI4NGJhMjllMzViXG1zZ3NcbXNnLWYyN2RjMmQwLTZiNTQtMTFlZi1hOGI1LTYwYTVlMjViOTZhM1xhbWUtdGVzdFxmMjdkYzJkMi02YjU0LTExZWYtYThiNS02MGE1ZTI1Yjk2YTNib2R5LnR4dCIgc3o9Ijg0NzIiIHQ9IjEzMzY5OTkzNDA3MTY4NDI0NCIgaD0ieHEzVUUzVEVJNkY1K1c2dk5FTGdQLzNoTkhBPSIgaWQ9IiIgYmw9IjAiIGJvPSIxIi8+PC9tZXRhPg== x-dg-rorf: true x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH7PR07MB9538:EE_|BL0PR07MB8210:EE_ x-ms-office365-filtering-correlation-id: d832f8b3-53c4-469c-6a98-08dccd78d84d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|366016|1800799024|38070700018; x-microsoft-antispam-message-info: MT5yAzgIAFpqHa6fN99P7ZsjwHA6x+QchodFvgvQZhpd/gvU9ckE8wFXFwcy7m3oD+9lQfSewTPC9a24AMUuCGOMWYVFgWf7mzzwQZYxeViIDvuz4d0ZND33wCSpGMlTtz2hiw5GFvXm8qUm2UCjd+OlKZIbn7VaEi6ZOu9j35TMR0c4vWyPQO/9H7mTOvnOm3eshFcRLuD4bBqJ/UaXwyIPD3mybls3cIGjVMLd5P2D+KXoWA1YAF4lWur/8HKxdDYdE80bxlQliqJ8LWiKhmefGPQKyjXOWTb9OEMZAYxNoZMyWk/QpdEYsjdNbxOyr1SsyO3bxsXhixHAE2LA4TcctanbiDGQ6V/4dQvL1B+k27C5YEBpaqGMbPJwJOUyKuTT9A6y63ZAlatclhVGtLtKwEnNgB6m9BIIw1f4zrPDLwr1jRsE6VAN+LgRrReSQIHy1xZt8QyDY8bZf3ap4pw/T3qi414rfp65zxj7lVqk9eOQgjHObxpLBRyO/tJNmi9LQGM2kkj1I/M1NaxiKRYuzgBbFmviSROhsZz7NI/TaCFjqN6zCGaNsebU55ryzg/2rn/pkgxpBcS/Mwu+JXbLRYGKRkE5ABsx2I+QekU/zK3k3a4moON7YevzjfoCMuKc+CNAIgrjeg7/I0mAqFuAVTzbihaC1bwjy02+Z6B142sYLFrHnaBJLPOfgM5mysXZd6f1ptfE5p4PoarzhrsCfEK9lQJOGteJTEf9Z8kgfV2X+B5T/c0/fu22tgnuvhqqG9TIWwLui4fonrfRv2heithsyPtZbiwJfckMODKHXsdvm0AfHRJ5ULIvo/4lEUkcRkv3bi4HTVJE2SiDoYeg4EKs5f9TdKgLdYvrMMBw0/AEEyVeJsa8Re/bYdKBecOENNfBhAadX6p4S96ch/rgJig+f9UKFAnijkW+Apm19h9poWrNGqnMLN/Nm6SZOdJnf3YTTF5MQad5hW0pV6iAiwgpc5zRfFwjQo6urzNJj8zPcrmVPabTgVt2E11z7QmFWLE8RLb49SE+zvDOuioR6cN2IP8OhrHeOKp9cHwORUc7zTobKR0lIUbTjFFJPYwuR5g/DNY3lvyW7G/qEIuFimVfoK5a1omF/6apPoHOlpc6adZqkhigmnnYfXHLJEK2D/vw+Ea0SMPce3lhoZKykv3UG3/AjgbHOWTMa1D4CEBCbdAhD9njFueSnbWpG9AYA+9CQiR4ZAIIND8GLWQP/WINp5ubSK0yYCJRzTEaw6a0XCnxOMg4apjSqSGo6LFhvynfjCF5zMdiy3OtvSpjMkZM8cZygHYMnpLh3bS28x71dl6GescE4L5FENRoLhmPmLUJrGjgSOWJMY/yI9njHuuuHDZzoRP14T75yklHgiygo50etUoFl8fZoriMR87B52h56RmE7c2K5pbBeg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR07MB9538.namprd07.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: pEHZbtRf3lig+0s8adEoqohAzFph+l6Spib4hcPKIoDRjaZq/4uQZDd5QLY1KSJ9OJ61aoxNdtgzPYSub+bfzg8N9GMLBq4k/D1Za8oG/9QL3n0BnXuYPk1BFPvge9/bvqu+Bs30JO3KixEKeNoRYc8LuZXrwDuVHWIosjxThxxfUziDi5HISp9GYRZESbv85IyML5+dUGmfWSVNBkn3UTXsvsPvjPTBGvDUMfUtmbZxKiieTVa46X623/On8tZcYThmGOxQm3bwNKMlmswHiyBAaR4wM/FaDMhC6HhAc5umKpTmajmDW5bewLUyVd28iZVBqIRQZfmPG/iLEfVjJ9y6d3pMXrwLhegln60ReFvcH5erwopOo1eTbM1fqH5m40B8gD3cNplWSzvD3j/7H8IELYjiav9gdgPvTQ8DLElJ1NB90M3IHYOoo2Gg5FqTVHQS1xgM1YKGZZ2yX27B+E/evEgls1nnAVbHGX4NXZKTibWIuYoCZnLUXWRnHlKFWtXS0ilbzaGJ7/DEs3dj+RBATDYsrbSJPgUBPhY+s9078T1eymg6/dNQTRsfnQ+QiYHIpbRJa77dcqftlVsPPTZX9D95+gj2hqTQ6hSvugpCQLhmIumdalaiXg8gM5UtMbZFUbA2DvFGPYNXMHeHF96ZTTtvaGki1IEhDfWTuTpO7lQWSLwo/9UYJ+8FCwU6a/1ohIraOgrKjaigxQceoI7xKNjPBTCRLTZifZ20csm/DIdk5dBrskNnIPBrhOii0sd3hQ5z/ax1kxDIuJbNgl1r+yFa3SLz8UiLnube2gnfqfsuv6RwfExTmHuGztkAO5D5mVfTVN1UUfZ2tslj7SkWWTnxFJDFxe7mi0je90ds/oagI0NxiuMCVuhhe/mX+/+xLY9iaHREFTaCkHQyHHLguKIkXTg6hrwT53B76EMU8ff2xiFkUTNx47T/K6yXciYUlY1+Jg0jx9otR81aZgMq9G42Q1rvOu9hednDwF84aeUiK017O3u1CYXZ+QIAZg5MIgTc4QKJJlWoS9vX56dPhlJqfL+jMM76uhxxNBgW53y/GfAWnYNatZKvaEP62bFPnmosl86Y0pQp33iuCs/BfJ/xQ9emDlMyrFgaZ7DW4Km924rVo7+i8z1k3udIx76gjUBOEyN+yKqu+GGdisWfegW67yt9DIISwDaBRsDTt9dgA4lFW+N3K6SgBCh7fB/nmtWMtYKfG4jbWIh8PYlHaOaQfUUYMrpNl5sMMkp957vNrvYh65r+vjEs5nnMd7H6xx9psELbW5X+nwR/fKwayCXCfEImWQxoQ8FektOkKOgG3PpOAEsXl2lnSUJHBbqCNS6PVvzeLWR+W7g4CotzpxVyZ+SU7fCf/VrLzTORS+OzeWNcPfOytGp7YgjpPFY9rByiNdxWKMoVAdhgqA1C4BU2uMOpTaTkL00SENRRcIQhp7wMG6akZnJ12zFw4lZpVEmU0mM4V2ZDDV2x8GTpA9MqsKs0rnrhLT+oNJtW2ONLul409oUTqoct5tf5ORdq2PCqp8ty8O+Gk+QEnA58a7vNMQgGGJS0CvZu8H2vWXGQAJTYC7VkSjU+MQiq Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR07MB9538.namprd07.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d832f8b3-53c4-469c-6a98-08dccd78d84d X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Sep 2024 07:03:28.8417 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: aXtddycfLXD7UKKtZPwnZat5KbFx3CUvbwt3IfY9fV2rKFEDlZzOs0fl0ngwGoZ+K48MX0BmZg2v6Z8SSjRXX9ky6umxHpcOA/OvAGhnO7E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR07MB8210 X-Proofpoint-GUID: fh02fGLYLvNC5OxkTmQZimVAu2_oyw-p X-Proofpoint-ORIG-GUID: fh02fGLYLvNC5OxkTmQZimVAu2_oyw-p X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-05_04,2024-09-04_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 spamscore=0 bulkscore=0 impostorscore=0 priorityscore=1501 suspectscore=0 phishscore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2409050050 Streams should flush their TRB cache, re-read TRBs, and start executing TRBs from the beginning of the new dequeue pointer after a 'Set TR Dequeue Pointer' command. Cadence controllers may fail to start from the beginning of the dequeue TRB as it doesn't clear the Opaque 'RsvdO' field of the stream context during 'Set TR Dequeue' command. This stream context area is where xHC stores information about the last partially executed TD when a stream is stopped. xHC uses this information to resume the transfer where it left mid TD, when the stream is restarted. Patch fixes this by clearing out all RsvdO fields before initializing new Stream transfer using a 'Set TR Dequeue Pointer' command. Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver") cc: Signed-off-by: Pawel Laszczak --- Changelog: v3: - changed patch to patch Cadence specific v2: - removed restoring of EDTLA field drivers/usb/cdns3/host.c | 4 +++- drivers/usb/host/xhci-pci.c | 7 +++++++ drivers/usb/host/xhci-ring.c | 14 ++++++++++++++ drivers/usb/host/xhci.h | 1 + 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/usb/cdns3/host.c b/drivers/usb/cdns3/host.c index ceca4d839dfd..7ba760ee62e3 100644 --- a/drivers/usb/cdns3/host.c +++ b/drivers/usb/cdns3/host.c @@ -62,7 +62,9 @@ static const struct xhci_plat_priv xhci_plat_cdns3_xhci = { .resume_quirk = xhci_cdns3_resume_quirk, }; -static const struct xhci_plat_priv xhci_plat_cdnsp_xhci; +static const struct xhci_plat_priv xhci_plat_cdnsp_xhci = { + .quirks = XHCI_CDNS_SCTX_QUIRK, +}; static int __cdns_host_init(struct cdns *cdns) { diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index b9ae5c2a2527..9199dbfcea07 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -74,6 +74,9 @@ #define PCI_DEVICE_ID_ASMEDIA_2142_XHCI 0x2142 #define PCI_DEVICE_ID_ASMEDIA_3242_XHCI 0x3242 +#define PCI_DEVICE_ID_CADENCE 0x17CD +#define PCI_DEVICE_ID_CADENCE_SSP 0x0200 + static const char hcd_name[] = "xhci_hcd"; static struct hc_driver __read_mostly xhci_pci_hc_driver; @@ -532,6 +535,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) xhci->quirks |= XHCI_ZHAOXIN_TRB_FETCH; } + if (pdev->vendor == PCI_DEVICE_ID_CADENCE && + pdev->device == PCI_DEVICE_ID_CADENCE_SSP) + xhci->quirks |= XHCI_CDNS_SCTX_QUIRK; + /* xHC spec requires PCI devices to support D3hot and D3cold */ if (xhci->hci_version >= 0x120) xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW; diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 1dde53f6eb31..a1ad2658c0c7 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -1386,6 +1386,20 @@ static void xhci_handle_cmd_set_deq(struct xhci_hcd *xhci, int slot_id, struct xhci_stream_ctx *ctx = &ep->stream_info->stream_ctx_array[stream_id]; deq = le64_to_cpu(ctx->stream_ring) & SCTX_DEQ_MASK; + + /* + * Cadence xHCI controllers store some endpoint state + * information within Rsvd0 fields of Stream Endpoint + * context. This field is not cleared during Set TR + * Dequeue Pointer command which causes XDMA to skip + * over transfer ring and leads to data loss on stream + * pipe. + * To fix this issue driver must clear Rsvd0 field. + */ + if (xhci->quirks & XHCI_CDNS_SCTX_QUIRK) { + ctx->reserved[0] = 0; + ctx->reserved[1] = 0; + } } else { deq = le64_to_cpu(ep_ctx->deq) & ~EP_CTX_CYCLE_MASK; } diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 101e74c9060f..4cbd58eed214 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1907,6 +1907,7 @@ struct xhci_hcd { #define XHCI_ZHAOXIN_TRB_FETCH BIT_ULL(45) #define XHCI_ZHAOXIN_HOST BIT_ULL(46) #define XHCI_WRITE_64_HI_LO BIT_ULL(47) +#define XHCI_CDNS_SCTX_QUIRK BIT_ULL(48) unsigned int num_active_eps; unsigned int limit_active_eps;