From patchwork Wed Dec 11 00:31:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902661 Received: from mx0b-00230701.pphosted.com (mx0b-00230701.pphosted.com [148.163.158.9]) (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 0785E1E535; Wed, 11 Dec 2024 00:33:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=148.163.158.9 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877241; cv=fail; b=tgUmmGhoP80HffBcAayakS0Vqtu85H5V0gbGMlF8bBrtvzSwpDYMnBGjZD5elDGoy3XpD19RFz7Iu8VAydZnQASN3oIDamdtEW93BBZRRiI63jlmhFsahUlzQhwN41pFQPGaDEsOW6HYZolIKQMt9THYd4YXIzE0FxHuktGj0/Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877241; c=relaxed/simple; bh=kAmiVuk7PagAnVgZ2SZDweujIjlFy3BJDWxZSCig88w=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=NrpHyXfe0ze/nGE+CMgxIJfuzR6EIWeTfFCLP/tp8SThvPgbWFHUzzGYAGk5fXis+lZ+Tehl1MyGyW9GPc52oPFxR/fsTvXV/5krjyUsRbH4CE3hLoWL7yTYR5Qsl+47Cwf/1k6LEQomkVeiPZo3VsUJFWS8nQvHCLRehp/QDQM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=synopsys.com; spf=pass smtp.mailfrom=synopsys.com; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=msueMJm+; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=M+YJY5n4; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=sJ4tueQA reason="signature verification failed"; arc=fail smtp.client-ip=148.163.158.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=synopsys.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=synopsys.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="msueMJm+"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="M+YJY5n4"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="sJ4tueQA" Received: from pps.filterd (m0297265.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BAM2nrG017323; Tue, 10 Dec 2024 16:31:39 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=pfptdkimsnps; bh=uW4ImKlgKpP1u+HuMBz SQHDWem/YyOTu4wPPjfhBaqU=; b=msueMJm+JymwxgR0eQllmKuZ//aQ5EcJJRR zOatk3AHo8RbqaexnZlnAgwpYBgaLdKqnzkYZC/GvHS9MuPJkDiInf/ecVeTO210 fWYcoj5a88IiMpUrXb8nkU8x3p8W/0zYgY9gVJG//rNB0HgzrxD0CkdQ9bRtj8pi 4ItPtvm/62gL51HI7/ae+bGeTpKvbxCWZ/Fn+r2Rw99wxAOwVk5SbbEPDLSWwbtS 868hk5mSGs3MrgiPULvR9+492wiiZygs8wZCcmtuK4iCVCA0g6Msx82J3MeZLFhv EET+ZMdyktPus2icMrdpv9jiU8gZcyM+38AzaRgfbBta5dSRLbA== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 43cp60t0u6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:31:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877097; bh=kAmiVuk7PagAnVgZ2SZDweujIjlFy3BJDWxZSCig88w=; h=From:To:CC:Subject:Date:From; b=M+YJY5n4vGYF0x7GaQDwjsbh0rdXsXzhkzNuQJn92bIISriVijCP9FYYsOKhrB7l3 836LIvFuypad8qzCpTmj99qwjEzL+LSHiMydQWPyCEOsuu8KXEucBteXURXLO5A6S3 OkglN74iXkeyy/Ic7ksHTfTbAjZz60WDPIdLzbU1BFl7MOQSMhXbi/2uMjcTiIl0wm Z6Nq0v5A1M0yCqYqoGecu+tDjcK37+SmX9KD5PTFWYMVdEz3wmVOmwMN67IwcoZGYj LiY8+RFXL1op/VGQhK8JxLEvufns2Cl/BJDPZYdzEd1opyB+VJCqWve/0qbATzCA/1 Pe3WpG8+XDotg== Received: from mailhost.synopsys.com (sv1-mailhost1.synopsys.com [10.205.2.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) client-signature RSA-PSS (2048 bits)) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id E75A440593; Wed, 11 Dec 2024 00:31:35 +0000 (UTC) Received: from o365relay-in.synopsys.com (us03-o365relay3.synopsys.com [10.4.161.139]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "o365relay-in.synopsys.com", Issuer "Entrust Certification Authority - L1K" (not verified)) by mailhost.synopsys.com (Postfix) with ESMTPS id 915ABA005F; Wed, 11 Dec 2024 00:31:35 +0000 (UTC) Authentication-Results: o365relay-in.synopsys.com; dmarc=pass (p=reject dis=none) header.from=synopsys.com Authentication-Results: o365relay-in.synopsys.com; spf=pass smtp.mailfrom=synopsys.com Authentication-Results: o365relay-in.synopsys.com; dkim=pass (1024-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=selector1 header.b=sJ4tueQA; dkim-atps=neutral Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2174.outbound.protection.outlook.com [104.47.59.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id BD6B44041D; Wed, 11 Dec 2024 00:31:33 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Lk8PzNNV+HTQtCEgit5og1iuGrXAivcUHkOxVkWS7/SV5/sgrTAPrUdaxLbZLKwXJ3A4voT1Kj1nOO6d5H5sPA2yhTw1h4/BkGd6IqIOtpppTteljOuThmL1N++0JIjXKa8W3cHen8YwmicXE3VYe2v0Q/b0TQH/02SowpPYtfQpMzdGUrDg/V2CIwNhwS2LB6k4MkhOAlkZNntU5VR9SBTwR4V46wwvZ7Y/yLLOsry8AEclyAf8K0SZVXQyp5/OkyfPk4TNyM8iEViyvfgNd0D3hlWoyD/hrzB9T9hdlwRdoO+idNrzAhibNe/k3SbA8M4+S4qLGhFCO9i3Di4pJQ== 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=uW4ImKlgKpP1u+HuMBzSQHDWem/YyOTu4wPPjfhBaqU=; b=YGE6lu332T+bVlhU6GPeJmcX6q5Z6zaqh3v+Y6fESeQJ3QB7JX7XaoucKjqA1YvPZWKGv39GDAzSyv3XyPN24pzLDIBYjjO8FhKUKaatrZODE0DBZdPt+Jh96CWt1qTtHtNJpL4+4HbJQl6A62g2zPadH+Tb0ULofMRw3UyS82031djP/3x1X7SsUUGTl9h08X6i9zOkbb9ks6DPh9MACDYeFb+GMlIx9dAYkMO/luro2s5pgOD/VhqQt8fg5GaESEKj2p9rCoSZ+ujB6fd1E9YGHXv+QfQGaCMDxd30h8KdbY/+I77WIZkunp46OMagRRaOxF9Gt9gsZZQA9E2F3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synopsys.com; dmarc=pass action=none header.from=synopsys.com; dkim=pass header.d=synopsys.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uW4ImKlgKpP1u+HuMBzSQHDWem/YyOTu4wPPjfhBaqU=; b=sJ4tueQAfehkfWlX04Z7zg8fOEx5VltFLb+vqOG4I3wPF+j1OdBnf75jz6XyguJtMRtliaqUdaAMfIcm4oFFLJb6BSj7H+ks6HkqayAFdJ85jwkRQvNbmRMtvvmvLBgLzQevzgwuMPbVSSXO4UE/ne168NspLUOxojC93IZy7U4= Received: from LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) by CH3PR12MB7691.namprd12.prod.outlook.com (2603:10b6:610:151::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15; Wed, 11 Dec 2024 00:31:30 +0000 Received: from LV2PR12MB5990.namprd12.prod.outlook.com ([fe80::3d09:f15f:d888:33a8]) by LV2PR12MB5990.namprd12.prod.outlook.com ([fe80::3d09:f15f:d888:33a8%7]) with mapi id 15.20.8251.008; Wed, 11 Dec 2024 00:31:30 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Nicholas Bellinger , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , "stable@vger.kernel.org" , Homura Akemi , Alan Stern , Andrzej Pietrasiewicz , Christoph Hellwig Subject: [PATCH v3 00/28] usb: gadget: f_tcm: Enhance UASP driver Thread-Topic: [PATCH v3 00/28] usb: gadget: f_tcm: Enhance UASP driver Thread-Index: AQHbS2QFjUURmKlzgkWNYg6lxVUSiA== Date: Wed, 11 Dec 2024 00:31:30 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: LV2PR12MB5990:EE_|CH3PR12MB7691:EE_ x-ms-office365-filtering-correlation-id: 5ce6f794-fa7d-427d-71d4-08dd197b283f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|366016|1800799024|376014|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?rLo8YMIwQOdPAQFDj4P9F09UgI?= =?iso-8859-1?q?QGwwtsOvRgh6/WokNP/xQOE8kQgOAH7NFGA8xIqrwJU3WvbLsmMO6KrTpr9K?= =?iso-8859-1?q?i7updAlf0crsAYo1m0zXL3kBIUTlY9XyiUnULV6ZMpmZuNEDfkOrenzyjpUi?= =?iso-8859-1?q?JyanPTc1AM7WdeW1msB06gp+OZShyLWNiYcHWdwgB1iwGf7C4tljrlXFMRoY?= =?iso-8859-1?q?BHuDpvnYTnJTmDB82JMpcT35o2BluVHKAvoSS2QXfrsPNr473Bcxibe/9w9T?= =?iso-8859-1?q?yWP2/GP7V2xS+pB6A7v2Ch3VFfFsXgGZCVPDT4enIA/C2upXPGFpu8B2DUdc?= =?iso-8859-1?q?JD9QUwB3rDW+cJsAApDf4dX1QUOayudJVBNMklk05ZuuD9rFH3ABQV62MwiJ?= =?iso-8859-1?q?+hICZujaZyeKqp/Em0eg37+bpHIt4SMsdam2PJnXpjwrS+v4O2h1VYCkT8R4?= =?iso-8859-1?q?etlfTU1Aqbb/UVw2u/ulkFZxuAXvSxNwTaYANqgx+gsmUeMJl8dA63CPTmR9?= =?iso-8859-1?q?bigjIRtzs4CHlxYK0kE8u1cNFzyHtRXPv1jxgJteczJNCgcaTD5VYdhDL00m?= =?iso-8859-1?q?+jiDYLcfUW4wzJYoDah0VccPZvT8eMwLOppLydp0QK0GplyL9wUkYEF1SDjx?= =?iso-8859-1?q?pPndYUnMoSNIcTYvzf06obNlhnywQMLDe1KMk7EuD41r9SwUzuZMTgaa3o+z?= =?iso-8859-1?q?kaWqH+U3CT2MTWKlqspToiBnEs5XxWyMRwVOLIOHFSfuEec6WoGF0TgVr5QX?= =?iso-8859-1?q?EE2wLZfaxCAxQC+UhcHwPnyfhy0ziJ64vQph5hJP1dJz00bBTZIZeae1JqTQ?= =?iso-8859-1?q?r87WsPvzGDjwJB8JkbmnzWu16dF2ekUAbbywjhXFXx+mo2AFZtG+9dXpc6rs?= =?iso-8859-1?q?sNZ0eSBGlEadLDcQGlDzfKWtSfmSFb+pWlsJGn4f0sStdIZWPAO/PYvBBpMs?= =?iso-8859-1?q?cIv9h+JruMJbR3ov+irijaftEPiB7SVvnVV72hhbeWa0+aPDR7JPCmSicyP2?= =?iso-8859-1?q?Ab4q3sD6Q+u747XGwLoOZgz+0eY1DKNqIsiRDG1Y3phEHpD3CC2Z0b5+YM+w?= =?iso-8859-1?q?FhLpYUeogrIZd+MlBu0mGuv0raUmh0uuSuUwmYdVfG75x+ENfk+z4TKAMwxE?= =?iso-8859-1?q?vSUp4tlSnhdhH6UCgECT9OTQ7DcPaMpWi16P9n+KpWAaO2ywxon5E/1rYCyb?= =?iso-8859-1?q?mHIZ7masQkiDZWaanANGI4Cu3bH8pLhHwbvhYf+sglk3heewv3lcyFCT1869?= =?iso-8859-1?q?4txoBWjmFC2PGlLNO7Y2XR7fy6PRNB/pUj/Mva9Vj6LfADcrTq/8jwsEs1gX?= =?iso-8859-1?q?4vrhexYjMeTEO0WtfTjItyUqL3DLwPbb6NA+0TOVR+2Apc8HEHepVGcWOO6/?= =?iso-8859-1?q?DaOOOQhaNJ3ruyTYdC8OSB2oGAEDVsHMtrgAegYvu4sz8sQ7wtHoP+r5i8cs?= =?iso-8859-1?q?shg+7N5blNDkXgdLNR+M6sJg=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV2PR12MB5990.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?cyHT+L0OcqbalmtmXmM5bNK?= =?iso-8859-1?q?qwZXD9pnptTIOXiFNIMOQlWool5tAgnd7ju5mUdiGv/plfEoGHb1AJ0gMFNk?= =?iso-8859-1?q?gKqhjQt8cuzU+xKFooPZHKi9gF/mZl14bmijCtOf1rZi6/C7NgPN97qnO74k?= =?iso-8859-1?q?tJ8d8GiiBgr0BbZSDvdYtbwMsVngDxYqIH4mB156sQukwOKsZDsgakOFJHn5?= =?iso-8859-1?q?f2DL7xXgEyImxa2mR0TRFtOL71gtgVUDdcUKPrvCxoxQ3rDUKUPA75VYVx5o?= =?iso-8859-1?q?9n2OFZOMKS2Hw7jMvtWn7oF5lkKoPuehS96bap7tKgablln08HLPmOwp8uQL?= =?iso-8859-1?q?DFNx6QiySmCHPDeoRoPwT+QD8TdubEMUE4WPWXVR90UjQ5x5YNly8idVgqoI?= =?iso-8859-1?q?hq5kFv8AXc76JEH5m7FdAP0iDWxrWSoaeafoXuvu3Dcp1gNxOOmt7U8vri/k?= =?iso-8859-1?q?TYc9tVFGC2y5MKSXN9hkClXmFSGwswKMGE8/fAfXIkb0QExSoWP4dEMRfD7h?= =?iso-8859-1?q?k61l6NSvy3qrjNWO66whcyUoocgbGCgYBjNung/f7uCt5dUVjQ4e1zg9+G7S?= =?iso-8859-1?q?SVFszFIqJi912j1C+gAdtLJWe53F0zcjiwMUemHiERd4Lubluey1TRS49G9X?= =?iso-8859-1?q?zwVOs3FHDdFQT218+qYXibELp3tCS3NJGELg7Lil3i9W9HNutmI3tI9Sb2T1?= =?iso-8859-1?q?Fqjf0P0D3IYGjrBQJPZfkKPtf86tUTqAjhKXjQGT+XBo9zQNT3g75YoRVMwP?= =?iso-8859-1?q?9nuTlN9AtvuofuDWhR+sxg85BX3xsAm7Q3QQd/s1Iln6RV1miUsayWqGPqCa?= =?iso-8859-1?q?zmKclBdCu8b/toNjfB9IxtCaaNHeEeP+doEdp/VyJel8LBzOeysvdbb7huZX?= =?iso-8859-1?q?otVtlkuhQetOMJLLSXOjT1flcDkFAw4v+zBoldC7XY/6sITFLbnf7v1/kjfA?= =?iso-8859-1?q?s7OEYz4iqNckRr3SSmVC6VUreoI/rXs+NahSWBUuwL6DUMHFxpu3DZkJ6Ojb?= =?iso-8859-1?q?7MNNwgWACsuHtWTvyhsBJk79w9BCK3cVQ11va5fBa3nVl3S3JSBRxwa9i2vA?= =?iso-8859-1?q?9rSPJV7pcy33dUgtQPeSdVuC8EIDejJ1vpML+foJZPPF9ayo0y8dGuvp8VTG?= =?iso-8859-1?q?4amkeAIp1r9xJPHr3nJ94l2rWd1v5aGQZmPcbo/MvnyG9LMtxDpGDeSKKo0i?= =?iso-8859-1?q?tVfBI2kOg6I8ZAYtww+teze7a9KCkATEwb+bk6tQ2MO0KOPlSYIEwLOVXYgB?= =?iso-8859-1?q?0rfvjWu5Fit4jjxJrzwnW1TpFVlVPxnQ/LYBoQkWnEqP4WApxlk2VLfTsObm?= =?iso-8859-1?q?6HiMELRWegES46RPPe4SXjtgvhh5Ez4jnmpe/H00lszmk1zvW2+lUcrfYFDc?= =?iso-8859-1?q?c3RQzE1DuTrVVF7Rb1cEDfbMW8ha9RCTGNkbkJl91lLExAnp2CCdx9T1PrX2?= =?iso-8859-1?q?y34c3P0xINYeOwow51bYW8UT1jTcusHngNGNB9dX8p4lOf/Ug4hgHwHcllEV?= =?iso-8859-1?q?dCabMzZwYhhIcrHmpUwkyd2CfJV8kihdJj5viC8q4SYvQ2uP6Ep1LX9+eaFJ?= =?iso-8859-1?q?bPQhhjuXkNDfAY41HAM8BKtKsSCgXsRtHrQrPOQcyhqaYl5LKiFISfgmYU/I?= =?iso-8859-1?q?Jz529z5wE8RF8c/Pj?= Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: bMdBKuoOQ7SciSEhIyOMT4lmeLzdffTmn2GnkoSDpHyLDlfMn7eh7ecgGvdH4Ov61C4flMuFtk1TfJKWIRin7s75TQ7ueYM3+ggrIT9UkN9sVl+6XmlIvN0Kgmf4klwxyH8crd4pmyfT5ALfYWReBUPmhFdCJUoY0CmRaxBgbmaRAClzLRPhZg0bcxH3YwA7m/mjkbfQI+KCCbRjNt4y/mF6WpUdbwfLsQOY5gQXc/VA+yWAOdaR4WVvX18tBNFtQH5240uWz5I8m++YXzeFMHvaNghR+iqLJXcCLfj/8zRASkFmmivXP7LA3DT47MVwdfbwieL48QQPHiynGgBO6iteAAEErCgTwyfEXSFGNh8p37NAwbmGHQYdYGYsVIThVD6yUWztoYh0X/xuP7Y58+2l8mfbwU+aZ1dTsKuiZzv3vAh7nXWIzh/l8jOrWXgDHPi205gPCdsZS1gKWPsY8e2YsOWSG33Abb/Lnyff1oqmv1OgAAb2Ta9e5OYSCTvDOjZF4EZH0r5HofekZVA4Wi8yGL13w8wgAYVX5udJWVQi7eOxYcie7vUiq7Y8xzDQmqFx66M9yR2vtkWgFjhDnHGJGhonQNISVeCYbIn394rYqSNV8YciFpYtdMeoB/SEailuAysWjlqX65rqfO/quw== X-OriginatorOrg: synopsys.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5990.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ce6f794-fa7d-427d-71d4-08dd197b283f X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:31:30.3205 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: c33c9f88-1eb7-4099-9700-16013fd9e8aa X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rHg/cFLWj14MGWyUT1LlL2+jS69vO+IjYFCMu0fbrniwJq8yBFP57+nL1a9Jqu+S1vx2VROhC7XeKYVCGrmHsQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7691 X-Authority-Analysis: v=2.4 cv=Z9YWHGRA c=1 sm=1 tr=0 ts=6758dd6a cx=c_pps a=t4gDRyhI9k+KZ5gXRQysFQ==:117 a=t4gDRyhI9k+KZ5gXRQysFQ==:17 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=xqWC_Br6kY4A:10 a=8nJEP1OIZ-IA:10 a=RZcAm9yDv7YA:10 a=nEwiWwFL_bsA:10 a=qPHU084jO2kA:10 a=VwQbUJbxAAAA:8 a=jIQo8A4GAAAA:8 a=V0tzN9xz4lunQFGz6f8A:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-ORIG-GUID: bY5KtUyrt0jPtdrj0HOvSOH8gkNhSRWG X-Proofpoint-GUID: bY5KtUyrt0jPtdrj0HOvSOH8gkNhSRWG 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-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 bulkscore=0 clxscore=1011 lowpriorityscore=0 phishscore=0 adultscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 malwarescore=0 impostorscore=0 priorityscore=1501 suspectscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110002 Apologies for the delay; after two years and multiple requests to resume this series, I squeezed some time to push an update. This series applies on top of Greg's usb-testing branch. If possible, please help test this series and get this merged as my resources are nil for this work. Example Bringup Steps ===================== To test UASP, here's an example perl script snippet to bring it up. Note: the script was cut down and quickly rewritten, so sorry if I make mistakes. my $MY_UAS_VID = xxxx; my $MY_UAS_PID = yyyy; my $SERIAL = "1234"; my $VENDOR = "VENDOR"; my $MY_VER = "VER"; my $vendor_id = "my_vid"; my $product_id = "my_pid"; my $revision = "my_rev"; # Must update: my $backing_storage = "/tmp/some_file"; my $backing_storage_size = 1024*1024*16; my $use_ramdisk = 0; my $g = "/sys/kernel/config/usb_gadget/g1"; system("modprobe libcomposite"); system("modprobe usb_f_tcm"); system("mkdir -p $g"); system("mkdir -p $g/configs/c.1"); system("mkdir -p $g/functions/tcm.0"); system("mkdir -p $g/strings/0x409"); system("mkdir -p $g/configs/c.1/strings/0x409"); my $tp = "/sys/kernel/config/target/usb_gadget/naa.0/tpgt_1"; my $tf; my $ctrl; if ($use_ramdisk) { $tf = "/sys/kernel/config/target/core/rd_mcp_0/ramdisk"; $ctrl = 'rd_pages=524288'; } else { $tf = "/sys/kernel/config/target/core/fileio_0/fileio"; $ctrl = 'fd_dev_name=$backing_storage,fd_dev_size=$backing_storage_size,fd_async_io=1'; } system("mkdir -p /etc/target"); system("mkdir -p $tp"); system("mkdir -p $tf"); system("mkdir -p $tp/lun/lun_0"); system("echo naa.0 > $tp/nexus"); system("echo $ctrl > $tf/control"); system("echo 1 > $tf/attrib/emulate_ua_intlck_ctrl"); system("echo 123 > $tf/wwn/vpd_unit_serial"); system("echo $vendor_id > $tf/wwn/vendor_id"); system("echo $product_id > $tf/wwn/product_id"); system("echo $revision > $tf/wwn/revision"); system("echo 1 > $tf/enable"); system("ln -s $tf $tp/lun/lun_0/virtual_scsi_port"); system("echo 1 > $tp/enable"); system("echo $MY_UAS_PID > $g/idProduct"); system("ln -s $g/functions/tcm.0 $g/configs/c.1"); system("echo $MY_UAS_VID > $g/idVendor"); system("echo $SERIAL > $g/strings/0x409/serialnumber"); system("echo $VENDOR > $g/strings/0x409/manufacturer"); system("echo \"$MY_VER\" > $g/strings/0x409/product"); system("echo \"Conf 1\" > $g/configs/c.1/strings/0x409/configuration"); system("echo super-speed-plus > $g/max_speed"); # Make sure the UDC is available system("echo $my_udc > $g/UDC"); Target Subsystem Fixes ====================== I have eliminated unnecessary changes related to the Target subsystem and reworked f_tcm to minimize the modifications required in the Target subsystem. There are unimplemented Task Management Requests in the Target subsystem, but the basic flow should still work. Regardless, you should still need to apply at least these 2 fixes: 1) Fix Data Corruption ---------------------- Properly increment the "len" base on the command requested length instead of the SG entry length. If you're using File backend, then you need to fix target_core_file. If you're using other backend such as Ramdisk, then you need a similar fix there. --- drivers/target/target_core_file.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index 2d78ef74633c..d9fc048c1734 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c @@ -283,7 +283,12 @@ fd_execute_rw_aio(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, for_each_sg(sgl, sg, sgl_nents, i) { bvec_set_page(&aio_cmd->bvecs[i], sg_page(sg), sg->length, sg->offset); - len += sg->length; + if (len + sg->length >= cmd->data_length) { + len = cmd->data_length; + break; + } else { + len += sg->length; + } } iov_iter_bvec(&iter, is_write, aio_cmd->bvecs, sgl_nents, len); @@ -328,7 +333,12 @@ static int fd_do_rw(struct se_cmd *cmd, struct file *fd, for_each_sg(sgl, sg, sgl_nents, i) { bvec_set_page(&bvec[i], sg_page(sg), sg->length, sg->offset); - len += sg->length; + if (len + sg->length >= data_length) { + len = data_length; + break; + } else { + len += sg->length; + } } iov_iter_bvec(&iter, is_write, bvec, sgl_nents, len); -- 2) Fix Sense Data Length ------------------------ The transport_get_sense_buffer() and transport_copy_sense_to_cmd() take sense data length to be the allocated sense buffer length TRANSPORT_SENSE_BUFFER. However, the sense data length is depending on the sense data description. Check the sense data to set the proper cmd->scsi_sense_length. See SPC4-r37 section 4.5.2.1. --- drivers/target/target_core_transport.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 8d8f4ad4f59e..da75d6873ab5 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -804,8 +804,6 @@ static unsigned char *transport_get_sense_buffer(struct se_cmd *cmd) if (cmd->se_cmd_flags & SCF_SENT_CHECK_CONDITION) return NULL; - cmd->scsi_sense_length = TRANSPORT_SENSE_BUFFER; - pr_debug("HBA_[%u]_PLUG[%s]: Requesting sense for SAM STATUS: 0x%02x\n", dev->se_hba->hba_id, dev->transport->name, cmd->scsi_status); return cmd->sense_buffer; @@ -824,7 +822,13 @@ void transport_copy_sense_to_cmd(struct se_cmd *cmd, unsigned char *sense) } cmd->se_cmd_flags |= SCF_TRANSPORT_TASK_SENSE; + + /* Sense data length = min sense data + additional sense data length */ + cmd->scsi_sense_length = min_t(u16, cmd_sense_buf[7] + 8, + TRANSPORT_SENSE_BUFFER); + memcpy(cmd_sense_buf, sense, cmd->scsi_sense_length); + spin_unlock_irqrestore(&cmd->t_state_lock, flags); } EXPORT_SYMBOL(transport_copy_sense_to_cmd); @@ -3521,12 +3525,19 @@ static void translate_sense_reason(struct se_cmd *cmd, sense_reason_t reason) cmd->se_cmd_flags |= SCF_EMULATED_TASK_SENSE; cmd->scsi_status = SAM_STAT_CHECK_CONDITION; - cmd->scsi_sense_length = TRANSPORT_SENSE_BUFFER; + scsi_build_sense_buffer(desc_format, buffer, key, asc, ascq); if (sd->add_sense_info) WARN_ON_ONCE(scsi_set_sense_information(buffer, - cmd->scsi_sense_length, + TRANSPORT_SENSE_BUFFER, cmd->sense_info) < 0); + /* + * CHECK CONDITION returns sense data, and sense data is minimum 8 + * bytes long plus additional Sense Data Length. + * See SPC4-r37 section 4.5.2.1. + */ + cmd->scsi_sense_length = min_t(u16, buffer[7] + 8, + TRANSPORT_SENSE_BUFFER); } int