From patchwork Wed Dec 11 00:31:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902659 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 4EE311CD0C; Wed, 11 Dec 2024 00:33:56 +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=1733877239; cv=fail; b=qSaH0uzp9ZfkzbkWLQXxOweqnuJwUoQmOplANa5giK59nfQd6tKcH3td/RkaZeguY79Fsg4LnXmN1VX0pt0VSEEFPnDFMXeVSPdeBTAdnMRlMg72s/KKSMXwgv4IK4c1iL+Zturx9Dpx5MArpXU7oiI+0XmXXq/QlKS6noek1oc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877239; c=relaxed/simple; bh=2F1fa01FlzGNvP4SW9/uGXQYuTWkljd+yEQ/qB5QrVc=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=Z08x/ZDOPqSS/2Jvi1kVuE5wLA3D1gazx5VkAR7At4S3UXf6H6rX7QlpnTGkZrzarCfcrnTx8DYcwPh/b2RVKAZr9hVxWknCBu3OqWP7I45gGL7MXLrZVLJNaXP+kln5Xv/1vrNjBOlMZY2KLNBQapxSS40+4BSA2L44e73pots= 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=ckJWJkeX; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=M9IGwKjo; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=MxmZzAiL 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="ckJWJkeX"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="M9IGwKjo"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="MxmZzAiL" Received: from pps.filterd (m0098572.ppops.net [127.0.0.1]) by mx0b-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BAMBDPX000584; Tue, 10 Dec 2024 16:31:43 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=xvYZPiVmvN7FxKjMD3vdLVXXtMvSRabvS6CHN1S42Pk=; b=ckJWJkeXgMy3 IPAGWwcerQ8n6UyH3SOpWRusiqf3kkMIvxIjamS8DtUVkWNtCf0ENeMiEIHRkPIw ITh8C7xaiULUrec2r8gH1DOxP4ZkyAYZy+hYk5QE4X3eZ8nJ/AQ48CQBW7eoGH5W VIKB+d8aF6gxqBxK7ukbRF/5gxdDIgjlduNXrop68WZBwLAauiBNwLEUCqzQ1lMN ngCFa/y64CM+jvHe/WUVGc9YbYVICOcXcivbRGcilUtG8ViVk6dkhGiiIdpWLdbJ 8bglQ0zYRLPbzuYtcWz54nBNSMaO0DGogm2iXCocnExg7BVoyKiNLY1e0Z8Kn3a7 g22u/K7olQ== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0b-00230701.pphosted.com (PPS) with ESMTPS id 43cnvka119-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:31:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877101; bh=2F1fa01FlzGNvP4SW9/uGXQYuTWkljd+yEQ/qB5QrVc=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=M9IGwKjo71soosfxs1QnEs0M8VCpJyXpUdQflR9AEq7PSioyUDsUwdeaiq2oZ+G07 RTvU5XPEMbvUCdkXMRMCo7jhCXn4q/UIXDWET+fI6SQO6XDxTuH3Ekf6mHKe4GQzCB uj4UoOhGPzmAaqG0f6guJMzVP92SWHjqYyIC5VEGy/m/5NDECSVO5LdJPLPiHM80YE t/6oeCb4LLcaAWLLADLvbeRcfVqssXvGQHGbqs6+p9GOFhVUFjxbGMq3QFS3ANzJVY uZa+d7y3XpIPHKrXrklHe1pP1tzSEC35r2oxOKIT27p0SnMoRJsgsAb1nj9ZydNkXG YyQGHkcbwhweg== Received: from mailhost.synopsys.com (badc-mailhost1.synopsys.com [10.192.0.17]) (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 DB0A1405EA; Wed, 11 Dec 2024 00:31:40 +0000 (UTC) Received: from o365relay-in.synopsys.com (sv2-o365relay1.synopsys.com [10.202.1.137]) (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 29A9FA0091; Wed, 11 Dec 2024 00:31:40 +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=MxmZzAiL; dkim-atps=neutral Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2177.outbound.protection.outlook.com [104.47.59.177]) (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 2ABA340560; Wed, 11 Dec 2024 00:31:39 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cjzsLBNOkHmxnSWbel02yefLdnYhcDuI49j2WJmA/HNR9ZSyTQhCZSRMT7B7WgEzQAIsXi5dZT8lVGfavrkg1Hj8x85Uon/9XF3TbX+YIsFyWLjZsU6QqAwhHOuYYeJ9+S9fKnup95CIosV43QpYG2T+LUvhYFWG66j+6ALGv46HtUvWsthn4vvJv3OPHHOK/WVyvOETQMNxbF94jsfxQNsr2bp53Sy4j8mpyURGSLg03iowXnw3SmIjpc0FGsQHJZOIKAaXZivVLrS/YGtih/spy01sf1WcpVLsawAdgUWDzRCcNhvOQFcHOlsxqvM6Q/SQKlItTJa8tP+airryMg== 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=xvYZPiVmvN7FxKjMD3vdLVXXtMvSRabvS6CHN1S42Pk=; b=ZWfLqhH53qmS8k+qrQ2l23iFFQV4tRr6UiytmGA1aWtjocWKB7vgXrODolQkdqmZYWC+FZezy7ZnFqejXlV8S7q1asx7GpW9ne0/xuXdjdXRxgRUEl/v7EPOtII6Car8vhZxMSbP/cegGYBmuGauAMkvBylGHPl+s9EKaqeKpked6Tv/Mv+eBd7t4YhC1LeHwPfzFBs1jLHXQ6zlqYMA5VTElin0wYQDaN7daVjwC9SP/AtbcBzd22AXMkMuQ2jDPlllL2ol5VFSmP9JS4k7K19TOQ8mzDpOZUSre+NEf9F7BjT0L3d6LgrOOvwEFfl+cg/kfR9H7unY+kVelIwaFQ== 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=xvYZPiVmvN7FxKjMD3vdLVXXtMvSRabvS6CHN1S42Pk=; b=MxmZzAiLYGPsxpKlEefXCVWa+COSOIFKGyf8Ky4SAEc6L+0DElOlcQ603CqlupOIjKEViYNbMra0Bz6juz+BirfwUbF837CQct8G21dVBfmOtFbE42NqcN//0NKGzdQPcBFcFWsbdPsteBdSbRuQtkJc/SVRufY7KmPg4edQ2Qs= 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:36 +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:36 +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 , Andrzej Pietrasiewicz Subject: [PATCH v3 01/28] usb: gadget: f_tcm: Don't free command immediately Thread-Topic: [PATCH v3 01/28] usb: gadget: f_tcm: Don't free command immediately Thread-Index: AQHbS2QJPaWIt2oTTkK8bp/oqBEgaw== Date: Wed, 11 Dec 2024 00:31:36 +0000 Message-ID: References: In-Reply-To: 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: ebd2c70a-f39d-4f2b-1573-08dd197b2be6 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?LQ+lmFBKZQDPANdu/t7tympElr?= =?iso-8859-1?q?0AmAfhq73tt7+I0S2PB87L11inTVbY/t/vQhFBLr2iEFH7BVhi0TrATV+ngn?= =?iso-8859-1?q?7Dd/cOZh85Wp7omYTndPfA074L/qmCVop6hof7KiF04lOYt6YR99rIORvQ2v?= =?iso-8859-1?q?c0kdzJ2hmPNGlG/7jF0KRO9oRN5eKbQSOdqOwNJTUn3XelRTxy+aPvwOjXtY?= =?iso-8859-1?q?Q+wmm8cWICwpQH74EOj36PgltosjgZxXuGVWM8w6JgenRtYSKlcrpGMVu9ru?= =?iso-8859-1?q?rTVTLvl9YlIqQFvayiOOwW91p8wJkiOE498r7nBsmyZ3yOg70gJNkoXljfhx?= =?iso-8859-1?q?yM4eZANx3VrKi8paUltRDD6bVQFMWubsBFwOeDZUlua4/w4eBvnZ0ZjCvo18?= =?iso-8859-1?q?veFn9Mm+JRr4vlLAWFZ5bAlAkg/L7R7rIJyQzv7YekvCEIJoZVDFWlPAcwfY?= =?iso-8859-1?q?dXy2Me261bmXFS2QkIKRN99EamTYVI1GJISkAeFcW6TZZ57lwxLYBjOyDCjy?= =?iso-8859-1?q?zxTRLzOUbJ11sVUWLThQDSmYQdxvFcu0xEijVzq7W4zwbTA8elJAzQMWBOrw?= =?iso-8859-1?q?uyy47GhZTbiFkL22gVDNWIli/byJ9SDDhpg/Jp74SGm0oIAcgdfrADvglXR7?= =?iso-8859-1?q?Sns1jcbzRjPEEtmrQB4JU1gXar4UVIH1JOIBTw1AjIzu5N0rocJ30/GXsNlh?= =?iso-8859-1?q?idNCvHmlTliiO9uHdK/rWsiDGruMAt/jbtcweACfW0fqiMwYdEUGAn0xpV3M?= =?iso-8859-1?q?H4m7vp8IlmvoN4plrYLZ2f+kI2t+pxBNp9RHsgJf+/i28xPVuIV85dRbSSdM?= =?iso-8859-1?q?keuGWgXvz0CrNvdOi8DYuqwgEztOD6KzimkH6YMrFIWc/jjO026e4Lk4uO+z?= =?iso-8859-1?q?/T700eILcRk0huw7ybaVFu2iBC5zlS57uZIGUIBbnKBmX7O+DSz7ef6yGd5K?= =?iso-8859-1?q?o7yANzLFB/pAGXK+kc8zNe0RN1aPPRdpUlV5zufUSWGVdovT7AAwj0H0/Ey1?= =?iso-8859-1?q?iLgcOrfULpVyMrexLU36xh+8oZKzb//u1zy+LQBt/YispH7eakfpyeiCD1yQ?= =?iso-8859-1?q?ywKy+XA13ClB8/xn3j07HjmWjDmhsHR+D1jlvloZbpeA7NJoeHGyoODXl60l?= =?iso-8859-1?q?tqM7yi6DgVEL3d4EIDPBWPGyibvCkZkPnzQ09GKq7+gAzqx89Tlk6ed1gwuo?= =?iso-8859-1?q?87W3jg9aVBLSO9A7RJPGHLEDCTClRhMhr+3Njblw9KAWcatfl8rYWGCeiVNL?= =?iso-8859-1?q?DFH/Ly2fjAWBzT2b4OdTOgWkvC9OGX47HmfZ+Yr1mLqGE6OEFY6Lr4/w+XhO?= =?iso-8859-1?q?hZr+dvlv480P3RoF2Y5W7Vevg9tO4zOMhr+1SgQmOfhCZW0kmSfvEs/XqQCo?= =?iso-8859-1?q?7gADGsSPDOfkQP+h7m7bi9SVyjoZGVqVYk3+wPW5G1V9cN5/99XX65puIxdJ?= =?iso-8859-1?q?bk9qTBy5cL+ul0RxtoIvxD4Q=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?5qjJhYUzmPmaHOjPqN60vgM?= =?iso-8859-1?q?cMHajXChZ03oPGce2fS5/4+YvKnqHl44p1bS8JygKka6uqVHNgu9NId2sE7Y?= =?iso-8859-1?q?Yvx/+JDS7Cy3Ydd2SIwHpAk3kdHDid7HN9kYSrrlUEOjmkGUJmA+BclgqcnG?= =?iso-8859-1?q?BTJDuFXSQNnjt9uiXlSwaMSJF87Ty/L7jkouJLsbEM1SUzw34DguL57As2gX?= =?iso-8859-1?q?5D1qy/0iyfraGRJXFujqy9VHva1y6uYwZhD/cYjhrL5f4/CE6orAjvIt2apY?= =?iso-8859-1?q?WV27C3zsNAzmDOWfSlK8pwyKefUeYEX/x5w5XvFBS/PodPI9IvHIvt3toZo3?= =?iso-8859-1?q?g/T+1qn2Foc8bT5SS1vT9RkNupoG+AHAiclH/Fks/rB6gA4YuF2OmXYssYZi?= =?iso-8859-1?q?BNp2DgsXf5SeSboCAzIkhheU+4ypuNeHyRGD4CV0vOEFdRcBMqHmQhcEJhlU?= =?iso-8859-1?q?VXMhNeSrPMN4QyhDvWXRpK9NKK3Nxhx4ZgwcOhLrlJuFm5MmkBFoN4eBfnnc?= =?iso-8859-1?q?IW0wW9acBLj1MCf0AtMCHLMfPnYH/0GlHstLHUOLJnMFfIzjU0I8zGPumNy6?= =?iso-8859-1?q?yQxGhKVlfC82aOLR2Z46YRe3II04Tkt9zndvCwS6ED37iEZWsjgNIAm4xOcS?= =?iso-8859-1?q?Q2cNuK2b6FFY37Sdpj+7QXIU0kMdwrlmbJCPk8HyYO9BmuTQdwbjZUk4Mn92?= =?iso-8859-1?q?6Sy3SZZr718kvU1pkPUkQzI4JGQjyPPxInv3ykuBRHl9DuflK/3xz/5DObk1?= =?iso-8859-1?q?XMnrJy7FXTKCPQ101FnR3vTGPX1G5MAzrq2IZ0BnmsIc5201qpqOLFjpL+9s?= =?iso-8859-1?q?VvWfMzuzLymSLeTfi4V27/0sPj3b/hUmloJFsM4Q3GNsrGjbBnONWjbNNjZI?= =?iso-8859-1?q?mgemsrtKJsv+nwRBko2pBjsfIiXZInwg9F8mPF9xXNQ7p3fTf2gHQ+mbHsJl?= =?iso-8859-1?q?tI0w0xwVDL5iZ5AI/E7B751VzZYTUUcOm24hCZajxgAuk8ltysH7BI+g6L7i?= =?iso-8859-1?q?TGGq4skwC0r229ArcL3UAym5JglruAmAbIIeKABGW7dD/7XFdJm5xxTRTGRf?= =?iso-8859-1?q?MF/c2ujizHqECJ4JbM0Ewwghl1057wrnInl9LDE1EriVa3i6BlDioOoZsPna?= =?iso-8859-1?q?ck6RRAGP1gLVXvGds37lPkLfpfsPW+CfumAJI63i0lJwM44hiZBKomfSCkSz?= =?iso-8859-1?q?oNGqrvHcQUpVL8pLe2ge9EppjQyiLX7bRVhIknSdUSC3XK7N1Cv/jaL0O+1r?= =?iso-8859-1?q?GUbkGjCddbTOhOp4Zlow7RsFjDrjZCE6wn5VHwBhoXuHmeluAFh0ChX4ceQo?= =?iso-8859-1?q?PVZ/47lEdCz8Ql6IQJ4spbT+XOUInc8B3DKe32eMfxfzk8iB0mM+JdpZVJBI?= =?iso-8859-1?q?zLVsRmIpxA7Zawm8czBdFLVQt0d8Z4fzY7eOxUm96GlyrawysP+AucGHj61n?= =?iso-8859-1?q?RBe1nAbwPxxXprL4sWAqErMGC4gKR0iplKj0eNi/gSMQu6ht1licuDwlmVuB?= =?iso-8859-1?q?dUc/SBp++tuxmUlNh2fUw1c3CEA+b/HugFyentMX/wjOZMLcEAxj9RLfM1aX?= =?iso-8859-1?q?2AAdKPSv7FSGp5eucSUttFHsgXl/9zbU+9Uu/roTr0uhgbRyYLVLBVCLbPKU?= =?iso-8859-1?q?KEqProQop2HptIIKd?= 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: C1w6VuBvTHJjfKNkDlZ7xhrqZEyFvJBz8nW00j6pWrh87ZFz4Ry6RBLiXdV3wAZYTgRf7OI9F8z46xL0T3tq+1UqxHU92ncyKFff+M7QB1TtbuK6vD1EXIrSJu35GNPPw7t0HK3g0/TfDXibDlAvQcpduN23LtuM8JXiIUr9am2qJ+H2Auix4O77Eg8AO0sJ4wpcx/Xc+ZtN4cjWZW5AQkXcvxCJAaUw/ducj8Xg5mJ/3FpGmrN1wjAWPMNAgK9U4YhanBpdsPvjbgMPQx6YZ5xaBDqhs5cS806zAwltA1wZkiW54dYmd3Avrk4+bjaIU7IWgnuT7fM16CzHSMJj8Zt4Uhfxy1daYKOvtpNOZsb7gAhFzeQU4WsSEbtlYdHt+iICKSye/Pdfs8qBEkWBalF1QpKobUsWQ6ribR62jDRDBEHMB8/mqHiApVMbqUxDLhxkpOE6+cg9d4GN+mtvzOjacs1ahVN50pNBvgib1vvFBiEaKvc9zbMISCo9aLp4U+cFUAgmCgtzXfU8OJrQ5rz0dKz11uvlnFsze/tZx8GSyqTWF2wBOvy10tX/l5VaFHDdm/riRgBqEiCOABW9UDI+BweqG4A/pdfT0km9WQt4TurvDk2Lxu1f2JnWC+84FcdSV5Sz/CdSaBYL+lfjaA== 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: ebd2c70a-f39d-4f2b-1573-08dd197b2be6 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:31:36.4143 (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: xKYcli0C56j+J87/SiBHfK/V8gsptXwqzOalBa3gzzTguv49zLIaSQY2g0ILEg0iVHVy/t7ndzHUHVg/ontZzA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7691 X-Authority-Analysis: v=2.4 cv=fNPD3Yae c=1 sm=1 tr=0 ts=6758dd6e cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==: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=P9SarY25XEDwvii7LpEA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-ORIG-GUID: 1NHgaCyb30sbr0QXxL-q77yRE1EBVTsQ X-Proofpoint-GUID: 1NHgaCyb30sbr0QXxL-q77yRE1EBVTsQ 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 mlxlogscore=821 impostorscore=0 clxscore=1011 phishscore=0 spamscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 adultscore=0 malwarescore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110002 Don't prematurely free the command. Wait for the status completion of the sense status. It can be freed then. Otherwise we will double-free the command. Fixes: cff834c16d23 ("usb-gadget/tcm: Convert to TARGET_SCF_ACK_KREF I/O krefs") Cc: stable@vger.kernel.org Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index e1914b20f816..6313302a5b96 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -1062,7 +1062,6 @@ static void usbg_cmd_work(struct work_struct *work) out: transport_send_check_condition_and_sense(se_cmd, TCM_UNSUPPORTED_SCSI_OPCODE, 1); - transport_generic_free_cmd(&cmd->se_cmd, 0); } static struct usbg_cmd *usbg_get_cmd(struct f_uas *fu, @@ -1191,7 +1190,6 @@ static void bot_cmd_work(struct work_struct *work) out: transport_send_check_condition_and_sense(se_cmd, TCM_UNSUPPORTED_SCSI_OPCODE, 1); - transport_generic_free_cmd(&cmd->se_cmd, 0); } static int bot_submit_command(struct f_uas *fu, From patchwork Wed Dec 11 00:31:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902660 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 955FB175A5; 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=1733877240; cv=fail; b=qE/hx5S07MlooYHbjvBF+mB5AGaGMyrKU0vZRjCaxQdwF5FH90toipf0zibWrUvYR4KPokXTQ+JGagxl2U/q83seaZfizjfpZn2V2pRqEnl0/vAAx2As9HY1D3DM9H6YBMjpPKY9dUuOdr4fs3VsDdaQZCPLaH9tu30rxqbH8oI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877240; c=relaxed/simple; bh=zylX45SclTToMx0DKHZf6XKtosEehJttd1LWg5QBgsA=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=iUTN9BM5AnFx538UoP0RqqzplkOMFiePElpXZ/cPuhUOrlxanan6GGsvQgD7et00utYUI2zCZMgtz86Sqc+HyIlDu5/2w1c4wNm6jHonYX5sAGOC0X/LRrZ9e2O2ZfgFmIfbcfuK+zuRka92bi3INVnULRX1obsa1dmBtTMfyBs= 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=j0rax64f; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=hg2/tpOr; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=L3hsCgck 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="j0rax64f"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="hg2/tpOr"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="L3hsCgck" 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 4BAM1Z1I017223; Tue, 10 Dec 2024 16:31:52 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=nQ3ToMYy/+k055h48KltP9+nYtIVZ5K25YxXgWLUcp0=; b=j0rax64fcu0t 4haZk7OhWHMrW59jWrc8f3jNPA+fkY1NpSdipM35me5xUwlWMPNaljJ9GpgXy2kE J+2FGsizwCbtlyqB8J4PR9vTqW41Ey+D8ri1/T8Otpu/Ke1Z/Z6moMvEr995Rm89 xNRbacWB8o9RxJdFqfmKDGWIk69b5e2RBb19eK3v/IhVfMumBFNUcNkLKgs1J2ya raS8SbNKOpctSZrQ+p0n25O7R74Vo3iUinsCfHlWJVz9EdZUxEZVmxkYuGR8Pm39 w21Izyujxfc2GrX1jq95AZdqZjBaMf8E42IWwlFuqkZgU4lMHFCqw5vrDG8OfD3Q XpC2RW65Aw== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 43cp60t0vf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:31:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877110; bh=zylX45SclTToMx0DKHZf6XKtosEehJttd1LWg5QBgsA=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=hg2/tpOrRbya1z1L2dsunFsSejHoONESjYFkscluSk9uzZLCzoFElcjrH+hhINvxR N/6GN9qpBnk3jiJkdfIBFn2K63ZhNAwCGuVk5UpM/DbSxuZfE0dARQy5zZg38Ms5Jo Z0+AV+yisaRf4eugn3cVK/3hJkZHvZ6BzO4Ka0WUpYsRz6fSkg55j8hnUAnWbscIli DZ8PDS4sGRbzJ7CmDZ5MbsM44/me/CFapH3BwXbnYt9IYZ4C4juBsAgJ6RB7Tw7uMW W5zU2mGxADo5LGvKeyYA1c05D7eMa7EQ9AeJqPaV8GQlb+jN6kAOg0pTff4Pc0mZys Co1haxYGJ0dCA== Received: from mailhost.synopsys.com (badc-mailhost3.synopsys.com [10.192.0.81]) (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 951074012B; Wed, 11 Dec 2024 00:31:50 +0000 (UTC) Received: from o365relay-in.synopsys.com (us03-o365relay1.synopsys.com [10.4.161.137]) (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 CF594A0068; Wed, 11 Dec 2024 00:31:49 +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=L3hsCgck; dkim-atps=neutral Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2046.outbound.protection.outlook.com [104.47.57.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id E14A8405DB; Wed, 11 Dec 2024 00:31:47 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cD4QgMLikQJpITq3AQ/SZW6BwBrLv0Zk4IxPI+w8aAmc3YfxGkk0vzX4nlFb9kayQwIo/CeENAFkoEciMBrQCeHovnjCk5qLf/0meyYhLHhIGtrgcXBLUjwLSh6oHQsBjV/olW1O4JseOPELaD5z8w97sfBU7fGKAZvqfsJj37h/8J/xteazSObcQyyMUs9YFqTbZJmXuDwbC/XaW4lLO0AAqtVcgtBebJFOmL1a0oX8bmtVJTq3j22hI6GRl7arAiKC5nmV4t0pKOyW3a9kcvhe6NlmKJvis0q++yvCtrBahPxk49HZnE8+nVsN5L87fomerYqXdd/gGgwhQSIuTQ== 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=nQ3ToMYy/+k055h48KltP9+nYtIVZ5K25YxXgWLUcp0=; b=bwL0+Tv04ADsdKtiq+ODInUHM04553WCShTcCLBYZV3C8oE+PL73DWw2RU+GjWBfhqS9U4VYaENVddhgYuFX1wiLDKTGa5/r3pb6HtFIeNDr49F2xSfixouwzAuzinBu5qpZgcu6LYruB0Qp13uZb2X5q86JV76T8F2gpDOKOlCtOimU6+0e90vS9c3+TBMlscwckcWzteNimeoM/EsbPZlNEuYyXGdFvu0bZxuIxErb/ZevVv08Hy9CvCCD0dXe/9tDUaovt+zSL6K9Vk39f51hMnFpnb7KASp1MAFmEBcclPf8Pdk/dvpd5JjzwybccqTjbDSTNhlHBZOyO+6vQg== 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=nQ3ToMYy/+k055h48KltP9+nYtIVZ5K25YxXgWLUcp0=; b=L3hsCgckqqQcxj0c1KlboJCM8g38EJhWOLcrZaCLWnwNeuz4R6Dy0YILd/ZJHHhMBELPShRBDIixNd3443a0Q+svRjIayLYbOuAGR8os2W1xUCutNe+CrYWdIHla346Ekc+R7dtosD1DWPO/qpDMQ1J02q6G18sPLaHiRoSR+VA= 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:44 +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:43 +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 , Christoph Hellwig Subject: [PATCH v3 02/28] usb: gadget: f_tcm: Translate error to sense Thread-Topic: [PATCH v3 02/28] usb: gadget: f_tcm: Translate error to sense Thread-Index: AQHbS2QNKrRIrx5sSEKLaYoqRp+CIQ== Date: Wed, 11 Dec 2024 00:31:43 +0000 Message-ID: References: In-Reply-To: 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: 87027d97-6e6d-45c7-b693-08dd197b2fdd 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?fgb3nPWmQGiHU8gJWnPIc3EIlZ?= =?iso-8859-1?q?Z+i1VsjewknaHqiEOfYIBI/02ATde6IIO2KXwalWWx5712D0/5qmJ5TLvF2Y?= =?iso-8859-1?q?/SIFUDHvB8yDrNsRnfTnw3/FRe9S9zNKZ/QN1OHIqkszbEMzTOtXlx8M2hPa?= =?iso-8859-1?q?hplZWiaU6OhjdJ12IYGieeyJ2JegTASrmxG9CRu8R14QutQn2IJmfHPsCh8R?= =?iso-8859-1?q?i8Clb9PGTNh2gYeArL0I2ZSOywy33T7avl+nA3o3aQT5uD6zztTJh7WLciVn?= =?iso-8859-1?q?ZRQkhqoeVRQCEBfQ5VZ7v0gn/3RRDobG5F9bNDBxPiWsUSFQ/tYR6r8qFHOr?= =?iso-8859-1?q?/7+65iPeTLzV/GaQWTqflmgJOvGKNcPM7fJAztDqoIPvImHrhuhpQVdukid/?= =?iso-8859-1?q?LcAglctlfH1nI8V+JRtB3kNPWr0txIe7FB6P3be/AiKKO06l3TNadVsVximz?= =?iso-8859-1?q?rayHLy+DmQlT+cjT8XgURZTVN6bgfAjQHToxVLi+xao3RJKRqQm9yXqeVQoN?= =?iso-8859-1?q?pXqyscbGdue59z+AHSC7AWKUwfHGESCCzl5LLhIPuNQ5IspnlI1s/aR3JY70?= =?iso-8859-1?q?PLAz8Y8FihRycNg8D1ryscdeEsHNELILRBxsMRliMbEKy7KLLE3roPv3bmhv?= =?iso-8859-1?q?lhST5R3CjWJTFuuB7kk20d3qaBaS1U3jLQh+4Tr07LRaEAlD3T8laKmvNxE7?= =?iso-8859-1?q?XhiL5HEwFJ9ycMIUGQZZjUQOdPpASCBXAK1koJbRZbrZJvHQilz8FLcNxR3A?= =?iso-8859-1?q?IrSf6pvFCXPpvVQuGhaGSdEUQKMBUIiABuzZlsll5G41/JFrBEaVQPCk+ZWb?= =?iso-8859-1?q?p/9JUw9Cw61pFPqLD4P44igmWgBd4EA7LrmfeA0f8ITQuhaTonJ6KAL18TD7?= =?iso-8859-1?q?0yzKXqMxl85tiujH2Sj3kcXJmWshEuTkiuIbmHJ5JU1/oqycUwmCcbVsU1KB?= =?iso-8859-1?q?Ldj6tR5nik+skrhNDCpobIuT7ihfmbvCrmh8Cv45VfHDb17KY5/t4xYKxWyl?= =?iso-8859-1?q?rjlGD+G/CJLjFIB7DNXegkypzwLNmmV7zhM7ASYsDYcg7Am7VETZs8GqLfud?= =?iso-8859-1?q?rkOqDVVW27ejHmnsZ5NMIjSk4iOVe74KMUaR4EJhi4DIxwiQ+pvstZKj9TQ/?= =?iso-8859-1?q?/NKBcdc41AWrdmPg2aFkNtNzh7mXEWgrjGXGAenSrQx+XX7FojbWV53hmIli?= =?iso-8859-1?q?se6V3BsEFiaJ0J2qt0iXvbXs2md3zg80mfflXMHBAbhsVQqMIAbxXfu6z8KB?= =?iso-8859-1?q?ApIdZEK3zAl+e63xt/I8thsrn1iDOEiDf8WBNofr6PtN3VkMVIOdgpNm0wmX?= =?iso-8859-1?q?QwQjqp72J1pfGtsemJax3lfe6arNIX0F5vcfIqa/qmsvDO7wRZMrJOa60GWz?= =?iso-8859-1?q?evyg6IqOlj0lFoAlc5PjVsv7XNviY4AqczNgdfFs8vFMsCGOFUojtPdH5XOY?= =?iso-8859-1?q?XtXX/P4PD3KmMrFVMU4O9b2g=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?JqidUwfpqH+WhLa0qf6UPQu?= =?iso-8859-1?q?OYGkJuwKGFMS0CDrn6Xj73pBcyGOmhzrqxQaGg6MgaBswNN9FL4rKso+Ptnh?= =?iso-8859-1?q?JZuRICiFVFESTHS4xKszMjIBL7egx2WDvI4qI1nEx6cnxjS3yZF7BMeIlIKV?= =?iso-8859-1?q?c6jwN19s+qBcNn0jyAXdP6OqnKIhl6DoSIxot4F7e9bdBQ1OQPO02Ra6N41Q?= =?iso-8859-1?q?Y5ySr2M/GfOR0moMpJ83SvGCNYN90J7hixegxFLVK+WidTqUOqDNE/ymr9Dr?= =?iso-8859-1?q?/lX3PIPQAninBgzlGiVNwIJ3FjQj9oiFd5KOvEzmcFGYLicNkwAyRoEs6NLf?= =?iso-8859-1?q?aoaMj0KZ/CNVovSzroD30lmVvq1Stdkoyrf4PuFwdl5ofU2QN0vvhRlTCqi+?= =?iso-8859-1?q?Qln2SbSm++QJGQutFsit/IlgaSyxlhzh45ymlspcgyFiKECNpQEMT4obT+DX?= =?iso-8859-1?q?QKu6PWRpZe9fltBXY4+5gyMHor71xcMQdZ13yID4Ic1bM0GaJS12Y+M6RjLc?= =?iso-8859-1?q?DJxz6TUe90T+MaL2QlyivxbLfUsZ/qqmQsrOkanMDGLR+FaCWWnPhF/rSP5k?= =?iso-8859-1?q?PvLJJ4bn6LS1J7Lho2nCRkxGAclJ1ZYnacXbB9Jiiwd5lpGFxh/z60lBmtDs?= =?iso-8859-1?q?zOYOkfx5Ju5XCm3Ep3TAgvvr9BEZRPWtNta4X+RtJMEekbDyhOyqX3m6ndq4?= =?iso-8859-1?q?ntiFX82QnWW03/R8TUvLVgpatjRjvDvee7IULaC+40bJl/ib4RRdMrd1yH71?= =?iso-8859-1?q?xSB7vvCOUlKGVtvnAZMG2m4GwBZuJuGfzvkp4y1/KrB4FIVZcEg8ltpUmsku?= =?iso-8859-1?q?YexkngvdRcbyBfMC+voSUNDT7wJCDqugq47V7ZzubRMUrqdxNxlNgpUAQ4VV?= =?iso-8859-1?q?tUHlIegrx431A3xFShim4OFrgAkDWnVxsSIvgFaNo3BmKLmB1+yAXrrwfM9R?= =?iso-8859-1?q?d/j+HEV9IpnM1mDXJ3gasifHZVhXQBpTGLiCZFxYBPdavgRmk/8RqOIfTzI8?= =?iso-8859-1?q?E8BRYVEqnd7toVjXfptT9iONywvkjlib8VZ8pzpZeW5MFSUrMos4B6GK7YNH?= =?iso-8859-1?q?Hdy0h3kqZj6DmXIaNKG8dUN0rU6nREvYECtALnKoFuBfVhFrgP6E8vmaozL2?= =?iso-8859-1?q?OFecU8t6pt9/nAdvz4PLLb6Mwkb23i4/6G3H0FVETXRWNTgErJMtxx/ViNXN?= =?iso-8859-1?q?XVFGryU3Xz3EFgtNnMR9Zn/A8229CrnoqVuHsVNueSvWXu+K74bpaUwgGxvq?= =?iso-8859-1?q?Qhb4yQAd4uI1IoYGxf6CbgaxnkoYJeaVehjh5xHNbJMASQRFlo8UR9xUOcks?= =?iso-8859-1?q?NNhHIEfwMDcj2y3nssCggt05L58ddczAw2dTsXc6xip/9bybZYOu13FqCyzL?= =?iso-8859-1?q?LDBhqxyDOkZdLCwG9Q/wD1roHzWo+wkFYSooPP96ef0y1wSc3c4tsp43OxNe?= =?iso-8859-1?q?ykT8E678fBqCiznzJqitHr+OeCMvh3sMZRMLupafYNIonhnJK+MSzXs3MWfN?= =?iso-8859-1?q?gnMs4NrPBGpmy3+4uli7Gx6ft08hdMhBN8ahdEe8XhmxvGZHs/8ivCXZeLHH?= =?iso-8859-1?q?rf48TWkxtnf5Lw0JpEgAnUWg92CliLo3bQpY3MO5SPSvO4vdqfOzVtRFVz7U?= =?iso-8859-1?q?qFyTIOtQl6qCkCeFg?= 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: HJK/Xvsz5fCilRU2aO9yjnainJnEv9sgg3Ty8PzCFy3Ur4pXd0VWBnO0eJGxDjVM56ypb8gJZblb2OvW7BdziXLlb3XPTRuqUfMVNddHxrj53eox+5nAf4ZBpFGdU4UYNj/PM00a8aXiwSaz5gfHstDHCiZUDVE13jjKjRhCWa6qjjdIIfdaFP/Hz8V8jLdIUbFTN8+CGItRyUo2PcZrS5tYootRt+OhN+XQR69krb/mCVJbQzL7RKZjqnuKK5P3o+UU6ad8+rOtpGzxJRY2P+tq4Fa0y3jfxyMV+dNxRoUz6sMPnriwHq4/tZ0CE4BohOq6p2092ym+Qyf0xg7IBKJ33wsAecKx0CT29tXyH6xHgBYwhZqSJH5bN9v9gqI7VNgPSgpmol5xpLM9dHuTDHVtJEwKWwnYZY5Nuw8sPaycdmBzCy1zUQONSlGQgroVSuh9X1AVJz9Efk2eI3W7l+nYUwDO8mn8QC5iGJQhRJ+d+bEaRCsk+HyomjKvgc2H89vXlgTDYez0wZ1TR5VXhV2L6z2df3R2t2Bslr7/h8qZwWv/WOGplJNBFSLQqIrX/NoiAeexXmVpdztfRl4ad0+/NKoXN0VNlcmFMeQjUU5qHfhMGSPVBDAx7Nb35Xxcke7XGsbzzZNPXbeDWM/ZrQ== 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: 87027d97-6e6d-45c7-b693-08dd197b2fdd X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:31:43.0638 (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: mhYBx5k9OKpWS2Y4LzkIPff3wTi3H8RaGootRGjA8WbDBP938aR1BH1uDcHCbpv6uwzQob2aSSfyiCJQQE8YpQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7691 X-Authority-Analysis: v=2.4 cv=Z9YWHGRA c=1 sm=1 tr=0 ts=6758dd77 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=uci9V5TbMvxmTE9LAKsA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-ORIG-GUID: gkAtT4gl-tddLJSRWpsfLZxazeWaU_nr X-Proofpoint-GUID: gkAtT4gl-tddLJSRWpsfLZxazeWaU_nr 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=883 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 When respond with check_condition error status, clear from_transport input so the target layer can translate the sense reason reported by f_tcm. Fixes: c52661d60f63 ("usb-gadget: Initial merge of target module for UASP + BOT") Cc: stable@vger.kernel.org Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index 6313302a5b96..88b8b94fdb1e 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -1061,7 +1061,7 @@ static void usbg_cmd_work(struct work_struct *work) out: transport_send_check_condition_and_sense(se_cmd, - TCM_UNSUPPORTED_SCSI_OPCODE, 1); + TCM_UNSUPPORTED_SCSI_OPCODE, 0); } static struct usbg_cmd *usbg_get_cmd(struct f_uas *fu, @@ -1189,7 +1189,7 @@ static void bot_cmd_work(struct work_struct *work) out: transport_send_check_condition_and_sense(se_cmd, - TCM_UNSUPPORTED_SCSI_OPCODE, 1); + TCM_UNSUPPORTED_SCSI_OPCODE, 0); } static int bot_submit_command(struct f_uas *fu, From patchwork Wed Dec 11 00:31:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902663 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 6DD5C3BBC1; Wed, 11 Dec 2024 00:34:01 +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=1733877243; cv=fail; b=rQyD9Ku2440IXh8aVNVTUtyKJNFk/Fu2/ZY+b2ToKh7DTWCZ2CUnDb5GN11xzkgkW6PP1+hxkUU2t15XIkvTL5mvN31kYlkqeOWkngSwV1+PPiT5k690CdcDC6s1HAo7sFStIukxzJ4OELFX5jOTXYAIQTH1lWqiUtG2UUMAR4Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877243; c=relaxed/simple; bh=sSZcQgfa401XPqf7oUhu6X0w/bnPJ6vwltPa6jXWtiE=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=HKvTABZ/rYJ9DBZzf2OQkpcGWd1LGuPpR+Iy+qq4dZXZlznDNUtMtQRsec+y239YxE7A/zw+Uh3Q+UjYPxJxLTCgUGfriXdY53Reo4RRExlp2EliEDL8AMgY2pzE6OrrAl1BN9ze4tKgdEl29BUA+fjJIKYNdJ0sP3ICFB7kHyY= 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=E/OwNHdm; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=P+0Lvhps; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=Jk8YaIqo 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="E/OwNHdm"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="P+0Lvhps"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="Jk8YaIqo" Received: from pps.filterd (m0098572.ppops.net [127.0.0.1]) by mx0b-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BALFNFD000621; Tue, 10 Dec 2024 16:31:54 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=PJKDdsTF0kra+pLyUPR388wNz+mZlI7CvrfoFFRCRFI=; b=E/OwNHdm/Nm0 rXyCaQvqO5Fekr2+N9/IowZn7plGhubnxVZEW2Zwf9El/MPHx1nQQ46j886W59uI 71sbQKIVPWLSpqJwBPi669VlNe+RcGSNOYYyAnrxGa8jzclrsUHRH6XPOUKBb2en aMP/Bm9lTwIzfHGdJHEWpN8EY9dySI6169bx13jRa3rr8Ifje65FmHlzKW40trgK /VDnzuflfgXSFjk1ym85Q4btlhgiigMxr86Ij4FOgX+7FghIn/kG+Qr/daffQ2vF +hi1nniN24jrujyyW64GK0AfsX7dK4b+sKmcXjPclC6ipwoow5PfF86hlqx7TcFc 6sME6kK6Gw== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0b-00230701.pphosted.com (PPS) with ESMTPS id 43cnvka12c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:31:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877113; bh=sSZcQgfa401XPqf7oUhu6X0w/bnPJ6vwltPa6jXWtiE=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=P+0Lvhps7AY7oyEnBIQfl4nFvVw8xIGxw5F4Tao3KCp9mISXqF0NQTUSD4ZKrYNn0 2e7cQJ0w5IoIDDyl0Oro351uzoix4hhmcV3/ukJ0zSoAlULttvndrdjmQw5BV+GYB7 q3sOOEhV7/Fn1YLFrKCUZ9JO06Ta3JL/Huv9bzuABgdbQ6tZkClm3pE2fSh9+GwEkV 7fpGsBTDyxUrQtwN9OSAR/Ai33iZTvXxayRbzoC51G7c/PwaVvTHOMELerUMFoHKvy OJzl8DzzdT4hE8YocaoX4WeeuHRS4tJ6ria+ZYhBYWKVjbUKQp/ZyfrCeZoCzkqUaC iGtwoOdt4uLOw== Received: from mailhost.synopsys.com (badc-mailhost1.synopsys.com [10.192.0.17]) (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 217674012B; Wed, 11 Dec 2024 00:31:53 +0000 (UTC) Received: from o365relay-in.synopsys.com (us03-o365relay1.synopsys.com [10.4.161.137]) (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 1F052A008E; Wed, 11 Dec 2024 00:31:52 +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=Jk8YaIqo; dkim-atps=neutral Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2047.outbound.protection.outlook.com [104.47.57.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id A52AC405D9; Wed, 11 Dec 2024 00:31:51 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NeqetPbO2xi1OTfU8kUU/1hcsowfK7MTZKn4C/ECtvIWjpQipknNcIV3jjIS+3okwavPQzR1+w1a6CblBPmSOyv4FVUs5sL2uBztrsd7jp/5rYTS1ySJeJS89v5nKuuBUifICi4ntDF4oL1OhrKAXJ1z8z3uOjf+FcZgR3GzBEVFldU+ulSpVpXOoJmY9o9kEUh7VLIBdV5b+JF9MBwmg67er7bXwM8+JvJWKSep1z6isJRVheDckoWQKbhIoPlm1W4tZ5PupU23+a7Ga+AkUVTtfVGivBpTqJNWkDh+GLQlNF0motEuwUCAIqAXZacZFb8lRcbdsjr5LGIOjTdaUQ== 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=PJKDdsTF0kra+pLyUPR388wNz+mZlI7CvrfoFFRCRFI=; b=WBXMMKh1XGVjHyMXETwvNQ7zcT0uo3+BQ37urTF7Lf/ognn5v9XXXx67tLenSrSS0Jn8LGK+oYrJu8rEf6aZmmSrdHeCkHYoZMTn2kg443fh/zO3fhjsDpjct+K9ZO6RCwSMlBs2/rY8DaqRQzR1cJCHN4OBN1zqNq7HXK2qtGgvdyEVHVoQ/wNvCGN2IF2lADWXPZ3WHzfLrXdNbO4z/W8ya3uz7M6LfiP9Z2CZmufPVuT7q+2ci3frTc5zhEyBuf3nFXpRhBtB1JC+wFebLgBBYldFjzuQU/5eWq6yFj4A2HcIB4weUDxM6Txj2kql0RcgXTye4TFEU4TumCEzzw== 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=PJKDdsTF0kra+pLyUPR388wNz+mZlI7CvrfoFFRCRFI=; b=Jk8YaIqouY+/XMqHPfO9x0AMfjxjFAWZ9VXx4mQKUoi2fLO4UR8hWk/PSiIIPlK4+fd2O2yBZScGhGG/1xE/lCJEgX7l4ygdZyAVo2A3pAJtbK8lko2WrGAH69wuKqBlH7HSuPxP8k02338MIvCr1ImJO/YFY2JDztwoxunADpI= 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:49 +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:49 +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 , Andrzej Pietrasiewicz Subject: [PATCH v3 03/28] usb: gadget: f_tcm: Decrement command ref count on cleanup Thread-Topic: [PATCH v3 03/28] usb: gadget: f_tcm: Decrement command ref count on cleanup Thread-Index: AQHbS2QQ+qdsN5JPhECrWm5VgZOR6g== Date: Wed, 11 Dec 2024 00:31:48 +0000 Message-ID: <3c667b4d9c8b0b580346a69ff53616b6a74cfea2.1733876548.git.Thinh.Nguyen@synopsys.com> References: In-Reply-To: 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: 86281425-46dc-469e-31bd-08dd197b335e 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?o4vEmysh67kjf5QmCB+EUqSN4V?= =?iso-8859-1?q?jROq86KPHJD6uWVWFXZJ2+VWQWqcGHS8s2Ftnuv6gRjoUGSflab7ri8gDUKN?= =?iso-8859-1?q?cTpgkfqGOTvy6Q3PdKpUXyU2bgX8mF+V8ZQWH46MqsjNEYNhio7uWZp87vo/?= =?iso-8859-1?q?LZgcxZzFIxRweyHYERZ7oLwotCzmCdmQW0BlOs1GbjhdKOo1OUF5S9ENimYV?= =?iso-8859-1?q?c4kZwox977Yk2MnjfahD105BFkgCBZS39n9ZtLF3DrG4cQOL2fXXtbos5IZR?= =?iso-8859-1?q?TE545brryxScVQ/VkgJnrQ4Iow/2pmkhdSO2bOHWb0JRh3MBSCdrTcbxo/xq?= =?iso-8859-1?q?63rhuu+WZMc13OyKOO7tY7hMx2sOMbj28hfX7XIbn7JWqSZKca69GKXvFsRd?= =?iso-8859-1?q?tCvLHSAMulPGIzgsZTiKiCGicwn6Aon+ChlYjB33fNO95MYrQD+FHBxMGTcG?= =?iso-8859-1?q?iw8NuromBwHPABI7+vYgeefhXkm2TPvs2Kkei4DGAT1tJXI/l7+WkqkB0Kes?= =?iso-8859-1?q?yQEtsyLv2m805tBNYgkvBeDcxplHqbu/O9GHpAUIp5nwB5L6UnG1OScRUDbr?= =?iso-8859-1?q?EUwn+BZ79/N8eHjlh2gB/DtvG4r/xzyJts3mDJSjWT6AF6T0wyM95BYOtug9?= =?iso-8859-1?q?4GzcMnTBJxsWWhMGTIWZZm08uzwKj3Qb4QBv3B7q3s3tc1bYO4jjAU5Zf5H0?= =?iso-8859-1?q?MIoPiCixnqVpX9KQ15mHE868afgJ79fgzQusdUaY6UBiwh+jB/GJNYpZaRW6?= =?iso-8859-1?q?JlAlGkx3kXSjBixgmI2eKQZGXGl0bO7gJePMjNVWO5MLh6quaYaqw8c0L9QD?= =?iso-8859-1?q?rOrPPXLB+Qm4tAq8rbJ/wY31HsTJ2Xel9AufvzRQi2eiTR2CpOx90/yu3MxT?= =?iso-8859-1?q?Q0al+vdH5vsVeqnUmoGZftlHLDHsm7xMqdi2tKvi/+2RSYQfrgFv0gxBnl4u?= =?iso-8859-1?q?RTtulb8jECgiLYwSOiAuBLzWPg7tbACnQ3cr5Nzy7IfzOuekkZgOytyYtAye?= =?iso-8859-1?q?JFqt3bz/z8tXs9C4kXXCGC/kkHizQrsiarML17j1YAOfdqHpHumDMQEB8PAx?= =?iso-8859-1?q?Ee/zaX86f9CKG4C1YzRGlyNjvkTNKJsYl6yQxqASICgScXzul7I2i4sDbTP3?= =?iso-8859-1?q?pSudEIXNdcbavDHluuYekmYfzIWwncMLGQEa80U2wpMypgJ1k8SysnfX3wLk?= =?iso-8859-1?q?CvPnV5Nh3Ww+/USsVrjoxD1lwMlgoYqHocpjzxlFDD1f0t+TqDly1jNI0QyI?= =?iso-8859-1?q?av+/fvrzATxt4QTzjaZsTZXoQ2NnnJKq0WNW28Cf9FcysGvZAWE1s9Gdr90F?= =?iso-8859-1?q?fMXkYa26c6QUds34Zu9LFN/7Z2gVpWPUTG3r86e0mGk6hrMlJZTL2MGZcam8?= =?iso-8859-1?q?dVjMG6SorFWPJfzD5OcqRuNbuEHcB5HkL+osedGfeVwVB15nO7KNcDNsGppo?= =?iso-8859-1?q?aeJ3OsOuxe91dHDCXdYDLk2w=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?ItNhfQ1RpCoebqUE9WdwBGI?= =?iso-8859-1?q?YFEVbxtPx6jOcUB8U+JZi++pE5NFWi5728ITdYWIhkcuABGijU4/lQteo3Vb?= =?iso-8859-1?q?/3Vlnwrjhf/MuzRUyl+pKShSYYyzFf9I67LL/XkyTfp1tZq39zSNqhev3Hth?= =?iso-8859-1?q?rNP+hqrRcvFygdi61Ygy5rA4Mcp9b9BEkLJmhRYak5nu55OpdEywDeV5T9mt?= =?iso-8859-1?q?1tRmTY5f15pxuQrEFodv3oO1sgQqNQ1RyBcN+JBbyjTv5oakqQ0dQIzpvOQr?= =?iso-8859-1?q?5bF4y/QQcb7I2XoXVY3yx/t52fMlw0LlKIpaM7ECK+g7uOmVUvWbeI8ua6t8?= =?iso-8859-1?q?JIxTQOhUo1C4pSdIZSVdlSnrOGPWUYgitsfp9Vkrvz/KG/gztS/oxSkV8ghD?= =?iso-8859-1?q?yiSTALM6VP45OfZL3cBE+VqDmRuBu0CtJfGpymZ4l0LCCjIRoVAhrQg/6WnZ?= =?iso-8859-1?q?4movAqC64C2FHbBvUe2uKtJBMrPrOZKG1rdezxTOkU4E7qaSNItlBlAC7sK6?= =?iso-8859-1?q?ktq/1RUwpuooc6GCyo9YQnYzhdI/06/dU33uQIrZLytOpwnnKbhBPBQim7wM?= =?iso-8859-1?q?cNs/QXt6/Ukmv6iOC/wkxe2qe9/MpzkqMAzKfmZ+vD7Zad4ce9AxGt266j/1?= =?iso-8859-1?q?Y5sGJU+Cap9O0s4jVfJ8E3rjc3Mwd1QIrJ4nLh/4X6iSzSA4B2ltXnngVvsd?= =?iso-8859-1?q?fsHFhclTAlDXGi0XrayPc/iEv2YLbQgLjofSmhwq0nbTgDJfHuZeYOU+bAkU?= =?iso-8859-1?q?ooybQMRYOnyk6o208oEiyUbp4faSqV3r6UQ1XJkpztXlQ44wHr3nYGDVL2ZC?= =?iso-8859-1?q?kZT4OPsHghdwebKNH9bUPCEk1kT3gVBNlx86gujUUAa0hh4rBv9gZuSuE98T?= =?iso-8859-1?q?TB44+qvd0ooFx1brJMd7t4JRPAMzJLX3F3ofqv2AapggzZ2fjrkW2evV9o5E?= =?iso-8859-1?q?36khM6KQZb+O9KY4r/9FfLLJkUZa2W68NVDGAyZEEva4rRCC5ikgfR5/Gp3w?= =?iso-8859-1?q?lKXoVxjOs8ASfhS2c6guoqDetVYr7fVjUwHGeY+a8PRJYn3tmUwTFJzyYuSj?= =?iso-8859-1?q?sg6Ap64d0fGJ7mNzktBhX4pdJw3itz1jufQvtelRQT7LtV4DWE7lNRyOw70m?= =?iso-8859-1?q?J2bLylZfdU0Q/3+TWg0NY+19QQ1m2X4/s+PoUClbzsS3ncR26+CI6yF6M+mg?= =?iso-8859-1?q?9DX8/n66N5vdOUUubb3H/aGuSf/Rqu9R50tc5ZZ6pFyJiTP80JUlEnfEWYET?= =?iso-8859-1?q?SlyTXd/fWqWb0JU/w25UJ4iVsiKCejvciyUJ9DBlNxPLkiE+KlEM/bmXZQka?= =?iso-8859-1?q?HJo1uhB1u8ETUS8+12Ssc5l2kvoG8/wRPhNogIenw7DAovzmLuApLR70cd0J?= =?iso-8859-1?q?MfgpCPzncgjcwtZswTWx1x7wnSOBpv0WgBOfTKGBRa+Nu9B6UM5DVa4AnZYN?= =?iso-8859-1?q?WVlTJfXkPQk+gJmOXNGJ2QY46dPtlF3NbsadGSj369qftVtyFkBEZJWHVXRS?= =?iso-8859-1?q?P/ZHFnzL2nSQ+kn7K3QKCPL2d82bl9MylfqW4UPOXAOtm6S+LoG1fucf6Z7X?= =?iso-8859-1?q?jer/lhHQvvhoOynts4AmpHqc1W8xx4nBK3/gTVPYOaApvoDqvJeTHRM9MSx6?= =?iso-8859-1?q?RR9IlAXVdCGQOEfXd?= 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: wKMa91mBRQgJdwpnhlM5mzmN1K17x9SqrqHxlgwe9NFP72TWtKxEriO0ZUYWizvAP4zOEo32y87XND46jBZTHrbPCh5gGbXDLsy5i0rwMXOECkouduN1DF10TpBmIed+WxTA/KfDGmOdde60AOXd6+uVMGwR7uGGqkfD7zfHBbsoJxY81AffgXHZ9cFti/v0SrhPA4y9Nia4vI+neK+n9t8bI4LzRvUGDV+dLJDiCGSk8ki11k52xg54ofP66rVZn77LxZf3CSIvpUaJwsULuL7gWLRD5OV8Kz7N+XSd/E7LHDqQgh1AYogCEXCJv7NfiokLpYL8rYL0W9yJMOwJC97df+sOHnLzzVFU91+dJz9QQcHA5EwDd5j+yNB5jk/K1CyIqrr9hBMfYFbINQCPjH9ehAj7j8hDN7R2UVFGpF+y1yT7jqy3M1CJWUsi1oJAevYahtmpl4/vED3/gjHk9oKvDHm2C5DRBCT2xRn/Nu9QbLfvUrg7hUFHF1bA94UthYpsd7XYwShEPjDCsmEAsr0PAgEJWVZckbUSxMY9W5cVFa+4lxzkRaCI01b8AQ4cGElvlctuazynFvyzDpX+VmfIqIx+BJot6jrX0hLiVJyW+6NFYu6RmP+fdCI8FL2zgkiCx/LFIj19uP92QnHYuw== 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: 86281425-46dc-469e-31bd-08dd197b335e X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:31:48.9717 (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: wMGmKSaBUJb927g6YebhslvUloXFk5nrexlLDkZZ4qpJ5txEaK/faGjWxRcyjSi5UGAUrfEOQ9QTiMcbhUzOQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7691 X-Authority-Analysis: v=2.4 cv=fNPD3Yae c=1 sm=1 tr=0 ts=6758dd7a 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=0cASoJX2RylK66VWcoIA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-ORIG-GUID: prSskLNdXrIn_g-u-pBfA9yMXi78fes1 X-Proofpoint-GUID: prSskLNdXrIn_g-u-pBfA9yMXi78fes1 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 mlxlogscore=999 impostorscore=0 clxscore=1011 phishscore=0 spamscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 adultscore=0 malwarescore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110002 We submitted the command with TARGET_SCF_ACK_KREF, which requires acknowledgment of command completion. If the command fails, make sure to decrement the ref count. Fixes: cff834c16d23 ("usb-gadget/tcm: Convert to TARGET_SCF_ACK_KREF I/O krefs") Cc: stable@vger.kernel.org Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index 88b8b94fdb1e..5ce97723376e 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -969,6 +969,7 @@ static void usbg_data_write_cmpl(struct usb_ep *ep, struct usb_request *req) return; cleanup: + target_put_sess_cmd(se_cmd); transport_generic_free_cmd(&cmd->se_cmd, 0); } From patchwork Wed Dec 11 00:31:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902730 Received: from mx0a-00230701.pphosted.com (mx0a-00230701.pphosted.com [148.163.156.19]) (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 C106778F59; Wed, 11 Dec 2024 01:20:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=148.163.156.19 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880037; cv=fail; b=pNeW3LFkKmn+1pX6Y6jnHuIOrSluRLLARs0LPvbVrx04Y/6oZk3Pv7JLqhIOm5Kqc4YwVVsUPbZdBQx9sQBs+twLxVDZWPX0D8Q1a8bhjRzJINRzQynVeQsa8QeUhbqW51iuslBAaYAuzrSRknIMTjAx73VmjPDkCsmlCn9gVvo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733880037; c=relaxed/simple; bh=01abjqtU73ydHJmeeq4hG0UxruHWB5j+KUYyqYpYc+Y=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=OK3RD8rm25cjuoHciPSifKBJBWvZMx1BZDECwcY1Q9cLTDDd84NF8/gdOvR7X/8+9qWoQPOcw1RH6PQM9OUtbwZ+4IePiaIIlmIcfy5ezWdZ3YURnMbjCBLohPacDuqU+jqoCB47LjyQL5xfUX3azOVXr4yWYcqi3Mn2EqyrboA= 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=uwx0D4TE; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=GxGOAvnf; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=IjT7I9QV reason="signature verification failed"; arc=fail smtp.client-ip=148.163.156.19 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="uwx0D4TE"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="GxGOAvnf"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="IjT7I9QV" Received: from pps.filterd (m0297266.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BANAfGF010838; Tue, 10 Dec 2024 16:31:59 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=o70eq8Wi84u98H2mL1OU2J7lHDMgdsir59kNkeW66Ig=; b=uwx0D4TEqlis D7LRcTII0JUVGbcRAXtT3mBF9TexZQj2HRAln0NXjFyLwr2CyeTeFGJYyj/J1OdG aJEHDB6jfJexjwVqxpMoQ8A1+8fvyX1n3GITxB1lcCbkU2FInZHN6WxqhmfQet4Q Anb5SOiLRGCGWNofh0+yORkQyflxZxzLjIyq3BsnG5cZPV/XwVwgrmxFqFjf68vT oiGhfDRTffl3ewsCAcH7NNKUlJZJQeuZdCz4K6AQtA8vzexRnG5REAbHhOQ9+aS3 aCQYlksTDyKilxo1kVSm133AjEJC/7EVYfA9pS/YUuly1SPmJH7CeFEyBg+As11U 8RyCS6qMBQ== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 43cpgb9ptg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:31:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877118; bh=01abjqtU73ydHJmeeq4hG0UxruHWB5j+KUYyqYpYc+Y=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=GxGOAvnfFwJf0l8F+svQ63VzR46CLuVodd/8xfV/52RXsB1H04ClkWPg7W4nUd2uj oGBZMWN8BTXNUJpS1uQLxJQmhnzAN9r/nYTajpU3Od4qeX0tKfVDe5r9FNehtNRcKc yMerKOdN/DEkBVFzN2h20EK2y+UGI6ut7cPUZQFhn0zazqU/iVltuGusItsriHKng2 n4d1/HlElklMBJuQnGree+ij8atYvIvhdDq7M5bAvsrzVaTokYMAVoCQG3Ozd8hLWv L/dV+SK2BIdAYc/wBIbOsCAfBvoZzz1u6wOgYS2OoFIOkTCSrS4TBmRymEgSGPn/hZ 84hhQnRcxtUqw== Received: from mailhost.synopsys.com (sv1-mailhost2.synopsys.com [10.205.2.132]) (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 B6E5E405EA; Wed, 11 Dec 2024 00:31:58 +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 96137A0078; Wed, 11 Dec 2024 00:31:58 +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=IjT7I9QV; dkim-atps=neutral Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2170.outbound.protection.outlook.com [104.47.55.170]) (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 429524052F; Wed, 11 Dec 2024 00:31:58 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gqKmsiDve//zjp9TiNQbQMxyNQACovfJktgTTgr1Bo3ksTtp2JUBkik9uS9iWf9paZQwd0W5mipFo58Bsc7/Te3PoTBJODjT1uVPYHY0jpX74TiU4L6fcvf7MNkTdfNgJ2eJB1bbbyrloMPGdZFQfIEf1Vk6hzaG+xaWPmGx21snhcj9RKrQTeZlgJ1X1NOJYsqDZQcyt0BaFmyuJebXuEsrJUuu3yKADLHZ1z1yrPRi8VClcYPqht7/PbTrxdO9FLL7gLXeVvSeBISwLjFDyS1I4le1RBcWlDDFrYlsJb1BA3fd4ECQRj9voDmzCqEfdUg8Eur60BsGMVryZ0lnNA== 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=o70eq8Wi84u98H2mL1OU2J7lHDMgdsir59kNkeW66Ig=; b=KSzPRZuWqRjI3h3KI4B6yqr1Y3OqhqYgURmF7o/PDpwgyDOyz3eLGCrk9SDzE5MvvlJEC2/kWANCsNvwxFL/IsbGpokgAxvAhWirOJ9Ma25c73A+JPm1p99BPUZsVBMobKz6oXapfjtu7cHZtJlHMHRjpW4zvKQXm7Y5IpO8NdossffVqES6E3cXnyenzOaz+ai56nxLik1Oo++X92mOEDmrOVIxlRseaar+NrcoVs9MnjVYTmz5GY5fAaas0Pa9U70seCBXJXp6UZTr1mXX9Oqgz0JKqxSZiJq2oF4JzIY4QdH6X5zyGHqlvevvLUhNdL84xZjXIIqPOZKm99mGmA== 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=o70eq8Wi84u98H2mL1OU2J7lHDMgdsir59kNkeW66Ig=; b=IjT7I9QVD23a3pLuX6jfK0e88ZXMjreuz0mWNQNIoaql7F3bFOTUfWbqrWJRpeQaLj6N4/nPJx4nzHVRmycZW/JzSvoEz0QulOzdgNDM0sBR/2Aoa1fpbIrYvJJawnWqNPKrnG6P7exugNp2hSPE1ggcLKdMfeQJP9GphOs1nD4= 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:55 +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:55 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , "stable@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 04/28] usb: gadget: f_tcm: Fix Get/SetInterface return value Thread-Topic: [PATCH v3 04/28] usb: gadget: f_tcm: Fix Get/SetInterface return value Thread-Index: AQHbS2QU9/q0tySWeUmFeqAe0EQW+g== Date: Wed, 11 Dec 2024 00:31:55 +0000 Message-ID: References: In-Reply-To: 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: f6575bc7-8d7a-43f3-1cca-08dd197b36fe 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?bwWCANdjWpLCk6RSTuFr68mtbc?= =?iso-8859-1?q?RcbdrDYVHXx6UkrxA6TVwwfeTSohWR6RyrGMwx7FXHHohgCnzkkYMvsQAy1P?= =?iso-8859-1?q?KrHZdMZp6NF54KbqI4NdH7TzXC3Sfu+HQLcNlUErAlRuDXvi32M9KKV1SHxD?= =?iso-8859-1?q?tuCPQckCayS5U8MNF+NvTN5osjFMyMhggAYOmJa5lc9ySU/gbSaxtjsqTXXK?= =?iso-8859-1?q?jFcLF+SXVMN4Z/cRF5nyCRXp3FBaQDHIIcSMbN4Q7G8AMJI7LzBy4m6g0z7q?= =?iso-8859-1?q?BYA5McMJKUfTvdmfjCi+3+bWC9sxwDL3RlqysJZcmzKblneetKkx66EEgBXL?= =?iso-8859-1?q?7j9nf2Kd4AwqSY/3tW2cMT5AIFeZgKazktYT9BU2BC5QzRsXvIJv02CX4emQ?= =?iso-8859-1?q?hqP3l3hYD1PA2PRF1E+443z9qgrgTu9Ey9Lm5mUBO1fb05L0f44kDFirj6ZG?= =?iso-8859-1?q?C6UFcDnXZ4vYNL127tVsXmyUQt0c/P3QY1fpaSPlqIEkPC2NJcxsfVfa4cKE?= =?iso-8859-1?q?7+l8WACaqI8F7HhQCK/0FCmtazWsC9gv58IktZgkp5QqtK4187xe6COCUOgL?= =?iso-8859-1?q?jeHDBlGVRuPz5TS2O1LplVe4PP0d7L5gr+3vVErOmp0bU1AI7dkIskPwPN6U?= =?iso-8859-1?q?XYGvqQ1SYd+doxdMyh77s4El7qZV6e/eTLJ0l1ssdGhfECciPQRKe8BTAhi8?= =?iso-8859-1?q?80ZNYyHL/W3t98nTimcOWNsu3altMsevPXC8nVewbtX3ghL/5POt7B27pJQs?= =?iso-8859-1?q?4KOJErqmufaPCopZnogUScfZ2a/U9/y3K/GZGXI72OGUkwDFKU+KqEd6MvtS?= =?iso-8859-1?q?H30+5FvKApNY4/xJof0WygbxRLSaVaTwrR0akZXmxbUn3B/hLk9f0k46kWBH?= =?iso-8859-1?q?xtZpchQuVuxR/BfkBw2fSemWz945G8x21S9MBnX+bMoQttf9GG1mKFDVN0Dt?= =?iso-8859-1?q?0/secJEYtQXjhEUL7Q7lh9In5kWZgR9nzv78pFGQmWPT4w1I/whv3F3XpDam?= =?iso-8859-1?q?SHk4w9kAeWktIleuyM1eoQWyKV4LJfpfFw7HApEqTyS+fhqy925krINXCVBZ?= =?iso-8859-1?q?wi+PGisP8BUK97W3eJIgBJjGwC0HYz4JFqat5ez9hABQChhFTQ+iKzRuEXEL?= =?iso-8859-1?q?PbkSayx3GpRGTOm/fCC1FOfaB900uzetAarQLvsPxLF6V9vxwzmJ+c009zeD?= =?iso-8859-1?q?X+bTNG0udAOANRQuHkptwkascrx1E8d9geir0a9miJwge4ceJsDnjLxfzhh9?= =?iso-8859-1?q?HOXycx44loLx4w0K0YXmu0YrpFMpqkzCCaX6JnUcy2O6koBD7fQ2rbFPpSmP?= =?iso-8859-1?q?6WK+l0fV9NcuGImPh79sNneq1dkyW9O7kGVjFPLuv+u9jFvyHoeGgX0cpMyz?= =?iso-8859-1?q?YviWTLNPWX/3AS+LC70ruvQb1na6rq2ypLeP1eQ+E1HzM1n/wcNOuwB3ZbvS?= =?iso-8859-1?q?fqxGyrWoOh7IhMf1WsmtFQRw=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?pftWXWjSGf45sET3+qYbWBK?= =?iso-8859-1?q?PiYTvm87oG6W+aXd9upXTpvJsQO+0Helz4iA6p3OzNPapBcgzfC5lb6YRnGK?= =?iso-8859-1?q?OaisDrznqfYRn1TiKgCPgDEKhkovSujB61KG3MowdJa0aEYxd5pxaz/aUlk1?= =?iso-8859-1?q?NDMporXi7Du8JypjbnNG86taWW/gerHKhhDzR9IqGFw6dV9/ak06N+RADWeK?= =?iso-8859-1?q?y5eR2kTsICvUeCOb4pLPYMQN2h64yv9H+GuwF0LVoIcC98/y4tO9wBP+Irwq?= =?iso-8859-1?q?xf+uaEtycwmUJhjEbHqs0oWvP53xHnOVDrFc2TlkfIRgKydxxbr2VltOnSbO?= =?iso-8859-1?q?2+XPSHSQlDTKCU3yV8zNGwBJ/B3FP5tovYYKMclIRGWA8OMuPLtwX6bNCvvz?= =?iso-8859-1?q?Vu8CQmQBNWnD8JO0EIR7mDF5mRrU5VBD/H1wwkwM1i9Sgk0UNk5gzrmuKQ35?= =?iso-8859-1?q?NLHc0hDOx6ujmqFwpup2jmZaSCMqbeg3VNUhAPkvlsoqaXYsnJgFZQl4SY1z?= =?iso-8859-1?q?TnErj11WLkepxEcWrtRh70pVicXY26SFNIbhwZxhk642JFevoijbBORLWDvO?= =?iso-8859-1?q?DPhotzpd8cE12MYmXpate98m5tgg8bNgzAJfGBVx+/BDmlGiorpTiDd/IWjf?= =?iso-8859-1?q?KmtMuAYgSusaHXok3znIGi0iduFrc8f1lu80rwjrBRWy1nAGGndJ8+Vw5ffx?= =?iso-8859-1?q?+zT3qUu/TFYqec+OcEVY+9uo51vaYwRI1FMhvwBo9YQjdOhbhvxLP/gC3FG+?= =?iso-8859-1?q?GjL2eEk5u+yEN3OZoY5f6RvCKNbeQT4PG3OIOnk335dN8M22tRVxEyjNj+mp?= =?iso-8859-1?q?VBHkKrgqLyVbeir6hgDOmwgomqvqhcajwKeFpqYfIf11+7Rig0E4OuoQmJGH?= =?iso-8859-1?q?tRfcpBGHPBzMqH3qgV324xxIk6O/NncG5t1d7CtBM6H8IWQR1M2aYzdNKREb?= =?iso-8859-1?q?PwxvHPiobL5zJ2E+zi4UoFRwVLh3IvPZmpe9XUtt+8kPt7kfYQWSujOG0hCx?= =?iso-8859-1?q?S6bzmbULM86RxcslPKAgPHBhzJCtM0xIP5ZleEq3vdihmrtW2ubAlexWRJcn?= =?iso-8859-1?q?JfZMEhLzy1GRQrDYP1rmWVp7Px8OLfYpC9PN1WkmGKXMqiVjbWR6UIsLlpqk?= =?iso-8859-1?q?X7uOhik6nXJOekl0Q+Md0vcJ7gmWugWcSWZ7QFSgHfEyAbqYFcFYWO4rasmp?= =?iso-8859-1?q?Y2AfYG95aBiycJRY698oWOyWujGOA+QOR7A1AXWEl5buZAI5zHtTbjPraWYW?= =?iso-8859-1?q?Y4ux+RTNBDhXBT8gkiSn7Q2Q079b5Pw5CW26HUtjc+utX0SOSQwEaST+djHW?= =?iso-8859-1?q?Bt29LNzZx+tki4/935M6Tikki1i1gBbyOkMls+RdyDwgy/l4Mc9HhBQjY+P0?= =?iso-8859-1?q?XLI+L7T8Vb1LdYy7HmJ8ilAnT+vos5cF/V9u14SzzvVCKvAOQvmfPbVzpdxC?= =?iso-8859-1?q?Q93f6i6aCAu+yDknYDEHiU12jCTnEejK35/yF6IM/AjmY9UhsSE4U69Ll0ri?= =?iso-8859-1?q?lmnQJ8UkrQR3IzUv+Pt1NSwyOQPUipbue9/ltqVEDswXELCSut+Q1Tm+LA2R?= =?iso-8859-1?q?FdHB0YOys70bk+wsLX4K3eo/jqDmyA8ED7jtqERgk22pY1N4ACIuWTnyoXi6?= =?iso-8859-1?q?OKUabARBP7QHGtath?= 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: mhKsRvT2nnN3CBxiRka3Z/oUvDot61zpwD2YNioDRryODK9yvgUn2XFLyWwSSgMUbNdrdkilSJikgHOeHPILEZelxOnJBY+QwoPgqD4zsPwv9/4ugSa5EfIsCtMTE/7z2JhqDLDvRuDtXE2ERTHTq7Q0WkWo5HiweICr2eKxSWU6j6OlVWccGNqkzS+16iSEYo7RxaYOn0TuNakj1met2wncO7GFMN6vCb3Nh7qAMOBEuFJK/R19qHUx6lqVfKb+CfAsroaPrUq2VWIFSAe1YBobqFDUqUkIhmepJLM41iyFTw92XYDPGKGNI+tGnQAdaoHAz51tRTHPjMytbGmxihtTQnGS+ow0FDMKpTFjO4e5wXT8NC0KBC1aNHBOh7FUWSRuqADg+um8OFYtvPb+01V5X0UStx0/hLUDZ4bYgbQKu94DKxVj6lPbxRD28RjXMSMzHbmUHIlaCWGdsrups/C3QS0yZHEbV9o8rS7uEHTl7Fw3aTbMywVz3IDxCGm/RQ+Ev6zhdocWdZ2whRkasDTyDAtK8K00CP5HoSTMDGxerLnpsRaTz7RwArGFqcRL7RYGeLcDcDlhcaO04Ot+3d5zB7ug23IBfOB/oBOxs87ajDqi4//EaNO2njkcUPcGmJ8J0HoX4P5TyoBo3zvGwQ== 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: f6575bc7-8d7a-43f3-1cca-08dd197b36fe X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:31:55.0571 (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: st8fqijvpdAnnWwc6i4xVGLiBImxZXSVK0Z39SJlPNRlH222bE6An+Zmcm91NXQppVELHJuFngflg7VyJcRGng== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7691 X-Authority-Analysis: v=2.4 cv=d+8PyQjE c=1 sm=1 tr=0 ts=6758dd7f cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==: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=8ypM3a4PBwIcZ7bM9bQA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-GUID: FN5BzpjO27UOXWklEzHUuir8OLC5fxWh X-Proofpoint-ORIG-GUID: FN5BzpjO27UOXWklEzHUuir8OLC5fxWh 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 mlxlogscore=857 suspectscore=0 spamscore=0 clxscore=1011 adultscore=0 phishscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 mlxscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110002 Check to make sure that the GetInterface and SetInterface are for valid interface. Return proper alternate setting number on GetInterface. Fixes: 0b8b1a1fede0 ("usb: gadget: f_tcm: Provide support to get alternate setting in tcm function") Cc: stable@vger.kernel.org Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index 5ce97723376e..f996878e1aea 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -2046,9 +2046,14 @@ static void tcm_delayed_set_alt(struct work_struct *wq) static int tcm_get_alt(struct usb_function *f, unsigned intf) { - if (intf == bot_intf_desc.bInterfaceNumber) + struct f_uas *fu = to_f_uas(f); + + if (fu->iface != intf) + return -EOPNOTSUPP; + + if (fu->flags & USBG_IS_BOT) return USB_G_ALT_INT_BBB; - if (intf == uasp_intf_desc.bInterfaceNumber) + else if (fu->flags & USBG_IS_UAS) return USB_G_ALT_INT_UAS; return -EOPNOTSUPP; @@ -2058,6 +2063,9 @@ static int tcm_set_alt(struct usb_function *f, unsigned intf, unsigned alt) { struct f_uas *fu = to_f_uas(f); + if (fu->iface != intf) + return -EOPNOTSUPP; + if ((alt == USB_G_ALT_INT_BBB) || (alt == USB_G_ALT_INT_UAS)) { struct guas_setup_wq *work; From patchwork Wed Dec 11 00:32:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902667 Received: from mx0a-00230701.pphosted.com (mx0a-00230701.pphosted.com [148.163.156.19]) (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 D81CC8494; Wed, 11 Dec 2024 00:34:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=148.163.156.19 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877263; cv=fail; b=C6utK6dKZglATb3bI8m1fZ+1Q6WOVsPvFwiu8ItFIyPjRFxLw4xq/FGgnUAOhuRBW2l3Dc+6uk8tZEgvJNElc//cPHWDJzz0SKgmwpSM5ajVIsl8ZZNf98yqPC53wxPuSckLqHmfKYK/qHTGbgpbKxsYvXkWw8OQlrHRxm7yYnE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877263; c=relaxed/simple; bh=+bsjUAdAtpqAtbhC31cTF+QdCim13WCA7LORk4FpD3A=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=TNSAURTmG1drbT76BzqkbmvYVX1BL/82OvJz+yFAp1scbJesoufEbyIvGEj3PefD8rB7lU9PPpU9aiuaQMwvXPZhqLc4vosSUEHduDyrpcS2AAw/tpiNCGhajWzkmR9j4y4Sh8Pb2EvxCA6WB1nrq9aIgf++WHv/AnnTKZYE/YI= 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=ErkuAD+k; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=erlQ37M3; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=YqGJDnbS reason="signature verification failed"; arc=fail smtp.client-ip=148.163.156.19 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="ErkuAD+k"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="erlQ37M3"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="YqGJDnbS" Received: from pps.filterd (m0297266.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BANMPTv010812; Tue, 10 Dec 2024 16:32:05 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=+8UHCyE9bnErKEE2QanncECjkUbln3DuEji9yWgKV28=; b=ErkuAD+kw3dt KiIRAbVH5m1fB0OEJ/Tvv+DnXIN51fLR9dB5BHFXC1LFC/kBXtmkDFe71NQtICc0 VPJl6kgnTJkUkejKmZyJEWr2rhK6PG4USubyfwQ4AcmwmedCFwmgEozT5GDUYy3x SkUcTJZdvKsDFEnxs3rsS02Iy1Gs1fG3iLxM/MpL/lpr0kneJPVLuOYpiuAS8hVm NdRMO5WmdGaz3ayp/SHpcrK8Dw6WzZpF7+bkWidej0P7jikLn3T0oiTKQdfTYvs2 tYq6MNQ7JTTYs+JC9k88HZ2s17/jO4PaQgEcYEhrCSCaYEct2Ag7qfBNSKh7eaCp UWg+Ht347w== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 43cpgb9ptw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:32:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877125; bh=+bsjUAdAtpqAtbhC31cTF+QdCim13WCA7LORk4FpD3A=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=erlQ37M3bUN35bW3eeDAAjzDnhvb7ZgrNanXQ6HOeh7kQLjVmhsmZIedabbA+erwF 3QPqFqwRLekTLEmJ+HohJD77KF8rSjzazWJxzW9MetwTdEoFGLCnT4guZ9vwlOuSM5 wqXw21FUXIcDiQ9ni8FqDkzNu60+XSjhOmRhwVOiuXvRywffR68L9a4GiZphMMja+H dFE3mbFrA1RIEX7pqTbGkS/82FwXe4n2zMaE/R/IEilrmpLBeaGXQ38ObGm+wqWl0g 6YOTVtNIXpSiG5z0yQPm4JVnCXUz8sOUKtNfWixShPTdmJZjqxVVHzxpK67ZVs8LUN noQQ/51zeA1vw== Received: from mailhost.synopsys.com (sv2-mailhost2.synopsys.com [10.205.2.134]) (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 3372040126; Wed, 11 Dec 2024 00:32:04 +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 E6A20A009C; Wed, 11 Dec 2024 00:32:03 +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=YqGJDnbS; dkim-atps=neutral Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2175.outbound.protection.outlook.com [104.47.55.175]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) client-signature RSA-PSS (2048 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id 9A58B4041D; Wed, 11 Dec 2024 00:32:03 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CqxBVVBUDNvVBtm8gSHE5WmxaBkj0miVrjychrTo7W2dsxiOx79I6CkiXc03vSIkd4H7XRzNeWbrdhN12ml5MEU2UCtyxYsF5cS3BbkMutanLSPpdbObWbO5+5mdPKt6YRZwfxhzmhXuxdrObHkb1Zjm8Up4GayOJ32CmgOuRHfLQDs88rzWa9EhBWZFH9ZCpjVz7ZiFTuatanMDmfMJon6lo2vBeiq6iMKQIDVoJfmbj4N6LX0tnYVKhu/x7axL0wFFRt4PoWZ4Gv5SRY8gEdsTj7ysP7lBZiZ/riAjUtd6scUPxXZQT5TiOmbwqfnYabaUhQ0Byxpz0yLYxeDaDw== 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=+8UHCyE9bnErKEE2QanncECjkUbln3DuEji9yWgKV28=; b=CZbMsUfIilQty+XY5pR3ijCyAlrZFwixdbDRCw3yrp0ul4JnRE3rMJmFV6yappb8aKtLWHZfVUMMSpEGuGib8uPwE3Y/C3oMBXoHnpQMn0g2179ecWXyFIRHms185FBG3xHOy52YxjiGp1SJiMM62ddDKY1p6Xo0E/iRumwLsEw024qnLKuzfHvKJmlwGta9znoJdAhgW6GKyWdL6IEMVabcawLoQde6czg4gqxd51EYkA38DB6KWbPaxq6JvNDGtsEN2vZli1tfbEGvk8ikThsBpQThn7fhgbmxPhqFfcb1gCwf2kKL8QaybRQ/RydvmkJwzjsfIMEpE1lobaxBeA== 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=+8UHCyE9bnErKEE2QanncECjkUbln3DuEji9yWgKV28=; b=YqGJDnbSVAFC/s6lYULwAy1rNbBPFYVhVbcn7mutESePoqK9l/kvR835FaXXgjzNi8ThaZVcT5TLzzpG5990sLC6jyz/Gv1PROFit2UlfnG4Zsh3e3rJQDPadkGJwfjK+hCjovzgt11Oaw6b3iSY9iC1DoRwqfih7ukTqo5Mcck= 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:32:01 +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:32:01 +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 , Christoph Hellwig Subject: [PATCH v3 05/28] usb: gadget: f_tcm: ep_autoconfig with fullspeed endpoint Thread-Topic: [PATCH v3 05/28] usb: gadget: f_tcm: ep_autoconfig with fullspeed endpoint Thread-Index: AQHbS2QY9dYrSv50sk+mzfZnuPzePA== Date: Wed, 11 Dec 2024 00:32:01 +0000 Message-ID: References: In-Reply-To: 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: 55a775d8-4462-4e35-9075-08dd197b3a93 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?V6IgZ5kiRXE+SairDKxQa2fNeT?= =?iso-8859-1?q?cMhdrkjAYcrGPoGL97plk0XerHf0Du0eaFTM9TX9rUA06j7lUSXn4FFUN1w2?= =?iso-8859-1?q?CVoMk5x3+BVXeZdA1jEfUosfvSRdmyHfrs6HNG6Y9iqccJX3eZUkVH1lyojv?= =?iso-8859-1?q?6TsiDpGxFKxr0Z4gDXgVHfHGS9RAMYcKqP8+YaC4qbgoO56+t/AQYwqCKBqy?= =?iso-8859-1?q?kXHFv94+2HQ6igowZzKKv5CuYx7WT3I8DQtLbTwy8LY9y8OXkAC+BFHnf1We?= =?iso-8859-1?q?mxKXiG5gcQUGeYboWBEJwGTn+pAKYE662EN5FBPucWzFcjDzjgSQ5Ly7XhHu?= =?iso-8859-1?q?lUzvFFr/F6Gch7IhObTxIoteOsCoc6Q/WKNysEyV1oFM+qfv/HwHzKy9vjA1?= =?iso-8859-1?q?N6hfhOiDuLhzEqDl/5q8+gUe93y3Ekq5PXCiXsqNsyL4a0zUVCmM8SiNHcZ7?= =?iso-8859-1?q?RrsPbDG3EKE8nHrJfT0TpEyEf41NmNeuQ9247sJp6Tos5PajeTcGSdWUED68?= =?iso-8859-1?q?DXv2a0qhmP4YREQJZtlCZG0lydq/hGYaqPckgJlf+QydA80H1s2g7fxfVfwB?= =?iso-8859-1?q?z8pOvvHlJwC4eJsMxUX4766ia9nQq3EjS5wAacEBwtd+6an5l5lzOe3TFJU0?= =?iso-8859-1?q?U598ZDvNM0hibLKLOIy/SybIEHLZ8gJ/l+shiJvqYbfEJjJS54q7atuRMOxi?= =?iso-8859-1?q?tHc0NtFRk654bhcNst61YUEQ8Ab1CWj+vv7EvrHvI+E+GpZZ5j6Fch3fonl7?= =?iso-8859-1?q?PfPH+jCDKFzWa7tuja5dwS1mP9c3LPfjlDG++9b2xlyVrorkC5vB2aONRiGV?= =?iso-8859-1?q?zWj8Xpc/ossrTR4K2AI46QCBZtsBJLICO02KeQYozK0pZlkYZRHwxTHBe8h0?= =?iso-8859-1?q?l0p9yL//gnkuu2u/23erc77aT9yHiITkg7pPsdoRBPrMoK3r+7/0Qwa2qAZ5?= =?iso-8859-1?q?9JcwLypsNiR6gW/Ew4ngBq6iWo7n6B0Kqan4mBxXw4mB9hYz27B3B/Q/Nvp8?= =?iso-8859-1?q?lMUZbco8bLNqRxc7PJSdGjdn5JH6cer9vle+Yr2K5HYv0oapD5O+ta0Rqmi0?= =?iso-8859-1?q?drNDqW/jPCWwqjy0ahWEBD3PGy73a2BX4lfK1lLFVkiG/HB2cJlHKcyqIdRH?= =?iso-8859-1?q?ykKmS5lEHXFU95aObcK0k+FJEEyPyo26vPEpUACVHzBovmdYTEeftDT+xYtk?= =?iso-8859-1?q?xdOvcUOVBjky7vHprJCwr3+77M6xCAQPvdNlzihxB93M8vn0XwD6me6gl/jJ?= =?iso-8859-1?q?kU2P2KTvBMDOIBDEnDfDMbi5yBJIErh3L3BcfiU4NM+KZuIl+hK6qoxzkOoG?= =?iso-8859-1?q?CogRGuuifarq7Jc3NkiGg26M3rD0THzg5RVcfJMA243WTxIhQ5bBrx6InyiQ?= =?iso-8859-1?q?7iSkuFb445i+WzY80Rr2pSHkKB6SXz+HUHg0iBRGFd/B2e++fTDGLxtnrhHQ?= =?iso-8859-1?q?9sGNlmTAB6sqGkwxcg2iWmGQ=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?XWDBWRBuxj3Hk0FFOmCD/li?= =?iso-8859-1?q?m8GMnjnUemC36O1JDQfc0yzJacJo1dn1XvvDrBngvpFgbbcXgxHPXMpidqcF?= =?iso-8859-1?q?R5jVeU7qx8xy5YBp4edGPD9RhERE773uut5CTNc6oaAv5ya0nmVXBbXl75Kx?= =?iso-8859-1?q?nqTRtwXkjNec2AK9jP0Xwdfs6IUkPxiVHXnvWEv3j9Y5Xc4mHrrRKiowCOFs?= =?iso-8859-1?q?QS7mIfIapZUSHT37NgAN/QhbahQP9l0GfVDMQcFGNh4Zf3iqmrVYvydp20B4?= =?iso-8859-1?q?qWRhi72+BXYcR0ciAp/EVwYLuASIcH01bhPoUdD5ngV0leuPv5Ol0vH2g8AV?= =?iso-8859-1?q?vsGeoyzFdchTkA/smhS+im5ysLaxiD5nJagen1ynrjyz4CJsLQJb1vOCG3eJ?= =?iso-8859-1?q?wp7aeqRmHVoHQ4PmybaAuREmxNqIaiMuaA6SmEl0iTyb525TOg3ObMEW53Fa?= =?iso-8859-1?q?mBt824haPa9KhawjojutXcmL8qKT2z6MHvHgIH69h5Y/Q+2DnNnYlegLOJfb?= =?iso-8859-1?q?DS6niWvOBW+6wonaI/yXdp2kbOOr6GrZuCRSu7Xn5qv3dHROxCqF9I/9xKQZ?= =?iso-8859-1?q?ICK2T+d5GK8HjLqFR6vKnZhshGHqrgZ3fddkeFE6yduj7sD6DNDascE03VgF?= =?iso-8859-1?q?9fwVYXMEqcjP4TzsXtCIFJr1ewU89dwcQEX9wfzYxZIF/mBMGhT4i1fUKL5G?= =?iso-8859-1?q?QcRejTLaR/ABvYf7rncfWCJxHZkDfknbVkfI2mIsF4UBP5fMA4T6/3os2bUW?= =?iso-8859-1?q?rRlBetiQm4W/qrix+7bGYi/B7r3GbWRuf9wcEfPSireG9GqR6pPK7WOdmhmf?= =?iso-8859-1?q?NNZoAbj4gbw1/JwSbekVMTM3i19gWbIK4H1a077qB2B+bn7IIuwcr2evGg7D?= =?iso-8859-1?q?v7G6OBrqWE+MXOjJzC9mJTd2qHbdbjM8l3HeAhdm5vaaJRYLgr5oRu3TpiUq?= =?iso-8859-1?q?SmLcyGX7aEzf5N/BATXPi6hKKRlwEwyI0ayW7N946SZ+8MMe/E8lwtoscwFg?= =?iso-8859-1?q?PM7j1HzKyNOC29qjbqv9BALqKWdad8f9y7hPZA835OdSCXLLTIa68NTdY6TC?= =?iso-8859-1?q?BzcjzKT3PqHttqNClLYVVm+n+dpH4mNUjaI8cYljxQw5pe6AxoRQ2LAR1wQ+?= =?iso-8859-1?q?IiwDy/nmzGTgzX3YJXJ5r1grf2aQFZxPEGTo7YGhX4mhPXc1JO5tdnacz0kH?= =?iso-8859-1?q?nBKDiFMZj2fQcrjLuApKRCBAVeLRRDPwO2zdXG+3YNYuRCVn+ndd2mlTKYTu?= =?iso-8859-1?q?/cxnB5n4nRwr/Bmef7rPoRfhbObyiVFynGj6V8z2Yvjx6VDTAOaDgWhpQVC8?= =?iso-8859-1?q?+VOvE5NWif7qIBx4sC7jMyOXvxSou3q7rMyCEcJmffwGJrlCDc7U6zWlt0YN?= =?iso-8859-1?q?b7MN6WCFx9Yfa1vkynGwLIyukh/wP+gaEgVia+glnI/6VMvsBop1+RMngLXs?= =?iso-8859-1?q?iVMVrJ6UDcqeVjqxGYwdmsrUSGG0UJmw97Kd8bjqPFbUDBSeX/XyVu4VBuNJ?= =?iso-8859-1?q?g/uVNk+XGMy6Xqxg0f8uLFUgyyg3i3obu4RzmvVNa2Gt2c5Pdu0ik7lsv7x+?= =?iso-8859-1?q?OwSV2ljbU6gUqam2K8r70a2fJ5gZZFdGqBt6M7MtseHRoAEdWiu5iPCu/RrD?= =?iso-8859-1?q?RXjDia4sA+E7J0stB?= 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: SpCPeRNQkpZDERC/EO1Hue09aj8PneNrNChoDZEtN3jCDJqn5ob7BeL5J+ij459FuGh8br4IQjQ1nUDhGmm5sy84R/3guWfCd7rzHkWkMhVOwP9SZ1QIY589xpVr2qnjqx11L4bZTniPi/I/KcaBqIzylWssq4YVHfPIFPCr0IMUZyXIWsXm+ipn/L/CN7NInqv5lnudjQY4NyliOgTs3M/rN8XtKblwVruu1SDEy1fM2l0f42b1NZ3zdat1qAQEhm08tBapt0OS7Jt8XyP0A43K3voRyST0iFSRigRI1Qthe2cZxjCTHD3XROG4Zs/ep52EdMj9avax8H8w5m51ORJ8UO/6OW/PYELYjSg/Lc73dY5B7eh48YFVvSKvZ9xMDuhnpG6SfouXa0iL2GlD6IToCj6ye7jF4EuU1Lr3/sAB/mhfnkiDKCq9VNC2Vdvv9GN4dme/MGFi3+eYvKvmU+awTXLyMzeVnGAj6JvD9BVU0wZHL0xy3QrNoAQxHtVn3l0k7vDjzBiqphj+goXxGQzW2j47rtP86jdmT+HebWXbozdbkI8nvQ+V1GXWonxUJDjxDTLiickJF6mD3e4fiAddmo9sbH6vjj6gF0vubGxwsRYhbTx8Blr5Xi1yBwNUdk7MH+x+z5GBUYG5DbaYNw== 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: 55a775d8-4462-4e35-9075-08dd197b3a93 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:32:01.0279 (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: av009rao1q+P1WS97+WhqmwHR1xqyV9U3s7FsfAZby61AGMaKkxJJD0zSyANY/Y8kyt3tSrgF4o1qVUWGf/M/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7691 X-Authority-Analysis: v=2.4 cv=d+8PyQjE c=1 sm=1 tr=0 ts=6758dd85 cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==: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=bVWQr8Ic_oZympSaEz8A:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-GUID: RigdsN1n_s95C0EDm2KMUEaikPJm8wWU X-Proofpoint-ORIG-GUID: RigdsN1n_s95C0EDm2KMUEaikPJm8wWU 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 mlxlogscore=999 suspectscore=0 spamscore=0 clxscore=1011 adultscore=0 phishscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 mlxscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110002 Match usb endpoint using fullspeed endpoint descriptor to make sure the wMaxPacketSize for fullspeed descriptors is automatically configured. Fixes: c52661d60f63 ("usb-gadget: Initial merge of target module for UASP + BOT") Cc: stable@vger.kernel.org Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 32 +++++++++++++---------------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index f996878e1aea..b35e0446d467 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -1966,43 +1966,39 @@ static int tcm_bind(struct usb_configuration *c, struct usb_function *f) bot_intf_desc.bInterfaceNumber = iface; uasp_intf_desc.bInterfaceNumber = iface; fu->iface = iface; - ep = usb_ep_autoconfig_ss(gadget, &uasp_ss_bi_desc, - &uasp_bi_ep_comp_desc); + ep = usb_ep_autoconfig(gadget, &uasp_fs_bi_desc); if (!ep) goto ep_fail; fu->ep_in = ep; - ep = usb_ep_autoconfig_ss(gadget, &uasp_ss_bo_desc, - &uasp_bo_ep_comp_desc); + ep = usb_ep_autoconfig(gadget, &uasp_fs_bo_desc); if (!ep) goto ep_fail; fu->ep_out = ep; - ep = usb_ep_autoconfig_ss(gadget, &uasp_ss_status_desc, - &uasp_status_in_ep_comp_desc); + ep = usb_ep_autoconfig(gadget, &uasp_fs_status_desc); if (!ep) goto ep_fail; fu->ep_status = ep; - ep = usb_ep_autoconfig_ss(gadget, &uasp_ss_cmd_desc, - &uasp_cmd_comp_desc); + ep = usb_ep_autoconfig(gadget, &uasp_fs_cmd_desc); if (!ep) goto ep_fail; fu->ep_cmd = ep; /* Assume endpoint addresses are the same for both speeds */ - uasp_bi_desc.bEndpointAddress = uasp_ss_bi_desc.bEndpointAddress; - uasp_bo_desc.bEndpointAddress = uasp_ss_bo_desc.bEndpointAddress; + uasp_bi_desc.bEndpointAddress = uasp_fs_bi_desc.bEndpointAddress; + uasp_bo_desc.bEndpointAddress = uasp_fs_bo_desc.bEndpointAddress; uasp_status_desc.bEndpointAddress = - uasp_ss_status_desc.bEndpointAddress; - uasp_cmd_desc.bEndpointAddress = uasp_ss_cmd_desc.bEndpointAddress; - - uasp_fs_bi_desc.bEndpointAddress = uasp_ss_bi_desc.bEndpointAddress; - uasp_fs_bo_desc.bEndpointAddress = uasp_ss_bo_desc.bEndpointAddress; - uasp_fs_status_desc.bEndpointAddress = - uasp_ss_status_desc.bEndpointAddress; - uasp_fs_cmd_desc.bEndpointAddress = uasp_ss_cmd_desc.bEndpointAddress; + uasp_fs_status_desc.bEndpointAddress; + uasp_cmd_desc.bEndpointAddress = uasp_fs_cmd_desc.bEndpointAddress; + + uasp_ss_bi_desc.bEndpointAddress = uasp_fs_bi_desc.bEndpointAddress; + uasp_ss_bo_desc.bEndpointAddress = uasp_fs_bo_desc.bEndpointAddress; + uasp_ss_status_desc.bEndpointAddress = + uasp_fs_status_desc.bEndpointAddress; + uasp_ss_cmd_desc.bEndpointAddress = uasp_fs_cmd_desc.bEndpointAddress; ret = usb_assign_descriptors(f, uasp_fs_function_desc, uasp_hs_function_desc, uasp_ss_function_desc, From patchwork Wed Dec 11 00:32:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902668 Received: from mx0a-00230701.pphosted.com (mx0a-00230701.pphosted.com [148.163.156.19]) (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 7A7E4CA4E; Wed, 11 Dec 2024 00:34:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=148.163.156.19 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877264; cv=fail; b=DQVGdNi2ebtY23WTiuMJzM9SisxVP9aLQZ0I0RM8hSSnapQ4Hv+Q9Ulpz1WAuZNZa8hrLyBI1utCgmw+S4qcBWMRJxU8dozYL1/qtBZrBUv503aAEoMJxJsHgL0IDcFvJIXwqfVeBUovkvy/4KRqZPx7a+wury9T6BQGeZrPEVA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877264; c=relaxed/simple; bh=LYI3x5/5UgqsBpZUS+S/i0iKZBhuzGAbzpWdDq7ULYs=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=uUxgCM5uC/CQocduqNcxU0vhuViWqRBylAgI72Rpvp/g+Mcj/aMtMhl2Ahg+Vmp7Hvyj7k9WXSzgMq/FIhaaFA2sREsXdUOHIrbicLlrLeYe+CqiGE9cBMKfFREdqirPcOnjwv9NyFD7Uq11VMWuZhJj8nM/ceuEObQ6oL1BVDI= 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=WUIr2/00; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=PbCwJjjd; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=fuSO0iIq reason="signature verification failed"; arc=fail smtp.client-ip=148.163.156.19 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="WUIr2/00"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="PbCwJjjd"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="fuSO0iIq" Received: from pps.filterd (m0098571.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BANjYjd019385; Tue, 10 Dec 2024 16:32:13 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=lGdUHFaxgK2sH2aCiw4tL86EZHe4lYLV3BiPV0osGAE=; b=WUIr2/0047hP PyRtOtw+tb0HsbTj4mDjuqSFgHobHHu9u+FX+3ZpIefDNv7ZeO1NdUpgVwjmZX8T /Hsv4ESjCCTvUP9EyJZy56y8raYTm92pye/30VMYRSMnhI2kGlo+dptcuG9phvBU Ylv2Wc4xiwYx3eeQGiLyBR9mGRGr9vk60ht4wllLPWl8kTSda27yAVx5E0B7qunC dSagP1wuZrGQOCfu5Kmd6Z+A4mzGyq4WdFuxjaT79xhONNdqRWkR2rhDxVkaRW9b mnvpvGhfLYe7NQoPIt0xaO1thsdwQQ3A9YEUpDitmVNl42xiqb+cSQkbbiwbCIKA JnjvSOcDfg== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 43cp8t9vh2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:32:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877132; bh=LYI3x5/5UgqsBpZUS+S/i0iKZBhuzGAbzpWdDq7ULYs=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=PbCwJjjdcvnT+X6gBSw2OJyvyhdrZp7TQOFNZyyptpdc+N2Z/57KrTzmtB9sz8Ear nqzVXbt9sNNAGgV1MxCKriOyh+uc0cTyUAG0Lm1KzYWj+EYCybXCZFXDk+LzxITnBx ySFwtMEdGTVJsUoA3813IThTCzMGtrNeEm+vd7e5V+UBw8Xwe68/t5XAONnt63UASt C4MXhEuSMo7+iA4iOeP+d9kXcBzZHdcBNJjgqjatcRICC2VD2FgMBzswvGdIMMxv+1 VcWgN/i2pcD3YpCE7Oc51v5wo0jkde/W51Aoeor4nO+u4llIichMxAOcLGPE1O6n8R our0xntVIgDTg== Received: from mailhost.synopsys.com (badc-mailhost4.synopsys.com [10.192.0.82]) (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 1376B40126; Wed, 11 Dec 2024 00:32:12 +0000 (UTC) Received: from o365relay-in.synopsys.com (sv2-o365relay3.synopsys.com [10.202.1.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 E8088A005E; Wed, 11 Dec 2024 00:32:11 +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=fuSO0iIq; dkim-atps=neutral Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2171.outbound.protection.outlook.com [104.47.55.171]) (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 535DB40148; Wed, 11 Dec 2024 00:32:10 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RaeVjvTrsfge6UwSYhZZ6D5G1qiEhg3KnO4uF8tqzIYxL21dXEuEoZLYN2Gpx+QcTlcD2682hDQKRqj+TJBgEUqBLAws1JYS3IejLCCnntWMznXelk4glRoqa7fAz3UZ0HtNhhprXSIv8tXIZLiLB5+0LKf63FeMAvqyPJj3OyGdbAn4CVK78YGymmYj4wXka2RlbOsiF+kwzCx8m+4zKhcMu0vrh9CYvIEcgFFwGu4tAy0bhNP4uYC50NUo2l8o+4TswAQpOkD3LHsoO7aJ9DwsVjxFP4KGY9rmOzSJaiC/RcMp/SIewZH4Q0xuJqxtb/WZ2BYofNvDmovZ/iyh5g== 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=lGdUHFaxgK2sH2aCiw4tL86EZHe4lYLV3BiPV0osGAE=; b=c4azKhENrgdB/xzlD3AnnGlceTzAqnHl9lzDmTJcFSB+HL+yCwCphKSAdsluWEIBmEg/MkfjJpZFnS8ABT74TOInAhSdywvwSbL6kAR3ui5djYq1fG0lwwo6m2GO78SLj6m81qXvjT2nQcfFnFRYQrFA45uvG0FQvAftXA1ydKPArF4Q6F7l71axbEowQe2T8CDNR2sSdaMjX49f8tfgcKjsMlk25LxrJigs0NBtsc7qPX8urDqxCHrSQ2eDZImZ5UdEVjZ/+SZjbLinT9fJU6YE+6EHh+ietVMPfKno34piJ7vYfBx9kH3BQrefQjLb3uD9yP3pCXx/gwiJIXE3Ew== 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=lGdUHFaxgK2sH2aCiw4tL86EZHe4lYLV3BiPV0osGAE=; b=fuSO0iIqqaQeV1t+hf/JC/X87W0mZEAA68DQkYIlP2zMO0g99QM18TkyNPLfFPg0KblZEPZ23xonbMCEBvycjTivVD0fad+Sf816jii7kbjSTlFNnDt99hKOgs5Wwwxb4TusEkiBYPZwMgm99jGNDZf12cwUTPtUJGugVb6tn+k= 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:32:07 +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:32:07 +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 , Christoph Hellwig Subject: [PATCH v3 06/28] usb: gadget: f_tcm: Don't prepare BOT write request twice Thread-Topic: [PATCH v3 06/28] usb: gadget: f_tcm: Don't prepare BOT write request twice Thread-Index: AQHbS2Qba4VAzDTcF0+prwyD9wf8iA== Date: Wed, 11 Dec 2024 00:32:07 +0000 Message-ID: References: In-Reply-To: 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: 875f473a-d749-4b7f-3bc0-08dd197b3e28 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?nNK93poZZv8vqpHmMueLgEaOo3?= =?iso-8859-1?q?RcT0sWecE8pFm1UlYb7GJ7VxTMPYVpV2Ci/lT3B+RGzE8ptQdxwVG28MfzOQ?= =?iso-8859-1?q?E09QsCUfyX/9fwU3jekbTIeG19MkhpqcWGG0lkbT0sy7myhc/zCyZxsPZHjx?= =?iso-8859-1?q?5Nt8jriEQ3hdellEr1XbAk7lBAiPqtqR5W6tvZPA3UOEuEiNMvxgoI8xxrTX?= =?iso-8859-1?q?3O6OtoEO3YDdMMycbZDVaBMslxei76mEFiEg5AwnSwQ3SFvACzf53D5OuLII?= =?iso-8859-1?q?NepWEvPFXA0xh0uQ7tO+T2E0Hq1GNnugyGKTPZpYrXgUQZ4/Xn1o1p6deb5k?= =?iso-8859-1?q?QeTus04qtcj9mJPRqD5BhPGinYjPu9h8LMDosYX1QWpEqyNFT7Nn3gL1cA2V?= =?iso-8859-1?q?ADJ7/17tjHzhTYjrnP1RTYAXwST3bhpeptPbWJMkh7fL1XXZx3tKSDhl7xw2?= =?iso-8859-1?q?I53i3x1lRj28JfhHmnO+ISKduCReP859nRrIVJylsxZdnWpiixpdvfS9+IS/?= =?iso-8859-1?q?hmhtmxO4LoCYzV+9aaI4DMOQUwylewkdbvOHwkpfHIAxycO5pO06ahtERvJ8?= =?iso-8859-1?q?H7iHKZRE2lDoNgTmihbM6/Aa9FHM2V6Dzbl8nUd4gtbIAfw+EzbMGIKs/M51?= =?iso-8859-1?q?SY6ylyUJRReDIIfbLoihKlZYqSXYNUaKfoE8Nx/uG2E2/7cuW3uSXxjEApvX?= =?iso-8859-1?q?A71gH5Ang/0OpOhvfFOruLZBLzYnjYT5T66p/wo6VXqwEg7nhIkdnUlqeYmU?= =?iso-8859-1?q?X+x+Fy7ag+Z3SyV5OpcpHej9pfJ6BcejXuZiov3FT+xqBMVufmuTersJqtMw?= =?iso-8859-1?q?z+T2CZPeRV5AGrzBKcg8M74nAui/j6Ng8WOkzzWWjuxr4XM68yB3E4fWzMkP?= =?iso-8859-1?q?P9nHWseoxUw1FyO1DwHpm4JgsSX359Y7UxT8dwviCSSSTKbu1g3eSLWtqyJv?= =?iso-8859-1?q?Yq0GV9NJYEp5D0U40ConyEyRUyBYkZTuB6KGAHaDBaAWk+O7W5G6Vwz6dqia?= =?iso-8859-1?q?7wV9EVvKFVNkTfljHWwTOUzjmjTxBOdTDiFAcWRoIgAi+6mLwTW9omLMay3m?= =?iso-8859-1?q?fEMpjPk3H5fog+5K6Gj6wPj0EpaRrfBIppYs1UODjZsbxzUhjFy9gWrXgc+a?= =?iso-8859-1?q?f2iFQecExhlfrR/GOKCwIWCvh9VAziqlfpbriOjzsqdYpIBMpObTkvjrfAuQ?= =?iso-8859-1?q?6GCynEnQQxrOcfwLRyfcVSy+9W6Qw7qPOfGU0SeN+T+4jB7owGFTEOagmyP9?= =?iso-8859-1?q?8ImYahbS3bvxSBAiQxegrEpI/RTRDq8uf8X4YzNHTpi6lXEYvq4iyqisUoZC?= =?iso-8859-1?q?kua4Nw/O22GxKC9u0nHrj2et32yMB+FTSUD1QGoDeTRTPZFHOSN836b6hC/E?= =?iso-8859-1?q?SZYSJ7C80bq/FK3uzbxyLzEISqfkHjqsdZPyVERw7nAN3cGB4mXaxokdK2te?= =?iso-8859-1?q?jCZBVSLNwXbunA9pc9D+K0WQ=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?3LeHpqxtFoTjCnDLz7QqTnq?= =?iso-8859-1?q?HFsxbhcidk45jAjcH8uNwYnI+5Gn9nQV7xSjcBHQGgXadNBjEGiYk/wNCD5T?= =?iso-8859-1?q?/EkiLBkN7ZZZ3smP9nNyAvvh+2vVF2xvywchyqqGHw2OGBOD2G4558VV2dEU?= =?iso-8859-1?q?aF5oIXf6+lkxq7IGBfj9uSyiOWsifR0kt8UOoe8AhvshJgJCVGp7/5226w+L?= =?iso-8859-1?q?88CgOU4fDK4Fjra2CpCxE0Lw8QQ2m9DmuTWx2X73NyOqcaWp25UNXO7Hnm5J?= =?iso-8859-1?q?jI03S2WLi07jTuFlkLrEJnmfoKDE7NGN8AWJSxZw7aXB6JZDP5md0W1YBpac?= =?iso-8859-1?q?uwO0SkzonuOXgU3PD0IgwC6Af8esEB9Chv/6rAnAHbXLPos5RnczWBaFJOPn?= =?iso-8859-1?q?UHeGHJkciqPIt5Ck7lixuS0f/QITTK/lE2xKSEvcWsgZV9lWKqN7eq2rMhgv?= =?iso-8859-1?q?WKhE9YcmobU4E5ehzC7ET5Gwz4K8QmBUcRax2Cn+UkIS04zVSlyPmrIn+cAq?= =?iso-8859-1?q?VnyYrw1AyhTxv6uNoVFV6Rs2UxiquiTgNSvNstX9Wz+2yKpt2Xcse/96fRJF?= =?iso-8859-1?q?aIWuMOov3L51+D9pFtLhErM18iBbaUYH13ccxxS3mt8JACWp/+8dnUoFn1hQ?= =?iso-8859-1?q?h3s54cwKIouuZg5cc0XAsCPttFm4azH+yXSwoFFKojdb4KuHPAsryu3IRPy5?= =?iso-8859-1?q?dmAa52Lhxpv82WvqUNglyvg9z0ndc/TgpFiq9wR0o6BeZYHlqqGCzY2Zn/rR?= =?iso-8859-1?q?XeXqbyTacUelx0gygw/qjupO6oJU54LTAGdvdQAyLDGIHalqbRUqguZRRXrd?= =?iso-8859-1?q?JY4XpZ19LHwEAoyyv4ETJRZihx2hOV+n+BoKC/GQlBxXFItDyXY57R5hgJTc?= =?iso-8859-1?q?qkgHytnQlH8++HroKEAPWgFPHHDqMt2W174Pruktjs8LmAIREwC+14+CF6AN?= =?iso-8859-1?q?zeZc/W+q/g8t/840L/Cw+N7hZr4uJSmoJlg8IxCjkIHsnfVkc5PXUPvPJUmS?= =?iso-8859-1?q?OjuzDD36BPOzZhij91ocsM5n4ZGwgbNeV9b8WnV2UkkIRU/t/UEGfmn3SMrU?= =?iso-8859-1?q?viMa4bvp0zODzAnPPt61tNzpg+Y2BOsmLCIo8BpfBovNRxemO4JI7WTIbYWK?= =?iso-8859-1?q?uUstQIg2uuXeY9HxD8AXfUUzSIeqV1nnKkKUgMqRa9SLMxF8wFDBNxCen7Cj?= =?iso-8859-1?q?9yNKNpoDhe5H3FB7s2JMlYQjsy4x7oZRbAfxK2xncGjAuVrE0fdjevl2RAVL?= =?iso-8859-1?q?I8JeTuFW5YKB9JLYH+4LpgTiDArj5oL0S0cYqkpDJYRoreFnnzMKzlEppt4q?= =?iso-8859-1?q?hTvEfvclmykXYWHE9gmW2WZ35hVFIN80gMrUXPBQbGvAQe+qpesBcXV0Je+X?= =?iso-8859-1?q?o5B5+/bVY2MeoC0nDB6svAo8NliBEif4/wPCqnSwaku9FkKIuJ9SeCFwhzPZ?= =?iso-8859-1?q?n2ZhGNnXomJ12RdcqzctPGwTsdwSqf4q6KJIMBSR/J05rC5oh8gQdaLidYfC?= =?iso-8859-1?q?25t1CSyoMxAx+N95wVqSKxx6BBBF6eoxt2IGXAc4cjRcarTl46GjUwlrlGeq?= =?iso-8859-1?q?8A7ikafEhukiXFvXsv7K2TYTIbWYCX4uqBt0BDwz9F8YHZsuzK7S2Z/NOEuE?= =?iso-8859-1?q?tx/6MHIDA4WypBVwG?= 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: umHc6Ud1RRVocvZp9qOlmFuh0GUyiws2UUUinxMk95thEAqBnqFLL5WAX0wkifqr2uYBggvzqaQF2f43gheVt6zxr95XFDVITMo7n3NBmQU0PCEJP1OF4LgquiuC5kDvLV/Gbw5osBXCwqdfCQx0AxOKUYL9R+JmZXvmediNWgnb1j/p1S7sd7gRHSsRthODnBy55k6yIbmgzsMv7Cn1E3YUHjJVqdp+ztQoH80Cir44+Gzfc5HkQgRhtbMeejAV90jcP+1n9Wdf5yu+o3kQOt8Rik8CSf72LZpMdSWlIbjUHormhwpBlwLosjehHLgIRNgQULtZm5XjZtiDbjAHW96oso8afyq9zDcbP1Ysvp8DphX5QtC1tAxPZh+vwOi/LjE4dS0H2+C7GRMzamN7Pvgj7d3KiAc/KFTD8wmxXanz2bLuIFceB7CtCNVuzoio3S/aX5LCYy8oWD7EMW1poT+y1bGB3JtVY+T5PE3jnTU4ZQA70NQFPkqbbIrcMmC2K7P66ZRUh4eWtK0bgKWfVQ7pfogrmHYPmk8t1SUF2fUHEq+LQyQgXOWJ5UK8zKNbKjmnta2lCSy7HE8MBtYf8grhS/nDNdIezE8sjH0mpp9wzVuL25NAH6Ryp1sOINEEhLcOoez9LiylQ8UvZMPIuw== 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: 875f473a-d749-4b7f-3bc0-08dd197b3e28 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:32:07.0451 (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: NVdMhDUei0+vtRcpw3yxncaW22UN0cYGJxjCSHQMBHxJ1YUnMflNZiZ/eo0D2ZJI0eIdzZMqRXc0QZ/F0tJ+Pg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7691 X-Proofpoint-GUID: bghzpIoZMAxexHUz5K8GKZtwt4wFV0BN X-Proofpoint-ORIG-GUID: bghzpIoZMAxexHUz5K8GKZtwt4wFV0BN X-Authority-Analysis: v=2.4 cv=KdsosRYD c=1 sm=1 tr=0 ts=6758dd8c cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==: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=6lpbQM8GuGKqb_z4f3IA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 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 adultscore=0 spamscore=0 bulkscore=0 impostorscore=0 priorityscore=1501 lowpriorityscore=0 malwarescore=0 clxscore=1015 mlxlogscore=566 suspectscore=0 phishscore=0 mlxscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110002 The duplicate kmalloc here is causing memory leak. The request preparation in bot_send_write_request is also done in usbg_prepare_w_request. Remove the duplicate work. Fixes: c52661d60f63 ("usb-gadget: Initial merge of target module for UASP + BOT") Cc: stable@vger.kernel.org Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index b35e0446d467..4fd56ae056a3 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -245,7 +245,6 @@ static int bot_send_write_request(struct usbg_cmd *cmd) { struct f_uas *fu = cmd->fu; struct se_cmd *se_cmd = &cmd->se_cmd; - struct usb_gadget *gadget = fuas_to_gadget(fu); int ret; init_completion(&cmd->write_complete); @@ -256,22 +255,6 @@ static int bot_send_write_request(struct usbg_cmd *cmd) return -EINVAL; } - if (!gadget->sg_supported) { - cmd->data_buf = kmalloc(se_cmd->data_length, GFP_KERNEL); - if (!cmd->data_buf) - return -ENOMEM; - - fu->bot_req_out->buf = cmd->data_buf; - } else { - fu->bot_req_out->buf = NULL; - fu->bot_req_out->num_sgs = se_cmd->t_data_nents; - fu->bot_req_out->sg = se_cmd->t_data_sg; - } - - fu->bot_req_out->complete = usbg_data_write_cmpl; - fu->bot_req_out->length = se_cmd->data_length; - fu->bot_req_out->context = cmd; - ret = usbg_prepare_w_request(cmd, fu->bot_req_out); if (ret) goto cleanup; From patchwork Wed Dec 11 00:32:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902640 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 893972451C9 for ; Wed, 11 Dec 2024 00:32:21 +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=1733877143; cv=fail; b=VtWlOLpi+fk9f7PqXmnW2a0ASWc0/D+iGcBG2kX349WJReVIjP/04SJK41qJzYnwNJXCpleBG3m6M4CV9qjlj67Gn9DJ3jNzQTOLHi8S1IKyRJhHhAnHn4C+mtqVWZ0nOGGFAOp4/UNZG2+06V4mjbS906NKdD9rFq7SnZFlMsg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877143; c=relaxed/simple; bh=6Ie8dfeBWuAM2l32hk+mtFAWUAyQ8/FR/emhPqGQrQw=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=LDCglm/5dBS9XGmcbDssqoM3L76gHolIVqof4fNry/IHlbhbeoSwrqqVcAJCCSaUUJuydiEDSztGS7oDZHH48s5ENFI0LEJwzsoxiyXuXnb4PTSK4Dt73i/uw71XA1RoJxAx0TaR+62kPh7NH6sbT8MRUZyAyEdSz6cSb1tOmbc= 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=QE609wo7; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=F4wo2ghV; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=vGH4q6yW 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="QE609wo7"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="F4wo2ghV"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="vGH4q6yW" 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 4BAM3qEC017428; Tue, 10 Dec 2024 16:32:17 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=7TMpmx8LT6zFJ/hHcI0RxmgtuPD0HGNsfDlrXczEJfE=; b=QE609wo7kYus ITtpqKffxSaNlRBw6tf+CyGNKMoBs/VyJbaK5GDb5fLUJdsRJuKwcQeUdqAIy6yb MVKgGBxrwBWjm7uYFIyTOZvQnDHjsgQpRmv925RWfJMTOw0xBs6hpWrR222+yO+X CmvXSJFWsic80JQ1+1NWlJDHwqzYPEa9MQ4pe6ZxfubhbPtvwlcswSmtLAUinpiF hnYGzBJ2NhxizsAhIw0XG7u7YXupUNWW++lD05OvHP4ElpSxOG2B7Rng7zlEHUAK GW2CvGFUpyrV6fqV0bJ6+A6lr+Pq7MInNAVOBKeqrszrm0KbFTzevnVvtnKRdYzx iDgXbOA82g== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 43cp60t0x6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:32:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877136; bh=6Ie8dfeBWuAM2l32hk+mtFAWUAyQ8/FR/emhPqGQrQw=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=F4wo2ghV7+DKBLNAQcD1329BMTKFhpvuMAE8dahbgnKvlq0vBjMY0whuUOIF91pj4 n9NiO8U0HHpBk0i56D4hh6fR/fy9f/f+hMq+rHHpFeN7dJ7QnLETIKFIddDpVYAbqd 5ZAOFXE6157IRc4Om/5cIIn1OfOCbZ3Hp3PZJivi9nctaUWpwcG1iZrqhV9vi6xaCp 44mH+nTj5sHclbc4snr9EKUi48b1oi8gMacRX++T4f2BkGG5dOXJJKgrUD4L3xurKo LYA6xaR9vD+DUrHDQ+1eWmlc+imsDMlQhaqaSzD0mrGuIBM0Zy/O387Z6GvXmlbpuE 81NWV8+2ZGEDg== Received: from mailhost.synopsys.com (us03-mailhost1.synopsys.com [10.4.17.17]) (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 984184024D; Wed, 11 Dec 2024 00:32:16 +0000 (UTC) Received: from o365relay-in.synopsys.com (sv2-o365relay3.synopsys.com [10.202.1.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 59018A0082; Wed, 11 Dec 2024 00:32:16 +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=vGH4q6yW; dkim-atps=neutral Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2177.outbound.protection.outlook.com [104.47.59.177]) (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 141F54035D; Wed, 11 Dec 2024 00:32:16 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NHFV0xrcL5SpY+wH5VXOrykHVPQQGAHGe6MNbd0G3Jw5Zb1+O7s+BJ7/D0vhhVx9/G5C8BgdNasTIP1ZDxluzoOVZ1Yc0ahCw7k4pNCpkZaXfAp9L+zAr0mq8HdWSQlI23sD0Wrpv/Z+OHnOL0RplczJXFvfKNnPkMZS0n6/vdbwWVGe1JH+E5kVQB/nWO5FI1FSubL9YN48Is297LlQnbi3Eh/dm0Y9xykvbIA9f9/MChLmnSUHduOH4drnRNbcS5znUfhcqVbg2vl4ZLBcxVQauy14svX59L4hdh6X5S+BpnRy7m1SZ0fyXZgmgQ83t0PXQHgzYiBzq54nIibs5Q== 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=7TMpmx8LT6zFJ/hHcI0RxmgtuPD0HGNsfDlrXczEJfE=; b=qWwAo6Lo6EKjUq6acHriRUi4X+NhBnIvgeYnEcOJjFnTGoQBbbMDMoIEIleAoSW0tmUjDnMx++7YiE5BR9q2nPJ9f19fmUPtG/nBVpCRNMMwd8CjvLsXrvcR5tM9sO8qBg5WzSe6FcLyleiqeQqDU9dYCQE5uEQMozZbif3rYW+MxSu3xAqqN70eH0IcUA3RYRj+hkUNZpgPHLyJlRkIFcoxgfdCNmP8mUduerD1R5ZzkWs+SPpw3Aw4AVTZm39Or6dqbmNVjnvKDpOGfdpcNBDqtCWCEJJ0jdV2w3je7AcesB/FY2AO8PWj/FBYnZOnn/qGignJ0iHDaf9MvMLISg== 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=7TMpmx8LT6zFJ/hHcI0RxmgtuPD0HGNsfDlrXczEJfE=; b=vGH4q6yWlhoSbEH8W/EhXDHc6EFfFX3bwPwMtBpfi0byEaVwo4RLYgiXtmrEKb3MZ5Y1lPNKxW1Y5dVBE1JDjmQrqNCd6Pnt99MI8O1qQt4ewH9pg6GYaJOkfPQwwiLmDQukoLZPAl2NZDUmJgJPJo+p6NDZL2BJhasG2u9xfrc= 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:32:13 +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:32:13 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 07/28] usb: gadget: f_tcm: Increase stream count Thread-Topic: [PATCH v3 07/28] usb: gadget: f_tcm: Increase stream count Thread-Index: AQHbS2Qf/Izf1MXWEUWZC5i51S0H8A== Date: Wed, 11 Dec 2024 00:32:13 +0000 Message-ID: <23bf7f5cb04da691fd6ba0a77babee9ad3195f44.1733876548.git.Thinh.Nguyen@synopsys.com> References: In-Reply-To: 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: ef5b6357-b608-4fad-1831-08dd197b41e3 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?iHLyZktMvsrq3OQFOVVRhzJKMx?= =?iso-8859-1?q?XNSShLSi+Fg+nQvvlQlhfgbwlapOENaXmc+1Ue1HlFy3Fj+K0r/+w6jzMNbO?= =?iso-8859-1?q?qnv7NTjn9kz7A+ldICpnpR2DDFkWXTSyL+ZP4MGID8u++yqGG0XPIJHhS62W?= =?iso-8859-1?q?EWHaKEJZ/dzaragbPxoT0BHYMWsn34kMcvptSYMBdQEgl2ac7uPmifhaw6C7?= =?iso-8859-1?q?lItF908mEmt7LQQBkRvEMf8ooFfV+XYyJ+XLnl+oVBZPRC5xU7uwJAexA8T5?= =?iso-8859-1?q?pYZGOo56q6u4jyO57+FycQBBL2t+3RGI+8i9MShRT81qY1P9AU3eP7MGCs5G?= =?iso-8859-1?q?Ui2Y3fRN3a/V3x5D14vkiGfvhHM86e7wrrU+IYOZJqnLfGLeyjwaHZrVE5jp?= =?iso-8859-1?q?xqhSqqu6qhsCt3NYqBybMwqAqjE6K4JSDbYEXzyUhyF/pyjgZyY8fCIQ+AuE?= =?iso-8859-1?q?Isl7eZdrQWKyKi/ry8X4lxLol3OSxtSY1uWAtyjxnzrPlvZQXWHTmE0txjjY?= =?iso-8859-1?q?B7ECOhwP1g2TKCxe1aXJag4kG9i3VbLvRzKAdaI4eHv1gNCUtIzLBa34wDjc?= =?iso-8859-1?q?NvV6PZQKEa8KuwVFqsXfOGDxhJ32knD7yTNgRbWQ0CCsoigMveF+vyzbbxSP?= =?iso-8859-1?q?RmCctlrLYUe9YovscSsXRaGBBqfIVEusyxeFQ8T1356o3WhYa5SxFTH28QIx?= =?iso-8859-1?q?Hp4Aozrd2TqcMdywIEQdBhtcCxtUHb5XyfF9tpDq6EVejVEJqGsPzdzPHW+K?= =?iso-8859-1?q?w1nf9T13oG6AJfNR7VRlmy+61bXYPCNYCfYeWClu6haDNDLF7dMVuKi4WwSF?= =?iso-8859-1?q?/9pWZriQ1phBqlVS+V0Jg3aSXSJag7tGVK8VXBX8RtSlgOe5RFncka7yj5Uw?= =?iso-8859-1?q?mnU/FdwqBxNlZUlbVpzRyLrvGL7F0kvKTaDl0ZQNwj0ZouhxXROnLmOMYn1k?= =?iso-8859-1?q?f0QjlsdWTc9XhTDoxWE3RV2bfEdp1AE0/uv82C3TbOm6DfRgzzt3T+ychR6l?= =?iso-8859-1?q?+7/DTmhBRtn0X/8bsFzZxY7a+dhdxBl0NBwCllHA8lGoYd9PuMgssLHIlaek?= =?iso-8859-1?q?X7Yzr1+XQeqP8M90J3yXDdr526i2nduhH4rsDQVjMWfHylXW0b93w9hVBNyj?= =?iso-8859-1?q?fcZVJOP2KFxHsVJmPxr2mEN3xWl40tShVDoPt1t2iH/2nLQbI76VOubyRlyM?= =?iso-8859-1?q?OfmXdm9YUprZ09HFLe93uGOZTD27Ea5OxHl03lmsbuAUoaHxCVOSPICbWPQa?= =?iso-8859-1?q?qWRqdLrn5WYHKYFA8o9Z0jTym2h+gSDcj8YqCU5NrxZHzx6h3DEWRicfwGCN?= =?iso-8859-1?q?ZWrT+8TWT/tshEyHXdxyj0TtJSPYBrQxIamvUZVxrDXrB0IrZNX8NTz8AtNO?= =?iso-8859-1?q?88QHt5clX+IAlEmAQL/u4EQp7JGpglx/sS0f8zCrBHm6u3ld5izGGJ12CI+h?= =?iso-8859-1?q?pTt/NVvYYirclXghf8oaR4ew=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?hI7u72meD1F5oPt1DYWvO0o?= =?iso-8859-1?q?KTigAUSvTqqzzf1TxERg190gJidaGWbcbMzn8Nvp3mjBIjVOCDF3jTgdzkbi?= =?iso-8859-1?q?du38MDw8DDGgEi0DKGCINb3JFfmZ1rDv+/TUfySyxx2zrE1OSg6zU7+vpQH6?= =?iso-8859-1?q?78qcu493RLT7sgt0MQVpU+Rt6xzliUxjajJVJHpORrL5jPXXV306ECp8KHMx?= =?iso-8859-1?q?SM2fE5RS/IODDnRKMM4EmOsReU2aZGZi4e79MahgG8KCiqXoeS3uLQPtm/Lz?= =?iso-8859-1?q?FxAiaPIqAJErW6ROqpEri0mcKR3UmmNMifrk1Olff3WdV8p76azJsyTq3pzp?= =?iso-8859-1?q?0Y3DpHzpDFgHzvWtc9iW6k/9CpL+21QKXoFYLjDUkeFsgBgZ6ukhJRet7UCg?= =?iso-8859-1?q?w+f6Z85PQ3fN7c01ggL8pEqo4/Axv021rIblCdnd8NyfZG/aDECKQD2oansX?= =?iso-8859-1?q?3QkOhp43p1ncQBk+YGW3OBBIWNPeGMs4F8UIF89fhl9eNCvFQ8KdgBrJkJyD?= =?iso-8859-1?q?gK9ycxYHuP3x3lXy2O4DZcE3HnDNag7/H4vUCk1F56PqfvYS9GryaMyLkUtb?= =?iso-8859-1?q?f9svYMlXTDp8XnAJz8sthc9O54CAg/R+P/2gdASOwRMIfYQPnt6GLSnjrEhZ?= =?iso-8859-1?q?OLgxl2KERBlpGXD16my9aZZ0JXKmn7MLiVfAWgImYI0xXcGOh9ZvW6Y/DK2c?= =?iso-8859-1?q?EMeR97npnyxlebqkYLhtdJ/kyUvbdpigXriq8QX2LnnkHoNAZs2PycaAPg49?= =?iso-8859-1?q?XCruS/oAfn11d6rnosJ/mo9z8RohykF7jyji8ChSQ1al3lQG9N4BrO0LP8zy?= =?iso-8859-1?q?v79YjL8RjyMtVvXTHT+QA/p2qd0/gfFHqxwo124xtNfUADf8jopPFB6AqSFv?= =?iso-8859-1?q?aMs4uCQug0DzLdL2bjFlLOIiFW23bQVaHKC8k++3J8RZIAoDKVkqEbt1n60U?= =?iso-8859-1?q?m57hEgp/beH+GBLZaEN9O4fo3WEMqFt2dHetoCOIOMDwcp/WuqwrsBc4zxUB?= =?iso-8859-1?q?xRR3Uc5ZmWfEULlg/0MzpnKCmzBuezULfqUWD/ysDJT/R8NHAuHE7FgXwIVl?= =?iso-8859-1?q?x4wONG7NVZDPKpnplBslJIz9Y8xlDQfREfAKspZAyMH5QO2u9COQ+JNLyKpU?= =?iso-8859-1?q?0GHKTCdXQ+Km3lUt7UuvjSRG4/y8DrZiPTNHChQNGgGLjE2Ptwq+v0GIsbZv?= =?iso-8859-1?q?V+95Gp6gBGn8F6Tnn5Pd4MrWJQNU09CPfBZ6oIA7Lo7eoyOkoOEten4jpmAt?= =?iso-8859-1?q?++DFRHy26/4JrabGe3Btzd5rOARA1AXWV2EZ6zz4S5Z1hr6rNDzeYuSPC0aH?= =?iso-8859-1?q?Dux7z1iXm08+x0B57DnS7A8T0erCQr5KQ5cOjQTEhVftLNnDPWn+vkoJoVAx?= =?iso-8859-1?q?8VQw1IybHl/3jsQFZTR/fVEIx+o7EiWZKH2MDGq/uVGOOye3GDx22oI3jhS5?= =?iso-8859-1?q?VozzPYnwjRm9itIxmltm05m/19xoEOh9ElSZkr5uu+2wuESSIvudlRBXAOLc?= =?iso-8859-1?q?9u1yC2jD5R1hqFgQYLjB6TJr+ySmZDBL7LIKuN3lObHKLeAt8yuFgPef/wUh?= =?iso-8859-1?q?D3LPuaDrUbAgkVGy7B+v9gh0FUlUH8Ra4iu+t2pCZj8NNsj3hLMX1zNx9D4w?= =?iso-8859-1?q?z4zD51ZG12KZZfR9/axAHA8ywLSxoA36sFMdHyA=3D=3D?= 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: 8ytCEs8ShykJpdElvNGUPhF9H63mPLo8zq6JyxDdOFU/23emmY1RfLLQw6hwPluGQYhmSCG1ArFTQ6AwNaZzQl9Lf5RSqElYN3/nTX+gcFqagPQs5U+6lSz6in0w6iS5sYcl0PQPHTghgXgUsRBLEo9vW+Td4UPSI29O1zaXke/hjwkdBe+fGkHdfUHBvLocC/8rpkpkTVkCF4MTGZOYISo1WuTNZJ9lhhinIhbT9zbAWYqVhy2mVRNwGr8tBXYjjGekH94qQLEqohggOCGQpEHcpV832eGFD+wKuA9yYpmh0Eg7gZXu/3vFRwlDN6mTWppMlzxRKr4RyXpQ/3toZxyt++m7Gp1TyLS18NYq15kQrlzpl7l/FDpKruugpa6/1H/lFWdFXmSyRP3yFuau/OJ9mESv/gkvu/q+wP3Nk1l9G1hcFwzmZ27VA6TbV73ZvT9Qzn4KgBttJlp4krKYuNe43asVc1D0b/O5VUwoma9Nc8+THlPts8GRa/Cbqd99P4M8O6ASYBLmZcLL+wfERhkP1prodqrjDj1+9BpL+7TLwhxrPo/BbMbFn5NIWFpNaYnLHpI9y4dzFD8elrE2LCA9eoP88HbW0El6RtkXTyopTAoqK0sjWukdmmCfzBnEVaI2z8su19QGC2RxCBb/dQ== 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: ef5b6357-b608-4fad-1831-08dd197b41e3 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:32:13.3287 (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: /P+2xRrzQdOE5ZTjVgyaEeiH5qSYyeDEgs2VKbQJ4iQqKN1VhZhbln+k+4ts7LfON/1vqHTUMir0N3/+eRr+Yw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7691 X-Authority-Analysis: v=2.4 cv=Z9YWHGRA c=1 sm=1 tr=0 ts=6758dd91 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=jIQo8A4GAAAA:8 a=cVNrvySLM83yx2NHRmcA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-ORIG-GUID: EQDCyGyFcbQPRnskVJ87Y6h0Tvww4X8u X-Proofpoint-GUID: EQDCyGyFcbQPRnskVJ87Y6h0Tvww4X8u 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=1015 lowpriorityscore=0 phishscore=0 adultscore=0 mlxlogscore=872 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 Some old builds of Microsoft Windows 10 UASP class driver reject UASP device with stream count of 2^4. To keep compatibility with both Linux and Windows, let's increase the stream count to 2^5. Also, internal tests show that stream count of 2^5 increases performance slightly. Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/tcm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/tcm.h b/drivers/usb/gadget/function/tcm.h index 3cd565794ad7..6cb05dcd19ff 100644 --- a/drivers/usb/gadget/function/tcm.h +++ b/drivers/usb/gadget/function/tcm.h @@ -13,7 +13,7 @@ #define USBG_NAMELEN 32 #define fuas_to_gadget(f) (f->function.config->cdev->gadget) -#define UASP_SS_EP_COMP_LOG_STREAMS 4 +#define UASP_SS_EP_COMP_LOG_STREAMS 5 #define UASP_SS_EP_COMP_NUM_STREAMS (1 << UASP_SS_EP_COMP_LOG_STREAMS) enum { From patchwork Wed Dec 11 00:32:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902641 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 6F0C62451C9 for ; Wed, 11 Dec 2024 00:32:28 +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=1733877150; cv=fail; b=hyvO8EPufHQGMZOPO3nlqWsRlscD0D3L2Xao8lVtP0jics1+7mAeMkxdvu9LQ7mX3F4hC98CcRip+b4ujk+ITvNwArgFkMW+q3GSe97h4k+1RQLyO0TOcJ7zwgp8v1rn8aqYjNzxeyDCxS3FVFcf6d7TC7ZMwY0zIZA5caVnJbU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877150; c=relaxed/simple; bh=FomZa8pYUDsO3wYxLs/kVqaIMPcbI4bVVXblAspuwJU=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=bX9BslzWo2SFlEUogWN5YAZ7IPSV+fM4lmHEGKj/ahqHE8Ay2Ik6/yYs6VGHCEE27YNAwsTPDxadrJqcUs6ZBH+O0uvGmSVc2IYmFFxoICYvJUoFDxd6fqGi8jJgEdJAfQ7XFc6uoie4J13gOzGn8ggtwQF+Kiac6lgZvy4CKTA= 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=rGV7hynB; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=bUsLZr7h; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=T2VbB3kf 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="rGV7hynB"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="bUsLZr7h"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="T2VbB3kf" 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 4BAM1fN8017231; Tue, 10 Dec 2024 16:32:24 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=8n6r/mx0km7e6fzyNwSa167DGRNIm87bm3eRiND/UvQ=; b=rGV7hynBG5D2 cna+AtQRauqGTn+81odtS8pKr+Y0IHFItKeg55ehMDYEkyBYv2xVRXyrZ0ug2n/u jztQrPCooif0YrDTP0OCUBpSxMPp217oNbPc5cqDoKvJql+hIvvMesrqCW0rBLvb bgRwqBhl3Yg5I+7ptC9+J3Nd/TfoVlTF+WM+Khb0v+Uf1zCSoQgxuwLweIAdvJAS HtbP3a+Xse7v2uPRpeUidxiK9Vgm5B7dPSeHh7zSKuka3BiaF4T3BkOjGzVoMPpW xeM8u4L0SrEgOqLnPxPYK0BUBbIRL3z9hrAKZGi1284P9bZa7sT9uBl31NTyO8TH s2tEcIrd5w== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 43cp60t0xj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:32:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877143; bh=FomZa8pYUDsO3wYxLs/kVqaIMPcbI4bVVXblAspuwJU=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=bUsLZr7hyjQwoZkagBSCX6wUuF39hTK0LTrnqqvGHATEpFijKJXuc8mera4G/GBBK qR3bgipTBO9F5AT1xXEWHQbSlIRNXoUEZ+OxIXhXC+illDJZ5VAwX2SqoIyGiQZrgz lT1E2+EH5RaxcsLyUcqPwcT1BF3sntG6QuoJXEoF4nZN0CD65+0Eb7nju50LqufOEp N1RG11BdoYn9CdK3UMJY81p0EoKNe+aXRZQyAV4Qsx4TwFDffzkbyY2sGWSW5s6h7x dSLNHeSWgKK4oIyqTm68py1VatvFdiPnCH7G0DcbYfgncuPznEIFh5pVSoJwOGPtmC 6TnDJT/cc1wEw== Received: from mailhost.synopsys.com (us03-mailhost1.synopsys.com [10.4.17.17]) (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 236B540126; Wed, 11 Dec 2024 00:32:23 +0000 (UTC) Received: from o365relay-in.synopsys.com (sv2-o365relay1.synopsys.com [10.202.1.137]) (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 D708AA0082; Wed, 11 Dec 2024 00:32:22 +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=T2VbB3kf; dkim-atps=neutral Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2049.outbound.protection.outlook.com [104.47.51.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id 8C81F4052F; Wed, 11 Dec 2024 00:32:22 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=R40UNO2s66iArrw9CqYrtE+w3Ff8FJ/tFFRXcVh0REjnUq3XbRsDCoAjQXUNpBR+XadLEO75TYCoaWIBBrP9OFQz5rdhHPyVpBP9TiIMPBU8J8Z8PRLDYHiwfKGz+KfJczwDmn5OK8sd9ZYoKPgxaPh+ZUTqI5o2qZwmB6q5pPCGTh4MI+L+CxQCfqBA7bWI45w7Oj7XwdFaCjkQTlRLBJA7SeBSXKiamGCjVj8ohRDHTWLvPNGbxmx0lzcE+HD+EDmQXv3/L4AsJyl0ohmdI0zOQ8PIroJDegoByfX80tk9Q9Yf5Mpc9eA1z63RQa0Urbk+MOgYs1YWzBeIHCHwpQ== 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=8n6r/mx0km7e6fzyNwSa167DGRNIm87bm3eRiND/UvQ=; b=advPoxhV9znZ2HhCZMSJ3b7PQMz9e5v5mTnt/YNnLF1v122tj+ovfkyfnfp+sR8iGB2X+D5KxHtxcPDvL5Ojid2f9hMpz8Wi+NNeWIv34ZAwVP1l1DsKJQo1ShW4MeRawbl3AdBD0A9e83h/mlzk31cFRu/WAzMtTc/syhW97OPsIv9+qhNf4wkcM1smif0Fq1HCX2DHay9MQ8bJRI0WkxYQAlTgmUamYD69xVe+u0p0e1TOZVE/2Xszwh/+JrHHPaa7aTf0XgBWJo1ciOUJTJOZTP85LDHhqNEoU9TOFf7WWiQUS+U6i2UO3ufX5oxI3XMZ9LzzGQiTZapIEQtP+g== 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=8n6r/mx0km7e6fzyNwSa167DGRNIm87bm3eRiND/UvQ=; b=T2VbB3kfK1uOnGKSrU8cohEV8Bc6COS5PXvJLmlxqR+EyorVUqyIiB6V0L/TBTuufB+Ye4j8J9eCti83CMW94yeaw0rxEGXeTSNAxOX630J4HyrP1VlLfr6PKvtwQRykpHJoTyqf/NoZBYFFpv9qnD96GfXyfhvw99zfU+rGcyk= 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:32:19 +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:32:19 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 08/28] usb: gadget: f_tcm: Increase bMaxBurst Thread-Topic: [PATCH v3 08/28] usb: gadget: f_tcm: Increase bMaxBurst Thread-Index: AQHbS2QilL41oIyArE2Gkp8gHuzGIg== Date: Wed, 11 Dec 2024 00:32:19 +0000 Message-ID: <9d6265db4d138e542f281988362bc4392b034d43.1733876548.git.Thinh.Nguyen@synopsys.com> References: In-Reply-To: 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: 642e1116-0710-4eeb-a4b6-08dd197b4576 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?ch3LBR4j+mge4mqrlmAwLw/WWO?= =?iso-8859-1?q?6AGHPZYr9UIIOHj2j3W/S/uKj5Dya0tLPWbMqv/FfzrmvE0KSQV3fOtuLxxL?= =?iso-8859-1?q?QjtLZQoYQ0EdpoPUomRX2DevGiGLIqeM1MRUbnNrm8i1lRYAU/+ry1uXUtQR?= =?iso-8859-1?q?l2eobB9TPbnaUQfQ22TdusD7fAvA7fWfF7ZWyKkV3dspvsocLTabMIyCmxyt?= =?iso-8859-1?q?U+a+J8+319vwKTXgRjHtSU8HGy6IHcXUppJHstgjHZE8AwAdcumTB6C7w3Qj?= =?iso-8859-1?q?zw6V/Jeqt6u7fjz8DF/oCSbtOu6GvR3VUZCZA3l0edMfjB5kgBx/7MyE6mhP?= =?iso-8859-1?q?13lRU/0Gymfq9EtI1vkhOiThQixBgF5QpkfJ/3Lw+K5/bi+wNyQjz/xGqhJ+?= =?iso-8859-1?q?EDIOnIYcS7E0zUYf/Dq0etFPtEd9qIz76NtOqGjkg/h40NAvC6tcg+ukGUZP?= =?iso-8859-1?q?EzvzIM40U8RgWm4abVMMvSUtXPsFUBzOvhD3m6z/MXupfcV1N5sMFifAM51N?= =?iso-8859-1?q?cUgRR91WOi2lfpUyHFmkJvwDWGbhJXwBzWe0+P+W7si4N3ubWvMgbLrmD+kD?= =?iso-8859-1?q?0XDIRwfVqwgKQxfrik/JCRopWoqJDRr9Hg6OgQZmFYOGKdBzSUw3+QKr3fDB?= =?iso-8859-1?q?sbKyrnY7B2Ps6SZlGoNiCn0ZULCc7dUAxRXdvMhyX7wDZN3XCZuVrP5SmuiL?= =?iso-8859-1?q?urRhn23KExJu7uMrexHsWPOrWljaoyiKwZjNbiwcbfHlE3axVIuqmRwiv6Ba?= =?iso-8859-1?q?28WX7jaIFKYc1wwRIUnY1/cYGMqQPzz32KdO5jY2UVMNXTw6mhHRF6SKGehY?= =?iso-8859-1?q?b+XMWxkXC4ogwatJamjSfdZ7tlSJXEGP460OadkVAyXOVeOZnuBl8jvsm2Is?= =?iso-8859-1?q?18UZDEdpSu8Ck5PbHg/nPI6hH6PUXKZTelMTLaiIj7wV/61ctYTCyMud7Zs0?= =?iso-8859-1?q?VPK8noSJw05fAZNhYoHQtGFOPk5Cjfrjt4FN2OvZCNAvLkx+ChOnJ7ajLgQa?= =?iso-8859-1?q?SFaJHNUZnYVynlnDXyoJ3cOs5RVFAZdplaeUAZ2ue5jWgevxYrowbG/+lNVY?= =?iso-8859-1?q?l1TrE5/5JbnkMBgVy2mmCJ00vhe8aEPF7aPvLovfcw2MOHKjk0upErEQKVC8?= =?iso-8859-1?q?hMCE74VmzK3CYYhChm00jFeXHgBayKG5NbhkV9FZWMFDwymBAwRqgumd6E0N?= =?iso-8859-1?q?zVHXiN674JaiAsTtbpycc4iyql4X+yu4hr4t6LK8nKpWFspYq6grK8MQEHfl?= =?iso-8859-1?q?JNXEa4bL03W9PtaBqOy+MJsH6qt5ZY++PHhIRzgahIJCYZfflnHhi883I9NO?= =?iso-8859-1?q?YFUAhD/uEDA9HT2ycZp7k9RJ4snA0N/edvPMgOfznbvwdPF2aA6GxkXLOEsC?= =?iso-8859-1?q?KBD0Q9llckMGOuQHEbt96Q1py/rG2B+ntoqxIxRpQU6l9jyW7GWfjFCHTFda?= =?iso-8859-1?q?jUuG5G4Dt4ysWnoMqG775fUA=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?XvsbFcorvPpWxKHYxAlFfC4?= =?iso-8859-1?q?Ae8uAyufzyNns9tpeP981I7BSU4VcxosL0Ck7pA50qR+i6/KJXRziolPMvQp?= =?iso-8859-1?q?s/04OvlNMugc18+bIuJkLWeBOYJP9+FtMhm0vx0bThXYVac4fqSZ7nP5EW45?= =?iso-8859-1?q?nSNpFEbYVpOsiL3EFCs4i+SC6SXFCiL4yGn0y/wS8KURyiqCmqOLFbNY4tUQ?= =?iso-8859-1?q?BqZhld/KG/J+zdMleV1GqxmOYCBGm6VgqH0daNAu3PgP1cuJq9X+eBqjhfQB?= =?iso-8859-1?q?Yea7VyQ7wY3keD4i6X1thqFpTlDRtUjkA0DYuq7a66IWJ6lRLlx6Hc8NQC+K?= =?iso-8859-1?q?V8BHXrbeezyHcFK5jyaPrh/D13FrhDUtt5UZZKJkEu/bDOgiLslNMUI7ge+s?= =?iso-8859-1?q?0O0juuZIB+UY2Vceigh9AsJFWDcSRCM9eUAa8bIQlE+/LxSmOdR3LZ2CkhEv?= =?iso-8859-1?q?qnN3MolS1QkFe/6shJ9nGlj7ZwPNrnkZF+bSVUMgsPeYl9YGfGfLf0TZZjQh?= =?iso-8859-1?q?ygiCHpPeVN9VJzwYvfHVJ+wR7z45Jaa6x0IDdNo7vbWxq/x0QiUv0DE0AX8/?= =?iso-8859-1?q?BUdw9o2qu/21biHIf+UPYiVkC6WjFP+67rDrokQVRyNoDHcTtT3AFF7J/9jx?= =?iso-8859-1?q?Vb3vyXJ6LN1UOi1/D2gg+EFjYrIUut59sR6vvfB+2Ia36QnpGovlLugGKfAQ?= =?iso-8859-1?q?XV9xBZahsuLx/0Ucbp1heTQImt4wzMUYxwgaNRJ54V+gf5NQ4dV1t278EjSY?= =?iso-8859-1?q?09rub+82o/tTcYnelQ8ouK28UibZVc7F2gz0m/FstkhW2Z7ZZFbMmSJIMBhD?= =?iso-8859-1?q?t+II1PXf9d/jczFMN8j4pYub7NwSmuzaPLFyt3V2N0bO3napU8rmAbw7Qe/s?= =?iso-8859-1?q?uz4exdCTFaEkT3ABKdw6Ai4y3XhxKvQF2HhI/mmD6kv2RA/CFHm63ZyTemZK?= =?iso-8859-1?q?7cQH2y2Q27HPa77pUmzH2/1gMOKWu5UGoOhAzzYIfyXDK7kZM/n01s2vr271?= =?iso-8859-1?q?gIURpKqFR9ov7LUFHUa09Mn6e9glPWRYpDuUfl7uqB4QPGejspvyHkhdNjbd?= =?iso-8859-1?q?MLvMOlNfrd3NEQNyDTXqJWLjzc/Zi/a3MKOH9fMLZXarrG8rKkY5IgHvyTaF?= =?iso-8859-1?q?ziOQYyHmwcco6dIH+0+y4LNag88lWMzRLKjAPucq1Pm5x4vtGcqmUWdgAJC7?= =?iso-8859-1?q?e/JLPI82mMeC22Ry0oUg0MrICiZMVej2+5+FVR9tmvTsn0GMl9n+RBQo0DiE?= =?iso-8859-1?q?hQoEApqkfONBbfeHs8GXwcTAIpFepzXCA3JV2ZZBW4DY/eWm0PZhW5STHjiW?= =?iso-8859-1?q?Yf3cPg27RT9Yr5s8V+cUFP31pEnr2vWIgAdDbtwkMbuDKaw3FmEfqtMV4TKP?= =?iso-8859-1?q?Ajb6u8aj2VDqcTbQ9Cb2OXD34XLLnT+32FOXo29QwAruMzA3zJVOp7ca/77Q?= =?iso-8859-1?q?TPE4rC4a+epUqXIrYjFAkilgVVFNQ42CkI5djN5NR11VNH5g6Cjur9wg8Vpr?= =?iso-8859-1?q?0eoKlgwmReaOfUDYM3QFfVKhxtEFPIudlYk+RL9imLFk9L/zbGzcgZZzxXfO?= =?iso-8859-1?q?8/SFuPauUjYSvTCnCxC1+Bp4nsrpl1PRsgd+z3xbPLjSaA1v9xofwm6O+e1+?= =?iso-8859-1?q?wDpmV2sFmhcrk6KhyyzDqc7q6Jy+WgLeaq+xnWw=3D=3D?= 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: sGyK4qF//1QrwwTLcPdf62MoIguDviySQaePQZSzsxCOSKgpWxVSx+Uxq2i1ijpgXD+RVTLBNJEbtYS/i1bwWJ2hcHudN+LwG+UEOFuMhHkaMXGMQC1z48hHPJl/GkDIhnDOcxaVdRCgwN8b74uoNoxjjlhDrrOUpC25D+f0zriGmUD4O0UQzStu6CwnawNcrn3ZfnL9hLcounXXbx+XGLLDeD9eMQ6ccMk7lQWLDfAJlVM39TDO9+6s3/LV/FJoZBlScJ/di0Rv1lNLjIF5hftKsyW1I20cv9WVms0vWKDsIjljmCZjLojiAMDF6zQkXh1ynbuTTK9kLGcqgVcM6AvMy66ibRrJNChew22eR8cpdwAK3O3cQ+tD8HKtfF5JqiRdyNc2T3IkyifKA7hluH3akVXTk5EvcPjDYXwuZpbnHgH3eOHf0uoyBnaZUwB7S+QVxHLLLt2BOj6RUiADLfUog0tKtJcw7ZABZ5lelFhJzekIULX3gVVcQTogOD/X+Rd2w37eqVwFo5KA20yXmzsSf3braBkeqxrZhJV94qqJ76uWSds7bNdfwTHGQDczyBrc3q0kZ2kBOAbDnP5VNC3wVaI5N7klB7TMCknjE9DdF27SclwmdY140Z2LvQc2KfapNwAHNRt1e6vLExC/UQ== 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: 642e1116-0710-4eeb-a4b6-08dd197b4576 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:32:19.3279 (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: Q/WMuUo+f70BZznufch+xVKfcgC072XIja2IUktdBxa09qYitp5EdXzwVtOAphKvqmsP0hrbtxljOIQkqR+tLQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7691 X-Authority-Analysis: v=2.4 cv=Z9YWHGRA c=1 sm=1 tr=0 ts=6758dd98 cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==: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=jIQo8A4GAAAA:8 a=MxBP6jBeIhJ25oVtBTAA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-ORIG-GUID: PiVbKDDQE5teq-EqR5JkW39rJDj4ocGC X-Proofpoint-GUID: PiVbKDDQE5teq-EqR5JkW39rJDj4ocGC 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=1015 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 Currently the default bMaxBurst is 0. Set default bMaxBurst to 15 (i.e. 16 bursts) to Data IN and OUT endpoints to improve performance. It should be fine for a controller that supports less than 16 bursts. It should be able to negotiate properly with the host at packet level for the end of burst. If the controller can't handle a burst of 16, and high performance isn't important, the user can use BOT protocol from mass_storage gadget driver instead. Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index 4fd56ae056a3..1c93f07daa7b 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -1724,7 +1724,7 @@ static struct usb_endpoint_descriptor uasp_ss_bi_desc = { static struct usb_ss_ep_comp_descriptor uasp_bi_ep_comp_desc = { .bLength = sizeof(uasp_bi_ep_comp_desc), .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, - .bMaxBurst = 0, + .bMaxBurst = 15, .bmAttributes = UASP_SS_EP_COMP_LOG_STREAMS, .wBytesPerInterval = 0, }; @@ -1732,7 +1732,7 @@ static struct usb_ss_ep_comp_descriptor uasp_bi_ep_comp_desc = { static struct usb_ss_ep_comp_descriptor bot_bi_ep_comp_desc = { .bLength = sizeof(bot_bi_ep_comp_desc), .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, - .bMaxBurst = 0, + .bMaxBurst = 15, }; static struct usb_endpoint_descriptor uasp_bo_desc = { @@ -1767,12 +1767,14 @@ static struct usb_endpoint_descriptor uasp_ss_bo_desc = { static struct usb_ss_ep_comp_descriptor uasp_bo_ep_comp_desc = { .bLength = sizeof(uasp_bo_ep_comp_desc), .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, + .bMaxBurst = 15, .bmAttributes = UASP_SS_EP_COMP_LOG_STREAMS, }; static struct usb_ss_ep_comp_descriptor bot_bo_ep_comp_desc = { .bLength = sizeof(bot_bo_ep_comp_desc), .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, + .bMaxBurst = 15, }; static struct usb_endpoint_descriptor uasp_status_desc = { From patchwork Wed Dec 11 00:32:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902642 Received: from mx0a-00230701.pphosted.com (mx0a-00230701.pphosted.com [148.163.156.19]) (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 B17352451C9 for ; Wed, 11 Dec 2024 00:32:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=148.163.156.19 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877155; cv=fail; b=mVC2BYUFla9U1czFUzLld9lJBIPGrWzfELK5jEjP1mMxexlINfS/MV/TEJtrXcdip7asTbuqLp4GwdTclERjSAA5M0ROzUCJk7t2/Is9dSe9AOb1OQMRFLo3d69R9KX8V4cvqr7if+7iOdAhOHuZkmx1k0VNuHqrmc6kOg7N75o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877155; c=relaxed/simple; bh=pCTnluXH8X/nAedQpZNaEhVdpwZlzP2rLzlqt3Lwaho=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=NfkodsBHu3dbkqh08TDuM0fLRWS4AF2tv38B5V+BbkjficgO/rCD8wJw8Bebtt4hxcFePITwnQmRkkOBiDfuWPc+XdzpkjhcTR8zFCcEUFOTFwuLv1EVbF3mYp+kckcIP/NZ/ROOmACaZKWjBxwUM2OIQ1xb+2EzRRRhEm7ilVA= 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=hgq6FsHF; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=FSWy/D5G; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=DZ4vxpjK reason="signature verification failed"; arc=fail smtp.client-ip=148.163.156.19 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="hgq6FsHF"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="FSWy/D5G"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="DZ4vxpjK" Received: from pps.filterd (m0297266.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BANH7Fe010895; Tue, 10 Dec 2024 16:32:29 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=szdedxmjUuejSVMaIMLf4gX5MKRYaYrMHU+5CvdM8ow=; b=hgq6FsHFWEDS 6jjMXL6+G6QtQecHO7iwl9arj7axuu3G8RbG3/1pxc8AL3GOGy6vSGyo6g+s2i41 WxOi2BuHX1asE2F9xLLq4ffgKc93I/J1Mcw9Z0Y/xB15QJQwCUR2IIS0g0OZzAhO Ew9m7NzFbvP+D3E8ERgYpcOzpe8Hi1yUYaxMpRGSw3UpbJBy0pqeXgJoJnVk3DH4 nksvbqjILF1gEh5lc0ZGcPB23eyBnhk9WLIkzwiin4TyuIMo2aR89dhxE2fk143s LtB038JQIMj0Z1y/GkR+pWfy4fczHZITXO6yPbXIWXhOBoeSJp6yuZXOp2iLrpom ktVbmf02Kw== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 43cpgb9pvp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:32:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877148; bh=pCTnluXH8X/nAedQpZNaEhVdpwZlzP2rLzlqt3Lwaho=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=FSWy/D5GoT12X7gWZZnrdYBNQdnF7/zH9sHsHvZy80H5rhnBDxyQQDy50XgwK8716 W1W3+mkeNfxXFMAsyzIHtmDVe2/cF1eABonoUuvxcxV2GgFUlHGgZHCq5k5B6E73T7 rtQ7yBKinc6VV2l70Qqfu2NwN42XFuB5xaDwZosY/SwOfLTTcykVIiyvhpnQY8ke7a hNX6M+YXH+FLXCSw6R4ZYJmRZ68qNuij+5vGxgFT6DNYpKeAJP2btqm5ALPLtOf/oR 9hHCgHUtngCaRAbEgxhWSzn5xKa8CGZPFvss1hZ8+alo0bSTDntpDgeIuSQw5GYi31 bjc816lEJBbHA== Received: from mailhost.synopsys.com (sv1-mailhost2.synopsys.com [10.205.2.132]) (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 208474012B; Wed, 11 Dec 2024 00:32:28 +0000 (UTC) Received: from o365relay-in.synopsys.com (sv2-o365relay1.synopsys.com [10.202.1.137]) (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 E804AA0078; Wed, 11 Dec 2024 00:32:27 +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=DZ4vxpjK; dkim-atps=neutral Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2044.outbound.protection.outlook.com [104.47.51.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id BF9264052F; Wed, 11 Dec 2024 00:32:27 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gM3gSih8NjzEXr6upWcuWXouVS5sN3AxOc8cu2xhzIcfyuADVZ4JIgKH6PFJLQmxFjfH0i6yyKEVNK7lQ4+2pcndssX5/4SNa+MhewzSiC6CvsbiSRxaVR9vB6CENa7E2vw8dTi75jxHz9Yzg0HCtJlrTgSMMBBkRciv6YA5ss7xwptnXLtRzLcQ62s78jfBh2GUjdY2cTUgLnJAfNy3T64ryjaP44P81lKyQTuSN+dY4FaItYuSztsO9y5b4DQi1rvFlUPtr0rWgPamD/5o2K2yiC9qKHYUFYgIm/kG8rCq00RhJpgOLnp4azzntBGOJtC2DrEAwm7n1+IPzErkEg== 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=szdedxmjUuejSVMaIMLf4gX5MKRYaYrMHU+5CvdM8ow=; b=DS+TVtB2iOP4ePnontexGnjXOM7UuO1Z4sJ1Qlk1/oAqJT+raNcF1YnPdplEJpz8w8zVI8o1455dZ3TWb1qBER0CZvW8zB0AmwynRZ7mrnw97ccQ2mZDgF/U/A82B9KBnURoLkgW0yDcxFRVzzliUjq/8mGnE0uWhiasS2qks63orxz0rrOVoa6IUNoWRmxruk35WiZpf0Ci625RPJChU628l5kpyHfC6bs+znEWTB1tkIrfTSCRx9dwL6JP5ppSzGD7P4N/MIyJ0iRuaXhJWlPJZ8aQaAo3ERquEtjWLt6x/Tr5CyzhESv3EBe47dgJ17y1nodVKqibeyVMqSRuoQ== 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=szdedxmjUuejSVMaIMLf4gX5MKRYaYrMHU+5CvdM8ow=; b=DZ4vxpjKYTJ9oJ6v5YNFgAYtsPZkDJw39Tz8QoeVfHk1OLS8kBHPh41xZgie3d4T/kQMoNujO56pPsJh4Go65Hdmsnk+zVr8eXzw1vmy0BcUoSC9g7UzJE/JNXy2DCzP/GrH8opZrTV/kiSE9sPp0Sq8ZwhH+UQeO/BlHtM0cww= 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:32:25 +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:32:25 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 09/28] usb: gadget: f_tcm: Limit number of sessions Thread-Topic: [PATCH v3 09/28] usb: gadget: f_tcm: Limit number of sessions Thread-Index: AQHbS2QmIZTMASfAAEuZKNgHPLwsEA== Date: Wed, 11 Dec 2024 00:32:25 +0000 Message-ID: <017016ffcab2f3c284d863fc42483b83dbd21b35.1733876548.git.Thinh.Nguyen@synopsys.com> References: In-Reply-To: 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: 6576b3ad-1d0b-4fec-b8dc-08dd197b4913 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?uMH6K96pHAcOFQAl1DjuUh7ZNI?= =?iso-8859-1?q?/3BMiJSHnStTzeF3ukI6peOKhLot5vjhJIhtZ1iY2yuV7xNgUGPdR5i9mtz9?= =?iso-8859-1?q?kbFGerUgAbXfZzqNixCl4yuZYmIeZkyqFqhfRPZF+O+HCdHGD/x4+0kBV91o?= =?iso-8859-1?q?zYGKngQzVbNDLrUMvEYevvVIutAyCQTYzJ+4bSwZEs4OLXEC+mF94JN+K+lx?= =?iso-8859-1?q?2/Z2Pmr+sTTNIivn+PEi43OtcyZ7XNShD/je4y6qU8VYrD9Qu117CNLANd9l?= =?iso-8859-1?q?5YOD5ax7K0FwxWw9+XVqWG5VaIe5VgzAASjZ3LxL360R55J0aZuLEFTKI4ae?= =?iso-8859-1?q?c4zLYL9OzOSgXnI05D+yJ/m/38ijpMLD1GBWI9uEH103qjD4DgT9X/IJGDZn?= =?iso-8859-1?q?53wZWr3ACwHU6AUm2OYWV5SRDmjfEXofeVdN4BrfkTUcu7BQKyWrcUz6cH4A?= =?iso-8859-1?q?Msgmh03etI1pz+xl4dS29IToOHV92RgHIf+XW63Rxc7i3gEt5sVMw7/goL6/?= =?iso-8859-1?q?mid/fNY/VYy4ekNK8b1fB01RdvTPVviFsFto/TDa+QRFjTVaDGuzOvIpycNJ?= =?iso-8859-1?q?yChUHd7buHI3oDWThu/uESfxsLkt2DczmkIB/JXEKD5SKDpnhJb5fr5HRMGc?= =?iso-8859-1?q?oCkekkCWAvrPwTdRt+4Irj4/MPPHrooK8j/IjiJQ5J6sQ8mFdOhJnaBUCNwH?= =?iso-8859-1?q?VFkiTeTRd/eY16xyz4FmiZGKWZcIvW1WtIRGBqQEGaBSJJXzrOEr6kp8mQo3?= =?iso-8859-1?q?ORFLgsQBfwckncJtiFmslaYmWVky2gqC2FqnXq2CHsL6q5N3pb95BR4zL+7d?= =?iso-8859-1?q?kq2APvJ1svDSwG3k+VNrfXb08KMVN/aWyYnlf/XDs5q6dLxpnLN8YlpYNIKN?= =?iso-8859-1?q?qQTpaT1sq70ueHQyuSq1E1KhV+p8a17d/jsoDkDxeFd0yj8WVzG947AHt6CA?= =?iso-8859-1?q?Mr+c76pa4U0sZXsqIcVvQdtH6NaPw9NNUX+gp7Z/ZiPOSj8p4laGy20KNrQK?= =?iso-8859-1?q?DsSnpHunITHWUnw8eE51mtijwPVShV77c05z8TMXCpvmD2dmrVEX1XuosmDM?= =?iso-8859-1?q?1hsV0ZjxHeJu93y1UGfFC0Ob+UO7fYTxy6NUb8/3baQh9FDHs++94rKcOGqR?= =?iso-8859-1?q?YzQkwzFgH/qXzbs594wiIJ4uetqHfOXCAZH+V95ic6KRfA6QIUowP+TQf/CD?= =?iso-8859-1?q?hrcTn1klRJTRmRxoB/76QW28vcgz5jEIfVcn4vtI6FqVbPFT/P7ombxwlJGU?= =?iso-8859-1?q?5kHp6w41WQpaOUCBAi2p3Ix8wHYCmUEFlA5v8PFbiB13BKi8qaSOXrJ4fZjc?= =?iso-8859-1?q?d9panoj8TXCxmYqDfkNHhAV6KAZYX2wXDYpaVs4MGwWBY4yyhcm7fGrGSzYA?= =?iso-8859-1?q?kISlMkqoHppBpCEcnjGqllSM+d/DNkSVK5ON/EFdSuB81vAvCrhUGvVUefyh?= =?iso-8859-1?q?2bXkPhUh4rXKw/s8Ta0TFxFQ=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?v6S/qhJ0rjh0vx8NvLZlzwT?= =?iso-8859-1?q?ZB93SpWh5yKE3VqF6oHnvkiqCgsRZQKSw72fMl8RynEhMYMpIl+g9cXPhuam?= =?iso-8859-1?q?9JaT+W3YasZ/5OiIJCogiNKgYPBfYq0pPZhLsLihwMMHg4+mGdmqFMU94NW4?= =?iso-8859-1?q?Y6Tv8NsfJFh7CEkYVU1lx339lL1LV/1aXnF+6OdexdsQpaREyEnYn0gArx3h?= =?iso-8859-1?q?sn6IZaosHIKcfxxv1Birzjys83+3Qc0koCdbmtNWRuRsLdF2uaoca2XI/Bce?= =?iso-8859-1?q?b/drueP5ci+zKpwVonITRQytUeOJEHjdNFeGOW2yhwrvlEvLNjB+/uk0X176?= =?iso-8859-1?q?t8xDiGivskGEJYvHhAfmw9ENkgm5EnPZ2EXCynLrz68KClEhEhzDx7c/QdYH?= =?iso-8859-1?q?Ss933dmTDO6b0EjZN4ILeNx4Xe22ue8KiXCJFYnbqOYQKERFQdteAnPiDOfB?= =?iso-8859-1?q?7Oz0l05jBD+zxj5C2eZd4qryTD6VMBvL/IjekKouXy0wMsfCANKzFtcg3G+9?= =?iso-8859-1?q?n+HqhfD0fGU3viXc3Q7eKur3w8kjNhNRC1xgWRHZg316KXRHsJdyuh3InkfD?= =?iso-8859-1?q?7+yoEZa3kYcUctmlA6jHKsW4qNAOtmCNoyHFJjZWf3EiXn4y+i6WLWGvpYEr?= =?iso-8859-1?q?HXxh5mku9FWonFlLv5mNmGRRMNgdgAxVHDy82RvuOEJOueCSG4sM3dCS2D5s?= =?iso-8859-1?q?KaZ82JCZd5ysu6sd8fk/zBTw1CPBR/xSimttt0617pMHbtllnxLTGvUCb8Y9?= =?iso-8859-1?q?JiugmB2I8unSH9I9YkRnSKqJqcj+KhhRiOmiO960uFw7P7RvmKkS0vXBsDzX?= =?iso-8859-1?q?ijT+aDAGFqDm/Rksh8WAzoSXzy1bSLRihNrhus6QYqwIawpF2dhhbJmw/fFo?= =?iso-8859-1?q?ngkaSYGSA2CWR2VTZXOO4Cnrwd2ab2rx7t8rte8SCE4ET6PekrNIV/+HBZ8+?= =?iso-8859-1?q?VkQkVE32cantwXPIWKyHzx0PRHkt8MWlywshuLQjZlph+i0eYwdc4zdVTVy8?= =?iso-8859-1?q?Tcp9uN6Lvkn2lbXopzrx79bxL0dS/1Wz+BifGm0DYzMTxjBCfX4QGjdDp33T?= =?iso-8859-1?q?rZ67uHKucfO30vgN8HUSRfq8ok6oTbOAqCvE53/H2YhCOv0nTV90/FZkwCCh?= =?iso-8859-1?q?dz/fPVobzqrw/OHayYUvUOJT8LaftfW4MAZL/XOxCREvPPRgXbprAuH42fBE?= =?iso-8859-1?q?xT11UsAwJCv0ohoVe3PFI/sAQxgqxvZHobR9S3hO1vtRP5aCzxikoIyiKNSN?= =?iso-8859-1?q?RNTzXMxNtrk7nEikZ0cTLWX8IfxmR+x4g6yL1m7v9MbJKks0+d/U2gCNkH3F?= =?iso-8859-1?q?VgDlbjHHzr7R7njcods1E53HOiuPtgT7aBSHLDtQiu45iJpUBfsmYTno1Xtk?= =?iso-8859-1?q?OMxv5bynsr4Q9+J7qmmH5YpB2GSzeUVl1x7PrqJ5436k9tcP6d8s4OK6q+jN?= =?iso-8859-1?q?qFOJev4Fyzp13i2wZIucS5hE+8PdeC7qzpPp0MHEMSsyona5BYlLYBOaqaw3?= =?iso-8859-1?q?2+0PIsmd6c7XHtXgMNwQOKFk6iz+CsLDlJ4X8tpu5S0N1ecBlIen5+evuT3K?= =?iso-8859-1?q?4kOhP/IYGjf4nrPmq2z4dgCMOk1FoDtfoAEuoj0B87kfRJ7GOP8iB3ipZ7zQ?= =?iso-8859-1?q?OI+BadME8myKTPQkWBNViSEsq/Z27l+eYKNPNGw=3D=3D?= 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: quOpA+KYyj47BNMUtRdhaukPjePBIhYBu6h+piEZBUGDn8vUpXxvjQZ3wGqzn5rDAXhH8ifL6b+t+umrF+a6A5NNIvhzBwUcxdJ4yRflNO+0LFzLF0sfCZqEVrEI7J5XhWKvqFu6cShS3EZUO+PXYXaqCKXztO9tPjSQi3Y8pL0AjcyQ2a237RvozUrsBcvu2Sm2J8smABRvRa5JBhHQISf2MxchEKssOnsbKoJy5Qp6UGEWlF5cWD5wEuQNX2wElKFGn9MggDyJnntUbacBs84wQLpeITBbqiofdGpjeF2v7bKiV6dSp5je4vwDKkBm9eyr0tLkhbVOwuNj2QdfNgtTcJpNSY8kQM2Bg6qAYdnWX5dWTWHhzOIRp+ega+vO9VbTzgLGgpePtHAl2TWmHcYesIBE2ruy7AslPnXB3ow5v9v+tMDAmEIWslLT7DiT/a/2vLBc6NXfvgL2OHpGgJh1Qdnvd9Nj5X5eianBcA0AwpfMnjT8Ycb7APDmewtjZU/CVXHP6oYy7kZhL4qOK3yyP5gUhh3dKOPrwJFhyVQV9tCUqQfpNbLh0/yFVzTe9qkkNkPO+yskMiihYWyvNOwruPWx39VrOUoCzfSweZKA5hznNaxBOyN/ZmjCW8CBNBJUzix8fw/XJQLD6EhOoA== 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: 6576b3ad-1d0b-4fec-b8dc-08dd197b4913 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:32:25.3613 (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: Uz9bIAiEgHZ2WB3rTcMb9kgGIhDsgAdx2qWPySeArRHtMW5RfZFk4x7HduBA41sDO/mTg/oAtbEBkpgaPy7GtA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7691 X-Authority-Analysis: v=2.4 cv=d+8PyQjE c=1 sm=1 tr=0 ts=6758dd9c 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=jIQo8A4GAAAA:8 a=NGJHf6JGuNThF3Jh-kMA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-GUID: x2ozNDHjCCnuWMB5ZqGYNsOqnInl9OwP X-Proofpoint-ORIG-GUID: x2ozNDHjCCnuWMB5ZqGYNsOqnInl9OwP 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 mlxlogscore=999 suspectscore=0 spamscore=0 clxscore=1015 adultscore=0 phishscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 mlxscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110002 Only allocate up to UASP_SS_EP_COMP_NUM_STREAMS number of session tags. We should not be using more than UASP_SS_EP_COMP_NUM_STREAMS of tags due to the number of commands limit we imposed. Each command uses a unique tag. Any more than that is unnecessary. By limiting it, we can detect an issue in our driver immediately should we run out of session tags. Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/tcm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/tcm.h b/drivers/usb/gadget/function/tcm.h index 6cb05dcd19ff..385bc2cdefb6 100644 --- a/drivers/usb/gadget/function/tcm.h +++ b/drivers/usb/gadget/function/tcm.h @@ -24,7 +24,7 @@ enum { #define USB_G_ALT_INT_BBB 0 #define USB_G_ALT_INT_UAS 1 -#define USB_G_DEFAULT_SESSION_TAGS 128 +#define USB_G_DEFAULT_SESSION_TAGS UASP_SS_EP_COMP_NUM_STREAMS struct tcm_usbg_nexus { struct se_session *tvn_se_sess; From patchwork Wed Dec 11 00:32:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902643 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 C8E7811CAF for ; Wed, 11 Dec 2024 00:32:39 +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=1733877161; cv=fail; b=L3XHTatjPvf6Is+WwaSe0q4YtiB2JDlF2PD6FeCEcjwXvirIoqEAdNjPgPyKA98WBwH0E/8V4pLDbsaWww4lvNM+lcxut/l0vauKMpGjWPC1YerEmmhgcmviLr2uwXy1k8+abWVx+9zIEWhHztXudBuPVtceeAfW9ZCW9wZbdMk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877161; c=relaxed/simple; bh=fAYeKuswwk8CWWN5neXlVnMxMswBcm8yoZfb0JX3JxA=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=j6hiwR8Iqi0g5v20zDcytvgy1N2xfGKymWDU0J96idMWFGuxKzFnlcRO9LaTeBh5B7Kv9i5buhL8iRfiiDA7A2TlHuTOHdl6Vv/wLIJ2hhlbcNqL6+G9oUusybOPHlNP5zSSOv7Kg+MkPpk8QBQld4/LcjmXHK78wDW1lmlSRGw= 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=dcJ1KICL; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=PiA8ONTk; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=CZmb6flA 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="dcJ1KICL"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="PiA8ONTk"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="CZmb6flA" Received: from pps.filterd (m0098572.ppops.net [127.0.0.1]) by mx0b-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BAM3rVb000519; Tue, 10 Dec 2024 16:32:36 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=Pn3Y5dWVLqyySaQTBEIxR7YkNlmL9LyJ79G08YFYd28=; b=dcJ1KICL+iCm +dBRb3ji4bCSWdmGbjST8obYLScoVi89WbcNbuGj7YzK27PMbSCXrQGt+FiHxWwb XouKsZKCjLHTfp15H9XZ2EL2SO2PpmmAsM7/lfD8hvNGQvrQ9QpWJ1Cy/NkJwuYd JDdRqf+3LkKvSpP0E/je6hEXhxl32uJ4Jmi/tckNiGl50L8bdbiPt/ju3cedRAFb HE9CXsXL/fLpkAuKMuXZ5h05qEjip71QF1TDBaXSu9WXvTpWu2AgWkbqu7pPjeFL dlg3x6wtwQbgdua+l+mYECFZG+3TK7oCM0eQJD6l/5vkv21+kMG+nHJPmOMk9FGr 410OVvnpkw== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0b-00230701.pphosted.com (PPS) with ESMTPS id 43cnvka156-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:32:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877154; bh=fAYeKuswwk8CWWN5neXlVnMxMswBcm8yoZfb0JX3JxA=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=PiA8ONTkmzElsFyg+czUxn/Ycxu3O/kRgFs/82e6aotuT0cR3wmI8AOD8QzzoInMM RU4qBOIdFxpvzzIz2FO5ZgZAFx6xhlYE39tgrgTzwUee+9kSPDAN4zdaZj6tzh5Ewl cjOBKNGeNRZ2ychaakXKUBLGR9XvDoiH5dN8rNgpv/+9bkjPD99KhqH0bIIuRZ2DFu lOTjk0aZ/m0URj8JWFEKc1QBV6VCdHkUp6Meog+ZqxY1DQJjPQ3nkid7B1i6Q76213 IK031Kjcujx4YF0jJ4SNsrf5crDIBJvYVKydn9GDEzdWovgG+ITp+OiTDAr6zGRkwg TkpATIqWbExhA== Received: from mailhost.synopsys.com (badc-mailhost4.synopsys.com [10.192.0.82]) (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 8C27440126; Wed, 11 Dec 2024 00:32:34 +0000 (UTC) Received: from o365relay-in.synopsys.com (sv2-o365relay1.synopsys.com [10.202.1.137]) (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 1AD3FA005E; Wed, 11 Dec 2024 00:32:34 +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=CZmb6flA; dkim-atps=neutral Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2040.outbound.protection.outlook.com [104.47.51.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id DCE95401EF; Wed, 11 Dec 2024 00:32:33 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SLC+F33h3hY7zkNsuHF4UcVoUGr2jhE4NY94flPe8vAbgYjVs7fu+0MEwRM4aYdzmhcbbxOwc3Nj2m2cEnA70I6cc081MasptEnJhNStgsA9PEu5cpxAOu8irTQdjgE6jj1g3Wsega7xRHk8m69bTIpnWbeH1q3lL/7hOxJ5NdMOmZj6cKJgUpsxzCPF3ZgJ/qPXA5KAs0AjulGOkAG2Gljvsz6cu+e32yeYkdRcnEF1CSjbyUbWXAAd2wsKbaAaXe3Lmfq91sHpjTwnzOEJphcNH1cfqMwjUPDCKxfjoigjOctP7VdK9Lw6OEOUBwRDj4+BCbwS1x9L7HojEWZNDg== 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=Pn3Y5dWVLqyySaQTBEIxR7YkNlmL9LyJ79G08YFYd28=; b=RzraxKwq6k19WKPtK723efLSp33jYUfLPuBCW86KjjFYYL8+E2MC1hb19KTZSR4w/U5J/0fpHS+yrKaVRgMtfA/aBc9SA6mmOuzYp0GQi9uGrl7jpzl8m0DQGPiyTYFrMpEHBYxF4F792FcOCNe1PiNPuccS4FU3F40z8IDVGJ6V26GMMEJ0qMQ7TzYE77Ate1zuqbE5C9bt+Q7pfR7goL2+iDaEZjN0vCTjP5yba8ZNoaQRLFfzGFg4b96CglZJZsGdCsFg/uJ2ZpA1/QNoxqYdkn17nCg5kRJReNSJfaAi3SDKHCr0XcvH8imZmci1lOTTlei4NBv9JnZzftYmVg== 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=Pn3Y5dWVLqyySaQTBEIxR7YkNlmL9LyJ79G08YFYd28=; b=CZmb6flAcMKBOk7gbXPKrWvj2kpJSl30PCHMZX/YbVUNMoFtzExqcqTUCqnNSRF310gwJuc3jMWGhK5wwECi6N5f017Ekt0kcwAzXUlyDP99b/rx/QCG2PWlpFU8pjJOH21yvPXbBFVT2wuaVP3SNBdBzwSbuDzBv9l/DRFK2UM= 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:32:31 +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:32:31 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 10/28] usb: gadget: f_tcm: Get stream by sbitmap number Thread-Topic: [PATCH v3 10/28] usb: gadget: f_tcm: Get stream by sbitmap number Thread-Index: AQHbS2Qq1ekOkVqun0y/WCDmHzhqTQ== Date: Wed, 11 Dec 2024 00:32:31 +0000 Message-ID: <169f67261162c16342bc8543db93c259b05ead0b.1733876548.git.Thinh.Nguyen@synopsys.com> References: In-Reply-To: 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: a176251a-9eef-4fb0-cffc-08dd197b4c9d 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?iv/jt04l4N/dhQGXD0HVcRPveZ?= =?iso-8859-1?q?/fqy/ismf4zM2aVROni/ihaQOBsAYmqcV9KUthQ4hcIsQ3PAcCI5X79moHHP?= =?iso-8859-1?q?zYCEZVPFThwDi1a5Y8/YuGdSBn49BUMb5Z5Sg/Kqi6ce3eSwQcO8kllcOe5V?= =?iso-8859-1?q?YlvFkdwqhnmGI9KD/8kCLULJwLRafUWV8FP/J+oXyoitmKIdKdkw5Ln65063?= =?iso-8859-1?q?d457dNO2DgQe+vV5T09pmESqEk04dzO8o4SIvKRDPtFVcyVk4IYL3e0VllQo?= =?iso-8859-1?q?zVscl84GWZuaKvkSxd/sdq7ffXwzHUSnWK15jfNXazai3ifvXxoEx4tzROSo?= =?iso-8859-1?q?LwYOoLxrU18HeOummXU65oaVjkvPMyYxPwXFoYvmjn4iwpX8tufpZgcGZ4m8?= =?iso-8859-1?q?rlR84jM3DnZBZ5xGh/I5qixb3FL8XjYYR626RTmI3gGDgb8U0SnNNrcgsmQB?= =?iso-8859-1?q?Z3+WJuaAzscEHIPbLehgXRoUfr5q31puKUH1LUrWhNi+6chXbyV5zEK/xwgU?= =?iso-8859-1?q?aDNnBEIx0stPeA/OU5fMjp3WhwYRQkXAVtYk8QjzTawDeBsC5LIDhRSnNmc1?= =?iso-8859-1?q?jiZrIryf/0OOa1ytGNBC62+rlBvpTJKisc9nxNoyJVEXuyiIgm8AdplltF+a?= =?iso-8859-1?q?ULkfN9grkqH34i5eOaOclCFZNKaCPJ0RhG7DRnwSU8qhoX8rnWzzn0yZXzSu?= =?iso-8859-1?q?Cvch2V0yXh6Z7aC+0hhJKQYUNunP1xPEak4WDFSwBRVjXwAgIUsfe7KZNn32?= =?iso-8859-1?q?JEkAe6UkSTVvVvNpSqIZEgdsqNetc9Ao7EgrAB8fDjIkF41+TrNrWdZohpi0?= =?iso-8859-1?q?kVZiXKNo04ZNd1Aa5LVtnrSqEax8oeIh7/1PRNQNKkXKQe3lDLIUq7BnzwSf?= =?iso-8859-1?q?xGzFHDh7bwh7ZzRl7T6l/uJFqnKWqqSmEJeDOl4twmzYXmq30L75wEGP0BWU?= =?iso-8859-1?q?VPzn+vR18xVbJS4S9m0VCT22bjwPAadKEpjWJPiSYiIVgJtaWY5n9kLgSiMQ?= =?iso-8859-1?q?vtHbpD5numZYmXorJLYiPgsdRjvQb+HFE/mTiZOHu5f3OPwgA7B3R5u5V/fe?= =?iso-8859-1?q?SllDFrAJ4ozZ7+4gX0FrJct48dYwXOiY2SvXfh09fx3/PSfthJwYNvDNlLtk?= =?iso-8859-1?q?JkyZ6W+KJNuW01U4Iugj/WIhzP+xYIyrlBq9hfjb1ZPbDsJa0d29AqPkft23?= =?iso-8859-1?q?rXBodMMZ2xdePlvRMfWLExqKFwk72tM3uP4FTarmfL0fmHZz5048neEEdABp?= =?iso-8859-1?q?c5rD1bJWQduMdyNY6RDH+MsKRV5gCFtqqFwvrR7mtwcEZB1QHcwfKCflT+vo?= =?iso-8859-1?q?pLniAvRgg3aoMuHE8RtE6QVgflXLgMMahQDerwv6GiElF22M7022499aX0Ir?= =?iso-8859-1?q?uTn0x5biSO2W64/ofvljFCAukxs6h3oCIEy/KRfjJV2FG8YPRxT3Gb0mch/T?= =?iso-8859-1?q?LSf+ccuDKxvFaic8z+sFWVqA=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?qH9RTCV3QbwaNSPHOGZ7Asb?= =?iso-8859-1?q?B5UA0xaSEKaA6eTFplxzbp9w9NpvUmAnBO7BzwcREbXwHOTjGwgWmV16likJ?= =?iso-8859-1?q?DvPFJVe4QA/Hh33YHcg2W0XERozakkBP3rd7naZDoQgCfekYAVZ0w/jcmPaw?= =?iso-8859-1?q?Bj10RdPUHGDC2/1gaqrUrYgZ4XYwxR0XTkVaxR4vFgRA3P9m+V+BXM4svtFz?= =?iso-8859-1?q?p5vLllxkC5tq6wiCEcwG6hfggq4SePz9cbLcJh+BPsj9eOwhAKaFISZqE0Rq?= =?iso-8859-1?q?coj9SUpZUzRqz1COuDUCL52HXVx+trTUp+DYeb7pUie2Vx0TbIXSBXaY5eIU?= =?iso-8859-1?q?EXKcsCEqRW2P/Yr3ozyxZACwMJt0KkGVX9hThr0PBxhtZCD7hlZWCFasx98I?= =?iso-8859-1?q?rGcHbCjQ6GaUAD6EaLUS+dJoJuzdy9vByxLuP4A+rCyD6kKPHFgnbol2S2XX?= =?iso-8859-1?q?9zf+Q/217KNMezO+9PMAu1fwjf+LZixHC30031TwTYIKs3wyQSn2PgXutCWA?= =?iso-8859-1?q?Peu+8kjFo66E7u52/t787komvWu2vhYsU7IV/I7fmTfZJ8WRSriufozGGzAS?= =?iso-8859-1?q?37l2/LkljLDGdxLPC/ByYolgl/vf58blBKEwD984FKWQ7NnAoi/Jcl3R96oV?= =?iso-8859-1?q?mH+929X7t4/72ZY+vo3KXM0/JwQZW4LL+cMJr+LR6qpPIrqMBR2BomNb9hse?= =?iso-8859-1?q?j0PiOMUedfvNQThKJteqyLXcUAcJJeRhel8ptc4zfnvCb/t2M3pnTocTpg64?= =?iso-8859-1?q?NJ9C/7+hDB7bsUmQk77ZR+iPxNnqG/ZQ5h6xpw+x05jzVZUuC93+j8Q/A1tq?= =?iso-8859-1?q?oiatMpz6Lkwb16mdLrBmRae6CXiJ7CdwHwuo/5aeB1BKj6JXBuPevQ1dIdlF?= =?iso-8859-1?q?k1sDJXVBkT2y6gxIPh9io4GxklMPIh+Df2eC/BJNBoeFdrsMSFlsCP147dLe?= =?iso-8859-1?q?s/AirpomVp1nHLd/hIAeoX07trY+LnBc7+LvgCdhbxfDemdqxAal4a9Wu3v3?= =?iso-8859-1?q?3zJmoAMRbe4qbs50HjhszYeRYs3OdOSq/sCI3UEZj8Cby4AiSgxVtdgKG/2g?= =?iso-8859-1?q?Ych4bUQd93+QTrjKLAtgBtUqaDm2FoGkWA6wsXRWraidXiAA0m+BP82a/KiB?= =?iso-8859-1?q?Rk6IL1MFGPwckWWLlo9hyhuSa/kn+iKToEB0VApGBJp1oIXbNfAJ/wo30guq?= =?iso-8859-1?q?HzeenJe1nJ6nqJDpLTHJpUO+VvsZjfD4q8GnUTII8YQuv9CFmNjZhkczgd/g?= =?iso-8859-1?q?XYqRC21i5QzloCWmXdQIynOYeSjserts7JNZv72ENVgErU8zogscmjfIuO43?= =?iso-8859-1?q?MVK6iypdgQAQGyabWPv4d35i8Wu82/oxZZUEpxa0lKROZH9JUPcQ+s1E5J06?= =?iso-8859-1?q?AOMlAJvTLU+rcrDzv23g+GIzUJ8TzHmWkp66aOTiyGIuOSmaKn0BLijIDsf4?= =?iso-8859-1?q?aZy/QjO2HbAAhLwJD0547U/+zgu5XJbZo75mmRxFopMqf9+Uc9l2sYrv6Uxv?= =?iso-8859-1?q?zOLwJgpmqhe3RkpwE+XvJp/gpHuDbyX+DPgUU0Ej2Bg4fF6bTUpWBKc56+E2?= =?iso-8859-1?q?2/hik4fG65LQiub5k+7lPwHWkXKiztus2yqJyImmmaWG7zU9K1iyUJiirr8m?= =?iso-8859-1?q?sqxYIRNcY6by5QZbDEFFwFIjUr9Vn6gAmOvOPGw=3D=3D?= 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: /kH1IxmISgrr0KnGLA8aI2nWpL3ZFh63Up3vD9DVNY2elZI1f4xc3+Zxqj2K9Dh0EooZXExWrwhxlsEzI/DgtzXyMhehCmDTtuVbt/in9bVRdH6Ut5tIn2z9gRXlsK+t7zFy047Di86OLZHK5pRZTxDVW53UvX/MSLES6d3ff8HvAWVq8BJc0LvSSrbX1Xoy1Y1wn+UbK7TdDcbCTWm5mTdpQ5LidyxSWiHZgZW/mtYSMROV4CG7CyUQhtPIjU6wU6gxz35W5E4ZqHO91uwr5AF+NsuNSsq6BB9T9AdFMGYF+6R1vH2ktHFMfxJP68XZnAHiwP+dkuGy/HcTLHwUpK24mAXVg2gBJjiPerX8q6ogbCF4C+3nE1mNSmxkhlbstybZxfnGCI3rhOJLzE4efgsdgqtCElr93A/wxzaf5auED/aBiADkg6zVW0t7DBoc2plpy1vau242hRZHkYlssBDhFQDENhu4wNffESUjfXb53qz3p7d3m+rSHS2dGMn6RTJnoXzYsS/tggIfLQYgQhiJ+EX7X8A5lEI60t/gCa4RsJ8aa32c9ZsXRV7/EHXZf7wuTLxH+Y5tO3q7EISLrywLFcTFnHNUF5IFZHxX2KFM34o0B3trcP5Jm64U/S4fOUYRGu/XKXhYhBNjiVn2Xw== 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: a176251a-9eef-4fb0-cffc-08dd197b4c9d X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:32:31.3305 (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: 2rzZjNHQhOw4RvIfMgtGI2tTmdkzuq44bR0wcU9IyaiCpsp+x2aYRBRYDqXyMQwrx8/3UcAvvkpUu+BDKa6SMg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7691 X-Authority-Analysis: v=2.4 cv=fNPD3Yae c=1 sm=1 tr=0 ts=6758dda3 cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==: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=jIQo8A4GAAAA:8 a=W-950U-e_TmYsRHEapIA:9 a=wPNLvfGTeEIA:10 a=VI-E8fl1FWJz5TsTLJMq:22 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-ORIG-GUID: J3AuuaqicM7KJ-uTNZ7rRxciCblL5tL6 X-Proofpoint-GUID: J3AuuaqicM7KJ-uTNZ7rRxciCblL5tL6 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 mlxlogscore=999 impostorscore=0 clxscore=1015 phishscore=0 spamscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 adultscore=0 malwarescore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110002 We prepare same number of sbitmap as the number of streams. Use the returned sbitmap number as index to the selected stream for a usbg_cmd. Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 26 ++++++-------------------- drivers/usb/gadget/function/tcm.h | 1 - 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index 1c93f07daa7b..a908bbd04b09 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -491,7 +491,7 @@ static int uasp_prepare_r_request(struct usbg_cmd *cmd) struct se_cmd *se_cmd = &cmd->se_cmd; struct f_uas *fu = cmd->fu; struct usb_gadget *gadget = fuas_to_gadget(fu); - struct uas_stream *stream = cmd->stream; + struct uas_stream *stream = &fu->stream[se_cmd->map_tag]; if (!gadget->sg_supported) { cmd->data_buf = kmalloc(se_cmd->data_length, GFP_ATOMIC); @@ -523,7 +523,7 @@ static void uasp_prepare_status(struct usbg_cmd *cmd) { struct se_cmd *se_cmd = &cmd->se_cmd; struct sense_iu *iu = &cmd->sense_iu; - struct uas_stream *stream = cmd->stream; + struct uas_stream *stream = &cmd->fu->stream[se_cmd->map_tag]; cmd->state = UASP_QUEUE_COMMAND; iu->iu_id = IU_ID_STATUS; @@ -544,8 +544,8 @@ static void uasp_prepare_status(struct usbg_cmd *cmd) static void uasp_status_data_cmpl(struct usb_ep *ep, struct usb_request *req) { struct usbg_cmd *cmd = req->context; - struct uas_stream *stream = cmd->stream; struct f_uas *fu = cmd->fu; + struct uas_stream *stream = &fu->stream[cmd->se_cmd.map_tag]; int ret; if (req->status < 0) @@ -595,7 +595,7 @@ static void uasp_status_data_cmpl(struct usb_ep *ep, struct usb_request *req) static int uasp_send_status_response(struct usbg_cmd *cmd) { struct f_uas *fu = cmd->fu; - struct uas_stream *stream = cmd->stream; + struct uas_stream *stream = &fu->stream[cmd->se_cmd.map_tag]; struct sense_iu *iu = &cmd->sense_iu; iu->tag = cpu_to_be16(cmd->tag); @@ -609,7 +609,7 @@ static int uasp_send_status_response(struct usbg_cmd *cmd) static int uasp_send_read_response(struct usbg_cmd *cmd) { struct f_uas *fu = cmd->fu; - struct uas_stream *stream = cmd->stream; + struct uas_stream *stream = &fu->stream[cmd->se_cmd.map_tag]; struct sense_iu *iu = &cmd->sense_iu; int ret; @@ -653,7 +653,7 @@ static int uasp_send_write_request(struct usbg_cmd *cmd) { struct f_uas *fu = cmd->fu; struct se_cmd *se_cmd = &cmd->se_cmd; - struct uas_stream *stream = cmd->stream; + struct uas_stream *stream = &fu->stream[se_cmd->map_tag]; struct sense_iu *iu = &cmd->sense_iu; int ret; @@ -1104,17 +1104,6 @@ static int usbg_submit_command(struct f_uas *fu, } memcpy(cmd->cmd_buf, cmd_iu->cdb, cmd_len); - if (fu->flags & USBG_USE_STREAMS) { - if (cmd->tag > UASP_SS_EP_COMP_NUM_STREAMS) - goto err; - if (!cmd->tag) - cmd->stream = &fu->stream[0]; - else - cmd->stream = &fu->stream[cmd->tag - 1]; - } else { - cmd->stream = &fu->stream[0]; - } - switch (cmd_iu->prio_attr & 0x7) { case UAS_HEAD_TAG: cmd->prio_attr = TCM_HEAD_TAG; @@ -1140,9 +1129,6 @@ static int usbg_submit_command(struct f_uas *fu, queue_work(tpg->workqueue, &cmd->work); return 0; -err: - usbg_release_cmd(&cmd->se_cmd); - return -EINVAL; } static void bot_cmd_work(struct work_struct *work) diff --git a/drivers/usb/gadget/function/tcm.h b/drivers/usb/gadget/function/tcm.h index 385bc2cdefb6..cf469c19eaca 100644 --- a/drivers/usb/gadget/function/tcm.h +++ b/drivers/usb/gadget/function/tcm.h @@ -80,7 +80,6 @@ struct usbg_cmd { u16 prio_attr; struct sense_iu sense_iu; enum uas_state state; - struct uas_stream *stream; /* BOT only */ __le32 bot_tag; From patchwork Wed Dec 11 00:32:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902644 Received: from mx0a-00230701.pphosted.com (mx0a-00230701.pphosted.com [148.163.156.19]) (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 217E71172A for ; Wed, 11 Dec 2024 00:32:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=148.163.156.19 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877169; cv=fail; b=eC3cxYjz3OGjzVWJdYXA0G/oOxkTH4s3ZBG+TsvV4sEcOT/lf6/2uOeyBdBLFKANipnZr++NfXLYCUesyzJ/gFDr8Wt94nH/fPVwk3MzY++37wofOXaRKpBRhQNgUEY9Cx9/3pTHH7E8s6oisorzeS6NjNXV5hWStosZJZ7B+WU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877169; c=relaxed/simple; bh=l6AU+i8P76DEjQMcLEjQkJMh1+s4+UbeXIPxvqAO9sc=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=sbDbNIKkbUkaP+FF6sQPdJwUGMNN2qDkj0kZDjvcgPArJ/4S9b7EWR6qy+FbCIfXtmZTZ/gB+KSxun3zBf/j96EBJ1pDmpYOk5G/A+OUHkOVhXO/YHLHXy66PiNtwuIQjKClZM3sOo1Hn2N0ywAtvGI3T/Oy/p6M9C6EngSkqMM= 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=ZVLHcMyx; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=JpKL0WPr; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=a3I5UfnU reason="signature verification failed"; arc=fail smtp.client-ip=148.163.156.19 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="ZVLHcMyx"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="JpKL0WPr"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="a3I5UfnU" Received: from pps.filterd (m0297266.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BAMVk5u010832; Tue, 10 Dec 2024 16:32:42 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=dlxgDh+LGiF3VVGLtZd8v8h1BCOaIxniu1QuNFmrvw0=; b=ZVLHcMyxCake hT7CYK3ZHAb0Rx6jg2GMaUPNkkVXVI7Ijzv/OP2vp4QfO91ZRI8VfpxSJmZYHI0Q WOtvAmlLFbAEURooTgJBrdSBGtiBs4vi9+v3OJLu9p/QVuOC1H67aOGC3SN9DT/f o88XKOPmCIdVAofOLyfxcTH0ghKue19+BiSrAp0UJoW6psULc/Ca/PYoOmsblS1h Xp/b1p0TGIKvd0u2pOmmm9Ih0MtwnmzpjKRJnPkzgV5f9sWhupDye7GEu6S2YGZb TuCxPZLbJ5mjOC4KzkYZ0V90GwI1RHwFEspz4HlpUJxsU6gTMBhHccnDpPQZbZrg iwt8BbukHg== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 43cpgb9pwj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:32:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877162; bh=l6AU+i8P76DEjQMcLEjQkJMh1+s4+UbeXIPxvqAO9sc=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=JpKL0WPr/cnd6eNt96MX8KgH4fqyPz7F+pym+Wdk21kCSgADu06hTAVP1Vi3FTZV6 IN2HCbv0pRNBRg2PEdzR3uIiAOEDFEqpfPmi8+8MNbvNhs0W0pvdcmMJwCNtv+Ynrf HjlqtddH84VDeRgPd7GqmNQUBGaWlk8R7jpMMWn02vWeWBi4XE+kn8+h0IOcZfEtgP L9v3KDNzxFxeTAH/ZI0TUbJ9SLqnbWH+iqWbv7H2GbcSfmdMc2HibdqCAAEQQDLGAz KcChwHDu5gKwsSZW1JuU6YeWbMGjLFniELnBWeROFvIJJpUBMko9baeWGmt7RFqN4u a/fzL7OpzWzSw== Received: from mailhost.synopsys.com (badc-mailhost4.synopsys.com [10.192.0.82]) (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 095CD4024D; Wed, 11 Dec 2024 00:32:42 +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 C54EAA005E; Wed, 11 Dec 2024 00:32:41 +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=a3I5UfnU; dkim-atps=neutral Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2046.outbound.protection.outlook.com [104.47.51.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id 6A3B54041D; Wed, 11 Dec 2024 00:32:41 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iPxAhz5YJOtqrfDy0u+adGJWyNLiMJH1QqsMjS+r9+3FjUH1zkEWOqt7qe1gb5DwctbiMBRwRjopWGUpC/4mizaMPKvNehvsN9j+Vq9nfcOG0CIrmPb0vL0rl+jMlUcXtyvo/0Retwpnn57427O7g5WtZPJ7rRYijtovntDm0g2H7r2rTXP2fy2H0QpP73Y2kiY+K9hHA7W1b3JnmkuBgLfx2kOc7mspq3bUNWsawoimefLdtHiPksDfgTk9i0/SNWHDA5lDxEWY7J1hTYcVc/S3IkeFrZOVqMlYOv14ffGmEyBWKqW3LdQ8xXzWpGZnKBKkR+yq8cq/M2kp94FzfQ== 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=dlxgDh+LGiF3VVGLtZd8v8h1BCOaIxniu1QuNFmrvw0=; b=fkk0v1hWNwkgnVl05w4SbAqD7RMhI4lobp4bCPC8LFekBYeHy36pTOKEQbdabDfyjtibAFGichZ+jb53lPcghgmHmo5eZ5TU7OaGkSisMndd558liqPPUeOzyssexl5V9L+ef+pFExUqW3tE6C2iJOefAZkgbBb+NteTeBPquc1yV0Rdgv5uZF+Zf/LhJE8qwqxNWh979sF6pwO8RJmSuRjyVwfaF2F7DhFMaRwPGX+RLgz0ZStPzrKM6FoG+WO35+aTVWb51390WoLOAY+HMA0RIK8L4vhY63fmgpSKrLPKArSlazb66i5mAdtjKItbfbxWXmuKx/KPqWeY5T490g== 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=dlxgDh+LGiF3VVGLtZd8v8h1BCOaIxniu1QuNFmrvw0=; b=a3I5UfnU8AREYG8YCut8julgGELa6BalQerW8P3u1XvsrJCVO6KagafxvBsLAsLSBO2TaFEc4fWSDQBGNZqx19g/rKeG8yk5d3+HrOayTY88zPFhvMRwPZgDkAgezYAVwiizBtohxdM2xF8F+s345Olaff3p+AGNwirwJBmMrP0= Received: from LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) by CY8PR12MB7635.namprd12.prod.outlook.com (2603:10b6:930:9e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Wed, 11 Dec 2024 00:32:37 +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:32:37 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 11/28] usb: gadget: f_tcm: Don't set static stream_id Thread-Topic: [PATCH v3 11/28] usb: gadget: f_tcm: Don't set static stream_id Thread-Index: AQHbS2QtDvRyrdgpDkO/+frJcDgIkQ== Date: Wed, 11 Dec 2024 00:32:37 +0000 Message-ID: References: In-Reply-To: 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_|CY8PR12MB7635:EE_ x-ms-office365-filtering-correlation-id: 792eef09-29ad-4202-6b62-08dd197b5031 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?hFuW3t/nv5VXVkfxl7THf7TURk?= =?iso-8859-1?q?agXRhHskjCOstyEM87Nc7JM6aIOWZmC+zSzuZzlvP8Zvak1KtGcax31FMXzT?= =?iso-8859-1?q?f8ffMGKcdfJEg107iqC8zYrNkFmvs6DOjOd2eHm5Gk9DcwAIH/AZdg2/K6Qm?= =?iso-8859-1?q?f6vdtfi4zEhORcu98siELDX/UkOUyKxu8F6H7l8cK4sS5Mti20XzPVfFrIeW?= =?iso-8859-1?q?aFYd2YDuLRZZE0wyqmvo8z4XydGBauV7UHwFCgg7JpqTMyDeE2S7VHbY94X5?= =?iso-8859-1?q?XwFFrPqDF9KxVc0BQmI4pqBu7DnCitaQqQRUpIlGtMLdbhSpiPYWRf75YtYw?= =?iso-8859-1?q?Em7czEW+HbjqtQ/6OtjS83T9um4NRpheZpE4Lddn6pyqvpgJOsgvOU09zRw8?= =?iso-8859-1?q?fn39lhVvLjyJIp39yg4onpkaSMcPYC1vixmY89Evq9OCzma+4y51s/VYCVHg?= =?iso-8859-1?q?aMpmDBK9ebC2TZKcYngyulRnGN1IPw996ybtrkKV8jAUkTRCnKDVbOrWoYET?= =?iso-8859-1?q?xkNgn8YliiEdftmKXVo9jrOvO+oHY2Ucl+PK1AgTrsQ81/MjznNCn+YPcnK3?= =?iso-8859-1?q?Hk9h+Ty1p7WIlhDNMYckkgO37vj6LgulWbIZMlCivkfJWbNJbt16YTjQb4JV?= =?iso-8859-1?q?bz1VLkp5CRSnpwmmN4UhbTJGK2h7ibVXUqfNFTRcA1aFmn4StQFuF3xojDiy?= =?iso-8859-1?q?TgBfh9YPvxf99ytNa7SpRA92u+Mz4RKJ4RqbbeUDOx9vd/sKLw1E9B0te1D2?= =?iso-8859-1?q?rSi4ypO1VtGhBqcm0aTL4qkBYmirt3ysdaoB38pJee6dUCU8zps391Atf49T?= =?iso-8859-1?q?LyTKsWEWVxZirzCUDAFkStSrGW7OHXOnwmx0yw7aGCZ0Gx1U9Ru3yMZIjLRz?= =?iso-8859-1?q?q+BNhDaF5I7dW2c+eFQE3P8p01fBcXTBEIZLEUX3IB5dp5FsAt1l4Cr7bP44?= =?iso-8859-1?q?xVbyhmS95AcXWCG25+Y6MR2nmA9POwkGYbFMQ8Z5ORTAoPuSBo4uTmAYAFgz?= =?iso-8859-1?q?+4gAlCv+amr+ozZWNPi9fcmKI24MH9Hndx/jAwxoJUeTVNJhauEQvT1Fu6ap?= =?iso-8859-1?q?You8FG/GtRZ8esAe1rW9x3jAv+1F0Q1VeoLkPYFfBKNup5YTZQuBXKA3aQY4?= =?iso-8859-1?q?8e8u1ANC+bBPaKHxRgaVVp+DNpt80okRHJbVtIqSn1B3JzWE3G66x2O0lwde?= =?iso-8859-1?q?I5aGqnPywITC2CiPiAMhMcELK2e2ekjdnUULY1K4NiIPKBDVrI+6xRS0gPc6?= =?iso-8859-1?q?FKRjDW0hkAsLMgQZ1s9684U7ZeWvIJ5JYXK7l31XW6HI+oo5xYXASqhmUrZC?= =?iso-8859-1?q?4zseJFbA67xXn9VuyuoMhYmJ1YNSpanRVLxYr9ugInBdwNIb7I63A3o2RO7J?= =?iso-8859-1?q?1Ki0Je44x16513F0wJA64hb8yubTSb8FfmruLg4FuzkO5muUOLOenCT+pRFn?= =?iso-8859-1?q?ba2tRIJXPENx2hINcZB9YYMQ=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)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?SeHPVGLVjPCdx1sR64nHnyy?= =?iso-8859-1?q?64pMRTsAeEEi73hWYoKr+cyYWth/bwZ0m9xlmtj/rpFUz5JDK5l/07M44hqu?= =?iso-8859-1?q?cTc37H44ofgnrjtKrifxjfFiSdnV4AORrhNP0UR3zT4JVKWcKuDYPkxQsK0I?= =?iso-8859-1?q?xU/dTM7YkN8xIf4/EdbWfyY4sebwx24D2B7OzoKHBDD5ofwNDr6GGjJtHCeM?= =?iso-8859-1?q?/3aw0tk5zZ+/k/ptbm1anME0I6t2eXpwOSE1J4VnvuwCNr1ebBcokqvdikqA?= =?iso-8859-1?q?uLNkQBiRdjVgkYFIWTN6SpGDN66+fF/KZioMNvKZRLHbrcS/fCDpuyzT4md4?= =?iso-8859-1?q?Ps6aT0zgeEArvVaaEt4N05h3Ngimjnxw8TbcyQcmZ5uI+1M4y1YQw9hv5yc6?= =?iso-8859-1?q?lbrf8TC43GPUVU03SB7LWXxrDxvBoPNS1M0a0JptLa13hAAVP7ZAmSusckea?= =?iso-8859-1?q?vL2Poe48ozC3ApP8kea0dBH8dSIhPxDOZtM9RUIQB1cR5E6EJTr5+4eRBhVF?= =?iso-8859-1?q?Yvp8R8/wcKBuI13PQL5yU1JNbUjariIBCn9DCjj4xK0BYAlbsh7yE7uD01f7?= =?iso-8859-1?q?Vi9dZ8iM0glA/jYThi2u5p1M3AGFe5cfmfnnfogEzxaoi8wuNlB+hUVu1fDO?= =?iso-8859-1?q?0FEui54AJ2mObJaADjdWOPzjE9aLKTeXu+70aPlIwVkobhbK7xY/HoYT+Z0z?= =?iso-8859-1?q?AAgAPPIZJN+trwXCRNRJS3k2psdqC2oq9l3bwI6xGLN6+deLWrhMtn7F3tWr?= =?iso-8859-1?q?hv+Ns5O6UQEp2G1qNr9erVdTiFuUsS0ZvUXgGbdBzsURO52IdXelLFyYU4c1?= =?iso-8859-1?q?Rj3wVIo5T+VmBzCUUxSvrNnXwHGTUL8jzmuJ0kazqGHK63w3WS/CZVobknTQ?= =?iso-8859-1?q?2W9Rjk6JIbmS1m2hfz9PeCPbA1Y9IkqnjiJ6naMrut072GiNALARVXezoN6/?= =?iso-8859-1?q?WA2oUHsbJ45/qf14GR38Q62q7012IpuWMYTchKt3hT1h1nX98exOu2CTEIWe?= =?iso-8859-1?q?860fA4j5GijG1vxC+uCfCjnZE2hapV2w+kCHk2mOlqBIWU7wtGqjswT23sWG?= =?iso-8859-1?q?hd6AknwIEXufifd9RQS0RFfu84klLLrGLetLEhoWfqBxsevuMFsNH2yv2a7D?= =?iso-8859-1?q?mVH3FaTkYZ6Kejp+8WJj/Y548E19X/O6pffCuvF8tXHdjN2LMWD0uRvA/zQu?= =?iso-8859-1?q?dxESCbELEVTE+Qs0M5FDCAwplYs8q5sPBeRRBlNpI5XvFV7nBW31fqMGK71v?= =?iso-8859-1?q?D5c3T30QMSoof0tNLLR5zpoqVbAPaM1sFnkFAG+Umlg2JA/dtcCMH5p4W1Qn?= =?iso-8859-1?q?3kAjiLIsKtgSo2Z7kFLoLqb8R/KxLibPKruRHX8PoDKOySBW/GnyXnLSac/k?= =?iso-8859-1?q?VsknSprBcpZUxtK9CnIjfHF6CWd0VIS817IH5FA3NAcUAELfbeq9x6J+eihG?= =?iso-8859-1?q?VqAtvKUCJNfzuC8/l0c+exfq4rQPdCSLDr+1gRsSWKkp/vJqbamTbShx7VPO?= =?iso-8859-1?q?W4ZFUvq1X7POjKTq+ck2IFEJ3Z92Np8W1XJTh5JLxd8AfHUBLeb1JTEB8gXH?= =?iso-8859-1?q?RFwW6zYxV4Yci4pdDzN3e73KsB2Uh2SwA+fLUPFSzkB0G/1K4E3jQZpzj8dG?= =?iso-8859-1?q?cacE6hTrc97SF+y6eX0VUDZTEHwZNsclNFXINIA=3D=3D?= 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: gYB8Ke8jI0CUacMZsuYAO3w4sG6whZbTLM8myskwHDUJLhFUNujoB+pY8zF/FILfgTtjL7WPovmGzZPqfam06O76WtlKtwSRpE4wjfhVZefrU7+L8tSt9xFyzjT2CN2aNAalEre7oq7bH6kCbYqRghkkbVr1CiLq4mJhlgQEjw2cLkh2LL/W2oerigD8jHvCvw1hfM0XGJHV0nXLikqJXTw/YUzNGe+/g9BJYL972jF53f6mrrcQjSlbS/0c7j+W95+1RVNgFp3pm3H7nOE72dzV762JZLIcGg7JVj7ZA87R1ArjxMgA3Xiyso7tpk4rYHIapeWJM1+HdeVus5Y+HcsXAkBnFtOlADrePH+/Ep1JbPALBL8LjTsx9zAAbbSqfrAz7uJk+50yDSFgxozUXCecsLhYpXKdPyUSJKLAdsenBIwlgyjCaCmABFu3Bf0zIIZfJmPLmy8g2Zxjr2qGpHkRi4HWtEGPRjBCMOUaa+3LOpronPkeKSvEpmjJMiQTd7rbKkHg5V4Hd2TYOP/hxTA43KUhT6DWTLZgDlgNH/6wjTzQlKpjJHir/a/XXk5+HYAZDZU8NQT+RvX6NXzwe9Z6H92D0Z9nLaZr+2KWGoCZR3gpr5tOp6fDrLfPHb1jZ41PIy78zugsTy88jpKKSw== 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: 792eef09-29ad-4202-6b62-08dd197b5031 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:32:37.3419 (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: rC9jYqJnW33LqJCHf/AtBS4LobfS0YcotvvjYM5EXVTCUtta/Xr03TuEk9uDtlQDEODB5zDZg0IZr9tB72s7+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7635 X-Authority-Analysis: v=2.4 cv=d+8PyQjE c=1 sm=1 tr=0 ts=6758ddaa 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=jIQo8A4GAAAA:8 a=UZ-aGP34sXRJlaZFjlsA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-GUID: Kis1KXXfW6HV1fKzxMkMHIRCmcOpBnkn X-Proofpoint-ORIG-GUID: Kis1KXXfW6HV1fKzxMkMHIRCmcOpBnkn 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 mlxlogscore=974 suspectscore=0 spamscore=0 clxscore=1015 adultscore=0 phishscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 mlxscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110002 Host can assign stream ID value greater than number of streams allocated. The tcm function needs to keep track of which stream is available to assign the stream ID. This patch doesn't track that, but at least it makes sure that there's no Oops if the host send tag with a value greater than the number of supported streams. Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index a908bbd04b09..a594ed1359fc 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -511,6 +511,7 @@ static int uasp_prepare_r_request(struct usbg_cmd *cmd) } stream->req_in->is_last = 1; + stream->req_in->stream_id = cmd->tag; stream->req_in->complete = uasp_status_data_cmpl; stream->req_in->length = se_cmd->data_length; stream->req_in->context = cmd; @@ -535,6 +536,7 @@ static void uasp_prepare_status(struct usbg_cmd *cmd) iu->len = cpu_to_be16(se_cmd->scsi_sense_length); iu->status = se_cmd->scsi_status; stream->req_status->is_last = 1; + stream->req_status->stream_id = cmd->tag; stream->req_status->context = cmd; stream->req_status->length = se_cmd->scsi_sense_length + 16; stream->req_status->buf = iu; @@ -765,19 +767,6 @@ static int uasp_alloc_cmd(struct f_uas *fu) return -ENOMEM; } -static void uasp_setup_stream_res(struct f_uas *fu, int max_streams) -{ - int i; - - for (i = 0; i < max_streams; i++) { - struct uas_stream *s = &fu->stream[i]; - - s->req_in->stream_id = i + 1; - s->req_out->stream_id = i + 1; - s->req_status->stream_id = i + 1; - } -} - static int uasp_prepare_reqs(struct f_uas *fu) { int ret; @@ -798,7 +787,6 @@ static int uasp_prepare_reqs(struct f_uas *fu) ret = uasp_alloc_cmd(fu); if (ret) goto err_free_stream; - uasp_setup_stream_res(fu, max_streams); ret = usb_ep_queue(fu->ep_cmd, fu->cmd.req, GFP_ATOMIC); if (ret) @@ -975,6 +963,7 @@ static int usbg_prepare_w_request(struct usbg_cmd *cmd, struct usb_request *req) } req->is_last = 1; + req->stream_id = cmd->tag; req->complete = usbg_data_write_cmpl; req->length = se_cmd->data_length; req->context = cmd; From patchwork Wed Dec 11 00:32:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902645 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 B51DBE573 for ; Wed, 11 Dec 2024 00:32:52 +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=1733877174; cv=fail; b=eetrSW/wxyUnP3F0kiCtYV3wIs70NGt84FRAvDiVAiYPUJQrGHfWnL1jRXzonKqLyIKCJef7iwK1usll1MiAiGfFqcn5vmNv+df3Et7q7sqe8xzSfZOGtVW+csRPHuz47w/PU3GGTfzwmphazYI5Ld7pyp1Xy9PllRlHGCsSiV4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877174; c=relaxed/simple; bh=s+Y1wqh4PMvPM77pGrBUQc5l04AS9w+OIbxssKROCmU=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=jBrgbx7WhskdYILrgcgwXs37H4AB5GiEgbil/FdwDTvXm6/lUKGgXIEtIiIQZtoiMP0znJ+sHm04aEE5Ng+i8cSldf3jrx5RqNXnPIHLyL0LZebTk8hMjq+FmXdruEjbsTMShCpXFefIcT1YhhPr4WyVzxOktr73tWfNjRT5Dmc= 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=ujIZCTW+; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=QHrslhrC; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=UzQBCcWv 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="ujIZCTW+"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="QHrslhrC"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="UzQBCcWv" 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 4BAM3qEJ017428; Tue, 10 Dec 2024 16:32:49 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=/vUPAoV4Z+6LjBwFiK0/lfi8/ExrWD54nkRrG+y0MMo=; b=ujIZCTW+u6nQ UDKxewSmLdjdRInDo0Sq0fZIh9pPMjM5/L8uCkRiaYIMV2TwVtScoTJCVeaL3RdT HsnECbXH33EZpPzsTFnrgbE29/e8jBnPihzBQY6OIntXXgItcfaLmynpSxCPw1vq FCJEx831ECG4WxsnOGbyuUnA30X8HCvDXxl7T7+gY+EOr6rGGhsL/d6ijuUM5PfQ 82J7a7G6pVVqvXX6K0G4rxClFBU+mgibwuv597iIoMuQcHtTGA23Ss3Z4pWUyRdK FtpaPFDhcd4ljs+zBwcVyZ08z+KykilXfObuvh8bW1/VxOk7YBZEzNl6NMe9UzCi LJTRBUTnEA== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 43cp60t116-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:32:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877167; bh=s+Y1wqh4PMvPM77pGrBUQc5l04AS9w+OIbxssKROCmU=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=QHrslhrCxkIVcNaT/L5rFT1J296YwuIkzPiCq+AWJaYwa6BiVRVo23yoJqDgx315l 0HI5X0XV+wmXv0oZP45A2yHsDUsrK7/snJQxrrvtb78R3Y52ZMO1nY5lgtekEQAGAK zB/5UlztVHiBVle8hmvWoxYDY3HpaKFK5f1ovpH5tV+8eRmwFJxVjB4f1cJKHXsfMM 11XJr5XbEylnqo7eOgcLu9dwm36IuhkxFYbTDe9hG4bcjEryJxjvVbixtBJ91kcrzV JyXKMSBf2Z4rFrYGtof2OpZEBvzSWyEFfAzgkzaZlhTqy3bzAgX+T8hbA1oTQuUSPQ QON0ZIXKtzzRg== Received: from mailhost.synopsys.com (us03-mailhost1.synopsys.com [10.4.17.17]) (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 59E0540126; Wed, 11 Dec 2024 00:32:47 +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 20B0AA0082; Wed, 11 Dec 2024 00:32:47 +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=UzQBCcWv; dkim-atps=neutral Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2047.outbound.protection.outlook.com [104.47.51.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id B4BD34041D; Wed, 11 Dec 2024 00:32:46 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AKMQCFX7Lhf5dakIJ4ZQzp/80q+/dI9Jjvl5309zgDCrpzp4HFY2sNP36EjXK0vJoWQVpxTTvFzqdhU23t/hIlKV4aNskYorWX31DOvP8eTWn6QkhKmBEm1kIUmrbgAp22ylttZIH60CF7Ax6ORmAFV0Bfy+JMmTvwzQEXk9dTy5Aybf6qRaNVUY1t/fWLl7JLMj3mmwcKuJoCSgkt6EJ/vPmzxxuhhImBI9PRDFKeAjibPQxc7zSYEK4iceeNBqRpK3GP8X/wpnryX5wpOqUKrAOXqD1y7CaIl0enbNW9cJ1B6Q2sVpyS+ZI9wP5rc9rjBqWVprBXZQgKaW8rI8SA== 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=/vUPAoV4Z+6LjBwFiK0/lfi8/ExrWD54nkRrG+y0MMo=; b=d0HcNIXRPlwZYsj+YDM6XYQrBmzT3CmeZSGMFjTjdnibPM1CdkUb55ge6pCjai4SJR+5ZTx/OOeb2saim8zKOPVqfeqLgIe8jbGPLL/DFrPhE25QDuRrz2MVRSsYMvh6OhpBowjK+KkhKSUwTM3m+7+onWur1wEU6zVzmYRGdgvzWz8lJAStZQ97m8w97T9hdtHXDiN+i+PeV38rO1PPX+X2thQKksbGUdGLNuUt5VjmaSR3ITpKHaz+R/YVX+cAu8Cx55tUucEODZ5swuROipVuxDo3l7XqpBL8k3813uyr7fAIEnEWTSIebh+lOWU/8xYUTwLqeZIYA+oY7cj2yA== 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=/vUPAoV4Z+6LjBwFiK0/lfi8/ExrWD54nkRrG+y0MMo=; b=UzQBCcWvjQ41/dxqw54IwfPIsZ48PGYXW5aUHCLNhqxAk2MDAkvudCikWpCdtvxA0kIPTJgIguFNuGRQQvJ1hNJWCwl16rcOh2euwSXYdOsSq3lXnGDPy6MOQsBE8AI9v5JhTIk8w2k/MsyxWjDIpjvjmwb2Zhb0IJokFzeQARk= Received: from LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) by CY8PR12MB7635.namprd12.prod.outlook.com (2603:10b6:930:9e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Wed, 11 Dec 2024 00:32:43 +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:32:43 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 12/28] usb: gadget: f_tcm: Allocate matching number of commands to streams Thread-Topic: [PATCH v3 12/28] usb: gadget: f_tcm: Allocate matching number of commands to streams Thread-Index: AQHbS2QxFqD4F+Za4USHnh777XmgSA== Date: Wed, 11 Dec 2024 00:32:43 +0000 Message-ID: <2d806120dcc10c88fef21865b7bc1d2b6604fe42.1733876548.git.Thinh.Nguyen@synopsys.com> References: In-Reply-To: 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_|CY8PR12MB7635:EE_ x-ms-office365-filtering-correlation-id: 218d645d-814b-4e4b-5c9d-08dd197b53ce x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?Pj7b5fxNzIcvnXxEqykAxjTtX5?= =?iso-8859-1?q?NM5x1ysDXVF6RmXCrq4uWzhhVWwXnD4SRnGcUXgJq8OaUPPg1vdLXvsVWlgG?= =?iso-8859-1?q?/U92iHwPYB2Xn9APYLSJaifDO4dAk7F6YY8W7aBGYLdLH1/bDGDB4GJwmbKy?= =?iso-8859-1?q?Ti8ryhR3evNZfdThQfo+LwljxTu3x2/HOq8fL+JYjEF6DLVFQ2Mx4INXByas?= =?iso-8859-1?q?zp7ga9d+qsXkrKpFzwEwovnRvKx7oq2oy/H6qsYgJmEeL2ZdvtYTk6aVZSwd?= =?iso-8859-1?q?2wnFhTHfVU2dlLbnFhBWZpL8QeM0hzQbj5f8aws7jWqXx8HDmMTlSWdqkiYP?= =?iso-8859-1?q?xen/4tq9gUqXYchVeGLWu6yxefhJeBOLLjHyjxQraCHJI3x0ToD4oGtGJG6y?= =?iso-8859-1?q?OY1soiCv2AvvaODQi7DQGYRi5TLRlWlsCIpQJveKbknfwtXLQRd1CjqSGRJW?= =?iso-8859-1?q?FMKiPJP96HsKsk8QTnIc44nconnxaU/G+ZfuMDqza0eC57eM290z/J20r1Tu?= =?iso-8859-1?q?htPeignCFCLXpb7NR2bs0mNN2REltDJjv4VdblA+4oPvtVcFNsgW8QJWXq7H?= =?iso-8859-1?q?L+UZLI8IYTvXdxFvCFN94VGPzicrCTjAVVLhgis+o9KXZ8jiQdI07gFCTIv5?= =?iso-8859-1?q?m3/THoi+TDcmSJvjrW/d7N818tO54MH6iT2fGTI2ZFYwpv4AeswosylB8Cr3?= =?iso-8859-1?q?kpLKvLjzjIQwZzSI4+QfW+UsKM3MQ6iH1tdr0yrLn+lYGVjLAKSZOVVnfgk7?= =?iso-8859-1?q?D3kckcg9Vgu1Rbs+hW8v+z9JNZLeVfKHxaQ/6nNFJ6ZxkPCwLnoiAFsoDx9+?= =?iso-8859-1?q?osZi2nTrfv7Au3+FRD0ngtAfzPAEHXh+Q3VHYx3DHS9ZDacs6PVpl1y2kiJd?= =?iso-8859-1?q?+iskiQ7jel8H/VguTI+a+GIqxFabCPP3+YCZ9P7m8JeFMO1mKhZO07SSzI36?= =?iso-8859-1?q?Shjz16egYAbeaFptTT9Y+w2sf0jRMN81MqBdJL3Gg2Xo3r1k3xzaL8hv2yHP?= =?iso-8859-1?q?cAxRIpzb2Vh7m3mYZxlvcjLtbYBcdqhj27nOKsq1cQuC80+ik0x1YJbwQilf?= =?iso-8859-1?q?zflJoxhrrH3rdn6uXIcEp7X9f5JLF/E2hcUsH9cg7igY3a5ATUrcj7p8E4Kg?= =?iso-8859-1?q?yJz8JrJHldF5NXBsJ3+pzc7tiDpECOZAzxrERRHZ3E2lysmNwa+2z+B+9AK3?= =?iso-8859-1?q?mEwrmdodcagKBtuV6K8lzT5FIpJQmVYTwjl9N3jZ8NXzKhhyP7/4o0fTUqzw?= =?iso-8859-1?q?nlAKa9jmspPAhUs/8xdVz5A/qSCi9UUx80Xq7OooqJROQp2psylwL7TNKXt/?= =?iso-8859-1?q?aRne1Zo0SFHx+8pJF2UY0xMRzm22fTGOwZ/oLw6g4sGFXNP1lOhYx7+l7PY2?= =?iso-8859-1?q?ZZm7GWsxDei9J+3zPLcjvZgmiInFU2FG3bQRv6IexQTEy+gmXnxF6PisHiYx?= =?iso-8859-1?q?Y80DVZRMMqTm/lCtKvAPMkNA=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)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?6FYSCP9JTmp7X1e7qsEd8rL?= =?iso-8859-1?q?xga7QSBXRAaBM86cid4MzT3wcXbVBC0OsrytDRToefRKiCraECMwoQ7q5jES?= =?iso-8859-1?q?atwjEQEdIh2ci95rsflx7dp9NohaQrmWgBxWAXgQpTK30ZJrgc4/KLGT0erU?= =?iso-8859-1?q?l/nbP0fSP9RgzzolxbV6TYCS/5CUizKuK+Dtne84YyygmLJmvrgacKnzv4xk?= =?iso-8859-1?q?uFIef0ZuAeZJtBrgehZNYrbYaXu2hOKHDf1b5oU/ovwV2XH36JfPVR1e5Qao?= =?iso-8859-1?q?ovnozq6Phx7fGGhqIfDZFZ8/6x2glXz4g1gABkeU3HwS3R6so1eDsA1Uxfrt?= =?iso-8859-1?q?yMwQDPYIJqE1OgH4yjDNq/mAX+dyVjdzUTnnPI1V3a3GyfQinbD1SBCsV61i?= =?iso-8859-1?q?FEjSVbMyBMKRgbYMRZ67TjAv/niooupSUsoMjHBkCGMMxmNavD/54zfve5F3?= =?iso-8859-1?q?4LC9DIvmRGWCrmffHCZURgV6WpiVNGz2DkBwVMF5cMpu1KlEDKmBUl8zGV1t?= =?iso-8859-1?q?tu1n/bribYiPJXq5phm7+KLhzPVAoheQxwlXlT1pHQmxWhRXNtxvQiUC9c0s?= =?iso-8859-1?q?zCdZx6UrCi/8Y8VB2kLycJb7+LRnq3T2W6sbclsXBG8CktnxYdS5jqBnilMN?= =?iso-8859-1?q?D1WecSsZxlezD6kl0cPtG1kKNGCSqHGF5+Np3JqxcbVXFHQW8qAHSvVxVFI/?= =?iso-8859-1?q?hhOHHSgsHje+bh06Dymui7Ax0x7uaA9Uyt3K//dHDFG3EFWKKCt45Py4NUNu?= =?iso-8859-1?q?Q9Y/lJZ5WSzJeSu1JtswNL0ILckEsqWQoFMnQZnVSUk40SCXh3uYay1A/ln7?= =?iso-8859-1?q?bil7Yql6Onc+AV6lDUy90lPuaHzc+tHUNqYG2O1tj0l0RVmeUuwvY0yynvxP?= =?iso-8859-1?q?loK/tq3ZqBHzYDwCy6+mhqdrPtWIHpI1hAFhi2pPMwTyMjAv3OlQzYj7EgnJ?= =?iso-8859-1?q?Z4H88USIax439ZfMy+sEA+H+vgmXAVnr/RXdXyns0/6PGsKr/g8Y7cGaxxTy?= =?iso-8859-1?q?kJM1dH9SG7AGMmCfwyJVyNAXWQzX3D81aK4LsGM4yhKqtt0JaGRmuJPpRiSp?= =?iso-8859-1?q?gggTdfMio8ZYaTKx7I2HpslrG/XkWYxLFXRkdlncrgKo3NXrmCSplHVxeU0s?= =?iso-8859-1?q?MkmOnMtACGw0MFKxq+Lb2+S10RjPdqqanKp2z0XGNzeVk2F+o3TPu89/rnM7?= =?iso-8859-1?q?zJhL/kfRjcC7DhmIi1B0kXqo2OXN9RTpgrKzjgoelsaUi/Vk5qkZ3FcagHC9?= =?iso-8859-1?q?C2LURP0xjwclcGZmBQBtRXJg6zXWBsQZC3/UDulRtLh1OyRYzzOp6FasxCyz?= =?iso-8859-1?q?oqIKso4gjRRmk2OUJ9RW5qRl1Uis3hkHD0uC8hd3EEy3ubm2UnSWtorvARNM?= =?iso-8859-1?q?uaY8ThtiOB4jONaunP5RodeaHWipioNkUnWJxajUGoxlIW+zm0KjJu33Tb3a?= =?iso-8859-1?q?SmLGM2rEO+Q6BT5B4QyGkfZCfXfw6zLvT6ZvmbG0L/BjobbUXGvsR0NkuZeR?= =?iso-8859-1?q?aoBQN0dXVxORgWyyGf8xckeh9y+Mfby8kau+hc7j5BMAEeZyRhF5m4y0R/sD?= =?iso-8859-1?q?di3aMv5fyU8J8QCnLhOumimDPwpBKYuXTU+0cXyPT5SBelvx/sQI9IYi+MvV?= =?iso-8859-1?q?uPNG9LgKLpr5KwXkaMQjrLsUJTnXc8XpV6OsZYw=3D=3D?= 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: PWdeFQ/aDG3R9duIx55NLYHFOkF5M+nAX93sR+m+vCsr/9n3i2EBOKevktDWATH9Z9lDU7Ryx9Tls20QFF8DK/3XwaADeXczDAzoDzSjIUb3yxKLkxPn3Ik7i9vU0xRecgDP3q6WhMHToi3KmKvNZkaCw6Zrbtt9VIQj/spNDnysDghlA+qozY+e6vjlxer9HbYreu/cqhqllP5gpfpY/NmSaneZKwgBUMVzHvRKQ5+7p8kq7hz9y5ZV0WbF+E6bIZMM/VCk6LzUbODdL8XIoxE138O3dKF2o/5ltprsp1lJUiSYqGJmlUgNu1qm+tGVEDtMP04cE0gMtU+YNcgtYRnZ64x+jh7HBeu68ZJbI8o9kqIPfypc7Qj2wJrzHtfyHANq7JzU5WWPDD7iIdDQFNv+AVMYLROCN+pvm1DSvTX7Ivrk/pwaXTxk6XqidfxVPhxOJNkC24pS9C2aL2BXIRNGVKDi2F681cwdaiGY650XGoWJKhqIEX72nTelXZESSMRM5n+dwSG8ThawH45xRwS1V1mNfTeZi7EjGy2kzfXAF10a1uakvA9VoGikDLS3Iaqe1isxCe3x88Xi4knjAYS1PVawk0SI6mpCgYldEHIGq/kPrCts3/vCA0VpNhOR9eJl0sCm7nh/YKzOsqpMxQ== 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: 218d645d-814b-4e4b-5c9d-08dd197b53ce X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:32:43.4129 (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: NNByvbLIVWACrCE9CZdt33zvll7ss07CEgka8s+fvMy22aMKNbpUAgAISjk1v3IiflySamUjxSGiVpxHgeGl5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7635 X-Authority-Analysis: v=2.4 cv=Z9YWHGRA c=1 sm=1 tr=0 ts=6758ddb0 cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==: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=jIQo8A4GAAAA:8 a=TH2HjKJD5bRpUVrW1iQA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-ORIG-GUID: 7zAkdcjPjJ2HbHXkHpn1--I4O96J-JY6 X-Proofpoint-GUID: 7zAkdcjPjJ2HbHXkHpn1--I4O96J-JY6 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=1015 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 We can handle multiple commands concurently. Each command services a stream id. At the moment, the driver will handle 32 outstanding streams, which is equivalent to 32 commands. Make sure to allocate a matching number of commands to the number of streams. Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 107 ++++++++++++++-------------- drivers/usb/gadget/function/tcm.h | 10 ++- 2 files changed, 61 insertions(+), 56 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index a594ed1359fc..a3e886294c40 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -50,7 +50,7 @@ static int bot_enqueue_cmd_cbw(struct f_uas *fu) if (fu->flags & USBG_BOT_CMD_PEND) return 0; - ret = usb_ep_queue(fu->ep_out, fu->cmd.req, GFP_ATOMIC); + ret = usb_ep_queue(fu->ep_out, fu->cmd[0].req, GFP_ATOMIC); if (!ret) fu->flags |= USBG_BOT_CMD_PEND; return ret; @@ -136,7 +136,7 @@ static void bot_send_bad_status(struct usbg_cmd *cmd) } req->complete = bot_err_compl; req->context = cmd; - req->buf = fu->cmd.buf; + req->buf = fu->cmd[0].buf; usb_ep_queue(ep, req, GFP_KERNEL); } else { bot_enqueue_sense_code(fu, cmd); @@ -297,8 +297,8 @@ static int bot_prepare_reqs(struct f_uas *fu) if (!fu->bot_req_out) goto err_out; - fu->cmd.req = usb_ep_alloc_request(fu->ep_out, GFP_KERNEL); - if (!fu->cmd.req) + fu->cmd[0].req = usb_ep_alloc_request(fu->ep_out, GFP_KERNEL); + if (!fu->cmd[0].req) goto err_cmd; fu->bot_status.req = usb_ep_alloc_request(fu->ep_in, GFP_KERNEL); @@ -310,27 +310,27 @@ static int bot_prepare_reqs(struct f_uas *fu) fu->bot_status.req->complete = bot_status_complete; fu->bot_status.csw.Signature = cpu_to_le32(US_BULK_CS_SIGN); - fu->cmd.buf = kmalloc(fu->ep_out->maxpacket, GFP_KERNEL); - if (!fu->cmd.buf) + fu->cmd[0].buf = kmalloc(fu->ep_out->maxpacket, GFP_KERNEL); + if (!fu->cmd[0].buf) goto err_buf; - fu->cmd.req->complete = bot_cmd_complete; - fu->cmd.req->buf = fu->cmd.buf; - fu->cmd.req->length = fu->ep_out->maxpacket; - fu->cmd.req->context = fu; + fu->cmd[0].req->complete = bot_cmd_complete; + fu->cmd[0].req->buf = fu->cmd[0].buf; + fu->cmd[0].req->length = fu->ep_out->maxpacket; + fu->cmd[0].req->context = fu; ret = bot_enqueue_cmd_cbw(fu); if (ret) goto err_queue; return 0; err_queue: - kfree(fu->cmd.buf); - fu->cmd.buf = NULL; + kfree(fu->cmd[0].buf); + fu->cmd[0].buf = NULL; err_buf: usb_ep_free_request(fu->ep_in, fu->bot_status.req); err_sts: - usb_ep_free_request(fu->ep_out, fu->cmd.req); - fu->cmd.req = NULL; + usb_ep_free_request(fu->ep_out, fu->cmd[0].req); + fu->cmd[0].req = NULL; err_cmd: usb_ep_free_request(fu->ep_out, fu->bot_req_out); fu->bot_req_out = NULL; @@ -355,16 +355,16 @@ static void bot_cleanup_old_alt(struct f_uas *fu) usb_ep_free_request(fu->ep_in, fu->bot_req_in); usb_ep_free_request(fu->ep_out, fu->bot_req_out); - usb_ep_free_request(fu->ep_out, fu->cmd.req); + usb_ep_free_request(fu->ep_out, fu->cmd[0].req); usb_ep_free_request(fu->ep_in, fu->bot_status.req); - kfree(fu->cmd.buf); + kfree(fu->cmd[0].buf); fu->bot_req_in = NULL; fu->bot_req_out = NULL; - fu->cmd.req = NULL; + fu->cmd[0].req = NULL; fu->bot_status.req = NULL; - fu->cmd.buf = NULL; + fu->cmd[0].buf = NULL; } static void bot_set_alt(struct f_uas *fu) @@ -461,10 +461,14 @@ static void uasp_cleanup_one_stream(struct f_uas *fu, struct uas_stream *stream) static void uasp_free_cmdreq(struct f_uas *fu) { - usb_ep_free_request(fu->ep_cmd, fu->cmd.req); - kfree(fu->cmd.buf); - fu->cmd.req = NULL; - fu->cmd.buf = NULL; + int i; + + for (i = 0; i < USBG_NUM_CMDS; i++) { + usb_ep_free_request(fu->ep_cmd, fu->cmd[i].req); + kfree(fu->cmd[i].buf); + fu->cmd[i].req = NULL; + fu->cmd[i].buf = NULL; + } } static void uasp_cleanup_old_alt(struct f_uas *fu) @@ -479,7 +483,7 @@ static void uasp_cleanup_old_alt(struct f_uas *fu) usb_ep_disable(fu->ep_status); usb_ep_disable(fu->ep_cmd); - for (i = 0; i < UASP_SS_EP_COMP_NUM_STREAMS; i++) + for (i = 0; i < USBG_NUM_CMDS; i++) uasp_cleanup_one_stream(fu, &fu->stream[i]); uasp_free_cmdreq(fu); } @@ -582,7 +586,8 @@ static void uasp_status_data_cmpl(struct usb_ep *ep, struct usb_request *req) case UASP_QUEUE_COMMAND: transport_generic_free_cmd(&cmd->se_cmd, 0); - usb_ep_queue(fu->ep_cmd, fu->cmd.req, GFP_ATOMIC); + usb_ep_queue(fu->ep_cmd, cmd->req, GFP_ATOMIC); + break; default: @@ -697,7 +702,7 @@ static int uasp_send_write_request(struct usbg_cmd *cmd) return ret; } -static int usbg_submit_command(struct f_uas *, void *, unsigned int); +static int usbg_submit_command(struct f_uas *, struct usb_request *); static void uasp_cmd_complete(struct usb_ep *ep, struct usb_request *req) { @@ -707,7 +712,7 @@ static void uasp_cmd_complete(struct usb_ep *ep, struct usb_request *req) if (req->status < 0) return; - ret = usbg_submit_command(fu, req->buf, req->actual); + ret = usbg_submit_command(fu, req); /* * Once we tune for performance enqueue the command req here again so * we can receive a second command while we processing this one. Pay @@ -716,7 +721,7 @@ static void uasp_cmd_complete(struct usb_ep *ep, struct usb_request *req) */ if (!ret) return; - usb_ep_queue(fu->ep_cmd, fu->cmd.req, GFP_ATOMIC); + usb_ep_queue(fu->ep_cmd, req, GFP_ATOMIC); } static int uasp_alloc_stream_res(struct f_uas *fu, struct uas_stream *stream) @@ -745,24 +750,24 @@ static int uasp_alloc_stream_res(struct f_uas *fu, struct uas_stream *stream) return -ENOMEM; } -static int uasp_alloc_cmd(struct f_uas *fu) +static int uasp_alloc_cmd(struct f_uas *fu, int i) { - fu->cmd.req = usb_ep_alloc_request(fu->ep_cmd, GFP_KERNEL); - if (!fu->cmd.req) + fu->cmd[i].req = usb_ep_alloc_request(fu->ep_cmd, GFP_KERNEL); + if (!fu->cmd[i].req) goto err; - fu->cmd.buf = kmalloc(fu->ep_cmd->maxpacket, GFP_KERNEL); - if (!fu->cmd.buf) + fu->cmd[i].buf = kmalloc(fu->ep_cmd->maxpacket, GFP_KERNEL); + if (!fu->cmd[i].buf) goto err_buf; - fu->cmd.req->complete = uasp_cmd_complete; - fu->cmd.req->buf = fu->cmd.buf; - fu->cmd.req->length = fu->ep_cmd->maxpacket; - fu->cmd.req->context = fu; + fu->cmd[i].req->complete = uasp_cmd_complete; + fu->cmd[i].req->buf = fu->cmd[i].buf; + fu->cmd[i].req->length = fu->ep_cmd->maxpacket; + fu->cmd[i].req->context = fu; return 0; err_buf: - usb_ep_free_request(fu->ep_cmd, fu->cmd.req); + usb_ep_free_request(fu->ep_cmd, fu->cmd[i].req); err: return -ENOMEM; } @@ -771,26 +776,22 @@ static int uasp_prepare_reqs(struct f_uas *fu) { int ret; int i; - int max_streams; - - if (fu->flags & USBG_USE_STREAMS) - max_streams = UASP_SS_EP_COMP_NUM_STREAMS; - else - max_streams = 1; - for (i = 0; i < max_streams; i++) { + for (i = 0; i < USBG_NUM_CMDS; i++) { ret = uasp_alloc_stream_res(fu, &fu->stream[i]); if (ret) goto err_cleanup; } - ret = uasp_alloc_cmd(fu); - if (ret) - goto err_free_stream; + for (i = 0; i < USBG_NUM_CMDS; i++) { + ret = uasp_alloc_cmd(fu, i); + if (ret) + goto err_free_stream; - ret = usb_ep_queue(fu->ep_cmd, fu->cmd.req, GFP_ATOMIC); - if (ret) - goto err_free_stream; + ret = usb_ep_queue(fu->ep_cmd, fu->cmd[i].req, GFP_ATOMIC); + if (ret) + goto err_free_stream; + } return 0; @@ -1060,10 +1061,9 @@ static struct usbg_cmd *usbg_get_cmd(struct f_uas *fu, static void usbg_release_cmd(struct se_cmd *); -static int usbg_submit_command(struct f_uas *fu, - void *cmdbuf, unsigned int len) +static int usbg_submit_command(struct f_uas *fu, struct usb_request *req) { - struct command_iu *cmd_iu = cmdbuf; + struct command_iu *cmd_iu = req->buf; struct usbg_cmd *cmd; struct usbg_tpg *tpg = fu->tpg; struct tcm_usbg_nexus *tv_nexus; @@ -1113,6 +1113,7 @@ static int usbg_submit_command(struct f_uas *fu, } cmd->unpacked_lun = scsilun_to_int(&cmd_iu->lun); + cmd->req = req; INIT_WORK(&cmd->work, usbg_cmd_work); queue_work(tpg->workqueue, &cmd->work); diff --git a/drivers/usb/gadget/function/tcm.h b/drivers/usb/gadget/function/tcm.h index cf469c19eaca..cd8d06419d5f 100644 --- a/drivers/usb/gadget/function/tcm.h +++ b/drivers/usb/gadget/function/tcm.h @@ -16,6 +16,8 @@ #define UASP_SS_EP_COMP_LOG_STREAMS 5 #define UASP_SS_EP_COMP_NUM_STREAMS (1 << UASP_SS_EP_COMP_LOG_STREAMS) +#define USBG_NUM_CMDS UASP_SS_EP_COMP_NUM_STREAMS + enum { USB_G_STR_INT_UAS = 0, USB_G_STR_INT_BBB, @@ -24,7 +26,7 @@ enum { #define USB_G_ALT_INT_BBB 0 #define USB_G_ALT_INT_UAS 1 -#define USB_G_DEFAULT_SESSION_TAGS UASP_SS_EP_COMP_NUM_STREAMS +#define USB_G_DEFAULT_SESSION_TAGS USBG_NUM_CMDS struct tcm_usbg_nexus { struct se_session *tvn_se_sess; @@ -75,6 +77,8 @@ struct usbg_cmd { struct completion write_complete; struct kref ref; + struct usb_request *req; + /* UAS only */ u16 tag; u16 prio_attr; @@ -116,14 +120,14 @@ struct f_uas { #define USBG_IS_BOT (1 << 3) #define USBG_BOT_CMD_PEND (1 << 4) - struct usbg_cdb cmd; + struct usbg_cdb cmd[USBG_NUM_CMDS]; struct usb_ep *ep_in; struct usb_ep *ep_out; /* UAS */ struct usb_ep *ep_status; struct usb_ep *ep_cmd; - struct uas_stream stream[UASP_SS_EP_COMP_NUM_STREAMS]; + struct uas_stream stream[USBG_NUM_CMDS]; /* BOT */ struct bot_status bot_status; From patchwork Wed Dec 11 00:32:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902646 Received: from mx0a-00230701.pphosted.com (mx0a-00230701.pphosted.com [148.163.156.19]) (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 B9CE12451C7 for ; Wed, 11 Dec 2024 00:32:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=148.163.156.19 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877179; cv=fail; b=JShZY/NCZE1b/NJETSeJmZklbFOafkv2A3yeI00Y5BEsBgtABH4JWp0X6rsT2UwUELgyiKHquO9i+KAaf/bygw3K9YUfS4eYCBnOTZHw+CERad+aONGwl33Swtn0CNU7PeYp6olRtsdjqtdRJGsrpnkpECqYUutd5wmltBauVPo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877179; c=relaxed/simple; bh=RcOeBBBwWqfy4MYs+arpbL0+7CgUK/nt+yElenYYZPw=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=Ri7sQ0ADMboCr7HwzIVKwHklo6IGvEvwGlbxftnSlt5GaBh+KuBxIGQlYO6A/FAfbJmai3+S9GYxn5aTAnFZZlVJcAn/X7HP0q4fkHUrvWDaCiLNshE6IDUDyrzJa+tpJJwXnS9rGx1FKDIy4PqhjzAJQGMu6kvT0pAOLGszKYk= 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=sQAudNzU; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=XwOna5Vw; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=avcYYO6q reason="signature verification failed"; arc=fail smtp.client-ip=148.163.156.19 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="sQAudNzU"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="XwOna5Vw"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="avcYYO6q" Received: from pps.filterd (m0297266.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BAMb3Ws010915; Tue, 10 Dec 2024 16:32:53 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=80tY0UKMjAO4raiEbQV8Vm6524cZE04pqCa5DqkOm1Y=; b=sQAudNzUYGGz cC8koNnMB3OWk0GN8bahtf+5kZBCqnVPniEVraLtMoRWlmouz+bz86IxY4Wtxgon cige2IjX7ES2EXdQRB8a1gmr4/1xBgrUBL9s0ywzn8heEczMIRg2GAzLZP3ZNrrU pR3O/57bC5Oeik8lGAPEpTFELSDpRLJbV0EjZQX7CCMOOsSp91aQ80xWqurfnC6Z EUxazk8AGFXShNL6MYR54b73jGVAmdtYEeBoB1qZrzudKpmgpsHe1QNi3tg17gyg VKIxoQQ5bUG6jkRHlh3YalufUdmhETqN4iw6RqotjJDZkEHmxRIoXI76b75aIncf yhIAI3Fbqg== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 43cpgb9px4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:32:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877172; bh=RcOeBBBwWqfy4MYs+arpbL0+7CgUK/nt+yElenYYZPw=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=XwOna5VwkFGK0lzckHLGzszE7I4epSOh7ZIJRgcgWGsfrDZPLfJYNewv8zlNtBXJf vtfuYcWHdvD8s+TycTurwaCJdZnhIY6v9GyevxUk+++ektS+GSYi+Z/VRTI34WzbXJ yPWLSkqhNQZfDiQ1ycXlb9OdjrdNbcRGhXuYrASFZYb/yGi77QPqoFU4WN3qN2Ua3v rN6egs7ZuSlVD7Vpp4xIqE5HBcXUKm+h1wW3oRmMqvdskfbX3YJcMfMPzDditydyxf Tsp6cCZqw2uNyjvp9lcMKphTe6lzM9Y5sGdPBnDTabs0FrAPPWQ3EfzO+au2idheUo USADNr8egiRRA== Received: from mailhost.synopsys.com (us03-mailhost2.synopsys.com [10.4.17.18]) (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 6268240175; Wed, 11 Dec 2024 00:32:52 +0000 (UTC) Received: from o365relay-in.synopsys.com (sv2-o365relay1.synopsys.com [10.202.1.137]) (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 4BDADA008F; Wed, 11 Dec 2024 00:32:52 +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=avcYYO6q; dkim-atps=neutral Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2042.outbound.protection.outlook.com [104.47.56.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id 10ACE4052F; Wed, 11 Dec 2024 00:32:52 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xJM7dg3RsCCMT/epTaSZ8M4t+S/Jmn7MS496RMG1st7/zsVx12QH3mO+F2Uqs70Hcd/E9IAYtAK7uz0VnuUJxEmwwbAIygB66jdDqyHO5zqun8nW38Ga+17iL0+WHFGo/0MNVXR70umxg1mJqAsNdpB0kTxQbJCc/kaXjcxwqjic+2p+2qqxPcoAZ4rDusjnzSh9KHtoqmm9hSuKuteKCGCB4+9oWZZZ7v65W8Etk2u8Aq/WQ54VxB0mS8IlE5q5E5ymyqY2dY257Cgv0mkKqksgCpigG4WPBiaSH9sHtwkDMc/ylrTz5aWJnBcgmW5hngxr0AMs/G/+wx77+lCeyA== 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=80tY0UKMjAO4raiEbQV8Vm6524cZE04pqCa5DqkOm1Y=; b=cqiacYd9xKRJCzMB/90+gIopEcBqMvw//TlUMEoiwi0ZGpJXcALC0ayOuNcHfMwZ8HQc9SXIo8vJcU5V8O1O27rerUg/hcIeyq+gwduYQerXhG2XTodHds2c5Inlzd/SZqM0QdkRUXDEGnAczL+Gb4pCHO+PnGO1lSdyDo1uH/2YNofU9NUdxADhcF1dncfErIzJzNrxw0GqLRETCQo/b4COwBZY9p3RevRQpRALsRE1kpsuSFfimZlSud/AkqTwAPynvas0+E0hX1ycsw//uQSpqj6bdlnAzFzqrf6KcnDn3n24NSrZVyTXWwbofozk1+qUwsg3r4dxpPf5fgsXAw== 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=80tY0UKMjAO4raiEbQV8Vm6524cZE04pqCa5DqkOm1Y=; b=avcYYO6q43JLBNKs+r+Hnnkzb+aPSauGV5dmkssMGc0XCfWc3A6ewJQmpz/07o6T2es42hL2Xn4CpkNuBLRcDEO2laJLnY6gkw7Xwg9MufK0qPNl2qpPn7h4eVOEYJHolnHG2pwyl/JNx2mfAq1We0un/tOXBl4fk+ccb2q0n14= Received: from LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) by CY8PR12MB7635.namprd12.prod.outlook.com (2603:10b6:930:9e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Wed, 11 Dec 2024 00:32:49 +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:32:49 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 13/28] usb: gadget: f_tcm: Handle multiple commands in parallel Thread-Topic: [PATCH v3 13/28] usb: gadget: f_tcm: Handle multiple commands in parallel Thread-Index: AQHbS2Q07f1OVqmN5E6uNHSroA3rsg== Date: Wed, 11 Dec 2024 00:32:49 +0000 Message-ID: <933cf7191b672bf4cfbea4df19af1b08dc1baca9.1733876548.git.Thinh.Nguyen@synopsys.com> References: In-Reply-To: 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_|CY8PR12MB7635:EE_ x-ms-office365-filtering-correlation-id: d794403f-920c-4c05-bccf-08dd197b575a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?zxbJJYjWLy8zJb700nisydwjci?= =?iso-8859-1?q?PIMoLOKJdcksDzRnvdaHLLC+FwZ1delDUjHFMHSEx7RTki0vC1/SsCx4Tin6?= =?iso-8859-1?q?kmh7XSCC1Vk3Y5L7WJ0ceUN+kWM4CSa7zMThZ/piK2kWEiqCAPRbdw4Fjr4B?= =?iso-8859-1?q?XDc3om6OjUgQxyd5Jl94uFGK36i/r3hvEWBVJ4iEhHbNhne0eNtM4dz8O0E9?= =?iso-8859-1?q?7cOYDUX/GFva2pdqsjuiHclUtSlY8xLPN+N5Y3N5JMtU2zsg66792JrzuSRz?= =?iso-8859-1?q?Zpe7d32I1CtZYWg9s3T29/HZjb3E3u15twC0aJYCACC5LeUYCLAZc3zGebO2?= =?iso-8859-1?q?1tCA2uA3s+Rs8+hUq2uY4iebmbFtFdIn9WTdIMD1DNrJC9fJ7izgr0+1V3j+?= =?iso-8859-1?q?XkjGQHo8brThL4TvSMUDOWRGGSgkP++P2NjaWSXH8IbzXDXd9wu9NFTyWsN5?= =?iso-8859-1?q?aVfn2vJWCBrAKXkflO7UsCekAo81X+Yd3+OWH9JuMvTAI2c6hOnUiG0rMcTn?= =?iso-8859-1?q?lyDAPmMmoQCKEmc774xA5JTn6dZQLKFVtmZvdHSohNmPxzNSwBXQO9KKQrGI?= =?iso-8859-1?q?SP3aGHLmL2GR6eJt1v78EAl2pXjTHqiVK90KbAy0EjIHJH+hvBmL/NtB6mpv?= =?iso-8859-1?q?AGqFTY0c0lllVWmCXdpkXxZMcBjuSi9EcqcNPuXVLcxAqPS9biTrI2uAFQLg?= =?iso-8859-1?q?7ryvOaT/cm80a5ltkpE5UhqcUAlYejZhOJNCrpHwB+eaEzj6/zN8DJ3UEQ2k?= =?iso-8859-1?q?MGrjl7B89gB9/V8uxJQMenvzYdJd22nbVG0xpZZ2HboYGchqsIG2ls5vI/Zx?= =?iso-8859-1?q?B9ZLRxS1i2Ub6ZPrEum63NyUQyMY9sVBLIIunqYtdj/24u75IpvCSOUqrp3E?= =?iso-8859-1?q?S5okmZqHvWP2UMRg48Md5zhMkGvk6NFFUFZnBo4jbcwkHN7Sfrxm64JvtM9O?= =?iso-8859-1?q?+NaovBg488gFjNl0KXp3eoG42ccGYNx29Rs3a8uy+irDhshC5XAjrxzpQkb+?= =?iso-8859-1?q?TsLtaEn15ZSCOKaAj1FW10O2k5v191k3hCEvMdsP/T6JXXsPSPv2HXBsHuKs?= =?iso-8859-1?q?VGlJfz52noeo0IvLPXD2QirSv+dLZrZmhFtMLXe15jWLT1JN4f4ONjaJpzRK?= =?iso-8859-1?q?xvu0HtdzfJSvBdUNqWzjp2lOSaajgijIBV4FIaxlot84ZRZ9Wy1hcne62z4C?= =?iso-8859-1?q?AkCXA9EV0H7s4xwDZqMkbMpjgjbCjKfEp2bPwycL2B2KCxCST55ZRYxe7lyu?= =?iso-8859-1?q?3tTwRVPGltmYovG6gCa2Y/2GevbAmd6uWZi68wMSGAlTnusajPcp4A0vh4+H?= =?iso-8859-1?q?TW8SCwO0ZNFdNwEJEJ/jS+9HADCsNh9oys3eb1WWjIs3EhUfomHw+xRTxQS5?= =?iso-8859-1?q?Ed0yJI6s7hBNWOp12OdMLsNsVkaeRSMEp8ZMeZIBeypiqg76QlLWPsGsSGst?= =?iso-8859-1?q?DGIs6xWkEJLuwAUjl5p0Nekg=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)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?TUMlI4YUcnv250YGR0VRl6c?= =?iso-8859-1?q?wFGIFqyiMjRrMGDg4Eq6sJxougwogsjnL8gpoZi/mpxhfh2+FYjs3/m4k7jU?= =?iso-8859-1?q?Sp2SD+X9d/zOqcrSEjJ4uEvuPR1Z7SKcmMmqB/j5Z2bjQ9yaw98YnrDptubu?= =?iso-8859-1?q?zGgw2vGRVl74n3N8UDMkSdOcYN5AR5sNHqlnqVr0HCUsE+lqx9RRwGrt7Bj/?= =?iso-8859-1?q?azphv7oWy/JhPCXginhXJJdLzG4+uMOG5Y9RKITendk4XsNuL4BurNOTg9XI?= =?iso-8859-1?q?IDHVli7DlB2K2Q5fcrENZAAMPA4cC3yLnvAVGstwu5ouU2NoIC6exqCA6Tbs?= =?iso-8859-1?q?j2hw0jCAcOsS4/YrP8elvwIJMisMuV8pA1LN3E18akTzdrjZ0GgbsPQ2UeNO?= =?iso-8859-1?q?OMo+02jba8mPDj9YWhkhGbNtWRnRJqUnxjroQOfCo3nnMVMk4e7Mt9yDxRP/?= =?iso-8859-1?q?QKC5bWhy3GLB/jdNbMomsIEOFg4WEPm0dBgNqrr3lIY71emZs4wwTgu2H203?= =?iso-8859-1?q?WcSazx5n1uWOrcdCX69sGiIYgfS+h6Wjkw+wMOmNbk0SgufdJeSxs31zTtOW?= =?iso-8859-1?q?Nt0YHv4FsvEHY84IL2wRQ4cWC9ROGTf+7EFjJu97ZNgoyfXRRbIxD/2UnM27?= =?iso-8859-1?q?LdZGZzF5IUBC+W/b9bYWy9UAwfBMIBko7oJiosR62uMUmbedJp7jKRXQoBLm?= =?iso-8859-1?q?brCA1va8y8d/Sbwx0b3LVr32v2GFGT1UFpZvYGjxxH+FmgBmqsaB352phUBs?= =?iso-8859-1?q?yiqhURkLK4ve4Y/0TFp3vMECCIC45L9azX3Fa97hg5T/RTHPIH3ilwEA20go?= =?iso-8859-1?q?zKzNOLMVBN2neI0zsJ1Xtege+Gk6O/G7mqMa2z7xPe9LGtZuRfFI8Zsu4o3Y?= =?iso-8859-1?q?LQoa+IFLsUG7kanS9OMuScYeD4XPXcGrjWeu79CM3Z5YFfnMVY3EnuxWvu7/?= =?iso-8859-1?q?0mMlY6yBn7/XAGGLcUBC5KDVgVS87pWODFTCfUvB0A8cjSf1L7V9XZs4Kqcs?= =?iso-8859-1?q?htrF/rN3pg/kPoAhLLHGMDDz0Alti1u6GFO3X5GsV/EfYKPfrzA/t3/8vYkx?= =?iso-8859-1?q?sMyZZI8XnKy46eAsTF7clTbVZ76Zb81fYdirnMWViF8gl5VZAD/ZTuxvmGls?= =?iso-8859-1?q?oWFpaYPNAcpCFLbp65LJBlvHXiQXgQ0rIxLL+UDA2faGR/S0AIjWY1O4Msl9?= =?iso-8859-1?q?H+LONnXZ7TtqWLJNNa7XNRtpVg+h0WRU7oooBj6tAHr7XslGmUuod0sx+Hkj?= =?iso-8859-1?q?UldU/fXQxrvJbKdPz+G95EOAD1fSESGAbvGhOfn71u/jUaUZdy+2YOFe5spW?= =?iso-8859-1?q?jUD1Mq7hmMqSEgPv41Jd3HF7f4nXZs44yq8MAyYpPJkLGTqsvq757e6h+tYw?= =?iso-8859-1?q?RiMOX7/kbx2mVAl+S62RtQxPnYSX0KxB71PD2WZM3IX8DH1aF+hwekGGPQ/y?= =?iso-8859-1?q?NkmnNbm0wWvgiIp9xQlLR/oy5KcvDRah8xMK+IPAK4L7h8g0vksKSgKB1GNN?= =?iso-8859-1?q?qeBliulnm3EDHaaGuz4IEHFvTDXK4dWm5hyA0lrJvZJXTZXVEYkibxyTkBd7?= =?iso-8859-1?q?0M7+Akqg73IVwCtTZAUW9s97HcW4FwIfVmveEci32ZLBzdJhf9NQlewLyauO?= =?iso-8859-1?q?AvQ3i87dfCKHmIT5Z+9FDDUfm27IA2lOzwxq8Ag=3D=3D?= 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: +JZaIbBb0BY6Z2muCUkS3XJVOeFKN6+UY2op0eoXF1Ru+t4VLuBYpS2f5gGkbKPOkxuWbMRB27MFLvaNpbP5+v/+J7JjcHjhmXSdyHKSNrVoyK4oEj5NmBPoOQLvPUrdhi9FQNZoZLcnMcTb9UeHAGhnAbG445Rr6xJt39ND8htpuQGsAPfWJZaA5YRk72QQaqFl+yn1eaSja6DomJ/mGRKMsodvWAanxxbqAxa5YhVY9X5cvU7VuJmg4HuMehh9zY2Zxq6AqeYx42lvm2bNQACApPko5Q6ZYp+n2l4MP/IOIHBzvha1BvWqaejG/cezL8g1T+LsraNR3WcDOuh+1VBYIwhCzWXYtD4hN85kL9mvz8QCWTeYnLD6hWMTGi03mhsuUAFFTXTNyhAEf+kyut3PX5/hBWzBu/3B0nrPqx0w86iZ5aakgL4rcvNqR+rslXC8bO9RoTvDc4kPawIW+UWLimwa49JvB9w1l0Ukx80VAbsr0xfVZkdPX6tt4ZacOOXMWlqT9qGb6WTxtSV/TNNVcGo6N3nO02tLBFA030hI0KK+/DkegZCXeoMtmXOFbm4brI8gwdWzSNC/WQc7R52IRzee6YiqFxaDZmaaCvtd8u9JC10koRcT2F5XutHB5MtrwnpwUWQklh/o/Pjx9Q== 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: d794403f-920c-4c05-bccf-08dd197b575a X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:32:49.3646 (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: fGxokrtLX1Ir+R3H3jw6D5U3FC35mnMHEH57DljD5x7R3SCQJzTGKd5DUx+z7HD/UxNHbsLoUyMoJWx5twbDHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7635 X-Authority-Analysis: v=2.4 cv=d+8PyQjE c=1 sm=1 tr=0 ts=6758ddb5 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=jIQo8A4GAAAA:8 a=gXydJFn6WctpvZIEjKcA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-GUID: QpXg3O8t_Tg2YLbDfHn1kg54ccKYDyA_ X-Proofpoint-ORIG-GUID: QpXg3O8t_Tg2YLbDfHn1kg54ccKYDyA_ 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 mlxlogscore=999 suspectscore=0 spamscore=0 clxscore=1015 adultscore=0 phishscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 mlxscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110002 Resubmit command on completion to fetch more commands and service them in parallel. Increase the number of work in a queue. Each work will be for each command allowing them to be processed concurrently. Also, set them to be unbounded by cpu to improve performance. Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index a3e886294c40..50e6a41aaa82 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -707,21 +707,16 @@ static int usbg_submit_command(struct f_uas *, struct usb_request *); static void uasp_cmd_complete(struct usb_ep *ep, struct usb_request *req) { struct f_uas *fu = req->context; - int ret; - if (req->status < 0) + if (req->status == -ESHUTDOWN) return; - ret = usbg_submit_command(fu, req); - /* - * Once we tune for performance enqueue the command req here again so - * we can receive a second command while we processing this one. Pay - * attention to properly sync STAUS endpoint with DATA IN + OUT so you - * don't break HS. - */ - if (!ret) + if (req->status < 0) { + usb_ep_queue(fu->ep_cmd, req, GFP_ATOMIC); return; - usb_ep_queue(fu->ep_cmd, req, GFP_ATOMIC); + } + + usbg_submit_command(fu, req); } static int uasp_alloc_stream_res(struct f_uas *fu, struct uas_stream *stream) @@ -1309,7 +1304,8 @@ static struct se_portal_group *usbg_make_tpg(struct se_wwn *wwn, goto unref_dep; mutex_init(&tpg->tpg_mutex); atomic_set(&tpg->tpg_port_count, 0); - tpg->workqueue = alloc_workqueue("tcm_usb_gadget", 0, 1); + tpg->workqueue = alloc_workqueue("tcm_usb_gadget", + WQ_UNBOUND, WQ_UNBOUND_MAX_ACTIVE); if (!tpg->workqueue) goto free_tpg; From patchwork Wed Dec 11 00:32:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902647 Received: from mx0a-00230701.pphosted.com (mx0a-00230701.pphosted.com [148.163.156.19]) (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 C606C8494 for ; Wed, 11 Dec 2024 00:33:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=148.163.156.19 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877185; cv=fail; b=Kzow9pSp34TpelIBwWVp2bUkk+RmrTfonq4K5O/09CowZ+oaCLVajo8RQi1akKsoEVod+P94jbNAZpWIow6XoJf3Sf0YV6lwlmVA/mtf41lM+Rwy2aN5Tz1o7PU7b54wp50BSoPW31fcOJjMs4Gx1N3r5gW1+OtZzSoQ/UnHZ00= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877185; c=relaxed/simple; bh=0fx+SRMyzKxxo9CO5A76Ok9xSR5EnWE5hqDPm7nxU14=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=lQ779wg79/aSu1SHHdFE2ZmfcJZdXk+5N0YyMa5diYVtFIo3vK8zF3I3N0CXpZ8IPIFxYOOpA4RX41CWBDgmJ8nTpqXrxK3/YBU66AyA3KyU2Opf345UDNHbE6j0+yMPWsO0EIrK9jxZ5jOqFh16Uw6Bbd91M7JvIExHoi2zOLM= 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=LvV2akBx; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=Uw2IZSzG; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=OBhv+STA reason="signature verification failed"; arc=fail smtp.client-ip=148.163.156.19 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="LvV2akBx"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="Uw2IZSzG"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="OBhv+STA" Received: from pps.filterd (m0297266.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BAMVk5v010832; Tue, 10 Dec 2024 16:32:59 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=8Bv1tBnG1SyZ8ix4xy59Ksw+STI4cVhg+BbSg/TVKq0=; b=LvV2akBxIbF0 vCyhUihqkHfw4DECaPV73UZt4ibOhD+o7DvA3neFepIHrnjo8Eb25qxGOkSh5gTg SOs7rPYnSD5SHInf1gDk+vN+jUuPehjBwzbzFZ0VMZr93rt7R8icHr6OVLmmC7Db GHYZ/bbxmVgSzkYFF9y8aar7KTeZel1uDOftS3wsC1EDeGz6V2/ijJca+Jz6Ll7J ETJ4ZUR2xA9oCQum5snhaA0aUb7H65WDh+m4GncGlp4yHFe+KfhKj77HjioN3IcJ 4mPc5NnkV+yBQGj9PrRcqIXQq2FOUfInXlNrC2z8/OtPH9T7LpyJTZqe2rI/i1eO MqS726839A== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 43cpgb9pxp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:32:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877178; bh=0fx+SRMyzKxxo9CO5A76Ok9xSR5EnWE5hqDPm7nxU14=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=Uw2IZSzGe4ROXRmLLU7vkhMVl2Ic3JYoxL1O3vhGGo8/4IXE9U+fD6wovI95NWTuK z++x7yWPpJbhhfhwMkvgziNi33d4LDDU3194Yf9jCgGmu6RBM+7uZ8p08NNs44mENA CRxTC3e/zmAoM1/0NrndnT5BQRf7xYx6SctCSsGkN6uE333h4YnpzFcWoFHKPGLYop XjGQdjLuEgl6mK9PVjURLDDlcBlHnY0H5/lI4Xc6rRs4onfiI78hCUiOSk59u7ZSCx 2pxbkyGqSmFnhmK+SJvJ1mhUjhhJ0m/b9XzOWo3wXxPU6Cl79Ee6oXhn7iy/zu/A9t EUdNN/0kCRQeQ== Received: from mailhost.synopsys.com (badc-mailhost3.synopsys.com [10.192.0.81]) (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 AE62940593; Wed, 11 Dec 2024 00:32:58 +0000 (UTC) Received: from o365relay-in.synopsys.com (sv2-o365relay1.synopsys.com [10.202.1.137]) (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 7EDD7A0068; Wed, 11 Dec 2024 00:32:58 +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=OBhv+STA; dkim-atps=neutral Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04lp2177.outbound.protection.outlook.com [104.47.73.177]) (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 37F67401EF; Wed, 11 Dec 2024 00:32:58 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jKDW6C71p5ZLYS/K4NrdqOMgUkMNiR/RTtD21hwbqh3JuSPdksYn1xwgWWGOqME7SOqYZnEc0DRqfzLQ7Mw73SiuxD7XOnGCbOywpsYIdzMc0fa6p92kittaCrsGTUx4izL4bRn5up3ko2iVGCuOX1r4/hotonfaG7VVdsH/2diCcVhaV0tSHZYQ+Ce/DYDGr4xeJWEmOqTrOUE71iyX0G9n5iPejuGDazSvfcBMhEkmikfptHIqeNa9o3qYSs2zI1MwyF7zFHegETAXBn/p8JLPv6cxxx19s9BKxjHXGSC9ykP781p+1mYQrDuRVl1kSxjnUW41i8WECI14LHRppA== 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=8Bv1tBnG1SyZ8ix4xy59Ksw+STI4cVhg+BbSg/TVKq0=; b=ZVISBL1wBf8g60h4pP0zyAqQaLDDKBetYBmNJZoFKGqY5RDiL6PvaVDeoyYnWNZ29Af8BtjynXkUuL9NW3Tk8lmQwnD8eFJUX6t2l0Gn6Wrjy+I3epjO21klnFAXsj83d06r73ArCoeTq42j39VJIaIa55wC4uN+mWULPzScLASLhPIWksx6fDvTv7jIwpuYnXtdxgSrFpdZuIHl01hVKNpBdK1/g8ZOpbHpwcTpo6k/oEHacmhapZK4vrXYOeIoHTHM3CJEx7cOerNjPrhArF6esE3wHgZbJ5+Os68e7F4HN8yV2Gr9vnHoiQ+JkJpMieG4VLEd3R7U5tPZ8kLHCg== 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=8Bv1tBnG1SyZ8ix4xy59Ksw+STI4cVhg+BbSg/TVKq0=; b=OBhv+STAPKicYf/ObypjL9JVBaqCsqisigtZhV4ifkuTBoTVXyPlLRAjNEJoDpwkB2dB0sGE+4rLGGSTt46U3YIdu2EV0fWQuWCxc4zh+41reJH6KYBndRrMVjIJxpzYRchqZRcL4P4rw5PI7/OMirfiMnyzPFWY1VgimoFAhOs= Received: from LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) by CY8PR12MB7635.namprd12.prod.outlook.com (2603:10b6:930:9e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Wed, 11 Dec 2024 00:32:55 +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:32:55 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 14/28] usb: gadget: f_tcm: Use extra number of commands Thread-Topic: [PATCH v3 14/28] usb: gadget: f_tcm: Use extra number of commands Thread-Index: AQHbS2Q4FnDID5Kh7USAYQZK7+RvqA== Date: Wed, 11 Dec 2024 00:32:55 +0000 Message-ID: <256f2ec8f5e042ab692d9593144fa75f3d3ce94b.1733876548.git.Thinh.Nguyen@synopsys.com> References: In-Reply-To: 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_|CY8PR12MB7635:EE_ x-ms-office365-filtering-correlation-id: e31e769a-9b29-42ec-8e86-08dd197b5ae9 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?tykEZclPwwZ3B8Ga39muqaP6PK?= =?iso-8859-1?q?Lv4GyDGy7Gif31Ck3/43vHNb7Fv69tS68SqyLMGInmUFSB46Pm3RqVIii73J?= =?iso-8859-1?q?R0pEoh6e3MDbulN98sYC/vfQN5cWP3jd2jPFMty8+QQyXHhmAaiMg+axzWS2?= =?iso-8859-1?q?Humc/nsLChgbbFYcSuGJH5sIaUHgf/KmcY5fT1QbOR2N0Clpn99bcj1AW3Q/?= =?iso-8859-1?q?stA3AjjI1AwX0PrZGcpYYVOFGxcKtrtMzjwv64qaHB5R0dF3vAP9rpAsguho?= =?iso-8859-1?q?Bunwm8ZqTKMds9MS3C5XJUbMneQzlsOXs9gYJvbD4vjnVf11brJpSqZINmsQ?= =?iso-8859-1?q?0IBvHoBnvw1AC+bPoA+EJtzoRNbN7Au3BK1tsMCazrpj5a6bNqdyeUlwM67Q?= =?iso-8859-1?q?H+0F6sJM6N7kb7phoUEY+jrQelOw+PrUv2DQJJWdjLBKvX6kDvbwnxMw+KXb?= =?iso-8859-1?q?+jn0Cq4hJIGAi+IcGRr3KGBri2mYEIUpudOMu5NJ2205AlXgq6FyDxQVxSzL?= =?iso-8859-1?q?eU7QaF+zWAzWbMUj8uUfG7ld9m18zedy4OQFPebAA33u+D7NmwB0yAWLN5wp?= =?iso-8859-1?q?SfLCeUa0Ox8TL14Q1+dosMU3IH/2OaX7on/FmXP/AGuqgQbynO7oU7CAey21?= =?iso-8859-1?q?kpEjWE+VI+E805EKIDq7JTYG6wQO4AXMfFcYJRF4kkXUr2ZZ/G6Tpikp4Ny9?= =?iso-8859-1?q?992flqofHRMAXeVwbdgVWwPuE/+hisGP/dJvIwcIQCSvpyHh9nU2yr6C97aD?= =?iso-8859-1?q?sOgYCKi7Df4QpC3eGaQ5sJkScdpobihAvBgie7+kWMDZYbHZRU4V3VpaUOLa?= =?iso-8859-1?q?arPLXttzNXWgLQ6FdEllXD1rwBOmfn96PgnxUnNXw3+8zE4Tto8Xb9akoXWT?= =?iso-8859-1?q?KRv3NEWBRErwNDvBfMqJ6bCQAqinZl22GgfACOiu9BDjg8ioMhMrVeNQ08xW?= =?iso-8859-1?q?5e3uWc1CM7+l4eqJ5C2uin1lx+PBSbTHZRqQChw+kF3M6CXGc/RR+6NwTVi0?= =?iso-8859-1?q?ML5fZsSYYKx5objom7j8tA8FLagQhy7inPK71/AfTAiUuBj/P2NKrwuO3eSN?= =?iso-8859-1?q?LO6COrMru46YloyH04S5N5jBIoJpp34HLs06k6VvEGdTnMOtPsLb8tVbahgN?= =?iso-8859-1?q?Pr4mzuKPjV8WvadGrr15sDVrPpDN0VJCn828KHOdBVsWwRkLBv3fhH179cVt?= =?iso-8859-1?q?9md/ePVkwaDZJoie7kIQmGLmbT3vPit0VexFrwrDd3So2/CdI/RmJ3Rr6Afh?= =?iso-8859-1?q?ZefPoNCfgh5fpprxVnrZHDjyAWvOB6itME51+EIxb+Ej9kecgKVOYambVWbJ?= =?iso-8859-1?q?xr7mtmCPasNI4Mzi47BW3x9aRJoEl0aePdd77IbkLTVCYwqDw+qVfaC6veQE?= =?iso-8859-1?q?3QIKr+mSu9Bn09Q5AYAxhelig9mbtQgqq2kwaob4DLiwWulHh2LsTo1Qr/ij?= =?iso-8859-1?q?pBRDSSN0tquoEyVz50GOLiag=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)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?kiIu7/l6C1AONyN7un1ybct?= =?iso-8859-1?q?pxyE6oNX3Rfl4MkydcvWWpTzjvqsXh5Fqr/wngibindXPy7dHhcpW/vZC0tU?= =?iso-8859-1?q?SgdCowJa3HVZT6K3PZZS9RclKB1F7fRKZBhuYpaZUKkDns9pS9A6eE5Zr3Sh?= =?iso-8859-1?q?m8NSVD0dNrRGsWl1zEelYeTX8+FnfmC/sLFhufGOI2LFs36w3xh76S8EhG/I?= =?iso-8859-1?q?+RV5rkcIgswbpoGbCI6eIk0t6iPRae/fXe8T7e1gIGbmj4SqfE5T3qAXZ/df?= =?iso-8859-1?q?1AxulPeIHMD5ia4mucVZa0LWxqplGSvwbVd2RKqNWKxnDMYdigwCUsDW81GA?= =?iso-8859-1?q?DJKGld7i0mJWZsWkbhxSEUZM11jN1XQKuOIKDwyH7+QeaxdW6fa3+RePQbBb?= =?iso-8859-1?q?TL9pxxpdPQ3YqizDHHFtrB4aF1zG64bgEFpfQczQwYdtbBUyEqCuABBAQHBC?= =?iso-8859-1?q?sUo2+wc1UQFWUj4AZPoxaqljDDTWJR78ngC4x0Ef6U2IzPH4OpdC11dxpdpD?= =?iso-8859-1?q?iuu789HHuPCoIEoz5TeLNOsF/F3l1jPb3EPvKx+vW68x8FaC1VL4DI0iZVCo?= =?iso-8859-1?q?NcwVxpypI5XcOj8YkOCFzCWgN6jcjGdVv4D2gBt7RrIKOCyeif+NAVcHa4/0?= =?iso-8859-1?q?35hXsAAVg3TZgTawIGONoQ8xFC8MwmpHerDYhtkxgz9i8jFlU8wiA28uJw7c?= =?iso-8859-1?q?nQ6BCTmlkd63cGOPcAVN2f9a7TlNbrSaOQ1YQfYNBQsdf8/3udzFQpuEDUYO?= =?iso-8859-1?q?/Zh1+5e/Ty/0i4+E+Bcf8tCWHTX91Rw5Fnl0OPlmdEMiLFgwmosoRxar9yEf?= =?iso-8859-1?q?/sESSUuP5vx64jkbmXKegKdZO7V03wA3pc9WI5+QCEyHpxCm5z+K2tmtzXJG?= =?iso-8859-1?q?h7HSaeo8Igovq5fzT4N1SVQxEqzvcy6Cs22mzutOUG8XifKnCwkqT0dLjfDM?= =?iso-8859-1?q?+b/S0MkxKOtluS75b1ywrdUA3gNUl1qvLlgT21+bocGMUE1JTszWRBJhJnUg?= =?iso-8859-1?q?+A4W22rot5MYs5Q7s7T4ZNI0DvbYYj4RYtdjI6FlAOP3CDNxVisdgVrIigsM?= =?iso-8859-1?q?jKippwPxtMXZ7KhKJ9yBgDmCpNW4m5T4bC28+f3EXPVFe14fG/wZTLiRHdBV?= =?iso-8859-1?q?axRLPFUHyoQQVnB/MA8npWNjXz9FntT+TcDYYgSdCvz2AN4I0QDLYwAvQc7R?= =?iso-8859-1?q?dzI56dcIA9VNxx8DSbzYantDAbGbYm3GKDu5xibn4DZcGa1y1fhnlzonaCxW?= =?iso-8859-1?q?S15pk/CKZxVsy8lOHK3bMSPbEu7rU6nvp0q1WX2LtMoZtC6OPfh/u3ZRw9AH?= =?iso-8859-1?q?rgG6RNluAtoa2vwYjYNsQF+W9Pgug8JS7kza1wJ36JF6MVV1P6e8jOD3M25E?= =?iso-8859-1?q?rY29C5z4jWcysXGCWrea7akehu/3ziezMzkS1Orqn4dQdJ7g/4i9782ykjof?= =?iso-8859-1?q?WKXpsnFMEezEvTSAK30cg4mKXYtC47HQqu/OzVG2sw6P5EtIhHvPzjjw3uhx?= =?iso-8859-1?q?c7DC9Ax8d998n4Pz0WGEnbF7xUdT2UdxHrTle15fa9a3s5L0N4zJ1SvxpWKt?= =?iso-8859-1?q?EqUCc1BJzaxFM5m8gXIz7R32sbK3fyo4jD7kh9CLNzdvVNr3yoPhVdpgrSUs?= =?iso-8859-1?q?bVhoy5fYX3TFDXA8Xyq+yrQlPdu74+6ox1/MKrA=3D=3D?= 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: ePNlvcnli4csyYgjZBC6pQwkX/43dpF5FAnEgKfvL5iwjf7doSNP3ZK8LdcTC1H+Hcdt/UEdrVJTg4nclx6J2nJfeqBHnu2j3yRHL0TyPL3kUjq6cEs8wXX+Hf20tsz0+mBuXyWHEuFY4x/gOJMuyELrZrUf1hIFHfIOcOad/91ewMTZYmuUu3eqvEP/DvZhqfU0bFbq2UkjHXqEXpdNpjX33Cigvrx9s0U7HmBi8LuOnt4hRNonpOP3n9QDoSrhQ+pCYJgZ5aCD4Pj2eRYt8BufbfyQFFk7TE6TRkzImEPbnAxwFSqkNnv5eYncStU8OaKp+rSivvEvG9VQI5bQZboAk3JSkppjTNq10LlUN0co95YrH50xtvyxAvyBRpPsBPSJeyYj2Xw2e6jgxfTuCSilVWbZbweDNH/VHxyxbzKeWngamFYcQJNSTflUPIc3U3+eVcr/dzVDsf+3XJqUt5A3cx2Oieaiw+3V1G3M2j03scoQi/3wklRsJLQTYp7yPX47elhus+CgcKq2cVKUnrhco/myzTDogV2L1yux82N99yidlbx5UjXmb9W6YcjKOW5ZV8OsJqMBCl8gCwHsr8Gs+vMYFHdbOcVAOkj4Izwa8LbKbAYKJC7B/WYbB/BwMUrzA0nlPHauOagZYMC60w== 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: e31e769a-9b29-42ec-8e86-08dd197b5ae9 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:32:55.2787 (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: hr1oz6kC+sSn7BiR255gpB2pjiZqAtwmdYOiKOeT2PzxOVGpft6JpVNALcMO1rhLrP/MfUIfWP6js8JuJuTbKQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7635 X-Authority-Analysis: v=2.4 cv=d+8PyQjE c=1 sm=1 tr=0 ts=6758ddbb 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=jIQo8A4GAAAA:8 a=VNPyIQiSFAi4eIlpKKsA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-GUID: Zy8b348m1uQMQfhc9QTWBRXp7c-38hnC X-Proofpoint-ORIG-GUID: Zy8b348m1uQMQfhc9QTWBRXp7c-38hnC 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 mlxlogscore=951 suspectscore=0 spamscore=0 clxscore=1015 adultscore=0 phishscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 mlxscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110002 To properly respond to host sending more commands than the number of streams the device advertises, the device needs to be able to reject the command with a response. Allocate an extra request to handle 1 more command than the number of streams. Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/tcm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/tcm.h b/drivers/usb/gadget/function/tcm.h index cd8d06419d5f..9d614a7f2ac0 100644 --- a/drivers/usb/gadget/function/tcm.h +++ b/drivers/usb/gadget/function/tcm.h @@ -16,7 +16,7 @@ #define UASP_SS_EP_COMP_LOG_STREAMS 5 #define UASP_SS_EP_COMP_NUM_STREAMS (1 << UASP_SS_EP_COMP_LOG_STREAMS) -#define USBG_NUM_CMDS UASP_SS_EP_COMP_NUM_STREAMS +#define USBG_NUM_CMDS (UASP_SS_EP_COMP_NUM_STREAMS + 1) enum { USB_G_STR_INT_UAS = 0, From patchwork Wed Dec 11 00:33:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902648 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 A0C878494 for ; Wed, 11 Dec 2024 00:33:09 +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=1733877191; cv=fail; b=djezTOXuCjoGiJxsMIvttAslRXkPjWnkdL81F30zOabogiEI3MpDLTxe2MsqLYtlNWp2ka0vcz/KdRPpyMyVtNrwR63+gju/gmyd6of2RnWecPQbcc/4otJQseuiNQgsED1U3YVvFx5ewHH8Rz5dJBq4kFgM1DS5SK8Jt6KH4oA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877191; c=relaxed/simple; bh=eNPQS7YAFuGTnZWWNZ1K+cyIloyW0Vt7ZilTOurtZcg=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=f3ej+PcpaEBf7YzrDS9gbLC3+plCdT8T1G7kbD2ehsMi3g8zOTBIK/Pig96wbS53B8MXSuZXxRmhbwqrLtLaCTzC0GqoZOYUuCpmHU2yVna7v4b6ojoC0nXNZksKFdqAjK5A2gNkkY5NWwB4HzAz8bMT7O+5XosaJrjgR320OC4= 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=fpsQefxg; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=bcOtHd49; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=Oz5DakhP 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="fpsQefxg"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="bcOtHd49"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="Oz5DakhP" Received: from pps.filterd (m0098572.ppops.net [127.0.0.1]) by mx0b-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BAMtPgN000581; Tue, 10 Dec 2024 16:33:06 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=xuCBki1UO4LMooqwsg8Hep8k2cUvnVCOq2oaFig2Q6M=; b=fpsQefxgTgwE 46N0HVhK4omRfufYekgc8L87U9jw3NLtC5Y6vcdRTbLGgGKUkx3O5zKom/GssZds i0hi/d17f8bzt9v2XeOagaiIxd9pg5btFbbKLp05AOANWNMZBTpt7zCUSJN0yLf0 rgN30wOZsSZKjv6kVWFbxOpLYj7giknlnqOgxs3VOSJ2lxEOtkwiXqIU6j91Hf+1 kUuKkbrLQgZpER1k4e3RFbJ3/cNB4woDjULi9bB/Ee3s78/tdxNKLbNeeEmhDxt0 cFN8PQy+4BzPJ7fxg80ag2M2gxAGC5FxKRWu/mNbAML2N64OA6xcxkLsD1pJFfN2 q7XaB2KvIg== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0b-00230701.pphosted.com (PPS) with ESMTPS id 43cnvka17g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:33:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877185; bh=eNPQS7YAFuGTnZWWNZ1K+cyIloyW0Vt7ZilTOurtZcg=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=bcOtHd49Sn7XOxtOtcSf9iNEfWi6Uo5MXYgcwGSJy90yr9jSf418zQgN+45A/QPoq hLJYFij0S19kbjY76BcBtwFIavUyjHpjsKZLX5zG7IkysFkrHSXhJMw//HzI1txNF/ RvMTg/GpQRFjaa+eGJqy8GLP3rxQE1NgF+IZUzP9u78x09igY1+gr7HXknv39azBcF AMEsfxyAskUo5Pi4Yt838DK9hUS39+Atgpc0uJSnDGYcHw+5LJfttcY1roSwN54bXJ diKJHAi2zo33rzzYljGyLuoCq/SBamHUUxj8SzYeUtV0BwyHYxSQ5G/Lt+/h7gERuc ukf41hCSxHFKQ== Received: from mailhost.synopsys.com (badc-mailhost3.synopsys.com [10.192.0.81]) (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 323D4401F2; Wed, 11 Dec 2024 00:33:05 +0000 (UTC) Received: from o365relay-in.synopsys.com (us03-o365relay1.synopsys.com [10.4.161.137]) (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 D354DA0068; Wed, 11 Dec 2024 00:33:04 +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=Oz5DakhP; dkim-atps=neutral Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2042.outbound.protection.outlook.com [104.47.56.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id 86BE0405DB; Wed, 11 Dec 2024 00:33:04 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TofFQLCzM0Hfc9KsOCMqHjmaY6IzZApsc6WUUiktYgB45gcwNTY+jGB8DPBTfazS5OgF5BZtq7+tQ0K6VugrXj5Rgb4UozOc8TrBTqzNeEMwb+9TZLAko3FEsfG5cPufnMxIoJxd5gpRNcxZsAkTqfazvX2eYmo6PG3eu5Aoc6gcFw5Acu1zOJJMZSn9QQtz5I8Dx2jb73Tu7HccC8+ztC36NZmCl22QYyGn9uz8FXpin14zy7B6VCmw3U1VGTA9tZHKB9go3WLbNpMLShv/5RfypmqUqQErqPRpF3GJQex/W8fnWzuh4mJ3D94cdGYL9DjQCqf+0G1Q4VWQpBcIXw== 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=xuCBki1UO4LMooqwsg8Hep8k2cUvnVCOq2oaFig2Q6M=; b=gxsamq9r6qtXWrmOak1yp9Altd58iDJnx+75yY8K34ZqhqkMBVFiuCW+02744YJca0JdIUI9VPkDQmK0+4H4h1Y/9doT87mk3rqROptxZPJdvd5hdfKjT6d74V5njpndmBVjMV/ARoCHF+0uLGDBrnOWU2n7+2hzqZlEqTPqrM9Z1S7wG70QSdQKsqnSv6ULJeBiMj5RlJ6qA8bUnick8Bb0+lkg9bzvQMOKME77sFb4Wg85NAW3oaaNzlxHeypIe6JiPzDysZLzerfn3aagQ4uLJ4l3ViThW0/ALG56tyWjftCQuXhWr0tUsvgMqhSEdfi9FzsTsULijzcuVHN7RA== 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=xuCBki1UO4LMooqwsg8Hep8k2cUvnVCOq2oaFig2Q6M=; b=Oz5DakhPXA3apJb8p6BXhvhWpADZthsdoCj/37lxiqs3/USK6PucbkNad72mO1mQdksTSFBU9PtgLxO25h+CsQPLn+w9weOjJ3Y2cuJqGjvVN9nGTanTFlapMXw3QXbZGmltLLdG2QqmhgCXxa5m0Y68RM7ONojFBnXtamRuvHQ= Received: from LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) by CY8PR12MB7635.namprd12.prod.outlook.com (2603:10b6:930:9e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Wed, 11 Dec 2024 00:33:01 +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:33:01 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 15/28] usb: gadget: f_tcm: Return ATA cmd direction Thread-Topic: [PATCH v3 15/28] usb: gadget: f_tcm: Return ATA cmd direction Thread-Index: AQHbS2Q7EDIPBhWClkyDQZuGYREskw== Date: Wed, 11 Dec 2024 00:33:01 +0000 Message-ID: References: In-Reply-To: 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_|CY8PR12MB7635:EE_ x-ms-office365-filtering-correlation-id: 5f17f23b-240b-4fe1-9048-08dd197b5e7e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?ZjW4rgQRENuTIS5+2jwVI8aRe7?= =?iso-8859-1?q?ZUVoLwJtSl0gfHI6aPdOvQoHAxCTEg92AvFmKxUa5Oy8Onkp3y3W8c/NzZCm?= =?iso-8859-1?q?JEs+pUY77jTuaVQcTz0Z26gIzNaLjJZlsWaygfjQjXTQtKFDkbOi4yoqnhA0?= =?iso-8859-1?q?kdMbFrYPawSbJatp/fxP5Oh/WMRtKgIPYEH4fsUMwGwmdsEZ+O69O/F3PdPg?= =?iso-8859-1?q?AWliy+QfCFaYxb8UZ1LqvjyLuiFjp/Z6DgMYX2lZn5+KZYopBXgLvn1p1o5+?= =?iso-8859-1?q?pQNsi0qYRVX6NdnXzn2toRTnC4Mt78YKKS8hYd1BsxdLNkhKxSkmqNa7dAnI?= =?iso-8859-1?q?XOq4Y2zE6jWEypiD4nC8E8fTTus91r5G6kfYy8fbtbBgSUZMsRAjtBXWQj38?= =?iso-8859-1?q?edXtW6LfooU4uaxxsTiMmDQoBXxmg6m9XQtmyiwNJVulNhtrXdagogL8EwFy?= =?iso-8859-1?q?PEODItAUD89dkKwn3ZPv30oG670u49klgj7NZHAq3ZNEwlWCbQxsJoMe0BIG?= =?iso-8859-1?q?C2/p8rQw93b+PsvZhL9VG7kkNKnisVjAyBA/7hJtoE4dxmZr4sEUKaHmFTuO?= =?iso-8859-1?q?YJZ3gNZjqyddvQ4girfRxePvbzvbMu6fGnlUOAyfXV3MkNs1HQyLVLQFZkEj?= =?iso-8859-1?q?6fm/a2GqSFE+VoALf1cuaEczm0cFHxis5iYtaPfSIfwiVGs7sJp+N65ZzLAW?= =?iso-8859-1?q?GhCuTV0dRQQPlE/BoHC56qzzn8Oc+BvX++e7jDkschK5n2VoSmgOn8bRU1GW?= =?iso-8859-1?q?eEXlgSMpRn1onWN/+/EI0mmS7V5DSczNJ5lw4h4AhwYL6jpYza1rwL230vPz?= =?iso-8859-1?q?bMXseOBPpAgNWsQRomkOHhGheUrYa7qbVSsFUPCz8Qcnz1LRg2by3tihmgoy?= =?iso-8859-1?q?+3QvyU+258RC4WlBCQnnnGpv66+NLahM+cC5s1L4q+mMZ1X6JPb966NCpnvz?= =?iso-8859-1?q?beuhiUnXzGzFlPgGHBJpIFvcaixK22/vP0Jkf7/raGpu2+E2O8KH79pJ5UIx?= =?iso-8859-1?q?i+CMfKu60frIRuVn9T4RULzfkjpEsf2kJZ1HLuYGtScLg3cZK//5ywRo17/W?= =?iso-8859-1?q?Fzs37FMdYi7gR70qngA6Tsyt1ChGvRIbCZDXWb5b7fwkcR5zYAGXukAWbkxF?= =?iso-8859-1?q?uubhDi+R2KP8TZxjvcfvJegkCE/jPR6YqoBKS7POAaD0mkAaCmsnm8+skNSG?= =?iso-8859-1?q?SzMDkX3nFYsMSYpBOmeUuJsZQ84jkjwFgiOoeEFAn0Owym33dHLpTReYDcqo?= =?iso-8859-1?q?m7Ktvih+49ppnwB9h57jViIuhzbEaUd76RfBoziBJZlYgWBkEzCBJhHPyVI8?= =?iso-8859-1?q?KA5BcdrUMw2tvr+dJYw+Dp9iFBVAWpsbROjucnvknYDrICh9S5vENPygfyxk?= =?iso-8859-1?q?JSL0PXzo0kCvU5HEtktOqGjcEZFuAv+4R4a8lZWD7/xnzzn7OhdKqY+IHq9i?= =?iso-8859-1?q?Htpv4JEnZUMiUMl+NzhOBPWw=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)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?C+B1xR0ABdts2Tk98F5r1jO?= =?iso-8859-1?q?781zNTE8fzjuObiHvuqWzJ0q7E8z/8ePODmCpFOrwNt/oEt/3PJpPeHB9lyw?= =?iso-8859-1?q?uXjGrd6CSR20n+3S+l4C6kgw3SxdYqH/zgR5cqKTIf568S/PbDuA4tRTWUD9?= =?iso-8859-1?q?944jhk9YFLS1CpSwTv0a6vdf3Q+Yf77HwYhv+HCqFAa8I9+/0I2wFdtaPsms?= =?iso-8859-1?q?IDNBaYYkmbyqFCJhHA+X9zkCN+NOym3Cy+wAZys4XnqMnDfoX9FWNf/BlmZU?= =?iso-8859-1?q?Q+vnTQ/zM/9/Vkm/fYUsInT1QGzTJVitaj0rAU12W1xDV1kDCuTQ5BuK9CMg?= =?iso-8859-1?q?0MBB4jKuSqA5xF0lO7/t0kAvxtPU1vemp9MbR4xUmNzz6ApV47CmrJJVkTXH?= =?iso-8859-1?q?duUHUteBGYuQwYsCym2EBI5qhjArM/Ub4WtvlePzoLomS4LWHp6YB9hOnNid?= =?iso-8859-1?q?JErSobRCi6LRjilFyGZu0O4v+JtLbhyMVSlVx4bT6rzBpO79vUBLB4XHKKYC?= =?iso-8859-1?q?Iob5Kam7VdtkV2OMbHbPlqrNo4000m9+GLeMYNxWCMsCUSA/Bn5TeX2jN4tx?= =?iso-8859-1?q?UHHQ16YGXYB2c2epAY0HL3LX7K43KYk66AFNN3Qw0ZrixLlO3xvv0Yd2ufq0?= =?iso-8859-1?q?ncLFzDplst0HDnfNi3CNwpxQAtHaYNTPAHneyaL1m2mME66pqPsIQS2HWtvm?= =?iso-8859-1?q?JAqx+bsz4P6XThOgysuv7q/k9UwqrfIQz/BJhuAm8BU2dXdEtn/Z5hVH5UiZ?= =?iso-8859-1?q?dunG9wfaMo1prKhNRyLRMhy0kh8W5idiUrGX+vGaHmfsDFlTOuZIpiHE4Hfm?= =?iso-8859-1?q?7I+cJpnLouA5Ia7JmrAeYRI/WB23EmLuAvzRbWD3YTxTZwAWRDdYdUszkjns?= =?iso-8859-1?q?BaK0AuxpEsoFjx6Mj0E1FSjvhWjp8gC0TyVRHEy2KkURYSWB+IeL5jwR0TI8?= =?iso-8859-1?q?4mKBkyOlMMLu4E0JDhyUXXawr8E1qCtEvUsxvxcogeG0eoGLmLFnGqex52P9?= =?iso-8859-1?q?KJ2FRqS+tgHqKES5E+hs4lr0wmJD36IZFsK0QODwIsZeSwiFGvsNHzcnHQkE?= =?iso-8859-1?q?78YCABtlympL7SB0dJPJV483rw2BlIJEyPGZAbBsATX3LHhsib2s3ZzLM9BI?= =?iso-8859-1?q?iSmhFMMoMmn7Nn4QBLxLEybJDPNlOSzGWzYdNRUg6X6/8Qe1UuvPg4ZQxG/h?= =?iso-8859-1?q?rfo9TdifS9nW5uKSZVWb1bOY0V+KfGQ2TEPATQ/cRw7jdmdjStqgMTl1ccgr?= =?iso-8859-1?q?8QfNqQCOD6tKWwyZ6Q6qESuU1mLEXLMihzJW2/7jS/jUN6CVqAUhQEzAG2lW?= =?iso-8859-1?q?92T+zC6RjJNV4Na8e4VMpfREld6fZg/zh3omCK+KvFaJnTO4/C09IGWfNNSs?= =?iso-8859-1?q?5Ohxd/0fQHfcvTqh+kMKoeLexjOqlDm2h3UJRtlBxhVPotjIO0kmMTSY/M6e?= =?iso-8859-1?q?YZVqum21eLvfZojALWRksfPdmHMIwDZdqytEHE11feydcIqHc6uFElP+FFwh?= =?iso-8859-1?q?/VuG2CioRM9d76GdjJqFbAeonL97LlWMdSOx5NCfAvkpetsSvIBu6zjEmixE?= =?iso-8859-1?q?EgJQqkqtFWFr56y2wnOCOJWNS30zdtIwOgljlZL8KBIa31QNWxfJ2Nrc+iXz?= =?iso-8859-1?q?AE5yTe8P68uWTyfkgqHlOk20DIIpFDd+mmJjYAg=3D=3D?= 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: x9080WG5u/DdH6Oj4G68DpyeaMUMbZkVamPGvPwM3DKzG521OSXdDPnxI4eNGl4O5uFl5kOjz4Otrhtfasx0BhvUEsvbEMEe9HHzNYZAl5W/v/5cEwRbF9YUdapblyY8ssf9ei5qBOxPY7tVNmiqWO1pCvb2rJct35RKHpumicky41BLQh3t4WGEeZ5hOg8cN8zsjznfHOQBUy9L3IxypEpTT7E7w3VIt3T8LEtZ4XyhUrQlDlqD0HYhGMJ/4sxLah62yk+85OasopgnreL36StA1BZppRIjZNJ8XME5X/IpoEsmkLK+zUoxM19onlN8KkY/NXJONkRe/hIwxPEdmcDq/+BxO//+9opuWWpkVTDlNHhy2N80JxFlsg/LDBB9Lt1okCUJaO4c2AZ4wilHpXsmdUiBFXu1rPTOiR6h78+MBvn7MBOVx2FM9RVjL7Al/behSNA0nRUMgTDfyzUOt/FwZJoB3iWingckfG550rKHzhWr8cj+jGuUi82PCthRtkLvZMa4TInfdp74XSu0D8VuiOL86WQv+pkBs2yPC/p1il865MQiZJcVeYJOL7QIbqiqAp0gF/NTwqyw880/F8dXUmiLLz1RdXQvENOfAYi9lQkAIFrFpYkRmnHNbvdidBt0FPDt3PB8CvJfUqWDGA== 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: 5f17f23b-240b-4fe1-9048-08dd197b5e7e X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:33:01.3154 (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: teLFPitY2fy53d5Nwe6Puv2yjnJ/Nyo/AKoHxgXJ7/fGTaUouVcMxt8s2ecp0SmdyAP1+QEL+5P1jsuUFi40zg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7635 X-Authority-Analysis: v=2.4 cv=fNPD3Yae c=1 sm=1 tr=0 ts=6758ddc2 cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==: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=jIQo8A4GAAAA:8 a=WVd88ziZsyrOexG4cEQA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-ORIG-GUID: fs4Gn1J7Ttul4GxTWwRP7zS09_6Q6BBL X-Proofpoint-GUID: fs4Gn1J7Ttul4GxTWwRP7zS09_6Q6BBL 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 mlxlogscore=717 impostorscore=0 clxscore=1015 phishscore=0 spamscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 adultscore=0 malwarescore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110002 Check ATA Pass-Through for direction. Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index 50e6a41aaa82..f43fa964d2b5 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -877,6 +877,8 @@ static int get_cmd_dir(const unsigned char *cdb) case READ_TOC: case READ_FORMAT_CAPACITIES: case REQUEST_SENSE: + case ATA_12: + case ATA_16: ret = DMA_FROM_DEVICE; break; From patchwork Wed Dec 11 00:33:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902649 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 8552923BE for ; Wed, 11 Dec 2024 00:33:16 +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=1733877200; cv=fail; b=lwp7sGwQAK8jChUf17Izsr+HkM3wCvIQMNEZoHfThRuvZzhRVFt1R/ZqXI+JUxE0KvVv+nJSv4IfRslmG5TzADqtw5SpxlF5wPn+7tNp1q2hWx1wjtmyQ65J8njFBH9rIyOUzRzmAmlW1sacNpoC/Uc5TfToCYEH/UaCmbkiq4o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877200; c=relaxed/simple; bh=8zZoTXW5qVtWkzoT61faOWYj4oVmiQdL7RLDuQjxHv0=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=UYF59uG4SZWHKyIDr4VCKsvaObYoZpTOK2OduilpfJ0NlemdqVsKkl2zzek+9jWgk+S7nYITSBGK7w4eNIrbIsrf090phIHV29VsHmCaKLUxkTk7E1F1RR3G2fDxWEZXiDjZgTsviiacersvX6KRjHFQVra/zqeI/UEAihNkFRM= 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=e5wQ35Qh; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=Lwu8E5UW; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=Sy1uFBK5 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="e5wQ35Qh"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="Lwu8E5UW"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="Sy1uFBK5" 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 4BAM2wCo017317; Tue, 10 Dec 2024 16:33:13 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=/KtrrhzhXgyiX6znEeHqUF3DWfAsq7WvxwnQrAIRwto=; b=e5wQ35QhBVf9 CYQG4hpvz7wbJ5nc+9WBHq9kssSu/xe5ecBa5+Ryqx7UMvK68z/O0nlxi3V9uhQR GpVEf53c1TTlMP8y+PLHyLgYVs4Fp8CAmfHqfHnvxLP1upEhJYwbXJAJz3eFyuAQ nRHwGbLMgiQPFJhuFOft8v12Wt3wHULyQ9DNhS147ZRVCGthAPjfGCqAIUCw3ISe eYMzvJafG6Zs1u1Hcw4kRoBk2B/GjpqsQDIXLZYe72vxBeRHwWUNkF7KWPlKrM1b I1s6F9rnfXhK8OW2AFlzOmg0whHpr2GtLgsxjy0l+YngBGf7fRumgcg9nW5s3qs7 nVNL8e4NHw== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 43cp60t12s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:33:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877191; bh=8zZoTXW5qVtWkzoT61faOWYj4oVmiQdL7RLDuQjxHv0=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=Lwu8E5UWLYgsknQMXX5aD4uCF/z5Abps3ThbQIQDElgG7tRQuD5aT4ixQqxpRVe3E nJKIVYrnsKONutdldYms4MQrgZfBRENk9DGlzpf3uScJjtU642felpIRdSLZFTKtI+ kx2iCLy0v6zzZBzKFVkIWX/MSOh0XF6lI/7+LcfYX/ou4PcupMG2NnTj6rdEJmIYwD xgoGdJqvyv+F5c79nou3Xbsv8QBycfAjNTd5hL8IpIEcdzNlK+pu/XLm2EkFpILoL0 RlBOIoWW5l5eP+jo2WdNe0VusUReTxwhWGi4j/353KBCw29WYbUcrZ8qjJziXQoLJz EKxDHkdd63NVQ== Received: from mailhost.synopsys.com (sv2-mailhost2.synopsys.com [10.205.2.134]) (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 5D9D9401F2; Wed, 11 Dec 2024 00:33:11 +0000 (UTC) Received: from o365relay-in.synopsys.com (us03-o365relay1.synopsys.com [10.4.161.137]) (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 3A013A009C; Wed, 11 Dec 2024 00:33:11 +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=Sy1uFBK5; dkim-atps=neutral Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2047.outbound.protection.outlook.com [104.47.66.47]) (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 E588F405AD; Wed, 11 Dec 2024 00:33:10 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=i2JCizYC9uc3GsRT4xm8al9IuG/x5/mmJNyt1q+9ALLKu7BURsRiBzNKHmc+YH99T6jh+wLUL5V5A1jNzDVx8GL3zDlfo77UiJSWdyr18Uuy/5aNxuJdGaTBxAxKaZ0aVdeLsNkGx+RWI1ZwCRrrUxDcIh3rsK/rgrpKQhEnvW+v6w63alAmvjdGU8iXPe2EYjzXiVx9euIWjsv0wlt3hX8c00TArm+qT3lvBZy8nqQ3KPvf3DsYmKDX0N8hDKJXt1VH6yuFvvlyQziC8ycjqNNLxHeeO4b4eYRlP1Q+WXBle6e2UH+hfJQK2jYy16GfXlUsA6Q+IlWDdHevktfQCA== 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=/KtrrhzhXgyiX6znEeHqUF3DWfAsq7WvxwnQrAIRwto=; b=fkaDmfanBc/c4+gxaHW2cGOWh4S8a3ZhE6jYxagvatzIXddZEAYH65gJ6tCV2+pI4T1qxgEqvFsLB2ofSXMeFBDwoYkVuTFAyi58GPrYqw3u+PodMYqRILK56ihkjkVOCqsTlzY2fl5sjOyOIUkfr3YCejaYGSjT7mwRF2S/eyu72inx0fyj+yvGK7hToXbZY83nhC2ma1XrGGBtWkvKL3EagpFhu7Kkitl3MLuWVVwgUfIJleyFtUo5haUcPo0AiDpz9HdG5LnR4MpZAm7KNQ7QBHZYCPMjo+5cxxdhgz31C3HIlXuAgQ2F8rVA8y4Vh04UGZ80cAK2Zt+FCrItjw== 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=/KtrrhzhXgyiX6znEeHqUF3DWfAsq7WvxwnQrAIRwto=; b=Sy1uFBK51KS4jDqCYiq7vZ4tO5BSm6xeaAHMlGXUZGKV7ObOZqM9G4IhMvbCMlc8zuDMaTU9yMEWXZggpKlJYM4KX9lnJfGkJd5eSWVhY5C/aMrrHX9pihdJCwwKwrI7FVkijDVjnYde7EsDOMl5hpp1ndAaEHbN5PTJUNe7y1E= Received: from LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) by CY8PR12MB7635.namprd12.prod.outlook.com (2603:10b6:930:9e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Wed, 11 Dec 2024 00:33:07 +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:33:07 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 16/28] usb: gadget: f_tcm: Execute command on write completion Thread-Topic: [PATCH v3 16/28] usb: gadget: f_tcm: Execute command on write completion Thread-Index: AQHbS2Q/RQy42qOpnkqk31dnR8JLyg== Date: Wed, 11 Dec 2024 00:33:07 +0000 Message-ID: <9f6b1c6946cf49eeba0173e405678b9b7786636b.1733876548.git.Thinh.Nguyen@synopsys.com> References: In-Reply-To: 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_|CY8PR12MB7635:EE_ x-ms-office365-filtering-correlation-id: 545654c3-055c-412f-f18c-08dd197b621e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?hisIVYS//C9ByeGyNZrMiDKJWe?= =?iso-8859-1?q?D0t5yQZg/OGlrULBoWc+Se+VSnENlkQT5L4VKo+LgBvyiJ+iRitl3W0Z9gyA?= =?iso-8859-1?q?xtJy8sSKanLsSOyg4f6fG1LLm9mQvk1Z1NpWfinPniP8CoXfbmz5/2GYAprt?= =?iso-8859-1?q?eMkFKTCIv70z9+FKhcw1VArIr14Quv733KpurRqGxCY99pYB72ty6oEmX7nh?= =?iso-8859-1?q?/b7yIkNo52zlRjDjQOspm/ABnWJ3K/cf28H41OBmHkn+pyPAfaW+xFvlkGJj?= =?iso-8859-1?q?VWAh2CAGxI5c1tMYuvZYovQbY3ErJmp6G7ZQ56QVtjtmY21/AmD0XiVk2mC4?= =?iso-8859-1?q?aBZG028nlP51kRRrmQvt+SzeBrKsDl+lGQo//PPHdCrmqFWEag+NErT9/qT9?= =?iso-8859-1?q?EjeegRP61VBgngJn7Q1E5taMG4Zad3rNN5LeRDxXkHQHLUT85xSSP3bUGpWA?= =?iso-8859-1?q?1zFTZVnvMqj1z2fpfXgAF30NqVSLqYeq97t8wktqLtxGYGy0/D5nC3SLsvsW?= =?iso-8859-1?q?O6ZIY00wEdVgHGYg9KCi80dvHlnC/VHKPKgY40Nh2ye/A1kmbGbOhvT2gH6t?= =?iso-8859-1?q?B3Js2seHsXDXbuDxRY+PftE6IlCi+Q0q1+5fCUOVooAd5Rv09skU0LrbTDzm?= =?iso-8859-1?q?jN83GIDsfGvkoN9fg4qxpqzae3hbfs3m3hHL14P0aAQdnlDDuXfaLRxeAShv?= =?iso-8859-1?q?2I1KT+5XF/dT3J69PE3v3kDCbmAknkgDLBkBKgYEgCYlKa6h7IZM+hdCpLlk?= =?iso-8859-1?q?Etdn+xYimJ/nfq+vEFLSd5sXnAdHLXTlNGQ7n8563bl1X/EC1H+hia9EezHR?= =?iso-8859-1?q?7f6R1hj3M3hWvaOcS1cBGv1vtGUlGrCIHRA+L5GBXI6ynPwrgWMmD9IOkMc0?= =?iso-8859-1?q?NV6Sk8eeV7ILJd8WkF5kwf2udyyih6AhmTGEf0IzaSeF6RH2C26X68x75bmt?= =?iso-8859-1?q?vmw/D+uj72oIbOxPgqgl7tRtkBqhQgpkCPRoh/W2Z6v2O0xxm7PVciU0VNGv?= =?iso-8859-1?q?AKxOB8UXwd/iOUnEHVtYKU0FuXZd/hjN6gx8Vc62hKgayHbpkiLmxTMP1QpE?= =?iso-8859-1?q?ehidiiy4bpN2qiKhnwNpb7LCIPe9UCcM4NiHrxqZ7NU+VgC43/g2Gp8Bayh5?= =?iso-8859-1?q?hllg5FhQ6zGuowr3yzjilrvTtiyfU2rl/Z73lORHALIM1bSWZCUOq2R9x8uv?= =?iso-8859-1?q?hUQj3Zyt1dNt+UB0kFFDcsnj7M/rlB2T9V6LvcmRSZPyx0b5KAEZu/3ytmDq?= =?iso-8859-1?q?L/ZJqm5751vjpSm4vnYbu9AYyiu2harQo6a4NffE9PazzH+dlaO0/pWKKpP9?= =?iso-8859-1?q?gjgLOOOpcAVZlr9tT7tDdbNaNzWN6CChClzdSjVx8B9xMY4jKbFxZq3gTjWH?= =?iso-8859-1?q?XIJRLWC7MOad0VBg/SUScnORGoNVyDPGg6Lx1PuXi6O1YW0YRxm6Xz80u9MI?= =?iso-8859-1?q?P7gQBeRPvYlJuQO/J3I9Hwtg=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)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?YBJymfOaLxTihwF1ExjdCrk?= =?iso-8859-1?q?HwIKdtHCarRExBNZWxG+0MYlCdNgZG99usG+PZyI1TBKRXpwZY572ivSK0F2?= =?iso-8859-1?q?f4wcqcS7Mki1sHMjDe+Y6saanc6DBk9uRxYv5Hw5ICTqR8gpa8i8ucI+1ej8?= =?iso-8859-1?q?9iPI1FDwakyHiXgga6H+h1rfG2wt2Ns13YANyepfVmRKsALFjHoBhfeNlJu0?= =?iso-8859-1?q?+hU5rEPwhESHzGCBHPKJDmes0AchvLTyW/I84pYTJAEYR3GIjEbmyc5yalyf?= =?iso-8859-1?q?x2qqYiOPQC7fzsPNXjAUX+mTjZM2S0OnBrHQsvyxTiKmlKEuhHbZscxwNMwB?= =?iso-8859-1?q?PhlSaqZUX03p9aNOR0DztPZ0KvVHI0wAHpMQpN1cv7hzSC/7igiaKMTpugJP?= =?iso-8859-1?q?qn2Fxo6V2khKuIO2FQzfpDXaw7cbh4pxicp3AWA2EV7iFLNuWOzFyguLCFQ5?= =?iso-8859-1?q?ys2uZgcwpQ8ooTSe4pt4G0VKm6Gg/MfdIlq3vBUv0d2A3wOKlkahiZhGG1xt?= =?iso-8859-1?q?iC+3mGXTVy7h5APj4jHHe06PmXSq7HNVyamdDButR/htlT+1cUtrgRv3m5Y9?= =?iso-8859-1?q?HUjlu1cFVZcQfugPeGnQqXCyhw2NGXPE04unqE5T+ps9r5SwGMN3faR437V0?= =?iso-8859-1?q?SKuw3m2RjF0GAPev+PfjqecJptdGdULNA6mL992irWpNV2LDBpF4hjyqhFHD?= =?iso-8859-1?q?SwJ9N99sZe4BDbfzZ4aVad1ANNAvI5eNw9OROqclNE6M86jSFR9c/DlyL1J0?= =?iso-8859-1?q?H6RHrIBqWZm7wFwW1+8Xr4N6NAyNR2vKJPa+23GslkDzXcLVhWEtz1OX5/lw?= =?iso-8859-1?q?8GjFjDORCYhhKHZ2J8iRIe8PAfD7+bH3o7qxCL7xgf5m4ezqsgTQjmUzz8eQ?= =?iso-8859-1?q?c8C0DIAhuzhgblrtbtR6JoBfQUv+6iEXjozW8UY3Kox5NoMqTiMB0MU4lt5E?= =?iso-8859-1?q?lQ5PnXcpk8w88oDP1uVlIqgqf8Ct461K5xMppD4nalD10bagQYLDQ6yaIVGt?= =?iso-8859-1?q?ebEY3ZKbiNiJfFemG6hIRoh88MeolyNSuehKjmH/batEa6hpUMoOqhoa6a9F?= =?iso-8859-1?q?Ml17ZtvMY4U/EAjMoGvr6n19i4URiC4FL1jYCJpI/U3inYJ777oaH9JDeXdS?= =?iso-8859-1?q?brbbJZuFUG6jypOZQizstg7VDy2JM4ICdKwgblwd3iXIeLj4Gd94zCjHPVAX?= =?iso-8859-1?q?c+xBvORr1CSgZabfZUtc5KUALe1g7Qht6ODdPLQWaB6LyEpH5S3gC3HY6/fw?= =?iso-8859-1?q?hGtj1w/YIovUH18uVvt90VMvVKYHs41O03rI8CE+WAVbvgVGEc9hlniu4BTn?= =?iso-8859-1?q?a3hnmSjAUGBJIORoXzemJCjNHYSXIoe4kdafRLZRw35PcWLqnfGUhGGGgsmN?= =?iso-8859-1?q?l4/xNuDMgIQNjcNomQflshzaSb8QlmHqX9/nbCJA0188RTLQXV3ivclv8sNm?= =?iso-8859-1?q?pa23RVMhflP7p+4pe4/uEMp/uR56XtOlBrXd1DdyzQcvjt/4PoKdVlldUtE3?= =?iso-8859-1?q?FW07/n2NtN+mgknsM517WLsLup1vmkrUVyjhbjx/d+b3K4oU3xGCF4fLJUWl?= =?iso-8859-1?q?hb+QK0Gj4fSd1f6Zel/DY6T7+54VEqqGpCqCBx6vO4XswTouCB4K33PtXmOo?= =?iso-8859-1?q?ZpaTN64tL41K7vtRK+2IlDig4hczR02Y8E25l9g=3D=3D?= 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: UQc8E+JpQ0ExWtWjReYRDLUuCx1hDUJiLHi/ycPi8d2BdETkQxj64FCugrgcsTzjhj7+5P/6yF+Y0ehm04zXrK/pg5hw9DpdB182QqN0B7byfnzFvyOyx1Tfu39/5Fs3A2xBkPf8aWG//HSj2T02HXvBZQutn9zK8XJhNvGVm/3GMQjS7BDbI7Qi7HN757yJtHwwgNWzYNfkdRQgntPe1zZWYWXR5Fney6t6MdAwxeW9DjBXucrdu5og4kwfHGW8iguf/4PZ51s2+R70wFv86YwfL67nL0d7qumkuiFX3bH2oGLaVNkwe6RH3em+/NqnhYoKRN3OzW+7pO3qLOAp9zqQwV6qk50Dur6c3DbD7W3NzXGZ9XnnA4MzaJftWBwX4Gr/iyhGWOl2wBP6zc8rgjvRzFkUwNl0fbHiHFCnkD9A4T4NfryfQcVVlTGWZnvClrJKp3HY7QC3uLq4C40f7+ZAZ9kO6U3Ai5QLEuzX4PJ8FIZmmsXRq4hzXvUc9hNgrHCsxaAogOdIaOj94548atK8NVoKMG9IRV/TSOnjO71+TYbI81vwE2qc8Irs2NQpcgnscD86glgHlHHu2hGGcjfIE3/xZDQ0p7GR87WxgNRXwjsVLbp0zXizwM26V2plH9xpPdonBkZuO/xqL50zRA== 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: 545654c3-055c-412f-f18c-08dd197b621e X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:33:07.3933 (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: MzxEPfpzYQcZ6W6VJxEyu6WxOgUgjRfA9XWOlg5+BKBoSSb5+TcTxRav0vyAvFfv2n+z8+QROl9sQ5hS1r4dCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7635 X-Authority-Analysis: v=2.4 cv=Z9YWHGRA c=1 sm=1 tr=0 ts=6758ddc8 cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==: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=jIQo8A4GAAAA:8 a=yKPNG9v0iw303YuVllIA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-ORIG-GUID: NGeZPgzHUmAJXv_IHRuJtzwtsecrbDUS X-Proofpoint-GUID: NGeZPgzHUmAJXv_IHRuJtzwtsecrbDUS 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=1015 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 Don't just wait for the data write completion and execute the target command. We need to verify if the request completed successfully and not just sending invalid data. The verification is done in the write request completion routine. Queue the same work of the command to execute the target_execute_cmd() on data write. Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 39 +++++++++++++++++++++++------ drivers/usb/gadget/function/tcm.h | 4 ++- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index f43fa964d2b5..50c0703e8df6 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -244,10 +244,8 @@ static int usbg_prepare_w_request(struct usbg_cmd *, struct usb_request *); static int bot_send_write_request(struct usbg_cmd *cmd) { struct f_uas *fu = cmd->fu; - struct se_cmd *se_cmd = &cmd->se_cmd; int ret; - init_completion(&cmd->write_complete); cmd->fu = fu; if (!cmd->data_len) { @@ -262,8 +260,6 @@ static int bot_send_write_request(struct usbg_cmd *cmd) if (ret) pr_err("%s(%d)\n", __func__, __LINE__); - wait_for_completion(&cmd->write_complete); - target_execute_cmd(se_cmd); cleanup: return ret; } @@ -664,7 +660,6 @@ static int uasp_send_write_request(struct usbg_cmd *cmd) struct sense_iu *iu = &cmd->sense_iu; int ret; - init_completion(&cmd->write_complete); cmd->fu = fu; iu->tag = cpu_to_be16(cmd->tag); @@ -696,8 +691,6 @@ static int uasp_send_write_request(struct usbg_cmd *cmd) pr_err("%s(%d)\n", __func__, __LINE__); } - wait_for_completion(&cmd->write_complete); - target_execute_cmd(se_cmd); cleanup: return ret; } @@ -922,6 +915,8 @@ static void usbg_data_write_cmpl(struct usb_ep *ep, struct usb_request *req) struct usbg_cmd *cmd = req->context; struct se_cmd *se_cmd = &cmd->se_cmd; + cmd->state = UASP_QUEUE_COMMAND; + if (req->status < 0) { pr_err("%s() state %d transfer failed\n", __func__, cmd->state); goto cleanup; @@ -934,7 +929,8 @@ static void usbg_data_write_cmpl(struct usb_ep *ep, struct usb_request *req) se_cmd->data_length); } - complete(&cmd->write_complete); + cmd->flags |= USBG_CMD_PENDING_DATA_WRITE; + queue_work(cmd->fu->tpg->workqueue, &cmd->work); return; cleanup: @@ -965,6 +961,8 @@ static int usbg_prepare_w_request(struct usbg_cmd *cmd, struct usb_request *req) req->complete = usbg_data_write_cmpl; req->length = se_cmd->data_length; req->context = cmd; + + cmd->state = UASP_SEND_STATUS; return 0; } @@ -1012,6 +1010,17 @@ static void usbg_cmd_work(struct work_struct *work) struct usbg_tpg *tpg; int dir, flags = (TARGET_SCF_UNKNOWN_SIZE | TARGET_SCF_ACK_KREF); + /* + * Note: each command will spawn its own process, and each stage of the + * command is processed sequentially. Should this no longer be the case, + * locking is needed. + */ + if (cmd->flags & USBG_CMD_PENDING_DATA_WRITE) { + target_execute_cmd(&cmd->se_cmd); + cmd->flags &= ~USBG_CMD_PENDING_DATA_WRITE; + return; + } + se_cmd = &cmd->se_cmd; tpg = cmd->fu->tpg; tv_nexus = tpg->tpg_nexus; @@ -1028,6 +1037,7 @@ static void usbg_cmd_work(struct work_struct *work) target_submit_cmd(se_cmd, tv_nexus->tvn_se_sess, cmd->cmd_buf, cmd->sense_iu.sense, cmd->unpacked_lun, 0, cmd->prio_attr, dir, flags); + return; out: @@ -1111,6 +1121,7 @@ static int usbg_submit_command(struct f_uas *fu, struct usb_request *req) cmd->unpacked_lun = scsilun_to_int(&cmd_iu->lun); cmd->req = req; + cmd->flags = 0; INIT_WORK(&cmd->work, usbg_cmd_work); queue_work(tpg->workqueue, &cmd->work); @@ -1126,6 +1137,17 @@ static void bot_cmd_work(struct work_struct *work) struct usbg_tpg *tpg; int dir; + /* + * Note: each command will spawn its own process, and each stage of the + * command is processed sequentially. Should this no longer be the case, + * locking is needed. + */ + if (cmd->flags & USBG_CMD_PENDING_DATA_WRITE) { + target_execute_cmd(&cmd->se_cmd); + cmd->flags &= ~USBG_CMD_PENDING_DATA_WRITE; + return; + } + se_cmd = &cmd->se_cmd; tpg = cmd->fu->tpg; tv_nexus = tpg->tpg_nexus; @@ -1190,6 +1212,7 @@ static int bot_submit_command(struct f_uas *fu, cmd->is_read = cbw->Flags & US_BULK_FLAG_IN ? 1 : 0; cmd->data_len = le32_to_cpu(cbw->DataTransferLength); cmd->se_cmd.tag = le32_to_cpu(cmd->bot_tag); + cmd->flags = 0; INIT_WORK(&cmd->work, bot_cmd_work); queue_work(tpg->workqueue, &cmd->work); diff --git a/drivers/usb/gadget/function/tcm.h b/drivers/usb/gadget/function/tcm.h index 9d614a7f2ac0..adf4c415140f 100644 --- a/drivers/usb/gadget/function/tcm.h +++ b/drivers/usb/gadget/function/tcm.h @@ -74,11 +74,13 @@ struct usbg_cmd { struct se_cmd se_cmd; void *data_buf; /* used if no sg support available */ struct f_uas *fu; - struct completion write_complete; struct kref ref; struct usb_request *req; + u32 flags; +#define USBG_CMD_PENDING_DATA_WRITE BIT(0) + /* UAS only */ u16 tag; u16 prio_attr; From patchwork Wed Dec 11 00:33:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902650 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 6193C18EAD for ; Wed, 11 Dec 2024 00:33:21 +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=1733877203; cv=fail; b=oWcDBpQUqyCt5fkOWfP4ecMGs1SrQI6Wq2vpR+e/B7LnPKo70A4JZcumgOtuZeFC3Rlrn697LbpRDkZg1CHFOuNNcEIJWorkhLngwvmgoWVzmwingW0axSq4dokELU18ZOsz7YttJWGVg4guELMN462ooz4ua5bNKNLyNBF1DHo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877203; c=relaxed/simple; bh=hhgsJK1AucYnM4yRAtrWSLv0gzRtCthd9LV1eqScwhU=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=kja+wYhmo81VJgUKqpK8/rlfbbAubZCb+hifJm4i3EDEPR4wYtVX2xWPAGz4ezOdxMbi9AraEhVeQ8Tq2xyUjr0uVz8yzcjppV5the8pFmNXTVv07IIEoCqPTgKGbFjNv80cBzQ4fFeFsVVamUKjMz0Dlw2Wy8xeLPzlRP0kmLI= 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=iRH7LeQu; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=KnLFLqLc; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=DFQ2lhgx 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="iRH7LeQu"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="KnLFLqLc"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="DFQ2lhgx" Received: from pps.filterd (m0098572.ppops.net [127.0.0.1]) by mx0b-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BAM93V0000676; Tue, 10 Dec 2024 16:33:18 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=iN8RUX5llM4FW3rGVHokEUaR7u7LUupB3r6FI8RwHl4=; b=iRH7LeQuV9Fv /11Nr+LDK+KNstjuUoeE8TgEyaKOfVCfdwvDte4RdC3MhlxJvvZ/4coUosFpXYAE QWK+kO6WckC9dBjYOflK6mRC80bIrbUEPHVeP9YVfRBG3ZROIqtG7nZR0HeFoOqn wNKeYNWCoLMR3WW/A3aVFfv/gqEPDMLT+QkgPYtBbF2TYOAsyNVBm2dWfTfZ+r3S yPPnqBZr3x3SXMqquFAnewXUWU8C1Nu/r8jM7bbb9dnCwstM57SaKoZR2J6QcBx1 iGgEg07mNuZsJ86ktxAvRrU1W7Jq3U49ES3stUJXgeYZMURbpRXbwPoKbo899u38 lWsNbWcIjg== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0b-00230701.pphosted.com (PPS) with ESMTPS id 43cnvka180-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:33:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877196; bh=hhgsJK1AucYnM4yRAtrWSLv0gzRtCthd9LV1eqScwhU=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=KnLFLqLcNY3TQ94rOCmXUOwOufX/mvQk7/tomyfBa4njgFIuHRRoRRaiwKDb40HT6 ewVXE/rMjgZowP9IFodCjtR4urAl5eul5QhPa2MOJwZyZdeRRerTiY/KsEOw3nk8nx G4VEMUBSt6effgnC2dcSFSTWSzwZjE14vXqpMuoIVLB0xoQrT7yNaywMwTu48vvKEU wK8th/JkJYHTW5KURoVYWcTG43lrGOKjHyYhEsBEGbcri90FhJY/XzUsuH22pRVpQL n1C2ey004HsYGydtqxsrrZ3uvHgHd63AzTux3twQeRfHSrGuIo0dMpL4kkXJhP6T3a LIeeha1DE7/VQ== 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 A06A14024D; Wed, 11 Dec 2024 00:33:16 +0000 (UTC) Received: from o365relay-in.synopsys.com (us03-o365relay1.synopsys.com [10.4.161.137]) (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 6BD3FA0064; Wed, 11 Dec 2024 00:33:16 +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=DFQ2lhgx; dkim-atps=neutral Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2046.outbound.protection.outlook.com [104.47.56.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id 29343405DB; Wed, 11 Dec 2024 00:33:16 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XMyNSzEKr3b4Qc0jmII1xDqLXxHhruBgqNnArynmpcubWvlrXcbROgIiXLAjFEobSYVVVTVAolabJHMr7Ni8i63qgW86Gv/k52lx6mBq7GDHEQmCVwv8Nr0MTBoZr3lWjpCz+/ZCzVYsNwsrIPbt32v9LuEmzXfMiWqt+ktq8GWayZsCgbhX5YKwqNEJvomzo5Ox9qZhx8KODY3icapCIpHtHQp+JDg8nu4COvBEM2+0TXQGBTZSNqaPECq2JWXpVaK5MvtJiuzUsWwMznu2DnL5FIfpF3pRktnw48wZ5Hofcw5arL3DhzakfXzsdzMl7jAW1pkfKi2SUAa+N4766A== 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=iN8RUX5llM4FW3rGVHokEUaR7u7LUupB3r6FI8RwHl4=; b=Bi1F7Z1EEaNvNlK31653sC3Ou2Yd8PC3q+KfoVr8a0kWDUhBpXOi2hPqa1b1/YyQm/0b5kvne1GDIuLcKzVWeRRfvna89Cq2+cg9cyrVcEKG9JG807n0AOayYyLpDfxLpF7Z4nD0uS2mQ7pdDrAjr5IbY74NxzUt++CaLEbDjl0uGdIa/a1Pxgi/0tExo1FEkDsjEE08cAWtJU6imCJuDE83d81IYuBMsEq5wE4YUB5dYYcopwummWcMR41KTumFlbwHZSZ3gT/kQpPBcOxTAL/gFBg2oismJeH/mGJql0VpNtIp8KmUBnUurxNeK7flsQrYBEsG+FRIzwJjbF89pw== 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=iN8RUX5llM4FW3rGVHokEUaR7u7LUupB3r6FI8RwHl4=; b=DFQ2lhgxvaZ/U+LamrQV5e+TOyGQ8YEBIMU148O5syIEFRchUqaqLkajqgJ/85a6xjenCtbmRritrc2yIezXC7S14o0kBVD84JaudLKdleNqqN3mh+VXi9tAeQXRHlmrhWb0+I1NJAGcKPLdKQF0+WizaIHd9GgLsVz4k1fsheg= Received: from LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) by CY8PR12MB7635.namprd12.prod.outlook.com (2603:10b6:930:9e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Wed, 11 Dec 2024 00:33:13 +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:33:13 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 17/28] usb: gadget: f_tcm: Minor cleanup redundant code Thread-Topic: [PATCH v3 17/28] usb: gadget: f_tcm: Minor cleanup redundant code Thread-Index: AQHbS2RDr2FIXmW810yZfdHDp4Viuw== Date: Wed, 11 Dec 2024 00:33:13 +0000 Message-ID: <2b2200a9022296f520e26f61ed6aaa6eb34d466f.1733876548.git.Thinh.Nguyen@synopsys.com> References: In-Reply-To: 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_|CY8PR12MB7635:EE_ x-ms-office365-filtering-correlation-id: 4379efe4-3648-4029-6c23-08dd197b65be x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?JAtEwIcM0cpoB9/xECL8f5rWr6?= =?iso-8859-1?q?n0G0dtUJ7F6Vs4NGjaWf4ctAY8smO9Jdh4vLqrp1RXIx+w7pVTWVp6VxQZBG?= =?iso-8859-1?q?PPrTW+78cBa75nH0M0iO0eJO7RdVtZN40SPi8+2Wut+sUMeTclbVljKGawUF?= =?iso-8859-1?q?OJeb3bP51D3g7sbdxutB6iqz7n/jICaiuHVSbeZ8mAV37yZu8QoivgT9VUs7?= =?iso-8859-1?q?gdhwy0QCMF2MVcBRpJcNy2S+qBNaej9yT1ybFL0CDWufnYFXU0YdBU3O/orE?= =?iso-8859-1?q?SqdbH1r5fsjV+u0FvmpH29ljerjiGIc2UbcBUueUPgpPe9zsvKpCZWLlatWZ?= =?iso-8859-1?q?9MRDhpA4WhVriooi9O1tMoc5JOyXzJiiPjlNFNXSRYMGmch58dkUo6lcG3N5?= =?iso-8859-1?q?z3xQBiJOECK6NipW5CAP8lRa7H6Wv0O2jh5UKipM7km8xqquwJdlaEmQ1KAi?= =?iso-8859-1?q?kgD+LmrS3Nq2bnJVFUeybr2+tEhnFz0AsG2hXd6SVPKf5PICDYm+9emzFviP?= =?iso-8859-1?q?kierH0sPhkoCfpWEziPPTC3pIuA5XJbn2o/pogJF4fcnuZZpw7VnSYbNHEXD?= =?iso-8859-1?q?pE0lVqzcR8ETZimukyxA7awkMpZw9z3eSXT1bbA7PQgRUtyzvGGouq52AcdY?= =?iso-8859-1?q?+WGhwu/o+FfPUZp1KBnHKRXreNzmeLgN/9PRMNKCHfM/88Qpt1ELCZsmwNnT?= =?iso-8859-1?q?mVmlvWJ8uVgUQynUz87agf8Ulr8HEs8Y35AdGwTp+QU9zy3wY5OJGxmTYr4f?= =?iso-8859-1?q?Gcqk1Y64Cgm9LlgyASQHJReYlUML7g74YsCceIIX7KXRQPALobAe+5O/2dIE?= =?iso-8859-1?q?anih+boSM0o/5J+OoU2MWKRe2M3oyTRU8o76hRkSsjwCo1HZSub0WtewMUFT?= =?iso-8859-1?q?c6/6AyC6W77WUaRuH1AqWeO+Z8tRnP8CGq0jnOPpCY82EPS8DPIm27f8XgRB?= =?iso-8859-1?q?kyFPfe1nAn6UyAI78fo7qv5CPm0mTjIEVc3nnQU6r6t1JX8XihH3YB0r48GX?= =?iso-8859-1?q?51YHy4SGsVN9FslGrlqQadmPu5QXOH6JSwSE3bfxVFOEDvfwnPa6tQXbDaqR?= =?iso-8859-1?q?yxaq3EgZTvl+EbHCkdA4Ix9HGcJEWenu7A6Xy38MvFsJlpi4aKUhAX5raUSs?= =?iso-8859-1?q?+nWVN0KBM1v+MCZVtoA2f24WoTv6vs2toj5sSQxAwf0zyHTevExg/eBdm/Wf?= =?iso-8859-1?q?2CH733PLWGo6cRHhQg3EN3nmUqCm28ncOmxjhkjdicIZrrOdYfjI+EfrSaM+?= =?iso-8859-1?q?gcEZ+oLLBg+UncYR0i8SENKCcLiXi0KOGOW8fw+4UnOaaa6gKCJGA55XV77v?= =?iso-8859-1?q?XpW8JBr1D1lFDTqFnagUbz2VcmB9dL5pKolcngPREvC/9Fobt0T0EBf7KB1L?= =?iso-8859-1?q?HNplw9xVL1poYjA/g8rfO9NwE2ptqCVP7bNhdtsiscSlNJ39GRyyMaLOG4+W?= =?iso-8859-1?q?4XKwP0Qc7S2nOeCiXfPqgw3g=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)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?Jwjb6gBaXjpLkYbrm5RJhb1?= =?iso-8859-1?q?u/s5Qdiu15mESJTbXS66JsRp8FudCE8t1Ic8jo6gC/JVMidiNuntaLV8//sf?= =?iso-8859-1?q?ju92ouEzLmiHB4Oha+e9a6TA5g6uXJXpM2hSFgiHeeSwGTMNlzQZdoXub+o+?= =?iso-8859-1?q?FFZRW8KdVwvUrrw+rqJHjQWSRidOjQ5abqDZmy8iqIDt/ZkBhMJUjTI3pXO8?= =?iso-8859-1?q?NWQ/NkjrPJ6U05kuMjScPiNwqGI4z/dreCU0WW4sxmlfMp6ZpunUpUB93VWT?= =?iso-8859-1?q?VZ3Kh/CtGotIyycKeJLCfkEcK8NGtIcD8VHhd5gbfmaGuHHju/a6RvpVRPZC?= =?iso-8859-1?q?o62GhKGDQEiRYyN/hMJ2ts70dZ8njUEEpXvNzM8aHI73x/82B26q48sp/3lP?= =?iso-8859-1?q?We4JKjXMPlILcw8IKa9y2EuE0AQIuFZ3SL7++KSdkAeHgnZxN/iJfhL21STs?= =?iso-8859-1?q?5SzyT0ZbeW42JJfSsBpfov+ODIgz7AAIjbV/zEvyunonfdYWOIZ0uFZGmJew?= =?iso-8859-1?q?dKgvjQR5EK0B1TCd79DNccK/uXzHb3bbNDnxawzR33DeDX8jkIkx3W3jdWYe?= =?iso-8859-1?q?pgReJgrgfVKAE0aA5VwMWqrYclVkVikYe9H26bEPt59NH4kto9WBHuzRUntr?= =?iso-8859-1?q?92mmaObbE127qk1u5Aa23n/HJy5obKJMPL4F3i7n7IL4wrls4I0W5wR41/nO?= =?iso-8859-1?q?tp+sf+dRSPUVTWaABKKLUs2EbVn/tq0XUBkfCg0aaZ9LddbsINAtkX7IwBxh?= =?iso-8859-1?q?hAQ9jaul4FQeQ6MZiZ30RSx19Agu308AN2pNovnynDD75MqWqdc3kgmjD3mh?= =?iso-8859-1?q?nme3M+jn/aOmc0iuTAXT/GSNVdzAkwP8GcjaKF1oshlnJIgbU2DtiMBskp7b?= =?iso-8859-1?q?GiuNckIr3QY9/iKcl7qdAckqZh6oV7mYXoE3z67Nr0ZUS6WKQkeYRCz4zaIx?= =?iso-8859-1?q?9s2WUQzuuRmimEaZWFIwYwweayjE9uQbiqHCqvDXKXF2gKqAO7hapOKOE3Sy?= =?iso-8859-1?q?uhqDBFLyXR/IcoGo8JLNtJDT6k0UjdePBeMjDS3XoT/IgkYuH8nz/bvCy2Sw?= =?iso-8859-1?q?jd529TlPkeCx3tbWdeIq7rPHPEPeNEawg1WCBIdYvkk0DRLjBdtSlCDmD7RL?= =?iso-8859-1?q?woLUL9OnefG7UBDrQvB9XcddWVRs9tcUR/edAJcForKd/33NWKUdEw+KL69c?= =?iso-8859-1?q?7/I3Wz37MNpmupg380oG74r9L4URNLSh1IzAcfW9GrYvGkq7vkp4guR1p6FK?= =?iso-8859-1?q?QwX4bCh8HFyrfkGPSk93AXWQ6+2/YZ6SuAuynttYgNmw0VSxd4L04yRU6dT9?= =?iso-8859-1?q?/YZWzd2Ca5o7LpvnD329JPPVo1udoZDSQ5Mm56wwHaTcEEO3DSaWkGKJftfR?= =?iso-8859-1?q?URLoAR7k5DoLI7iW47+Wu+rukT7yUegskxyySoagGWJhZoEQy9vsrPRY7sU3?= =?iso-8859-1?q?igCaVnzsA6I8ZbrCDwwLsrRN1IHJBDksA8hpenuQeatxoH8tgQe9JSeS+U65?= =?iso-8859-1?q?5POy0L2b7dkfYfxT+ofZazcEsgK1ABNiz5PQCpNwpiuAUCXqclaJVj/d28Jh?= =?iso-8859-1?q?P0MO09jFTjuQukreBv4jdf5VOvbjNFFhaDGQ9Q+JybU7wZEf2JPxiFZSsaoO?= =?iso-8859-1?q?j2OA4xuh5xSTrK9nRFhKkyd21wDkADmF21X0qYA=3D=3D?= 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: EcYzwUdKVKJ/GQkqOETJqgTOJWkDxydaNbMdwuBrRIErVtPZ+WeyaRTPKWCLv78Rjdnb15eh/A8RMLEPIvC9BOxWG2x7Jsw7ENJeC3BQZnRrF4LxSzt+UsBg3YOEd/EPMX0CH4jlNZp47SEgI29Bws31I8whnql1hKLXHAqn5WvylvzWm8+MfpyIajVtAOKV9KHNQEYCkhcxC20/bB4RULhluw85evz8HiGeNkYriFqWTcAYjd7JMr3ZodAYnQsTYnKL3oKY9T/Ey+z1b8hyY4lUwmUY86Hv+W4s7uoUV9QQ0Lx2o2uSKpTgJWYW4xfEAviZHd2uCNnFxZHWUQ8gtc81UIKRtm9ua70AvLy0i7FDsnvO7xyCTTHcxIPgpJC2hn8jANO+MIbNrO72C4hkiIeCVOeSMyjdq4o3vQWHMrMWncGLVjXoHbtCFAxB2iJgpObjBJ7AR+zfKZTylMfxDrtP2G7QDR7J3YJIQgANbJAMVDpCJK+onwBZTk29Ad8bNmAT17N/bqIEVrej1igcbDi5bCjIac3qbo9hz+GHJuDWvOH0JimIQK0OfVxsjJdl3k9LovhjElozVRL+sH7gxgsO/2yOYWY6LgeguFID5zU7vBAyeJZo6i3T+OX4MTAqxwMrWsdqoxqpg79PwsbzNg== 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: 4379efe4-3648-4029-6c23-08dd197b65be X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:33:13.4629 (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: WQ7BaSgq9lhUjD2tGtpr8vMT+DpBtFk0qCSp0zdH7x5rXGUwnOUNTEseC/SrAuT31BknRdJCBfACZe8TwZcupw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7635 X-Authority-Analysis: v=2.4 cv=fNPD3Yae c=1 sm=1 tr=0 ts=6758ddcd 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=jIQo8A4GAAAA:8 a=yP90TZ__DNoWKlr3i04A:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-ORIG-GUID: IUadUmxtmnXaZ3q-vP0RtLg3o8DNlh-z X-Proofpoint-GUID: IUadUmxtmnXaZ3q-vP0RtLg3o8DNlh-z 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 mlxlogscore=989 impostorscore=0 clxscore=1015 phishscore=0 spamscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 adultscore=0 malwarescore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110002 The status request preparation is done in uasp_prepare_status(). Remove duplicate code. No functional change here. Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index 50c0703e8df6..696d34e04e7d 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -602,8 +602,6 @@ static int uasp_send_status_response(struct usbg_cmd *cmd) struct sense_iu *iu = &cmd->sense_iu; iu->tag = cpu_to_be16(cmd->tag); - stream->req_status->complete = uasp_status_data_cmpl; - stream->req_status->context = cmd; cmd->fu = fu; uasp_prepare_status(cmd); return usb_ep_queue(fu->ep_status, stream->req_status, GFP_ATOMIC); From patchwork Wed Dec 11 00:33:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902651 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 E74E5CA4E for ; Wed, 11 Dec 2024 00:33:28 +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=1733877210; cv=fail; b=Pxaft50LWeyiPZ9N6/F+egC9TcWMg2KAkRzkG76sxb1aVH1cmSl0WpW0ItAzSm5PQWgvx6nNoUuwL2Z/stgy+VmdBMRhgqmTY8cdiKnk7bmF2RiSwj1JenI59ahpGg8aVPJM+GyOR5UEsCXbz8MYwFHgk9goktfCAhxKMouXxWc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877210; c=relaxed/simple; bh=Wuji6LT2OhYc0BxG1tvqdSfRboHVXVHkGAv7h5Cufrw=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=j3qYkCkPvIhraI6418V2OBe0hML5Hk9dP0wnuOyRwFOrjP3DOLWVbQLaV0GSTRxSSJbnNKauFGv5p2IAlgPiEKbyu6jtq4cXesMnsd6X0nmL5ygI74AHcuIJsXpTyXsQUFm9kDfvg1ueJU6HQFV3X9GgHzY8d0LavvPDrnaFt7g= 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=VLXb4GWw; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=G8nBt9bx; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=cEf/P7DB 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="VLXb4GWw"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="G8nBt9bx"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="cEf/P7DB" 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 4BAM2nrY017323; Tue, 10 Dec 2024 16:33:25 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=o2XUnWvwqfaCpfgeNN9GdHQINg6fjBlV3tOJX4Wv6K4=; b=VLXb4GWwCyz2 bddr/MfcNF+ZHcx0L+BNi+fuz0Mf3hFvEdPNSlsYtSdbiMrDoq/7v+u6km6RE9ZV uV7lSqd9cFQAJoslGAYtjCTi6QUkoJo+kGB323tvsuIRswlSVRcFXwWtWRmceCBq Oob8mSw7I5QgET+ruP3SbRipJixOClV+HqezTM+bghtQlUi2UqBAa7lrI9lo2584 X24ZS/p5vnWY679EsqRRLSdws57L49V/B0alAuo2UN5+A25MY0f8dHG89u7kQa28 v38dMlLESE5IrceDgrK4HB9E2waEH2QTF02wnJroJEMoMJQEskZ7Q0jBmM99cxoi 6pjdgEp3Xw== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 43cp60t13e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:33:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877203; bh=Wuji6LT2OhYc0BxG1tvqdSfRboHVXVHkGAv7h5Cufrw=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=G8nBt9bxv+uHEnq1b219anqDLPrUwo01rz+1xpXv7QUl4cPUmzVdbf4k1D7vLT119 LBnAyHMPkhV09N+tAZ5nDXmmZz5BTQq1oBQW5Jd2/OXKj8pYuX9GvXDnq2bLW7yT6b CZbr7vywlobD9II2rFsEIskuOpf3peXdvQ5aSozPSodXHpUZvVQIgfzvvpr3wEBXyI 8XzTrmrf9QwsPyxeA01yNvEYOcVkE01xUtYhLBgWKW2gl4aXKpkWrgTP7HwSyCv0h/ 0vtOtdxSYPdz2Cb7NE6gyNMr8jbz9ukAEEHka0ZfoAd1z/Ys2REWi1Ccgf2wU3K7H/ FXjaTD3ZZIFlw== Received: from mailhost.synopsys.com (us03-mailhost2.synopsys.com [10.4.17.18]) (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 68A2940126; Wed, 11 Dec 2024 00:33:23 +0000 (UTC) Received: from o365relay-in.synopsys.com (us03-o365relay1.synopsys.com [10.4.161.137]) (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 A3848A008F; Wed, 11 Dec 2024 00:33:22 +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=cEf/P7DB; dkim-atps=neutral Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2044.outbound.protection.outlook.com [104.47.56.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id 7126B405DB; Wed, 11 Dec 2024 00:33:22 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bCgJ/x2nJmCqSAhAWtz9g54XAHGyX49KWQdASkgNQikLK5lEWoLIf1mnUZFvfMYfmgN4dXcWYVkCFzIw5ZzCNMcCs0k21feTsKa4z14nXjxCDqJIIZlVz/OACUqLFXL6il960ZsDoXiNU+55veCsiamSBUb31Y8kB5GnJA0i4cKQ1DkMq8lmT2ZKs5rFkzQMURfFkTiq99il2hfPLOWKGeksyUP0DMSDXUU67W3qpqC9d+RiWwBOovMbw8q4ss2NP526r8jRbRbdJBkvRCSKqdXtMyGqSjgSm2jA1Q88A20JtrNLjrV4Wj4UmXLUCpkQOLfMdPF0vqR2VZIypVnlsA== 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=o2XUnWvwqfaCpfgeNN9GdHQINg6fjBlV3tOJX4Wv6K4=; b=mecg9rxfSkyem27utp2tJ1ri4LmbbqKwK7GrD7F3O3pACY0RUW7UkGzoifkqJa4PxD48nhsbO3LgRMZpzrgCtSHy1o66K2nvd0v6J4p0JBj0CwjLbXVRr1gQxemwRgiL1NXHfEWzdLYShjFtJVI1PsoI4a7pvqYwu+fGlFiOvG/LokJS4uTeXoJne9s7vvFNFeHTSD65g6200htOrX6xf8m0f5SdxYZvboOgkysziUO26C59eaS9jZgL1jFJDX2rSeQAiRiuDyU69fYOsVt75UOeOCwB7mm1whLzDDoUahTbHWvx5yBVNsHNbYYGE5E26HfykaawgaUEPXs6BAmvbA== 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=o2XUnWvwqfaCpfgeNN9GdHQINg6fjBlV3tOJX4Wv6K4=; b=cEf/P7DBq9Q/Pyd0+nNa0ptnXAyiuLI5AuUgTLQ3ShTsPX0JBo/MBOnyqf+w0CEQzjfRqenAuJiMsCMjXildktg3VXYKYHIjpEEkO0wJOO/ABTph8gmydVQJeQG1jed8Zib7E/P4ZDQVfdD5HPyJT5lQvp9cj8Pyye9l6lMzdXY= Received: from LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) by CY8PR12MB7635.namprd12.prod.outlook.com (2603:10b6:930:9e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Wed, 11 Dec 2024 00:33:19 +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:33:19 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 18/28] usb: gadget: f_tcm: Handle abort command Thread-Topic: [PATCH v3 18/28] usb: gadget: f_tcm: Handle abort command Thread-Index: AQHbS2RG8nGEvVWhYUear+K57kyW9g== Date: Wed, 11 Dec 2024 00:33:19 +0000 Message-ID: <6d2a05f120a0384e36b5150b50eec53a0991f400.1733876548.git.Thinh.Nguyen@synopsys.com> References: In-Reply-To: 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_|CY8PR12MB7635:EE_ x-ms-office365-filtering-correlation-id: e8ec236a-01a4-4c5e-2ceb-08dd197b694d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?1oa1uFOOHx9h+psGveFFZ1B3cO?= =?iso-8859-1?q?KXjIPLx9dQ1OeJPQYdbM6lciqL7ztGYy4H0LOnBKD1TTZ4Zk33hV7ULT68g+?= =?iso-8859-1?q?2LBR1ZZGD6OiY0XiQLDwRrpiNztu5MHjX+sZVFHX5wroFwT2meUYhD3KdiaP?= =?iso-8859-1?q?/brjt7dey0acGvmSSoExOEu3IcqReK/uFd3dkMrUkA4BlDmh42iaTmDAcbYv?= =?iso-8859-1?q?aEK3WDYUFhOZzVXevHq8BpC9ux7Wvy1inM3+CUVyQpT+XRIvVPcDjhu+50QE?= =?iso-8859-1?q?pZ1IfyZeE8aKr3KZGWTFD9b3ZMw1QnarKj4xSq9X4IDe70v2EcOP7Y+hcFx5?= =?iso-8859-1?q?nNR3qaiu9Tzr72G9PJswFCPmRvPUY18z6YZzY1Vga33G2nslL7jZwYuxWTOt?= =?iso-8859-1?q?hijJ3bsqXzjnpPhlGqavwjQZfb0cPOTMXazEJlUbOiuYhDJyO8+jMlExFDrI?= =?iso-8859-1?q?vOtHedN9cEo/6f0tDVsrJVf8QD1PvIa9r/fwrrO+tStlol3E/w2TSBZ27Zr+?= =?iso-8859-1?q?MSgqMpe0Qbk/KwnkVGUMUc6tGeuirzwNdoNsryLAF7GJdooIsRIeirxBRqfw?= =?iso-8859-1?q?HjFpBmoVse0ZD21FZ8o4si4ZlKCLDYI+sDqsAI0byw5GOAMKCeTqBDyMLi5Z?= =?iso-8859-1?q?mQ/LQQ8nIf3i75/n+QAXETg4ZrMiTKfu1H7kVrnv9W6cit3mGfKXLo1SlMu5?= =?iso-8859-1?q?mEdAbF3alXnb9F7bNiPYe76/s9NPVZCMKIVSILXs1wSBfSbnX2aKqa+OzpWW?= =?iso-8859-1?q?Tp17V0lE0m3NLidsqerjcNw017Hi8ntlFbvyNrqobFyM4Dt0J2C8t5wD1bW0?= =?iso-8859-1?q?LM1wPiOX2rIQ/L87GD+iDwF/2zvGW8o4UINJRAqRf6yOJ0zb0dMnpVV+DOnH?= =?iso-8859-1?q?7+ulJhL7/cpzUWWPjtBQtm1di1dGB7i0aXoRf7lcOUYyzdeWalXKAtct5ZRv?= =?iso-8859-1?q?NVeSO/kMitA87Hq09VD4WPHviJ0La4kuBw2UOz7Os24k4OlnY7VVEaaiiT7/?= =?iso-8859-1?q?MtZg0DR9heFyKjzYVid7c7l5yDTBq0M+1f3T218Zi1fsv3vGGl8EdEZIk4gG?= =?iso-8859-1?q?GdY7Cu19ZFl6+eQEI0WVZBKAdPxIJn27RY1vxAzTJXrQLFmOmy1gKX0/7/F2?= =?iso-8859-1?q?XkiNswwBhn8Og1sE3qa45yVn7mC0S6BJFWai8Nl1vDRWMwqU4qEqIZI0kXz1?= =?iso-8859-1?q?am3ywWYQzXIrYSugG+qu1w8WPGyYJvbR+USjfuRaCPB6f1RwFJNoOa7N/3/J?= =?iso-8859-1?q?ervqBWfzGRcX5DTf12rYK7cdvX8asqYePLiaxuNPOrP0IE0BF9ujKefr95oT?= =?iso-8859-1?q?dOLHQDc6IYusndz94EdxP0MtXrwjv9bIgAtl8eh3E4xjhshRI5s4tYIoNbMa?= =?iso-8859-1?q?YfPeLM6mW50QGF7/IiC+Ys04vIq/Tgwg0iAAHtCCNWZGhMqZTGVyp2IQEbTc?= =?iso-8859-1?q?FL9DhJrYIk41TtpyjwwIjp6Q=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)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?/fefm371Z3b0NDCg5TNRnG9?= =?iso-8859-1?q?HwXoHwdqLHzmijiElms0s92qh8LGYo//GUlutbA6YRf7uVAw0nmSAOzwpV4o?= =?iso-8859-1?q?HUgr9uE32IOyw48kKiNDB7AaR6SM6fZvEmbBOsSacqJE/YAvrPi7zy2XmqEX?= =?iso-8859-1?q?NJEl9cLK0E0eFYTNOuPdJe8MKTmGaWISspLlrmIV8un+gdV9TKMs6ye/yJbD?= =?iso-8859-1?q?9u91J9lFnuxPCT6OG34zERLiQT2+IuKC02qkbLFIFwi7s9W3dqVavDzHJTc+?= =?iso-8859-1?q?oirTHW14LTV4pFBW/bRz4XUDCG4gB/zTV23Si+7Vp2O1f6AX7QMhUzMbYI4v?= =?iso-8859-1?q?GzAbxTfZx9yBgkH2e0gLOwIp1VwjVkzim+nO8aDZ0hbyt61Qor1spsAB3V1C?= =?iso-8859-1?q?AqOWOTL64QtNdfR6XojfRrsib5C8mx9qi0QJerERCye9067CFGS3lNBbuoj5?= =?iso-8859-1?q?VISYeqy98DRmg49Y13dR3MbKvjT+l+lQYFxL5j9OXPZ4Wo1Uq4Bj5yYuuV4I?= =?iso-8859-1?q?S1JLFZ527cYbMluCMJ7I9s11tkDrA0gJ//fgRIoZB+kejqVpVzrefCz3HAmh?= =?iso-8859-1?q?DMWZJf4EnA/zVnpZYn8sjY3Yz5krT5Pwq5xGqriKWd1oiHw8RKbG/CknXiTB?= =?iso-8859-1?q?GfWyaCcQ3JgAlfPyG4xYwON/7oZ15Uy7ks+5VOKOzKDNeJe1VIuxFJVNoGN/?= =?iso-8859-1?q?i/Kt8dgJnAvtwc7fTJe3ZXekPZwiycS2rqJmb99C8Hu8kdnLdo+QRUWJ9KkJ?= =?iso-8859-1?q?W+BjsqnV8Ol/OAsgPnqXaZ+ODI3AStwFO3JZYcCQ94S741V5InopQyzSoVkj?= =?iso-8859-1?q?wY9IFnfvx5JpSALqJnEI8DPXFnuLgJsvTx0wxu0lmk/dK/HmC3/FUNPD1b9H?= =?iso-8859-1?q?toBVZiQKaah7ClHs4SFgzBz7UZVeFEFwE3VJ/xgrP/oL0KGuIaAPq3tYZrb+?= =?iso-8859-1?q?oz0UZ4RN3furYDZeBOr/AWKSVHcQmUC8yO46i3k9e669uCCOV3fYKTMxcoSR?= =?iso-8859-1?q?yloS42hTQOU8QT+gRyvbJMA1xgIHaZVDPMkCMd2L9vymxfYCtRUNHNt5SwWR?= =?iso-8859-1?q?48Cded7nb6S0yKNsfNUmKEs+NJRdhG2fCuqWfPTh23gGU9WEq+b9TANThSHR?= =?iso-8859-1?q?V1hUcGKGhC/LZp9mjBVJvBvt5CvHxfAB5FYigqiKPxqEw5l9ta8Rhyt1tRWH?= =?iso-8859-1?q?C0p3b7CEwbKA8QJWmMZWyFAjm579UDXb107myEk+nW97xB8N1/hFrLQhTTUc?= =?iso-8859-1?q?mxpAMS5od0Ln1xPKiSex5pZz3UpyF3poIYMFpbFrntbGgPrvi0V4VgpPZXHM?= =?iso-8859-1?q?FeiQMvvmmHBKoDkE7AwNkDdypZJFY78RgAw3660cH/JG6g9YOOZxnjcof7Od?= =?iso-8859-1?q?S61IjHfSF8HARZshXYbqH0JVzx1nGpuxPWjW4DAPZzWYr+YMYi5p1tQf1eL6?= =?iso-8859-1?q?6qRSMYIOivLnIm3wd2O2PwP6YK4e/ZCHXG3qkHXW4uTIt+TFvdLrx83ibpYg?= =?iso-8859-1?q?TILyysO8V2o3Drr0jO2Te/vfjFYqYs1ZcEB7XcgMFGamNaGAE9jVL/m8AtVz?= =?iso-8859-1?q?b/DYPzVxyfD9ngbiZmQq6irjOaMS6/tqNSHZlgBJCXiQDvLmLkDYi/oeb363?= =?iso-8859-1?q?EfxM2sqWvAwDT9ugopKdr+zxCgNuiACg3Qw0h/g=3D=3D?= 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: ffiC/6+smkCJDu+UtlXmv9m98SFKyvGzUkwwzfKKpjbb+gETuqNEO2tJPMWqimAUy2vNjP+eAIQ5QTCmG6u6X+fyk/APsKsgYFTcz7jGVRlbL5Wg305BJq6pwzgBdr4uTXRjogs+xhbe4MlVnqVkYZ2lKu5up/IDuCbJOKICXepLHyUw3MM11/mr8nutSCbdDgeEswZ+nfWS7yGW8YMLG8pusBrXoG9Elw/mITSH081ykl1WcjRR5qzMKYN41lVL8A1xOQ28BcP/xAGj25FW/rOKFuo6gHy35arvGW777H/CHeWzNo+zLcCGfp3oYQqdTrJ9l/mqEFBFZyzc7GvZTJ2rHWueEq1+xemeHNsnqxgZKaYR3oUwkUX0xBbC8qpV/hrS33QP1nVXK7rw/j3wowR4nItAyOU+31WEkHIm4eh7oS02PIkMM5Bjz18FnPzzG1Dy675SIn+FvIc+6ZwE6HtTRt+AI+pWcK+39333Eb553TUEzvnN8ofxiIHPF9c2yDyvzV3JqHk3OtdLBOqwn/4Cr9PgVlQbieYWpXMTzew5m3uhLf/JD4t8mYacqLBKAskWMjkFLM+Itje+MKmE0GRpodpX/pug7wt7B8mhY2iiJa6rnHfRQFsnSQxtymtZ+s0+rOGjqIQzpVBdMyR0cg== 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: e8ec236a-01a4-4c5e-2ceb-08dd197b694d X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:33:19.4275 (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: fo2YVQQVu2UCtmtTpoGLNmXbOUKucjv7HHWdxlqrB4lOgjrVLUCwKMit5tBnRaF4diqDyod04j1nKq+pCXXhKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7635 X-Authority-Analysis: v=2.4 cv=Z9YWHGRA c=1 sm=1 tr=0 ts=6758ddd4 cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==: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=jIQo8A4GAAAA:8 a=Shp3TScI-t8v02M12rUA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-ORIG-GUID: 9blWPjtOuDl1mqdIK7W89BnOLM1qrPOU X-Proofpoint-GUID: 9blWPjtOuDl1mqdIK7W89BnOLM1qrPOU 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=1015 lowpriorityscore=0 phishscore=0 adultscore=0 mlxlogscore=973 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 Implement usbg_aborted_task() to cancel aborted outstanding requests. Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index 696d34e04e7d..2a74414c7fd1 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -1257,6 +1257,24 @@ static void usbg_queue_tm_rsp(struct se_cmd *se_cmd) static void usbg_aborted_task(struct se_cmd *se_cmd) { + struct usbg_cmd *cmd = container_of(se_cmd, struct usbg_cmd, se_cmd); + struct f_uas *fu = cmd->fu; + struct usb_gadget *gadget = fuas_to_gadget(fu); + struct uas_stream *stream = &fu->stream[se_cmd->map_tag]; + int ret = 0; + + if (stream->req_out->status == -EINPROGRESS) + ret = usb_ep_dequeue(fu->ep_out, stream->req_out); + else if (stream->req_in->status == -EINPROGRESS) + ret = usb_ep_dequeue(fu->ep_in, stream->req_in); + else if (stream->req_status->status == -EINPROGRESS) + ret = usb_ep_dequeue(fu->ep_status, stream->req_status); + + if (ret) + dev_err(&gadget->dev, "Failed to abort cmd tag %d, (%d)\n", + cmd->tag, ret); + + cmd->state = UASP_QUEUE_COMMAND; } static const char *usbg_check_wwn(const char *name) From patchwork Wed Dec 11 00:33:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902652 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 8FBEAC139 for ; Wed, 11 Dec 2024 00:33:36 +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=1733877218; cv=fail; b=khlM3os70KH/J8T0vF8oUC50xItJ/Q2y5eYJ7uErL8UDT1VulpBRPA3JqSD5oX0vqaFgc8xUrJE3lb3Qsz802YizHzvH8AjKWmnjRdg58wauVW9s5kll35zmiy453TgYL8VJzusubrHuZ6zDSU7nJc5nFFwucfOYUp2zK4PVvUI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877218; c=relaxed/simple; bh=y7y7QB1rITiY4DXIYn75hrsMrqjzEQdIW74GQnWuxmI=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=H6Efw0IqqNY+deqvWMs5gxGd6BdmfNVDBki6yW1lwmWU8WLGQprYz0JJzW0TDVa1TaEzxRAzHcyQO7c7UjBIhH8xW2aiSFWhF2Md+Yy7pMuBgoSt9BucCPaj2tRwhLjhwSaAv2iGwSGmrdJU3IzTefSNXr+mZ5rkYo0RjMuYgko= 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=rCsXjnZu; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=jOsArcvr; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=seWfI2Rp 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="rCsXjnZu"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="jOsArcvr"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="seWfI2Rp" 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 4BAM2iuN017236; Tue, 10 Dec 2024 16:33:33 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=aGwvPBaOH/6OD4a8rbBiEzhkTgAJBc/m5xQmq11EMMI=; b=rCsXjnZu44nW TrWABh/4otCi7m3j/nzlQZ4aZth/I03dJ1iiA9fvrQGYsGOIMhiMBE2/84IpP2ho z4XuS7c2fPy++DRp+x4RUgwU7Czv8y+qSiD7MB2pbFRN933yzRCuvjvz4C8rW3Kt hR1zsn+8b25aOPwpE+P3z+NOol7wDyz7z0Wdb64Hi5VREmS83h029YEgG7IxFbVI t9C1uNw/1qCWVjev5OrtMBdqbeMLRwlzHIVS3mAU/uZ5e7Ws65PjulHc9D80rnCK i0qziiqsXbIJIi/TxQhP1leAu6qK4WkvyoRdV8Lnar7fOc2jTspQovrzIRPWfZ2N 8SCyGzBSSQ== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 43cp60t14b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:33:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877211; bh=y7y7QB1rITiY4DXIYn75hrsMrqjzEQdIW74GQnWuxmI=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=jOsArcvrdIV3b04A+/Rqqy4+abAnb6gXEppuKaMfmUyBLnbq0+Cnu3Kzy/1ip+5qd fal29U0r98FX4U5QRbmWoSsahT8ZrJU1KwYXEa2IVHdS5sY8BUtSzrsxUSthBNGSKe LJm/HakXuSIFfv9noXumMj40yeTwRIslA9zBxFtutNGS/Y12Tp3VcxanlzodYojk4o TA8diUbqmL0VWc5OPWvlCJsmmQKQ9PbOVk8pXaDsQ4BcgVqweoX6atwg3Lf/giS4KT FZKP2KFLU+LBdp8zAU04uymdfWIOEtNYeCKl42snVgCuWPSn99r7LTHN3dH5Ltz52r svVkmXm56aZeA== Received: from mailhost.synopsys.com (sv1-mailhost2.synopsys.com [10.205.2.132]) (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 E2A4540593; Wed, 11 Dec 2024 00:33:31 +0000 (UTC) Received: from o365relay-in.synopsys.com (us03-o365relay1.synopsys.com [10.4.161.137]) (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 A9605A007E; Wed, 11 Dec 2024 00:33:31 +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=seWfI2Rp; dkim-atps=neutral Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2049.outbound.protection.outlook.com [104.47.66.49]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) client-signature RSA-PSS (2048 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id 6DCD8405EA; Wed, 11 Dec 2024 00:33:31 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=d4WDFb83leLkwMyU+IOk7pCKTA7Tc9fYx8pFnrLYIg4wZg0aupqmCNzl67RJpq23WFQWPuP75W2EJSGlomO6IQURCO3CjVFARqecLZ1Oc+HLfPhPdNO+opo7lM/UNOghfke8dk9BpiieuSAVBzbJwTNuhwDU9B0TP6aieicg1q6XLxDurjYmSd5TXMYLXl65fz8moidCUy1RxE/SqNY4ODZR/ekE9CbYFIm/2jdnmXROPnOwsD5HOVEN3Vj0xgkt+yfiyoHrcs+YV6y/E5p8gtXtuVlT0gw6Iu7+GmNMPJZMs+O/Cck6zuz4tM/K82hgZu/LDibV8A5jA3CZoIjrNA== 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=aGwvPBaOH/6OD4a8rbBiEzhkTgAJBc/m5xQmq11EMMI=; b=YBZov54U1yOvxHGGGex0Sfe4ah86oFTdE3kwP/qFva00SpTrvjBy3uPdSYSVG1d+V7NKLdbkAi9npi4ETjdZPm1H6QpXuBVtWQcwQiBKGyRwBCQimx1hwi7LHSQa323ObFcz8oenR1PF/1FSttKvh/tnk8hwVKTP+WXt++ecRVbaSbjAaBDYw4UG7CWQKa9n12v3UvU5oXmsz7Bt+sLlNq7JEiC+Mav+GeCjgp0zeL7fPraxVAwyjMsnR6eyJvsFf3Er3syWm6fud+7BQaGTdRo2fqGnart62Q9SrFRYSO1dFTgR2ikxqGGxnDnygFg/sWw5AtHSeapXDv+VBl/SfQ== 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=aGwvPBaOH/6OD4a8rbBiEzhkTgAJBc/m5xQmq11EMMI=; b=seWfI2RpAu+DUZt02SAO01R4xZh7ZYnVwkiqvRCvde9T+D17Wc4jJXoGIP+o141N1m/A22hz/Ur5oXpLk7szvFLKjocCjieoOG1c1Bz39d1uqdkKADYnM0rQoT+mddOunGAtisNIQCpdGDdyA2r8WV/5DulKnydZ5GsQs3Ac1Xc= Received: from LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) by CY8PR12MB7635.namprd12.prod.outlook.com (2603:10b6:930:9e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Wed, 11 Dec 2024 00:33:28 +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:33:25 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 19/28] usb: gadget: f_tcm: Cleanup requests on ep disable Thread-Topic: [PATCH v3 19/28] usb: gadget: f_tcm: Cleanup requests on ep disable Thread-Index: AQHbS2RK1ZO5JAmPM0+HF0TtLo5Sfg== Date: Wed, 11 Dec 2024 00:33:25 +0000 Message-ID: <6c4ae2b4c2a9037bdcb6f909e173a94b11f04657.1733876548.git.Thinh.Nguyen@synopsys.com> References: In-Reply-To: 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_|CY8PR12MB7635:EE_ x-ms-office365-filtering-correlation-id: 2862dc05-ea59-481b-13cd-08dd197b6d02 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?wEN5m6FHbAFIqmAmEjlHPnnD/L?= =?iso-8859-1?q?IFIC/UfttrDFHvOH4CfL8Sm3kWAsDGMKjt9WNBChaDI7HXl6cYV/YdF3pQEl?= =?iso-8859-1?q?OHTx0td9fWlXnxwly77O0z833O/0aq1Kn5uevehf31bqZsy9hCsK+QKtxH+7?= =?iso-8859-1?q?3CBjHoEfxPibvSMU8OstVJikSycO3dT+AyN5JB1iCD7b2v+5OI4E/6X57ocJ?= =?iso-8859-1?q?+fNGDv7bc+7uNeqCHPiLbD3Rkk6YqXl5QPvWVEV8zr+cChswVL6LXv2fg6nP?= =?iso-8859-1?q?xrWTe3q2fbGb9GsOlyS8dIFOvxrn5VQ2h45HVhCwixmH2MY3e1tH2POWaB4i?= =?iso-8859-1?q?gpVfK5aMpO/1PHTT2WhSWdCNtMmLDsHtp26Orz8PutqDPaXZUNP3fqz4ZGXC?= =?iso-8859-1?q?D5nbn5fJyJ1BeDxNLUEbmn2YuXGpzftFvlCirvod0QbcWBQpb3KP6OIPzq3J?= =?iso-8859-1?q?I7ilqoFwTqFPIeveJl0ZGMtZ+VZQ92t9LmGqijolvrTEcDqscgv93mRUQhHT?= =?iso-8859-1?q?2Hvz5NTt34XE/qNkflsoCyDn4OSpZ4df/2N0jj+z3SyvXsHI15X9NQs9j9B4?= =?iso-8859-1?q?FwiY2i1ieqhAkAGy2pQeum3L3Lt2W5Ogjk7j2E6b0gtGwRbN5e/tFjCQhNoi?= =?iso-8859-1?q?rUuHqUz26Xx3xoQcbGcYzDUmbfZA9gwGJvIu8SOMgSHcOo8CtKfl1wW0Y2SE?= =?iso-8859-1?q?HMrsWttz6IVnHnrE+jjllcYg6B853FGX81npketHm0d4nqFpbUvXb4g3V92K?= =?iso-8859-1?q?yvI0OVGbhqdSfqVbTdzv3NXrXr/TfthpivvFRZMmB86rbFLi7O06f/EcUULx?= =?iso-8859-1?q?Tpv5qNBEynWP9o1YsyZcKVCcRFIHVq4CEuU09vk1KLDuZLWwb1LtUmpgA8D9?= =?iso-8859-1?q?3CAcLUmXi9SuAz8R+BilwmcyrPHdJh6MuII3GQWUhY9Q4g/yGNa2hVmAb6eV?= =?iso-8859-1?q?fZgun/AupfXrqrS24S8jWRRz8cX9ruka8+t8iCsx24HLAAv2byxtI1lTQh8v?= =?iso-8859-1?q?77gjXJu5R8E8eQY3gnEGIVm335kcjhd3//9Rhpu9L+7FF4G1GW9eU+fq+Kxb?= =?iso-8859-1?q?Hj9vy0IGI6vJNt2v2hK2X46khh5CqRsJI/6VtPirBRW9tnl27FaAwXLL+zt9?= =?iso-8859-1?q?bQKEFANqd44GAMtwY85yWfQCH1RWiYVdvuj/+ea6sw5GoiFI+6BExR3UxEhp?= =?iso-8859-1?q?mIr4Pebp5Aay4Qzza7Ux4RHSNVJTp/ASn65ZFZu/1yzgrfXsgdvnveZBcBXZ?= =?iso-8859-1?q?SbTdd0qsVB/uhO8LIuTOm48B7XsZ7MG6McKw0xAhAdOeK3uNQDwjVg3cVWWE?= =?iso-8859-1?q?PXhnY4/9pafsxsPAF0xGIaGfYBIJrN4T1ijU+hj4eZQmIMx7kP3GuXfJjYgg?= =?iso-8859-1?q?1/zexF7ErvGtKRcwa5BhTFC9VysNnxhf7UlxovFYyu/091J4lPnosvjbg0QT?= =?iso-8859-1?q?EfFkSr7D58mWb9aRUBrLyFPQ=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)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?gy1skcHAvRKB/L6avnZ2tzU?= =?iso-8859-1?q?SnHVM2SRGH4NcS1nk8wuKPg5RACLBSg2lU/ryBnR+1VQ9i8eUk+zGzb7+Z1v?= =?iso-8859-1?q?6dqaWooATWUfzrDmUBBuvESV715ObC0NsSx1/yoiuJ/8AcHD5et8dhXSOYil?= =?iso-8859-1?q?+XulnAF2Almy8hRz1m54+QoiN0AZK7dSij0rfuhRZF0rMqeQ/0L9uo9nShUg?= =?iso-8859-1?q?rQO9wXI7zqZ/qsccIbtt/4KoW83hqXPXvCStTRjU4pB9DrytfsDyrUaPxtyS?= =?iso-8859-1?q?srKdCekb1WNS5FNStZ/9TQg3d7LXZJAjdrx/z/z7VZtS/LDPzk/46y5/i0wG?= =?iso-8859-1?q?hhf0BDPUzp6Ob8jCxqKOtCjKugTNpMEC9X56Q9n7VfgL4cnbD4JWOGo44/wF?= =?iso-8859-1?q?U9dmxGonguO0heZZJfqrzSiGMuJ3m7zqCZ/gGloMlqfjW+C4o+TbHJdFv4tf?= =?iso-8859-1?q?pHoiRdkv731Uk6ygBh2iwmftIJcA11eoenARLaVDfuOPpTx7R+uXgqbgIT0i?= =?iso-8859-1?q?WpAMU4J6NH6WLjMBgYFa3NgLasILTFB8uEajXeTibp3SKanM71rVfWvHYe7s?= =?iso-8859-1?q?VJYf8QbI9cTwT6j0Dqp3zGEvYhr1m9yuQKV/Tulv514A4pHQ7k/BMrcC9xwP?= =?iso-8859-1?q?oIaNzHGH6j4fu2cC9jP6b2TSjtm4jlE26hQ1FXZrhF8zHAG73hm3OTMElVwA?= =?iso-8859-1?q?vEhbJSm7flfhOYTzADsCC2kzI1bFRlQZf2KuzpCjzAy4khrsxBRxg3mdQDlZ?= =?iso-8859-1?q?a3EEyeyWUY/3XluAlnKUAeJFVw3aSbtz3LKETG2I87NtyvkVd7DQtrs6d45U?= =?iso-8859-1?q?V3qzNLoEfLYjSD35u4KkwZ0ogD4hepQEgZ4a/FO1v8J88zkoIeT1YaR72SQK?= =?iso-8859-1?q?EYaLwHXVBN8oSLzRrU4r5YcMvrXaMkQEPZUanOBLkPcXc7Hb+0vLH/kqyTlK?= =?iso-8859-1?q?U7BJPvubLIFzcAWNyFnA1lsuD/tE5xotIxyBDlBOXQraFCh7nMlGVi9xs5R6?= =?iso-8859-1?q?mhxVxZ86TteoINXu8Zn5RdqViAiMcj+f8ZdFJxIp8bvQvU6bNbnMgh3tOsmB?= =?iso-8859-1?q?qjZ3HS1aSAurCQgNbyT+BQ3ZHhHQLIqDbvlDM2QdmiE/b2ebmr67kaibkFpp?= =?iso-8859-1?q?sWYghi7U6RIcVoABCaXXtpIW3nHqcr3mqlvRG5o32h+z1/mibrU+I131aZ6N?= =?iso-8859-1?q?reyCQ/SpDzrMNvpfQ0tpJtXhKXWDeTc17GvRSBKB28w7Bxy11ZaUqXgEWR6F?= =?iso-8859-1?q?aS9R92zw+Gq8XRQSm9orr9BOXW/o1NJgyUo5dcVSNuCfIIZQbjhy4vI5zwzA?= =?iso-8859-1?q?ZzwAxiXO0qL0KRCRu8Yu4+RqeO1NnkPagMlqOUldpG3Y6WSkI8ZkEHpHbqu9?= =?iso-8859-1?q?lJn8lkcAzLPjPXNGTGV4YKEIxmjpdxmNbpZQwiwNNNb34SBwvSEJqa5UIFST?= =?iso-8859-1?q?O0tfAy0ZSeKOqGuiP8VzLlSK3jVBexPxe4XKLOtUfeSH6N73MN3BzEnrlI/t?= =?iso-8859-1?q?byJu6uB932z98Q55TbDf5CXY8DahzdGDampXXl68Uz3enPWgG48BQLdXvpsI?= =?iso-8859-1?q?T4RFJEIDJRKPp1SaC9Z/YssQMAxafaM+/XuHLdjRec0vN7k4u64iCci7/n91?= =?iso-8859-1?q?8mTlOJ3WpZDoV2n3sng6qqkDcUVv40SHnbhiW5Q=3D=3D?= 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: qeMpwSPzVydZnaMhMTpyAXFmOEgNEyIMeKhsL5WJaKC+eV9zsGlQdPNSJ5cZjmC/DIlXUqtVvSK/2TXykSeKwVWQFiENsXWANSQD97ROXk7MV2CqvfxzE0QYnzVyprUF6uCXzz9AU6sW63JvAOF20HKB7nKvKSl+DIu3Si26hFWFQTxJhmkUdDgvC8UN09vekBJp0xZCosVcgqbkhn/jUJz0S33y43iZtO1pvLcoa7RbRBv1Jh1dCMV3yoLVHbfhjoZP5T3A9P1S+8R1L+NmrwzI8FCxnrm59rawj+CxYLEc2eafNUojc5j1nx5pUdVhrWHbpJm9HnV9MMFaHQs6VYRgnt+rLSBBdDycBpEr6ixzxt2TxLNNotDgsjAVC8NWBsi6EXa2Hahto6oCTgPn7Z4wTDIFVNcliWBimwGppY+C8EG6GsOjQuTgr84ECRH0/9M7EOpOtu8qB8BmwlY+yOxvC0lUgFi2PPqDWPu1x3o9QTsYQBs6IiHuCez+oIW9CbwjDute4D9pN6/Q2MzQDFW76b8wRjdV7/uD2t53KOFi7MJEWBW6/J23Q4075aDmJHrFkX/iLo8Pkp/pqz+CESxQ/O7w8xVrqx3+O7qihgpQbhHpprCx8wCe/Acpdvk/yBpPNCX7uHTMj607l+TF/Q== 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: 2862dc05-ea59-481b-13cd-08dd197b6d02 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:33:25.6801 (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: C1FfWST2DDAVCeJKv0iB5F9+Gc2d5NtfFRsFi5soWp6v8Ka+84ejc+aj+A/usJMgowTahx+QACFaXhoblwxFzg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7635 X-Authority-Analysis: v=2.4 cv=Z9YWHGRA c=1 sm=1 tr=0 ts=6758dddc 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=jIQo8A4GAAAA:8 a=WyihgUM6s8U50gmrnj8A:9 a=wPNLvfGTeEIA:10 a=kq0wLEfKOPNe3D03ryCD:22 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-ORIG-GUID: bbkzY-ts4-Kk5vAPh9W4FDR5IzXhhzmE X-Proofpoint-GUID: bbkzY-ts4-Kk5vAPh9W4FDR5IzXhhzmE 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=1015 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 There may be different reasons for the transfer to be cancelled. Don't blindly free the command without checking its status. We may still need to properly respond to cancelled command. Check and only free the command on endpoint disable. Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index 2a74414c7fd1..8a5aa58e166e 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -196,6 +196,11 @@ static void bot_read_compl(struct usb_ep *ep, struct usb_request *req) if (req->status < 0) pr_err("ERR %s(%d)\n", __func__, __LINE__); + if (req->status == -ESHUTDOWN) { + transport_generic_free_cmd(&cmd->se_cmd, 0); + return; + } + bot_send_status(cmd, true); } @@ -550,7 +555,7 @@ static void uasp_status_data_cmpl(struct usb_ep *ep, struct usb_request *req) struct uas_stream *stream = &fu->stream[cmd->se_cmd.map_tag]; int ret; - if (req->status < 0) + if (req->status == -ESHUTDOWN) goto cleanup; switch (cmd->state) { @@ -915,7 +920,13 @@ static void usbg_data_write_cmpl(struct usb_ep *ep, struct usb_request *req) cmd->state = UASP_QUEUE_COMMAND; - if (req->status < 0) { + if (req->status == -ESHUTDOWN) { + target_put_sess_cmd(se_cmd); + transport_generic_free_cmd(&cmd->se_cmd, 0); + return; + } + + if (req->status) { pr_err("%s() state %d transfer failed\n", __func__, cmd->state); goto cleanup; } From patchwork Wed Dec 11 00:33:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902653 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 409671C683 for ; Wed, 11 Dec 2024 00:33:39 +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=1733877221; cv=fail; b=ahF0au1hScxjcugCq8jSvXiT3RV/qND5cbepPn0tA+M8GGxMX1Z6w9lTJM3JlqVxW1klsk4dIjflEv2x/J+XW5WKMTphr2YvGiu9oRr50gNFv7Snao8eTfgdoIEL8z5DX3Ixozu0g455SSVxwxVyKs1DMjgEQyzA/zQ4HGKKSCQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877221; c=relaxed/simple; bh=PuyhBbFwjB0sJmxNEgQITo4QkZTXcn7FaSQ7Hgy1TxQ=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=coiG7EHuNepi/ZXs8r6KhmU6ezF2kb1/FdAnOpp63NsGrabhzisbxLQ31JEmuxHqraDr2LV/S3k0Gbl+sBbKbKtKhwcm+3dqL/SMXuXv6etw5Hf3sS8i1DNq8wCmjRxYdBfx7FxKf0DQbr2ItP4gjtVsuXE5+24t9u4oD7xAx2E= 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=SAFwC2TB; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=L+Ouhgx9; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=Y882D3Ai 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="SAFwC2TB"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="L+Ouhgx9"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="Y882D3Ai" Received: from pps.filterd (m0098572.ppops.net [127.0.0.1]) by mx0b-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BAMtPgV000581; Tue, 10 Dec 2024 16:33:36 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=aHURBgCdOxhTFPlNJ9N5wX/XJt7Lu8g/HA2e5EA3Klc=; b=SAFwC2TBQQmg CoO7mZdovOoNFUKM5Xm/2h2Qp9JhumGAaGc24eO6FNYyoYdHDA4aaCZBnsMMbWYb EUbtFaVNE/mXzZkDoIIMKKrnO0w4PnxyzcdlOr5B7N2WWaxDIAzIb1WfsmypLcMZ 2a8pUozNaee6qh6Q44VGfIQ7YTZWH7T/IUi3EVQkIg+L7G2sruLAN95ih3gsTvlE GUXfqlsfj6809hkDddfh+PhlsQ2TPwBo0X01trQFWYARcKa/cG/qd0Za9hZElZQa NiM/JzvFmWs9dqKLnjRTTauNeMp+j/xuZ0Owqdfdm5z8u+Y3cGVp5iBrkNOhbOHM ixjNIimzfw== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0b-00230701.pphosted.com (PPS) with ESMTPS id 43cnvka198-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:33:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877214; bh=PuyhBbFwjB0sJmxNEgQITo4QkZTXcn7FaSQ7Hgy1TxQ=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=L+Ouhgx9OwAmTPG8XN1YFRJsf7GwuGEshnDXawAGE4HJV9PaRbVX+qiNO3d71SsjD 7ZthBreeWI+iv/67BgdiuNoAYl79fLsmbYwKnB4bFpBYQ1HBRZPKw41TWus3sZHpzD SWox7jGru600Z/81rCM1bubpELFUmBgkbpGM9fv1o8Ni1e+8oQc5+YbSgT5VAcA1No dC8n4n2Y/j9g80YN4u76La5uE6Xa9Pv1lQgu7WOE9jJp4pvijowhmcHzzvZyp0VpDe 1niKh3KDsCkVEglCwDKFgzJQ9mXRq78FI91i3kmS7B1SnSef035sQiIR0cAly/5Uur KuQbehjLL6Jdw== Received: from mailhost.synopsys.com (badc-mailhost4.synopsys.com [10.192.0.82]) (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 7D1BE405EC; Wed, 11 Dec 2024 00:33:34 +0000 (UTC) Received: from o365relay-in.synopsys.com (us03-o365relay1.synopsys.com [10.4.161.137]) (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 60970A005E; Wed, 11 Dec 2024 00:33:34 +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=Y882D3Ai; dkim-atps=neutral Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2045.outbound.protection.outlook.com [104.47.66.45]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) client-signature RSA-PSS (2048 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id 1ABCF405AD; Wed, 11 Dec 2024 00:33:34 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZW7OhDpx2L2zsL7BNxWOkZ1vSmsLPtLiYfwn7tWz4kfuoaB6s/DF0RNYzQMeFUkVUZcvvpX5enuJOcXDXSGlip8Ms6T5Rb4ltmpCm4lPoJNuMGYXOdW/v4LTJIDFBmfCJuhZ6lyqaHtbymyXThLpCO4xqYrPUQNBzzn/7qVNgbnmuGoJzCSJHrj8mVwzFSolPs7XPfAg35bLGy8vtxZ8lJhDjUH08dbczUXkob51BfcqVMNgkmeUHdUebmRPGvCzq4erwuEN8IWF0jtKB65a/fa6EYsFdLJCQnzUQC3U/N62zY+qlQmKEDHwabdb0IPFRNtk67gkjSMLuJIDFh1Afg== 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=aHURBgCdOxhTFPlNJ9N5wX/XJt7Lu8g/HA2e5EA3Klc=; b=fNsgd5BpFgatKzTXp9gFUsRwaWMtIvXSl3RFonjHi54JXig/NnOHJ43sJu34J8gUUhfQUC7U1HCIz1qr2m0QFoDkNdTTbOMvGNQlo49m8DmguyLmr1Hvquyn5fpMVUrVvX97KfDcyOSmmQO7IWQxYlPDtJ2Rnc0rk4zSaHiJqL/nEhSsg5FzIyqBaJgUuWstxYhe7cpAYYUsW2jlEhsVnDhIPVXrHUU4ZoV5xCN56ThU7FhG/Uo6f0tEmjEHIHsQCAH4F0WT2JHXw/HpLXWuwW+MweaDU2MzOxlM+U+RygoUXrzKp0vICuJ0JxmQY7hu03DcZpBUWKSafGBsGwF+aQ== 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=aHURBgCdOxhTFPlNJ9N5wX/XJt7Lu8g/HA2e5EA3Klc=; b=Y882D3AiSMUyNArGS5Qaeq1SpK6U0kZJUj4MR0wyVA2kLbnYSO4/jzny97NR1HwyCRnN9j5Xf9XkZNwaMKrtIWx2Fp6cCYVUrHMAqcSsJZkAwjVrVEvMOJrSmBNd9rgVYdjgeCuy9on9+CT1whLhuAJvOINnUds0s18IQZD0LMs= Received: from LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) by CY8PR12MB7635.namprd12.prod.outlook.com (2603:10b6:930:9e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Wed, 11 Dec 2024 00:33:31 +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:33:31 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 20/28] usb: gadget: f_tcm: Stop proceeding further on -ESHUTDOWN Thread-Topic: [PATCH v3 20/28] usb: gadget: f_tcm: Stop proceeding further on -ESHUTDOWN Thread-Index: AQHbS2ROWD2GU/49i0mc5sRQS4rGvA== Date: Wed, 11 Dec 2024 00:33:31 +0000 Message-ID: References: In-Reply-To: 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_|CY8PR12MB7635:EE_ x-ms-office365-filtering-correlation-id: 46314ebe-51c8-4d4f-276a-08dd197b7098 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?cLd5Ttx7eXBQYTSgEQPmP8ogBa?= =?iso-8859-1?q?X8LEWNDAfA0eryZYGFjWV2yp7I3RbXcHWB9it+FyaD8McTn3vMGG66cEHOCS?= =?iso-8859-1?q?yX6gyYK21+aE9lPhDCCHoLFvqO5yWU8f4V3CrTadAybfN793aVHOc9Y5fBM0?= =?iso-8859-1?q?5JtHPBOQ7LHx+0wiFcrhMAcbLjsuLCuFx7dFpOjdRXdjvmQMoTnd4bRzKr/f?= =?iso-8859-1?q?KRd3SgNKJxusravxnqHktLzINt2HFirnHMI8rkWBFqhHhNbRXk7knKYhVLHo?= =?iso-8859-1?q?aGksveqATQRXoULelRbn+ceWDoEN+5dpsky+dE6a2Gso/gr9VqGfzZfE9zkb?= =?iso-8859-1?q?X2AJhAKg0ulYudfm48Q5iiiJ6cQURfLPCdeDZJrkSe5fXo/94RJMa5xlhHH7?= =?iso-8859-1?q?6y4RuOFhSLkxy+qefmFZWGlyQ66i9UMiCzUp7+xE5aDbvJ1jWu+NRtebVg5W?= =?iso-8859-1?q?hOhi7r4R7UgTl9NqmmdBtmgmvrUr3iIkfebO7gozqdpOm/qX/FEhiWv9qUS3?= =?iso-8859-1?q?tKqjPbDsPNM57T/+uc4jDzGmm9fvcKWZwS/zXmTKQtTQC7ykURLnNbWpALYe?= =?iso-8859-1?q?/2oqESSFQRP7dat/k/jfIHxzOAQfGtKA/2iM+vMZARPFjfRaEir3Zst0/vzI?= =?iso-8859-1?q?uZTwO4t/tlsxdlZYP0Lg9MctDGE0LPiX5vgQNKyDgt9Cj5glregxZ7v4iGt6?= =?iso-8859-1?q?W13GI0PDAhIg0Rw2aXpZWW4RXXyfxY0j0P4Lvjinu0bDBgQ75a1oUfFiDkF9?= =?iso-8859-1?q?ghjG1ykZd/KGUuEgxNUhaAWX/35+d2PywGISGH8bIbiOycevDaNvpjaC4z5J?= =?iso-8859-1?q?Dj/dsDtK/V/SM9TMmsGixM2sgF2W7Nb2SXtJWwempi5qkDRiCtDj/vcw0+7w?= =?iso-8859-1?q?O/dDP/cRW0SFfPmkcrBDpop0zublxBcIZG41SHM3TiXGuzRiP9ZGg+xUQhj4?= =?iso-8859-1?q?9E6l9b0NhVkXkGxAroAXCfZTZkmEQJfVvDJq1/tzdFV48YbFcHENqS8arU9b?= =?iso-8859-1?q?03kItfVPeolenFe4CYRVHbg+vk0+ZtepZLRf0C62IiQZtCczHB3Lfqq21YOB?= =?iso-8859-1?q?zg6YJAkmJlR8QT6/AmJpexwXzWy2WArKniVh21Jjv8f50/Vx8DCvBC9p8REs?= =?iso-8859-1?q?cer6SaZkeliPS93qq4aaBiapk0ka8+uejuEz4bnnvIlljfx8alxmkYJhl4Q9?= =?iso-8859-1?q?MfpqzKJttGT3IT2rcYo3UZWT8tBiGgX8fQS1pwaRZVHGAfekIVzRDavgwZ3J?= =?iso-8859-1?q?5C7+ENNzGQpsqk7FFuigbomqK4Ij9kS3MyTqbzjuzRM6QNG9dOUSmMXxoCj2?= =?iso-8859-1?q?Ztz1CnsXuhraV+M5CfpNl0VBVnnbOh78+oNUCChU5CUYiRqfQqfAGTkbHwSs?= =?iso-8859-1?q?s6xMRzMAGX1fPbf9UpkFbOYEvUMKqH1+oiymxp76EWH5So8sF7qh7yI3HSQA?= =?iso-8859-1?q?ZuOGOhCceTuMw0rdHdcnEzNw=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)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?Hv1WYU6R6uhvMDFvJ5l+xEm?= =?iso-8859-1?q?midDdxOuSD/aCYr1roo4uM+T1iNQaAZiokJiTU5FMy9JNeyH+Dg8yHfvOkrh?= =?iso-8859-1?q?bcvbCJNUvx+rm6YI160pTJI0l1VALYwK4QVS+gFtC9k6Qma6YF28gTum8s3a?= =?iso-8859-1?q?Hs12yaUn8fx5dWhovo3wiAzi/ydT8KoP9jt2eAWjHAtqkOp+AVVyF3Hy+YO6?= =?iso-8859-1?q?lhiyKpCnF8ZCHERC+jFEDhVVZxYPuFBs5L22yW2iCyH0Kj8NkKgk4YRYmRoQ?= =?iso-8859-1?q?bINlRiE1ewO74h8EZv6iSsUw6FJ9R4gTEjN/OsjkDqdp72V7zQjHmg2BjAm0?= =?iso-8859-1?q?y8E5wNhGiB/Lyaa9e5VYSIrR61WWY1PXulL7HW6XWznSxyK4fYma4zr84/9P?= =?iso-8859-1?q?B956nZIG0RKloHA0tgl/B7/KuDS/ieiamTZGtskIeZk9bOgMW3QOvTiLUzB9?= =?iso-8859-1?q?AC7YCIzSfixFRgiZrS+427jGw8hxFFkv5UrXieTKWIM9015K8kBZ6LueJzMr?= =?iso-8859-1?q?0/RJg3uJsJQl6H0GMvvl0t3RNwd/5Ia6vC/CNoY+WKKh0lcx/+HCIyM3E2ZD?= =?iso-8859-1?q?OTfTJNraVwRIFE/Aqog3zOk6oEghypnKz4J6C2zzv/xZJjfHcBXTS09FPpGh?= =?iso-8859-1?q?SGPxZJpQk+XkzGmRQFsQT4D8ZcbjZnzwbRfe0HKPxuoIEG/ZL13A6vOnwi6W?= =?iso-8859-1?q?hSiebG0nH0XEJ/GkdsNvht1q31JYYoltsbrYzrg+yE9IG2pylY+c/lOoM4as?= =?iso-8859-1?q?Ggn1BU1uUs2kolI4Pb0qeYCvMNanx8PFLM0nh9Tae75uwUeV4xtDQohOJerv?= =?iso-8859-1?q?sHbSM3d/Q5zBdEQdPd7MHeCOVa8vREoILmjs0Tqab8ueHId+UTqkGqEuSwsP?= =?iso-8859-1?q?I7eEIhuxWvfD0hp8licB/SZ1OOyf6AYBSbNHCAT8QmZ/uGIVnHLuahO7kLqP?= =?iso-8859-1?q?fMGof5AZg8op+Puc2urskwIjx8M8TCLwSRMVNtRi/z1D9YeYJKhSTjh8/NI3?= =?iso-8859-1?q?B3tk5DogaBSK/Pbp+GKzE2+PlxI5LVFwCwFLUu8QWnVunnxLmLS3unqW08lP?= =?iso-8859-1?q?9tNecl6/D8Db3Em92IQgE04g1z28SkhOjJEDmpsoWs4LJBSbnZy+Ykyavd1+?= =?iso-8859-1?q?9vyhOEcXQEbHceOw4paTsa1/JTsNW/nPHUpSpbmNZE65TaBC1vu4jB9Lfdah?= =?iso-8859-1?q?/bEvNGiTwYXxftxHnu7vsPgkr2TWXzHQaw9WYDKR5YEc2bwFU4DPmSd2THZT?= =?iso-8859-1?q?izRBeTIfNxDXQVFL7u+UYdcj1AEa9FFX0RBR/OMvQY1xUYycoNt0WgnrzfNh?= =?iso-8859-1?q?m3ye6G2LOPbP548iv+C0Jc6PezL/wNWqLXV9uNbdjCT5amuU2/cPMzQzTEkK?= =?iso-8859-1?q?SfyWxZ2W45d9zw9F2Ct/ST24xr/TgmRt83Aw9RSCMwBs7V9rrtoN9jHkU35d?= =?iso-8859-1?q?YFYAj+ipn+2fYPGmCdb+AXeDIDL+VSCF26BcXbi3R3E8URo7dsMTTIyk0Cdb?= =?iso-8859-1?q?nMZWgflV5IxaXVB0Ia5dmQvjn75lluK9KiwUy/sG32U/CyHqkMJ1R4NOiv8g?= =?iso-8859-1?q?nH9d0zPJZdixuDnVOMXHDwaH/f+xNeF5vA1dBQ05LKqHXD36I65+MI1Mvy6M?= =?iso-8859-1?q?aSGJPL/dBSovZW3v3kDoJM333yUqrq42k7KWP5w=3D=3D?= 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: EzK/TtGD8ehAMU27RhNoGif7TGHSoVil4CO6KbQRdo4Jy39WJYYS3lcZzTBWCQN4xp0wCEXaW36QsbovOk8hFiWhkMNGZfspC/TQT/dZMnFaRr/pDQik+jpjN2xjc21nNJuB6IPf34fZ0ay23IdTjKYUiqqZ7Wb6mUXCj10mkoVkj/n+SU2rNwg452im9zsa7JoavWzyY4wJbPwma5+crqJgF/pdNWTY+OXaCO1W6L6LssW0M0+4HFYgw/hWQzLuISVRqrJmZokjkJtecaoV4Gui87S3m+J10PB5/suWD21PZ6qTuntWsIzl7M1PTFep+Ver3M6eQ0Q6SiDBqf4jLj7nD/cO20D4Az/9Ji+DRq6eY+mkKUSIV555LoWbHOBIRy1BnysLUIMu9ZFwHvOwTzdPbe9WzE+2ihXnJ+EhFaPUdY53dGSsowsxlrj/ObQvBaUBYV+tSOa8l7PTmYVxJTc+ud81ZfxVVNl9rNLUmGJpgC++tBuc2cgWRZbdzo81yBCer/lh8eWcZmgsyESyeSIPjM3hcPLTz3GfUqDxwdwA4i63mt75yc50HGqnihWrERVBt93reCRimG8VwuOHizeNfN0Mc6DMLiI1o5TEhPp8jBxdXe+xg3htUHvTnCWiLb1BLYLt5ToA3m3wZjk51g== 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: 46314ebe-51c8-4d4f-276a-08dd197b7098 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:33:31.6665 (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: xDw+wM7uUcqwC2qvE9XbjXZ+wLb4rMFyV4trkZejy2+ZpI11HlnpnPrbhGFETEU+q86ueUcsVJ34dTrnvii+1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7635 X-Authority-Analysis: v=2.4 cv=fNPD3Yae c=1 sm=1 tr=0 ts=6758dddf cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==: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=jIQo8A4GAAAA:8 a=CU69Gs6ASZi2hjXg0JQA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-ORIG-GUID: 2AbITtMbTSsUn_y8BBVX6Dx9S00nW0oF X-Proofpoint-GUID: 2AbITtMbTSsUn_y8BBVX6Dx9S00nW0oF 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 mlxlogscore=999 impostorscore=0 clxscore=1015 phishscore=0 spamscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 adultscore=0 malwarescore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110002 If the error code is -ESHUTDOWN, stop processing the request/command further and prepare for teardown. -ESHUTDOWN is for device reset or disconnection. Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index 8a5aa58e166e..6aa341c1472a 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -62,10 +62,11 @@ static void bot_status_complete(struct usb_ep *ep, struct usb_request *req) struct f_uas *fu = cmd->fu; transport_generic_free_cmd(&cmd->se_cmd, 0); - if (req->status < 0) { - pr_err("ERR %s(%d)\n", __func__, __LINE__); + if (req->status == -ESHUTDOWN) return; - } + + if (req->status < 0) + pr_err("ERR %s(%d)\n", __func__, __LINE__); /* CSW completed, wait for next CBW */ bot_enqueue_cmd_cbw(fu); @@ -276,6 +277,9 @@ static void bot_cmd_complete(struct usb_ep *ep, struct usb_request *req) struct f_uas *fu = req->context; int ret; + if (req->status == -ESHUTDOWN) + return; + fu->flags &= ~USBG_BOT_CMD_PEND; if (req->status < 0) From patchwork Wed Dec 11 00:33:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902654 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 2FA97CA4E for ; Wed, 11 Dec 2024 00:33:46 +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=1733877228; cv=fail; b=IStPEdpUguGChVlILuRrRmpTgPHKlG1h3H+8kRSHh5m0UaEhl+2RnyJ6MQdWy/zAW0qa4C+Sxb6i6r+LWDLFC9NQB6n4/Ag/8nvl8xw+VcbzZ1xNU5knfe9LdHIZ4iqbpjtlk1vWWnExnvFbMZz4wszej+d3l8QV61Pj7kensIw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877228; c=relaxed/simple; bh=30ftRg4Jmj9R7n7OrzBjhix+0oJnLNuGdimoGSN0j3E=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=Q7hUYQ2itPW29RO9ae+iJk3/mI2zWH7zBjC62iKUZFmB6p5RxbiPkOYWskE35JQu8tPVqgpAD5ekqh5ZNuAJnm1g61bk++PD7Ou1p8TQQ6NsXVDmKcYXFrAe590jZZPYvMIOV2+OBm/ra3CeZdSZqaf64P3UHAN1TmOnLq596WE= 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=qauCdUzO; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=YDFESKW1; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=iaXxCuda 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="qauCdUzO"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="YDFESKW1"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="iaXxCuda" 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 4BAM2wCv017317; Tue, 10 Dec 2024 16:33:43 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=q3NC0aDaPgk1HYByKqbgq7c8XzFCrpLkuyVpwiRqOmo=; b=qauCdUzOqdO6 vsKUk0hTtvj79o44v3JfXT5M8lyVVseeO7bnXiD12gqE0IMbaeEU+BvPSVJipwWj kFyMeMoWHEfAKO+SiXzQwS88eFDI1/SeAIqpnhcSFKtR5k3huNKtPp3eHI5DI3Jc X3TOcReTOiqV0OxG/ENZA5CeCRL58OXdk9rnTvAMVBs/5kQFk34nIIGfVriLrbVp wWz8y8Pp6a3kPifv9JwYCPA+QPwGZDHL9H4sh7t1ICIAUGmUJtA6/nIUOY6Qhe2j flYRTM2BuLiMyoPqwTbCdKFpFjapj5ic1+xPqIBtH1X5fGRAjKsS7asuCSioQ+yo 0V2eQJKvXw== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 43cp60t151-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:33:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877222; bh=30ftRg4Jmj9R7n7OrzBjhix+0oJnLNuGdimoGSN0j3E=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=YDFESKW1jfia1pIWcx94efxjrMJR49932DShuNzddamMbfK74ti7Rjstfw9tZgkM7 jyDwqxwXeM0XAp2g2Hbbg5TxM1u6zhpQEHk8Ke0zhHPNPTmUKKjXTgDYk44FS5PMph oT9soEU5++YVn8A2q4G9OvyI5Nf3BKJJjIxoyWVZMnaYcw2n4c8LRiU+BkoGe2viCr mfpSDtpHmqkkwzLvyvGCLIsxuXy2xg1cVqx0ZsYLxuKZ95cNyrT8D4IrzyotH9xQpy b4Zw32+N89Jlvl/CAb9XYl/sUGcw1M0MHPBJCciWcTYYn1CFSf+Km+3E/5HwFcgul1 fMb/zvaOJyTSQ== Received: from mailhost.synopsys.com (us03-mailhost2.synopsys.com [10.4.17.18]) (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 11B85401F2; Wed, 11 Dec 2024 00:33:42 +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 CE40FA008F; Wed, 11 Dec 2024 00:33:41 +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=iaXxCuda; dkim-atps=neutral Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2049.outbound.protection.outlook.com [104.47.51.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id 985A34041D; Wed, 11 Dec 2024 00:33:41 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RpvPQj/vj7WWTKeG9S43sYhBKGYumkR59HCU6V64sQZAmLHgnXgeFhDp/99ZVm22nr7RvNh9LdmXQRt4JOp9/YKoLqQG6WTz7Qbv8XZXkCY+AVSU+ms+wiwOm9k3CWJ6EvhsglUBZF8uhmuoMlV9Wt44Azuip0cTtVX5aSIfJjD0GomjpxaES2oynl7JnouiNOBMqgfjY00t7vsIuhEk72azs8BYemvw+V8Wa+jFWSd/VMpA/1rrRVBV2xt7SS5Dt2TxSmnAhnLWzNWFOwn3cb5HU4I26pC14s69U6Dv3fepMFF3tvnNygldpaMKx+5UbAtcgIhsYZw6I0Bekx2Ihw== 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=q3NC0aDaPgk1HYByKqbgq7c8XzFCrpLkuyVpwiRqOmo=; b=apdezKVLpczQacbl/DEpJ7euF0mwtZPCDCH8EUrWeh/K7LYWMdli0my72rapObfWcuklOitRUbw7zLYTdh5Jm9ctwlEmsyKlz+2kzTIrmkc+5zPj8EHQ1hVo+YEaQK23ZtF4UJmNmuyuY4KQPZw61BWeIAvjrZXN1OA6ODozDcKhTn1j9KYRhTwBgk/sfsQyYRWOfONsVMsoaXeqCU6bYvcZnwl0/BJ/nTGmgDx3lpF4k+sQ6mEcGMkdCty3YTtllliXLrjJpZlXxf1IvdrNg4v7yl7cW1/HuyizA8sHnfdUN8zfz7VyFmuTiTw0JXWPDp+eYbGgIoDdZs0/iltrjQ== 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=q3NC0aDaPgk1HYByKqbgq7c8XzFCrpLkuyVpwiRqOmo=; b=iaXxCudaQhqivyUdcsKNrH2NqsiQ/gFyeUexGD1U6ZuJtHJe9mCzOufRC+P4Fx/S3lBSJpcAXw8sWssi+wcit91T9QSmTkRkeyEvgRreMUlTvcIlxy7Aavc6joxTzOUnLKDMHs81wcK2UQ/P+a1I/W4UaX+4tpjwTWvJnvixKKc= Received: from LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) by CY8PR12MB7635.namprd12.prod.outlook.com (2603:10b6:930:9e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Wed, 11 Dec 2024 00:33:38 +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:33:38 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 21/28] usb: gadget: f_tcm: Save CPU ID per command Thread-Topic: [PATCH v3 21/28] usb: gadget: f_tcm: Save CPU ID per command Thread-Index: AQHbS2RSnXzVtU++A06ydDEor1K92g== Date: Wed, 11 Dec 2024 00:33:38 +0000 Message-ID: References: In-Reply-To: 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_|CY8PR12MB7635:EE_ x-ms-office365-filtering-correlation-id: 86cb6e02-63fb-448f-2488-08dd197b74c4 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?SCf2nmDmmDClzIjRlTYnfJ6NUj?= =?iso-8859-1?q?MQ6WFgiFhRqbMsLTl9agg0loRfRulDSEMe/bgUwSPyDWPJjxl0RjdNhkyOXF?= =?iso-8859-1?q?ANqnu/knSiO5sYPGxTneeVVED5Zmh4OIKoxnaJeyG+JJt/dAo9rja3Lj1BhH?= =?iso-8859-1?q?I3n7hDm6mAYJWAfe1vFCJ/1zD7tEutcZmuRahSXfba17nMdwI9QwzNPx1rvl?= =?iso-8859-1?q?LLRXOTYKuEhkV5bLU1GUrzlgMB+dKsU0Z8SIGx0YPNkETdId5lsSyHg6H158?= =?iso-8859-1?q?KECOSYmqiJwjPlX/PO9agfwfOnkZRMNfLR+KlIYmNalc01XJUkdrrsv1u6F9?= =?iso-8859-1?q?7g//STt9bddIzAcO9+A3erMwEXfUnQHD2oYzUVCjY7eI29UOb0nQv51cQGAt?= =?iso-8859-1?q?4Iv5ihHlTAhOiePNiJpyKvXX4Ys7qc1goSEzNOFJbiYoqMSt6qozVxKTN96U?= =?iso-8859-1?q?HjPbSMeX+TLD7okJitbu3OK2bhXUOzV3t9PWHN/PjWaDRhndcdFfFuH7KTei?= =?iso-8859-1?q?Jc9Hv39YH0506ZBZEhiA8y/aUIQcTGyj7yIUmRuwWZZDDX8WqueqhQ0/y3hb?= =?iso-8859-1?q?A+TBZPi5jfn28pl4QWfa14VTMsXYrfSDFS4kyCFauTMSh4wEVKTFeR4S2nUw?= =?iso-8859-1?q?u5/evHriFwLBvhPAucjGWVjCX1pNr4qL5LCV5fGZ2eLwCUncFOhdglIYJswr?= =?iso-8859-1?q?QsXYTJ6RE5QyQKxGdns9aFV0Cx6ekIG91rC0ZBo14FKfRKA1sVe2CFnDbg0P?= =?iso-8859-1?q?kDNOHZV1liqs4tipGPYvBaDVQjZuiT509xgnYjogA8G0TbykFnxEz7mupmJ/?= =?iso-8859-1?q?W057CCJp/ZIUOLCDCfLtg+bsIIdkqE8WOdV20+u54YAZeoH6PRz+Mz9XvrSS?= =?iso-8859-1?q?cii2b0Awiv6KJq7FwjHgrSVIX496I9KA1F1ri+tU/gcTPVv/YB1ROfL3kmpB?= =?iso-8859-1?q?iude8vH+b1qg/YULdQfxH8CHISMjh6zM5MwOFwUxjajvjVruhfmtB7be02Be?= =?iso-8859-1?q?zRCzcbxqGLxjQIvcfPkEH3leVPZ/86rC9fdHcWVPh16VWu59WRsuqNGstAPk?= =?iso-8859-1?q?9dd/6TUY7dQZ9BVDxnGRZiqTG1YYF9bpSPa07xSqLVQOUhwvMsnGjOdz+43B?= =?iso-8859-1?q?jpEIh3S8/iE7bPB2YveM0TkHkgB4feQxudJ+OYP9GbhltAl5ONsm/jHrOAqK?= =?iso-8859-1?q?L5H1IY5ofX8jGBBb8WCy3fX6dPiLfXCOi/aOFtEAp/vJ6PKeAJ/GOwfatVJF?= =?iso-8859-1?q?rFkV3mL9xLSWkL9W/6EKphULeyTwRfEl1Uuu08ZpHOnvw5Zh8+1tM8X5/tAb?= =?iso-8859-1?q?yFbUaKBwqYvP8+jr4cPYGrIZQoJ9pnytcIheG72AGb8ugmnJT33tM53AXPkf?= =?iso-8859-1?q?KsTyv7oqn+8jswtXp/sxOuaHuszzfvmUbetJiggmn10N6efAUygCpoqkH1VC?= =?iso-8859-1?q?eVNXFQNVtOPTMsWja7pzZAIQ=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)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?jk6HYoxNSkXy0dQ1WHo5dn/?= =?iso-8859-1?q?ZiLS+7KT6CLk8/ZxBoNai1JopD3u2886xd26EVOwsffCq8+fwKTLhBUf+fWw?= =?iso-8859-1?q?Ye/BmmaPUoJ5yQYYymRsvv3yeFnyfKlAe3ACLlqzdnuv6mVIa/nHLhLE1/dp?= =?iso-8859-1?q?CoHSXzfRx2jKoGR9ZABw6Qc/odpiVKbWA+jkJnGukMg1cBQ/xT0Sc1UTCsM7?= =?iso-8859-1?q?LKSFABdz/BJc0kgl7b9YNFYZkWjzEis6JaHGbaRJ6uyPU9q240HvNmHLcgOn?= =?iso-8859-1?q?KMGevESnw5GEfx8EoI+FMaQB4SsNbjQHoe1mJlQG5LSUgNOyuCQPjt2GgjyG?= =?iso-8859-1?q?h+JT5lrGDV9QsY49SflTvN6OdzSyQNZQSUwyD2XuY6geHcJ1NhxHheqQWzEH?= =?iso-8859-1?q?r7+hKKWxjJSC0skX7kvn4unNbEH/PjtifrG0Datt4tACmVLLXfWiRJbpTEaP?= =?iso-8859-1?q?LGU3ShWHoEngWKOjfbMBfzxtQ/mauQFHMePlNOMLt3wBB7SaPdpBUCpGNLOz?= =?iso-8859-1?q?lx7IfWeEYDmpzFc1McGDtOgkHXCEJGYcRbER+haAtKHxnb1B/SJS3S8HRA9z?= =?iso-8859-1?q?ZLBOubVjxRFLxogoRKaDkY4x4T21roLmSdaSbZgEfm4ewSrAPJRZCo3vRpsJ?= =?iso-8859-1?q?/IXYnJYB1VT9DgxPjDQN0CI+5QzDoDKufhSMDevwn0zUekzFcVw1QMKet1Fi?= =?iso-8859-1?q?iYpoA4vKhViWT8Dg5haDOR1PP0pJ9CAsECKzQRaeAwz7fbtaPMSIiLewSxHd?= =?iso-8859-1?q?WAv/bHJCn3VfMap/hpETd1fqIi4638mwVIt85EBmg2t4o4WNlwINUMTk6Jhz?= =?iso-8859-1?q?Y/9KHGkdfVZs0yEcpwe9KJ5TXCJEreU0JOK4aOnReNLrke8gqc66T4p6CsfK?= =?iso-8859-1?q?aXiEiwABvpKazXcCFjISFQ+ek7O5Q4VZr27qsN1H0hMQtHtASC0k/CiZ/oeZ?= =?iso-8859-1?q?K1gPQYcpotndCROiD7qNRTecC0hSGuGdFb3v30k92qipn6JZ+dB1yGlVN+/w?= =?iso-8859-1?q?io1Se5xqmXYupDPs4z+nazO1FbebNCmc6Mm1VpC384ipXcw43saDqE36Ydyj?= =?iso-8859-1?q?1O85SXqdpQlTBJa9hIQ5RE8rJ3lEs47R+g+ZQo/34CWjUMSx7tXhE+GhXWl3?= =?iso-8859-1?q?2ZrQccrYEk/9aDS6OVmaBxMvolXtqD5Ng9nT51/xdf2HXC1IMCKs3SYgPugy?= =?iso-8859-1?q?HagGzFlbyHv8URw9CkoQcJ4fMpI/MKhPS9TbDy/TYpBUvhOvLiD8UmhojmZE?= =?iso-8859-1?q?jqdHzt81Pd9WPQUVn9ke79TlAhatxK8b/lY8HM66iLIfuXoKv9Nx1/cC3rXG?= =?iso-8859-1?q?aMGw/qJm2e6lQwpw0y1L4snPu8CmMQOJ2hH0fq1ehh065/fagXIhQ5u5gGoB?= =?iso-8859-1?q?4LKXkLctDAJMIFWUg44sD/8OrYAFxvIcoZYHbgz4lS/LagBNG8Bq5U/FoD9N?= =?iso-8859-1?q?tDXAzkMqSreA/6URRTvxAC/BNl8hmpvAiBTY6EFQ4bE1ajtlvoZk8G0roXVJ?= =?iso-8859-1?q?NFi6xy5YdakoO3QzI1oqGU1PeyQ0NfGVAGDdnJ3JNfk8DlfOgx0157JCMTro?= =?iso-8859-1?q?Emrdiwgfp5QBMXMoiqxBhU29mqM8/57XHC+v9Ge2YMzzNAAo5QWa1kvp2edL?= =?iso-8859-1?q?4jVswRnFHIJkG4q+VMPtzSDeNq/RRzYc4BEtXWg=3D=3D?= 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: un3vfLuaAWttHuYLKL9qVDKYUH0Bx5P13xY4YDo8qevHrqsoSIccYH598pjA5uqFYTRhG0aCg9xbdesNpCfi8BVXrapELii2S2ajokftF4CzB7EInbkzX24MdS92uINV5ZL4uqB9zTVihWW2E9yHSXcS4nu5xg+breZMpKKpcQe1y7kVOMnkc8dETuwf8rjJi25eASiquHEmtUPjmedkEMOia87CAxKNiu8ZbM/iZ4B6icNykaZZhArudkJzA4LmV8uvyflDTCrTJqsbK8oAlvbkE44j3W+4e0foLcL6oFO+0t+MKn7EQBvlSix7+mYgTvOVmoeiUnSbUQ1EF3Ft6gTgI7nd1+03A9QeHmSQybFeUrG7NT9dWr6HUDCDxDSk2UIL/vAbT2+m5DAhfX05dfld2+No9z0mC4gdOKcTvhH75CgqzDfe8XycUF59UsQk5Yrk+9BBz7UVwpzuKACj1MsJqVQBqDpzwKlbYX7gdInjU81stWV6WEuefn3Z2Yt0KICQQRcve1PaaqXuVHsVvRPAbj4codtzzW+qBIuXGbud2DU7EUQObP2mrcC5K1dQq7eI6rre9gNbbO12eyJlECxKEbcGvZiIf78d3h2sf6HqxPt+EDK8aZFjr4RMwzQ3/LQ8KcCj+Z11pjecWtXYzQ== 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: 86cb6e02-63fb-448f-2488-08dd197b74c4 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:33:38.6748 (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: T7Vli/51xI6fnZlzQmA0mckAhEcRhu5IHCj/a3rO8qpZrHrEh340eT+6Ybt46glkVe8hJDMrtseD4Zbr1ItAnw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7635 X-Authority-Analysis: v=2.4 cv=Z9YWHGRA c=1 sm=1 tr=0 ts=6758dde7 cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==: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=jIQo8A4GAAAA:8 a=ZSQD_yvq6OMFtrDGxUoA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-ORIG-GUID: bGWN9CmxNU5LvS1sFZg90cb3bzn0sWXq X-Proofpoint-GUID: bGWN9CmxNU5LvS1sFZg90cb3bzn0sWXq 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=1015 lowpriorityscore=0 phishscore=0 adultscore=0 mlxlogscore=879 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 Normally we don't care about the CPU id, but if we ever use TARGET_SCF_USE_CPUID, then we need to save the cpuid. Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index 6aa341c1472a..da594767ba98 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -1073,6 +1073,7 @@ static struct usbg_cmd *usbg_get_cmd(struct f_uas *fu, memset(cmd, 0, sizeof(*cmd)); cmd->se_cmd.map_tag = tag; cmd->se_cmd.map_cpu = cpu; + cmd->se_cmd.cpuid = cpu; cmd->se_cmd.tag = cmd->tag = scsi_tag; cmd->fu = fu; From patchwork Wed Dec 11 00:33:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902658 Received: from mx0a-00230701.pphosted.com (mx0a-00230701.pphosted.com [148.163.156.19]) (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 EADCC8494 for ; Wed, 11 Dec 2024 00:33:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=148.163.156.19 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877235; cv=fail; b=j1HxEmvU7y5lWX1Ou6WENybaYlifYqzIUQUxyY9wJdNeVYm7F4TvWlO070KO+iyyBrcd8+Fte4GJnPrHX0Arn+TTbybGT0sk76sGZjJyoOHC54EzDf8SkAq8gG064/c8sxTG2cA0K1JevXDv2rZwG6hbtH5qah3oo/bEVg8Jdl0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877235; c=relaxed/simple; bh=K3yn4bl7Vm+aQH5AXRcpRd3WK0uzcUthnC8bl4anqA4=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=Ye1qolnnc6OumBGudtZf9WlYKsvCnWZ8tLOycvXVGDHAahSOqxkO+mutnMDiV/lkBfc7kXg7Q/InNmH397bPQgK8OVS2ErRy4Ggz9v4Y2iHoxJxPIAe7U5Zxy78S8dMy3/OXt7XdZ4S/UWBorArN4SSGIYqsgCCm0VpZzFtv8Yw= 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=qFfyWaYE; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=RStNcXY1; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=pqZ93DqB reason="signature verification failed"; arc=fail smtp.client-ip=148.163.156.19 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="qFfyWaYE"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="RStNcXY1"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="pqZ93DqB" Received: from pps.filterd (m0297266.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BAM4hrn010844; Tue, 10 Dec 2024 16:33:49 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=0oBiYzwvtCSuIZePvlIuhOaq2hACT7HFmKFR8MM0LI0=; b=qFfyWaYEYt3N prVu0vmYfO/xycpuMEH4prWpvyl9HqIrcGCh++RG2TSCeXC0RYKyHbj5uHEv2x+C C9RKPFKFss93CAmAhiGNDIAK4FQRNEIZRZxO++AprQKMynUmIzJYwKo0fEf6rbuA cFEAuLasHqw+2qmNKd3tfjLPyXAZLU+DgoNEiWOHrHbv1GcMV5QiQDk605jHVwfj FuWN8oEHaUlTHH9GbMUlVDNw+NArENCef0ap6Ck/bsRXDF9YJGB8bignvIn7M8zp 4BUY563UKQtcCyu29Pg/qTRMlo1VEmT/CFfEY/o6/ZirwWt06GOk++9XPmzNpTZV cEHyrDPUpQ== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 43cpgb9q3j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:33:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877228; bh=K3yn4bl7Vm+aQH5AXRcpRd3WK0uzcUthnC8bl4anqA4=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=RStNcXY1ngcF3U/0aUe2Khk2YlDkSm80zOrEb8Zp8d3I/rYdXszKW0HTgxlL1O2/v f0br20i25viD6KlZ8A3Dp36BIQVamqIbbmAl569ZaEgES6GPIvNgQd/ObktJYeTlfa sEZB/MXBvzHQq8WZkJ6YfOyq3KyeeULPr4SBca+R17Lm/Gi+SKmQFelPaF8zljsLWi Xff1DI4l3wOUSx9agOgRWOJuc9QZNb4bptVGf6Wbquw0qXpJRr+Eympc43oHgHLhdn 7GTq4U4rAs18aeYGgxCUnCEn+P0lbYVr6PfBzymytX2fm0PpVx+sORpV/jx8fjheXB WhBP53QjT6U7w== Received: from mailhost.synopsys.com (us03-mailhost1.synopsys.com [10.4.17.17]) (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 80C0F4012B; Wed, 11 Dec 2024 00:33:48 +0000 (UTC) Received: from o365relay-in.synopsys.com (sv2-o365relay3.synopsys.com [10.202.1.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 60225A0082; Wed, 11 Dec 2024 00:33:48 +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=pqZ93DqB; dkim-atps=neutral Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2044.outbound.protection.outlook.com [104.47.66.44]) (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 1EA28401E9; Wed, 11 Dec 2024 00:33:48 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PnVmDxoBWfwgnqhGD5enPBbRJ6KKxQdP9EkInjXuPLBegfFT7nhBHHfZNkR45SrvwsxKvMR1KuwYOm2DwpE/GSL+ifSuJOrBVzvBbta8XQUYaltS+1Pam+asJAxPq/c+iAGWB9ymWtpBVr2mZgOMCFVEgaNZqEmJ/KFDDAlfzyZ237XmhcFFLrsYS2MYh+vIYL5IjKTRw5MMKSWCLo4xq8ZRskDuEeY0zwEQONx4RHBnOdKTFlfonYp6naQpMGnl6cvUmL0fDybINV7Rw35iaJ9DVf6nPr2gvVWWmGBjOKRrKzfiaomaZk/AuurzyV3nQcJxbbV2HFspJeT3G15++g== 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=0oBiYzwvtCSuIZePvlIuhOaq2hACT7HFmKFR8MM0LI0=; b=wH1sFro5006y88NCcXvpYnFehUKTBr8iK2cVoMuDPAZ61vUuSheyem+h8IWEPBFWWj9oBL7WwGuohx2EBxY96WAroOnv35ZWGGC6s/DnTavx6DwJD12HAA9ZNgAPKyC4npdq6a18Xjz2lpPUkyqDa888PEZHBRWnVRXPHDTgQ83+fN+0Gh09467a2BHreUIUCMjgzDJaDKir4uGR+Ytp9fKnXPtIDXaBHI710kkzLyk0RleTmC39zL0iML0ndiBOH+TSGcRQdeqmPWOAZoXXEJRqqcZm5R7R9Y4vZ/j/61Vu32AqNG8QujKUUpqSfujcR15vZnK0OYQIxtS8d8R/ew== 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=0oBiYzwvtCSuIZePvlIuhOaq2hACT7HFmKFR8MM0LI0=; b=pqZ93DqB0EQDo+gKsrV/rWWdXcE0OOn12pbHX/B2Slq/BI4VXhITKnjhL40ikXBlWAWaGe/fYR2GwbEKdtK0uIfiQqhSYjec/4D2svsVRrZd11DsiMMu/u/JB1xgC9U+GJ/euU9WKtmjxqSRYZTbaKoDu2jP86tjbwc6c6P+FsI= Received: from LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) by CY8PR12MB7635.namprd12.prod.outlook.com (2603:10b6:930:9e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Wed, 11 Dec 2024 00:33:45 +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:33:44 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 22/28] usb: gadget: f_tcm: Send sense on cancelled transfer Thread-Topic: [PATCH v3 22/28] usb: gadget: f_tcm: Send sense on cancelled transfer Thread-Index: AQHbS2RW9FPQmof2Ukqr4QKSb+VIqA== Date: Wed, 11 Dec 2024 00:33:44 +0000 Message-ID: References: In-Reply-To: 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_|CY8PR12MB7635:EE_ x-ms-office365-filtering-correlation-id: 5501b1da-e32d-4388-c733-08dd197b787d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?OzZ12lAHeYWrHz2NgUIqxHuFNS?= =?iso-8859-1?q?nKwzEuWq/FGY0Df7ntdpnGZtgcQ8Y7BUvaMjumU4yFdxSM0uuSpp+Ba/9rtD?= =?iso-8859-1?q?s6S5bMH1e4LnFA+Xdbt3f6HCUQGQXn7c8FqVA0QWpumQc4XqYQHxVkLBhtOC?= =?iso-8859-1?q?a+EDEZVHy5JD1sgT/uoBDQGEQDHtCc3oCcxL+AOtyw7ZnPpzSNvU0dDqbFMV?= =?iso-8859-1?q?SbyOKhDzWOgiAEzfCXjXVtzcHThvC8qlJfoZJDjn3DD3rV61a6Y8b4yuyMEs?= =?iso-8859-1?q?4e9cRGwHAQOQ0N9QudFGw+aKWRHl9jc0wKgB0mkgdW562mkG5cQuS+f+Myb1?= =?iso-8859-1?q?6ng+D/IJL3iPkfrkS46ZM/N7o+0fvEksDaqBFwEOI/263Ft18k2vKZIUZnCn?= =?iso-8859-1?q?+IWc11DfOfEcvUJ9PzzxoUw+dc9g4vcGhgEiISp1qOXMnAVzrM/er64T1biw?= =?iso-8859-1?q?Li8Dt+Cq5mI2y0/o/F7qn85oEoweSTzrl4dBstS7h0a774kppPN+4e1AkCXO?= =?iso-8859-1?q?VH26ep2EZoYL2+cNod2ciKMmsSFuMojtPB624pcATjQyzsLSugFbYvSdz8ed?= =?iso-8859-1?q?Gc7wF26bxdLIHU1vwJc99fO/Dt37jBWeEd4kjlUqGMvbrasaKh1hSZQNaARb?= =?iso-8859-1?q?iFjyOWtRj39K/UyZj/Hzbf7gqVs2HFkWfvPQEVDC0sODNhDOlOeHm+5oJXPG?= =?iso-8859-1?q?VuYTHVx9fg32Lr0IScW/eQ59hZiFlu+0jyRIa+5sClLJX07MgTFY5YF+Vzyb?= =?iso-8859-1?q?nkvxsXapZ35vXSsAyPppCa3wQB+qmv1ZiTjETYiQ4FrsucJtXGJOrzusXjC1?= =?iso-8859-1?q?katdduNhsi2XickmiuyH4505lGgSC4wHH86QwBdH2/RSNgMyp4Tv85FI8MgG?= =?iso-8859-1?q?yX56Vt53oQ0zTpav/MNSOGNeqkFOrI7DFc+Kd8MCmVSOlPJfq7XfKA52VaXf?= =?iso-8859-1?q?3sbqT+7A3FNL/lShyfVI60KQNtCJggMzAYipOr4Z2aKYSw9bQLznwWx1k1OV?= =?iso-8859-1?q?cI5MTmoUGQfbnXfw2zdAOLIAn7nieYV7LoCMaPzPQp+Pz427sciAUURe+t5o?= =?iso-8859-1?q?X+/xBlw4YTlZ2+Q0pAJVERm4ENZmoIG8GD/WhNb+u94ds8IhmPSy0/wgnvok?= =?iso-8859-1?q?cSDMUk7QK2Wc0lEWb8nzkr0GFZh8ERnY9sFHvRIW9l4ibxNtL70dtGBSQhsT?= =?iso-8859-1?q?yMhBw8eyoCDqUiLc1GIBIulJs64jyqf9iP/I9oHa7sIahvAXLy0hhsf7TNu0?= =?iso-8859-1?q?IoE+cPaa7YVC3qoDLx4Zyi0bxqySRumWDrwz8dmnBKwS29sbes0HavV0G1gx?= =?iso-8859-1?q?19FElHUWzD5tM9vwz9dYh2pbw+mWZRSMx1DbgQqCN9J8cLokCkaFtlwXxb62?= =?iso-8859-1?q?+8KXqjSHUU9TS/lI2wvOiqdfWM7H6iG7xELj72tfAf3ktL+jT3kXQ9r/gCAp?= =?iso-8859-1?q?Bn2JNyA5PCOJmwxesF6qQbtA=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)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?phUf50iMRBLJPr0OMznGs+f?= =?iso-8859-1?q?VJfg/k4/nqB0fZkcPnyq26kzxrWOufvK+LhpKRZmbChLYXg3iqbJ0iT2NQGO?= =?iso-8859-1?q?4Dg+D7SQUNQjQyrVtCpM4g/lXqh/KHrc0wfPV+Yqr8tWT56E31FI0xMEjMHD?= =?iso-8859-1?q?ajYPrpFVU7hF1OTUIjWYSywGYOcPIbN6RYjUP+hl03xf1ui05DGPkhdNLvvu?= =?iso-8859-1?q?rFmAqVlt48oEc9uOVqAaBbo2G59DBe8NZ2IEF7KCz1kLBE3xIDPdvBJG05mB?= =?iso-8859-1?q?G6ROVDInE31tgl4166sK+dmBcuJwt7ckziiyd6pCFfQrInuE9p06197vHb+R?= =?iso-8859-1?q?G6AaHMQ/kl+Bezbpk2MmjFfQQXLRC1gF0U1BQ5dbrzAhT8+9ISzDMqa5Q9jV?= =?iso-8859-1?q?TRePQZRG2pG74taytVvS+iHZ0XrQ/bMHQveyPulTuP4dSwtbtPIyUVmPRbCk?= =?iso-8859-1?q?aW1hbSMX/OZHlHSmTHDJtwR9chCIBJQpKYcZLjmN6xckkNquDwzlpkF994hS?= =?iso-8859-1?q?pnX7xS09eCmHwRf2C2FuSJTLdOSRcrxSsOzrfb24MoL/ZbntGqtfwVaUiH2K?= =?iso-8859-1?q?de162G5Umr6LaV3RCYRcm2oTCzv2VEqAuocXBF7a8NtbV1CSg6AjaLdu0WOU?= =?iso-8859-1?q?tOJVvMBByrq2iTrjH4g4i0601As949hn2Soxn4dOBSM0JRdryoZoali1I4vC?= =?iso-8859-1?q?KkG6Mf0mM2Ld5nnYnXzMvs+4zHMJUUCBn92byCCu2SQQ4/Td73FynVfemsZw?= =?iso-8859-1?q?8Mz0tca5TvSo9sBOAZV9441BXJT/0aQs/woKwuHLSlTP9DReO0ll0hMTUwmg?= =?iso-8859-1?q?aEOs09n57wVO6W5mRqPKHZW1gNCaBW7xyFN/88Qw+OybSI4MStz3gbCBDbs7?= =?iso-8859-1?q?zHcgk7fVuTqjvSK7+THUQ6+AqrN8sLm79f8SwcTugh1GSI9oXV9nwA6TGseZ?= =?iso-8859-1?q?JTbYJVi7Yz+9vqVSE1Vtv7dK5xscu0Coxt4KqH0YVLxaAA08WD17q+mq1E3s?= =?iso-8859-1?q?wzr8GsbhVhzB5KzJMQlUMHP8UJJRhYjbfnFuwH+esO4CjWN2ny+vMkAFExy9?= =?iso-8859-1?q?yMU1jZ8lvixRHzekZ0t39esHZKBJ+amk81k8pn1Uq9MCVisX8GNgg1Netiwk?= =?iso-8859-1?q?EHOcIeyLFuycF3v6YkTW9WAM9d3Vy5/wkMzq0eGYctVvcAv7488NEkXs+WME?= =?iso-8859-1?q?OduEWZynkE3hqm2BSXjmr1r23WsX+GWDaFfuVTGsnCizomoU/C2VYBgXwCm7?= =?iso-8859-1?q?jo3LjPWREvJLTEA+mKIHMvKy3qOAY5++LsavyK6vpYn0bn+36LXoVAeFKxxj?= =?iso-8859-1?q?mBvw7XCB+HU75oZTWwU3lvGILeCSUvoWtTtfZqNusB/qiuXkR91CpI/OcW3/?= =?iso-8859-1?q?xrJV7mUPLrNdO6Uf7SCUBxpGuJNGIqBLa66DGR4IwLSchj02BhA3Rgx6sL4G?= =?iso-8859-1?q?hZLx69M6GnIE1l4KaBw96sQMsOrrZ6ZEIv0/UNAWAQ3kkcC8hx3kBXB5F6V0?= =?iso-8859-1?q?MJrlnGV/DYlQ6PKW5f4TFUppoPr+hMz3nwrQ/elYBZWzXKuCFJpaIv4iTqiG?= =?iso-8859-1?q?UXzFthuG74dC714CIT3gevVdy1eyUPsJGFS5B9iF6L7EzIQqqxIP0TwOrxQP?= =?iso-8859-1?q?shhbgdPZlFqOfMXBL4AV/qwfdyKQ1Jttgb6mhFQ=3D=3D?= 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: chsLKoQm+X0olRpCWpQKMkXGMZL0s+SrdKSI4GUfr+QqhPtNnHXsdj7I0wsYxvC/yJjkJSIN6SX3Dd/D1y2c/rtr1Jkk7fwPY+80Bct1ZnXaQZDuC5kEyUwXs2/NS2QS2tZf430Ls86Bsw9VJN6wWl3v2QE7X//ugTbjwzUdF4ux9C1vKe5QB5Bdavty9q348+JCzt8EQ0vuGdhfSDJ0ifoZBQzPL6UzLaIG/+g5giRZM2xYYK5RAZka9XS69e+qzxP3n4a5tL0rrRw3jO/wDJRV9DywBMBUyWqpirSXFpz19g2qbgqPyYureDXdx6YM2mBJ+lHmLiiV3UVkZBaoto2OEJUxPBz1Lzj06eMwcoumweZ3XY4J6z9WjCT4inC8DI4r7F89Td7bX6i6KrBNuh976vOLK513d7ra7BXnpsfG1kQGpTaHKbqvgeW9ywCs75idJaQvmz7h6Cw8c2jwzvBXJHyTAjVcTXYR2KWtvWFYuXQtL+ngXR3SfOWuaGFaHRr3FSf1cqXrr03e7L5ZIgHYfuIsqlZGW6aHZlUueJR8w4YZfVcON9mJyrTFbzXlKEyulDOxof+o74DK372QMyi621WhV78e2i8FlITVLH2VRnSTO6cGRhgqmL2NhSzi/Je2hP5ddw/UJKCt4dT55A== 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: 5501b1da-e32d-4388-c733-08dd197b787d X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:33:44.9602 (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: +Mlr7D4rc2Tty0ppT+YnsB1RM2EAy77MbBmnY73GdUo9j0WFPTojpDWn1NTWdoWE7wqJC6BgURHdxn5WqeXWpQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7635 X-Authority-Analysis: v=2.4 cv=d+8PyQjE c=1 sm=1 tr=0 ts=6758dded 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=jIQo8A4GAAAA:8 a=qYIINIrsRnFWRYGy51QA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-GUID: 5MK5wF19Kyd7-hyrksLvpvWNPfq0fs0F X-Proofpoint-ORIG-GUID: 5MK5wF19Kyd7-hyrksLvpvWNPfq0fs0F 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 mlxlogscore=824 suspectscore=0 spamscore=0 clxscore=1015 adultscore=0 phishscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 mlxscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110002 If the transfer is cancelled due to a disconnect or driver tear down (error code -ESHUTDOWN), then just free the command. However, if it got cancelled due to other reasons, then send a sense CHECK CONDITION status with TCM_CHECK_CONDITION_ABORT_CMD status to host notifying the delivery failure. Note that this is separate from TASK MANAGEMENT function abort task command, which will require a separate response IU. See UAS-r04 section 8. Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index da594767ba98..c6bdd6023588 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -948,7 +948,8 @@ static void usbg_data_write_cmpl(struct usb_ep *ep, struct usb_request *req) cleanup: target_put_sess_cmd(se_cmd); - transport_generic_free_cmd(&cmd->se_cmd, 0); + transport_send_check_condition_and_sense(se_cmd, + TCM_CHECK_CONDITION_ABORT_CMD, 0); } static int usbg_prepare_w_request(struct usbg_cmd *cmd, struct usb_request *req) From patchwork Wed Dec 11 00:33:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902662 Received: from mx0a-00230701.pphosted.com (mx0a-00230701.pphosted.com [148.163.156.19]) (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 066B817C8B for ; Wed, 11 Dec 2024 00:33:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=148.163.156.19 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877242; cv=fail; b=RVwsqAZBNd6vjaEwupA5Y3NMi+4iYzcazBRgUznNKF4wBkSgGz9NdZZzoVOIYwy6VQWC3N5bjja5pynnmy3pBgwDWxFAjjPblNX6JdkJANy8KtwQYZ0eJ0+d3CCYP9MhN0IdUaa0VUAtCoA/kMipc0hZCs4GjaF7g4aIEFESiic= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877242; c=relaxed/simple; bh=Lr15AbdgDncZ98FAo+OWYqHL624Iax+ytDIK1SHQ5p4=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=ShMDRhbGTqYPDeyf6n8VhG81CxT+NJ93y+eDEyzXz20KbnZszyPacEk7vzy5c0Bmh07ocRC+N7+DZ+LOAc364oWZkmY6lwZZ+GfBFc0RvFLGxRkCioIPsMpoRn26gZnDgwoVJQftdz1i5KncwKHUrudqay5aOHbf+p2rqesbAE4= 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=nLL5kMGz; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=lDv43Z4l; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=NcqEgnjI reason="signature verification failed"; arc=fail smtp.client-ip=148.163.156.19 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="nLL5kMGz"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="lDv43Z4l"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="NcqEgnjI" Received: from pps.filterd (m0297266.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BAMVk65010832; Tue, 10 Dec 2024 16:33:55 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=klS7lpgVmvLHoVeehrhlIaompsbJx6W9uWqzgEjmnLA=; b=nLL5kMGzsx/h 4ccum1H88qtuUlU+RbQrmKSRBrseBEAXLluHfBHcdfaAYZhaaykKzywSDJ9CKE87 oB9D5bXhm66mnf5R5en9DwP8BAeIFuk4Mm8g1TrpKzhFxJkgu40mSAMcLRF4fskg pKaDhEPBqwwMN/lFcmhlT7Afm1eTXT4yHsU+hhyyWAl3zX79cxEjJT+6y37htudh +x9+e4sMytnC7SbWTPqfI1+eBDCJ7JdlBEg7AC4ebaciuQ06UtMfk7QnREAj356N WZDcFHsD6Hnjb7VBD5G4ejNBgftFe0h5Yf7L85odsqcnc0qRijnMR+DG+e25l1m5 hh7xDdN8jw== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 43cpgb9q3w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:33:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877234; bh=Lr15AbdgDncZ98FAo+OWYqHL624Iax+ytDIK1SHQ5p4=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=lDv43Z4l7UdzSwgTKsRCYEWB6VoF/H88xCmqGu3mBRLLfV8h5AzWIISAl6VpGJmx0 TDxnRd1AHHpo3eifo1UXjV2cFWOp/+apFshsLWgIzO6ikgEteojqpeJiLgElYQBfB+ Bp6IREfL4mvWRIi1dZ/levOOmlzKE4wr8N1+Km30CukMx8cwqa8OWL5rH0bHW7qc02 oQoBPgNcwYVLWNhDDdoh5hP0DI+c7VFl0H8Fg0wHw1X9hvjeJvtARUhhqOHZzJXqkJ 7D5bdRsp5qsCUB/p/7FPx6jo1mcXb1Orz3KoVKzlj9UbFUGJBKGza5nUo5E6nwWUm7 SsMjdQ7m5RCRw== 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 1D776401F8; Wed, 11 Dec 2024 00:33:54 +0000 (UTC) Received: from o365relay-in.synopsys.com (us03-o365relay1.synopsys.com [10.4.161.137]) (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 B798EA005F; Wed, 11 Dec 2024 00:33:53 +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=NcqEgnjI; dkim-atps=neutral Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2046.outbound.protection.outlook.com [104.47.66.46]) (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 67EF1405EA; Wed, 11 Dec 2024 00:33:53 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lQCm9gfoFt0KVbdmUbGhz7X32SrfzeMr9e8vugR9GZPl4y4m5gCUa/3/bnxlHTuBoVWLBh504GavmxXuHeH8idMItrRfgjL+gnWs3czHCO+/BJqsyV4l7bYtAvKXHMI4Yac5iCoWOys9c3LBiMB4UhzDxgWO5I8RCuoOGBc+5Kz/IXHKDpWHdA++J6WHtrmD7UMpANzqiYnFI0gPmvtmdcojYWQwFkjE429jyNURmOEHMwMLPxeNYlB72F3sEkcKaFVN7pFdOVQ8CRMifZQ0A2CIbxrxTYBAFv/DaxzI31YIAEsY+i0WN3Hkmr2SFvRokEII4QlGAE10gUj4sCYXhQ== 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=klS7lpgVmvLHoVeehrhlIaompsbJx6W9uWqzgEjmnLA=; b=Pwpa1/niLwyld4TfUyuWGQWmnxOFaHem0klEthOlP6ZUvguegbBKIC2x9TiUX9mVDATTmq9mLb+WSVpy0kfYnQbrG9SbQhmdsluMeE2iTS0FuBnVtp73xwm3yqqrzxafq+6TTc0lS1uK+iBR/A/zdsPnqZkNB1k/yWQMqZkXKJewV+h3N9gkbFRJIxrGNNHNmjqqedBP52oU/fENuQ+ibfymdAV83nmCugCQV4HEq8k5LW58wROF587vwOF8VsR7FYFmlepNnzJiXZlCrLRwsGdKwqPSgZRn/5JlElxl8PeEo/sQXPQr36fcwfPMeaDJIJ7ZR4q/8c+b2XJWwFhebQ== 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=klS7lpgVmvLHoVeehrhlIaompsbJx6W9uWqzgEjmnLA=; b=NcqEgnjIOqw9mVlElJvqRoC8ca01NV+qtCCh62HwVxARPlZao95AI8W7WzxDVLvUODXxMbNopoiSPSdihlMSE2nfat5sENu1quL0lohEuqDy5n4hCEe50FH00p27ETg+J7gCntX4ROGltNG3+NsLlGSq5GUH5pSPWDinKOGC1Xg= Received: from LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) by CY8PR12MB7635.namprd12.prod.outlook.com (2603:10b6:930:9e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Wed, 11 Dec 2024 00:33:51 +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:33:51 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 23/28] usb: gadget: f_tcm: Handle TASK_MANAGEMENT commands Thread-Topic: [PATCH v3 23/28] usb: gadget: f_tcm: Handle TASK_MANAGEMENT commands Thread-Index: AQHbS2RZIqz1YKbGoEi+NnLha4u+vg== Date: Wed, 11 Dec 2024 00:33:50 +0000 Message-ID: <50339586e36509dadb9c208b3314530993e673b6.1733876548.git.Thinh.Nguyen@synopsys.com> References: In-Reply-To: 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_|CY8PR12MB7635:EE_ x-ms-office365-filtering-correlation-id: e77703d6-3d41-437e-a1cd-08dd197b7c13 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?znoP2vOeJaABCckVQnslBZtPNP?= =?iso-8859-1?q?/hK3f/XZJ5XyAeJ/fh01GMv8SUOkTobGlOJm7oKK19DnJjshOx689u76y1aM?= =?iso-8859-1?q?Md99+LuGFulv7l4JCn23v1/sE+nh/fyIsEfaqyN/R08CV0QvR4vdnHsM6/ml?= =?iso-8859-1?q?Uec308Ny30L5Ao+o58FkwAnW+vLOmayz80/Yz8XvJF780xbWpMD71YFVjoaB?= =?iso-8859-1?q?jSarETktP47VxQMJ0AJ9JOZxwwl9dR8gorFT+nfB5EUwVmJ6UU93j+i+oagE?= =?iso-8859-1?q?RTRRyKAQVtmeo8/z5LltbgH6/HZcDeZHkuePysKiW1ILok1jbHRXevPgKaOi?= =?iso-8859-1?q?kTnQXcYvpaieOAdSpVDhqWhDf/iP3HiLsC3x34SCOaQMlrlF26eXbQPkVj4+?= =?iso-8859-1?q?1OwkefX2kyfgYJ2i0M7g9SdfomVYo2eBV2RiKtFreMymxy0pT7vx3mIczfkE?= =?iso-8859-1?q?EVF5dUjsfEmdu+0WEDiGIh2LoiPFv6/jDqHAEY7Wer1+yq3PRrMfhnhpK7XN?= =?iso-8859-1?q?V1/+TyfUYDU7MNyzCIKdy3nQI8b7/inh5MMA0qd7/Fkg3tOBldh2AQsGO75o?= =?iso-8859-1?q?jwfRcHYueu35wlXDJGpEp+DSrd7oncAocPMTsEc3cpWo8MKTjyY7oHS3mJZi?= =?iso-8859-1?q?Ln+VJQj1s2xpWXLTj3sxonf6m2XGQs/4XPJVgsHi72gCXAKy3emCFDaihlu9?= =?iso-8859-1?q?uJP4jwVmZ1XH6nxo6cbKKUUFUgPRAqMMElXLok8wDW8uCYn/ZYRXybA7Fr1m?= =?iso-8859-1?q?4YaRdctBztJleO9AdzQCIBrsjWmRGmOH+DKQuDz0i4Qc9hcRx843JkdnJrUG?= =?iso-8859-1?q?JQFPXy0yPqYbAW/+pzPyCZBwXftr15ECzidcPvcO9AFYWa7ZLvoe+3YkCNDm?= =?iso-8859-1?q?kWO8mt0WWPou+4Uni5C7sbyNctQEpNBun8u/oGB2uES2lD1ojXh1oBeHe+7S?= =?iso-8859-1?q?Rq+bZxbe0r8y0AT15XKP/0Gm+xQ1Q80VeiWHAwSi4G8sRgOQZm4PsCmsDP1L?= =?iso-8859-1?q?ZlerV+f2NJftnnpVvp/R1r4h6XcP53tUWneeu+RLpAdviemqIwMXfjOMsXwD?= =?iso-8859-1?q?YnEI6yxdPZse2MZGmzmHPa5r/wrzyx2mN2Nz8AAMjmgPGoB8sd8RoTxr1dE9?= =?iso-8859-1?q?jGEyJRBE7cWl8gxvk1IkfiZOY28SMv7UcaPsiI9f/2SCDeTc3G1/dj4TyAs+?= =?iso-8859-1?q?VfknAF2OA1occ8ywsQQi2n1ZFfNBv8Ixy0YI/7LqpcMQXck2NeFyRC46kGPT?= =?iso-8859-1?q?jDrq1OffKuq355NdwHbiN6TZXhl/ph/ihQqNpweTafjJPkVgFyAC1nSqvPVV?= =?iso-8859-1?q?8g9upBFa/h6xo6oOXGuunfJPm14yf3vvmhhti8y9BOCyYaHLakE7q0aorcn1?= =?iso-8859-1?q?Jp4FQmnZcWglLdI3qQmyy/68W2era8t+3b2PkaPFwc8eLeE731PE1UU3lun1?= =?iso-8859-1?q?Lo4yGPaygxfFfegHQwbur0FQ=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)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?FpyWK72DzxNwFvq8I3TNuaj?= =?iso-8859-1?q?S6Ktm7rs3SCF8Vvt7px0Uy8TZ2l1LjwfeE5IJww2LLQfF7Nn8AbJCiXZuOjd?= =?iso-8859-1?q?QZSgMA/T5gPtzVOMrRMWFAOudgS+AFShCgiBd2csiIxDkVY4qLTDgCcHilZk?= =?iso-8859-1?q?9TMZr5WwIeoNZKWNX0ZAiZLMRp69osvIgsHfxxKgpNuIT0I4bPtjs5ZuQyoZ?= =?iso-8859-1?q?Y2rOO6UtmV6VDVuZXYgxSZfM408Uz/sh/HWd9BuiHMnroIDBdgNhv0ou+i2+?= =?iso-8859-1?q?l1BdoYqiBvwoANSvLC3pbfD7yurjE98+LSNc1VzMTcp9JNtYn9oosNQz0Bya?= =?iso-8859-1?q?ZjfJuF0ExTgMFwNTbN/5XQ8ESb3blVum6TRNHUVuUbLj6Y7qs8x8ZTAxTYkI?= =?iso-8859-1?q?W151Rm2SpzDvgZ4XjJndTenTH3DiFODJqM+JjQr3Yt5jgmIqIfT/jYo7IQFs?= =?iso-8859-1?q?Qs1IoywYSePK8SFSOk2Kqgqqqn228p1onr9bBxlpNVWzHoL+jz787SB8aWzj?= =?iso-8859-1?q?mABaNrvAg6tcDCnGuJ5WLqy6Rh/Aq5Uk1kki76bdQnKaetbJnyNy72dc6ecc?= =?iso-8859-1?q?LzQmuaRWQbfgnk6ky6gxyfOtJtqL6fOyhZixLkbbhwe+fsRS/K8ALgOIWEuP?= =?iso-8859-1?q?HDIKtppiSxuFCHUUcbRr2oZkM4vY4f8OsIN4dYWDs45IqrnNnBb2pjVvRuxO?= =?iso-8859-1?q?jhwfa63cEay6SSN/Cu5yXAzzhVoL81oFfCmuAwrmhJcdx6F1xjy17CjZFtWc?= =?iso-8859-1?q?NDN0xEPivjAnSw/1q8XSIuKntZ6g1nXkcmkhh8jHXx5FSrj/EUfero08xM/i?= =?iso-8859-1?q?n9fr0412O+T8fLjtcpLfhtD7l7ZbKH+CXZZAFbWi6km4Vj2d7Wi/2RKZAE9E?= =?iso-8859-1?q?BHrlB79O2UDjAhDSBHEhFeQbfo2fZuH4SOPhghRDMF+xYZh4WtZmpufH9NtF?= =?iso-8859-1?q?P2ihx4H4iwFIvUqgrHA8sXGPN3NHZAknpLnPFiuzyMOzSES8r/1dJzETGRKs?= =?iso-8859-1?q?jlD1+zjpiH6lVDyh7RB5ikHeeoV0th6yANTmnpX+cx9yPnJwI+pqBdufBnml?= =?iso-8859-1?q?nam6FZDgWjukp8deCxq7OHLPCo/K6gQjixtdZ1tA0Ym4OycSi536NKI/sHZd?= =?iso-8859-1?q?CxlASYzmg2lTofK73boVozB2ktLy8WnKUWE/m2EuY2PS/pxsjSG2Z0cFaDn4?= =?iso-8859-1?q?rmfWnahMhurf/IX7dPIzq+oPyiRKlQVf+fn6IhkMVmuBAZH2nBlXz9JgtY1c?= =?iso-8859-1?q?jAhVRmCZMM9ucuenQ6ywgwLb9dZyDsCqa/BFqi7sNNnMOZEj5iyhwhJIQvu+?= =?iso-8859-1?q?k68yLKOIr+WlVxBkdhW2oprnrjX9UarZmQuZ8lKp5jH6Q5EU3inLs1sTLuYI?= =?iso-8859-1?q?xlaK5KUDbHvbszaFfi+5zgrFDyET1QgHOPFrNSNUXOrnG4K7gbxfsTYuQCrX?= =?iso-8859-1?q?ACUD5iEH5B/MXzdGjiTBhGSvPzD76fzQJ420N30Q/AtY+D7UEv2FFEtjhVo3?= =?iso-8859-1?q?/GCmtEpCmb/QlccGi+q8bDk3XtLzvxXM1V4nEF4VePFXXxT2iOELNkvfayvi?= =?iso-8859-1?q?1V7zpiYZJa42l3E/NWxm7VT784Q7l8WsqLdXcg/YqyO9SUJ8V+NV7wVHW9cw?= =?iso-8859-1?q?zeqIF0Any8lqfi3xGdFUZBdJKVNMCI7f3Usi5FA=3D=3D?= 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: j9XT/shZF6TwZKAlkgOiDq3Qk55nMZ2G/X/lfa+2Q1gz7Mp+1vHtuWey5zY8RAkV3+YRB68s76NDIJ8Grf124ZI7PSqjAOO93dQmAiYuWf+oJYnYwv26fzK1g+ADYrwnXh8htVvcmMmqIuHxcVco2lR+hQPtP/SZnhaDmjt82mXriQvAxBG2/jzIERpUBckG5ocEvqs8TNztt2NtNJdi/TenugMIN0vJ1P8oFm6EG/KE4EOVCGERuSd+MEIx6xhIqHSJZ2SZEK056DmSeWMhK/Vs5JuYGjDMZGY7xuxFPPvnZmeJxq6lW1oT/1oa/EPwb+MvlCZ6v3WsErCTqwaKEkIVBwPXwfVRMwf4r7XXbaZ6o+T/CUh9fFtE/S07w0zhc66pWnZtHt1O6ml8TfJR1U6gwm/EfD9jun7Pa9O73FvNzhBi65UH57Dg3366JWo+aJy7p0pwZ9TRoOQE3sHQwVjN4Uny7xE2sa1OI+fuKHu4FgIQHUWb0j7ifi+zzzsGNWOBsBEUulLh800e3cNhILVwCuRuy4X2EKhDOJH5/j+NdBpzpO5tE0qp6yPz0qAmZWG0xoqV0iO6iupke02BP1pJyk+pz/BQ9uzI//URyB3u+soq4gYJ81wwl7GhT2s7zkjcgtu8UPx/TnmCSPopQA== 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: e77703d6-3d41-437e-a1cd-08dd197b7c13 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:33:50.9757 (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: KN5uQLXF04ZJI8/A6LH0EHI0hyW4PmhOMLE17i24RcpOTjppGyTLbA2RYE9ylDusvja8AYdRiI8isgN8qqHeSA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7635 X-Authority-Analysis: v=2.4 cv=d+8PyQjE c=1 sm=1 tr=0 ts=6758ddf2 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=jIQo8A4GAAAA:8 a=mpyWSJtGwHFLCFruFkwA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-GUID: aBHDLRwi63KrAtPDE3QwFxOUcKee0Zwv X-Proofpoint-ORIG-GUID: aBHDLRwi63KrAtPDE3QwFxOUcKee0Zwv 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 mlxlogscore=999 suspectscore=0 spamscore=0 clxscore=1015 adultscore=0 phishscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 mlxscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110002 Handle target_core_fabric_ops TASK MANAGEMENT functions and their response. If a TASK MANAGEMENT command is received, the driver will interpret the function TMF_*, translate to TMR_*, and fire off a command work executing target_submit_tmr(). On completion, it will handle the TASK MANAGEMENT response through uasp_send_tm_response(). Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 220 +++++++++++++++++++++++++--- drivers/usb/gadget/function/tcm.h | 5 + 2 files changed, 206 insertions(+), 19 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index c6bdd6023588..3e04ce40a4a0 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -449,6 +450,45 @@ static int usbg_bot_setup(struct usb_function *f, /* Start uas.c code */ +static int tcm_to_uasp_response(enum tcm_tmrsp_table code) +{ + switch (code) { + case TMR_FUNCTION_FAILED: + return RC_TMF_FAILED; + case TMR_FUNCTION_COMPLETE: + case TMR_TASK_DOES_NOT_EXIST: + return RC_TMF_COMPLETE; + case TMR_LUN_DOES_NOT_EXIST: + return RC_INCORRECT_LUN; + case TMR_FUNCTION_REJECTED: + case TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED: + default: + return RC_TMF_NOT_SUPPORTED; + } +} + +static unsigned char uasp_to_tcm_func(int code) +{ + switch (code) { + case TMF_ABORT_TASK: + return TMR_ABORT_TASK; + case TMF_ABORT_TASK_SET: + return TMR_ABORT_TASK_SET; + case TMF_CLEAR_TASK_SET: + return TMR_CLEAR_TASK_SET; + case TMF_LOGICAL_UNIT_RESET: + return TMR_LUN_RESET; + case TMF_CLEAR_ACA: + return TMR_CLEAR_ACA; + case TMF_I_T_NEXUS_RESET: + case TMF_QUERY_TASK: + case TMF_QUERY_TASK_SET: + case TMF_QUERY_ASYNC_EVENT: + default: + return TMR_UNKNOWN; + } +} + static void uasp_cleanup_one_stream(struct f_uas *fu, struct uas_stream *stream) { /* We have either all three allocated or none */ @@ -552,6 +592,61 @@ static void uasp_prepare_status(struct usbg_cmd *cmd) stream->req_status->complete = uasp_status_data_cmpl; } +static void uasp_prepare_response(struct usbg_cmd *cmd) +{ + struct se_cmd *se_cmd = &cmd->se_cmd; + struct response_iu *rsp_iu = &cmd->response_iu; + struct uas_stream *stream = &cmd->fu->stream[se_cmd->map_tag]; + + cmd->state = UASP_QUEUE_COMMAND; + rsp_iu->iu_id = IU_ID_RESPONSE; + rsp_iu->tag = cpu_to_be16(cmd->tag); + + if (cmd->tmr_rsp != RC_RESPONSE_UNKNOWN) + rsp_iu->response_code = cmd->tmr_rsp; + else + rsp_iu->response_code = + tcm_to_uasp_response(se_cmd->se_tmr_req->response); + + /* + * The UASP driver must support all the task management functions listed + * in Table 20 of UAS-r04. To remain compliant while indicate that the + * TMR did not go through, report RC_TMF_FAILED instead of + * RC_TMF_NOT_SUPPORTED and print a warning to the user. + */ + switch (cmd->tmr_func) { + case TMF_ABORT_TASK: + case TMF_ABORT_TASK_SET: + case TMF_CLEAR_TASK_SET: + case TMF_LOGICAL_UNIT_RESET: + case TMF_CLEAR_ACA: + case TMF_I_T_NEXUS_RESET: + case TMF_QUERY_TASK: + case TMF_QUERY_TASK_SET: + case TMF_QUERY_ASYNC_EVENT: + if (rsp_iu->response_code == RC_TMF_NOT_SUPPORTED) { + struct usb_gadget *gadget = fuas_to_gadget(cmd->fu); + + dev_warn(&gadget->dev, "TMF function %d not supported\n", + cmd->tmr_func); + rsp_iu->response_code = RC_TMF_FAILED; + } + break; + default: + break; + } + + stream->req_status->is_last = 1; + stream->req_status->stream_id = cmd->tag; + stream->req_status->context = cmd; + stream->req_status->length = sizeof(struct response_iu); + stream->req_status->buf = rsp_iu; + stream->req_status->complete = uasp_status_data_cmpl; +} + +static void usbg_release_cmd(struct se_cmd *se_cmd); +static int uasp_send_tm_response(struct usbg_cmd *cmd); + static void uasp_status_data_cmpl(struct usb_ep *ep, struct usb_request *req) { struct usbg_cmd *cmd = req->context; @@ -590,9 +685,23 @@ static void uasp_status_data_cmpl(struct usb_ep *ep, struct usb_request *req) break; case UASP_QUEUE_COMMAND: - transport_generic_free_cmd(&cmd->se_cmd, 0); - usb_ep_queue(fu->ep_cmd, cmd->req, GFP_ATOMIC); + /* + * If no command submitted to target core here, just free the + * bitmap index. This is for the cases where f_tcm handles + * status response instead of the target core. + */ + if (cmd->tmr_rsp != RC_RESPONSE_UNKNOWN) { + struct se_session *se_sess; + + se_sess = fu->tpg->tpg_nexus->tvn_se_sess; + sbitmap_queue_clear(&se_sess->sess_tag_pool, + cmd->se_cmd.map_tag, + cmd->se_cmd.map_cpu); + } else { + transport_generic_free_cmd(&cmd->se_cmd, 0); + } + usb_ep_queue(fu->ep_cmd, cmd->req, GFP_ATOMIC); break; default: @@ -616,6 +725,18 @@ static int uasp_send_status_response(struct usbg_cmd *cmd) return usb_ep_queue(fu->ep_status, stream->req_status, GFP_ATOMIC); } +static int uasp_send_tm_response(struct usbg_cmd *cmd) +{ + struct f_uas *fu = cmd->fu; + struct uas_stream *stream = &fu->stream[cmd->se_cmd.map_tag]; + struct response_iu *iu = &cmd->response_iu; + + iu->tag = cpu_to_be16(cmd->tag); + cmd->fu = fu; + uasp_prepare_response(cmd); + return usb_ep_queue(fu->ep_status, stream->req_status, GFP_ATOMIC); +} + static int uasp_send_read_response(struct usbg_cmd *cmd) { struct f_uas *fu = cmd->fu; @@ -1016,9 +1137,23 @@ static int usbg_send_read_response(struct se_cmd *se_cmd) return uasp_send_read_response(cmd); } -static void usbg_cmd_work(struct work_struct *work) +static void usbg_submit_tmr(struct usbg_cmd *cmd) +{ + struct se_session *se_sess; + struct se_cmd *se_cmd; + int flags = TARGET_SCF_ACK_KREF; + + se_cmd = &cmd->se_cmd; + se_sess = cmd->fu->tpg->tpg_nexus->tvn_se_sess; + + target_submit_tmr(se_cmd, se_sess, + cmd->response_iu.add_response_info, + cmd->unpacked_lun, NULL, uasp_to_tcm_func(cmd->tmr_func), + GFP_ATOMIC, cmd->tag, flags); +} + +static void usbg_submit_cmd(struct usbg_cmd *cmd) { - struct usbg_cmd *cmd = container_of(work, struct usbg_cmd, work); struct se_cmd *se_cmd; struct tcm_usbg_nexus *tv_nexus; struct usbg_tpg *tpg; @@ -1059,6 +1194,29 @@ static void usbg_cmd_work(struct work_struct *work) TCM_UNSUPPORTED_SCSI_OPCODE, 0); } +static void usbg_cmd_work(struct work_struct *work) +{ + struct usbg_cmd *cmd = container_of(work, struct usbg_cmd, work); + + /* + * Failure is detected by f_tcm here. Skip submitting the command to the + * target core if we already know the failing response and send the usb + * response to the host directly. + */ + if (cmd->tmr_rsp != RC_RESPONSE_UNKNOWN) + goto skip; + + if (cmd->tmr_func) + usbg_submit_tmr(cmd); + else + usbg_submit_cmd(cmd); + + return; + +skip: + uasp_send_tm_response(cmd); +} + static struct usbg_cmd *usbg_get_cmd(struct f_uas *fu, struct tcm_usbg_nexus *tv_nexus, u32 scsi_tag) { @@ -1085,34 +1243,58 @@ static void usbg_release_cmd(struct se_cmd *); static int usbg_submit_command(struct f_uas *fu, struct usb_request *req) { - struct command_iu *cmd_iu = req->buf; + struct iu *iu = req->buf; struct usbg_cmd *cmd; struct usbg_tpg *tpg = fu->tpg; struct tcm_usbg_nexus *tv_nexus; + struct command_iu *cmd_iu; u32 cmd_len; u16 scsi_tag; - if (cmd_iu->iu_id != IU_ID_COMMAND) { - pr_err("Unsupported type %d\n", cmd_iu->iu_id); - return -EINVAL; - } - tv_nexus = tpg->tpg_nexus; if (!tv_nexus) { pr_err("Missing nexus, ignoring command\n"); return -EINVAL; } - cmd_len = (cmd_iu->len & ~0x3) + 16; - if (cmd_len > USBG_MAX_CMD) - return -EINVAL; - - scsi_tag = be16_to_cpup(&cmd_iu->tag); + scsi_tag = be16_to_cpup(&iu->tag); cmd = usbg_get_cmd(fu, tv_nexus, scsi_tag); if (IS_ERR(cmd)) { pr_err("usbg_get_cmd failed\n"); return -ENOMEM; } + + cmd->req = req; + cmd->fu = fu; + cmd->tag = scsi_tag; + cmd->se_cmd.tag = scsi_tag; + cmd->tmr_func = 0; + cmd->tmr_rsp = RC_RESPONSE_UNKNOWN; + cmd->flags = 0; + + cmd_iu = (struct command_iu *)iu; + + /* Command and Task Management IUs share the same LUN offset */ + cmd->unpacked_lun = scsilun_to_int(&cmd_iu->lun); + + if (iu->iu_id != IU_ID_COMMAND && iu->iu_id != IU_ID_TASK_MGMT) { + cmd->tmr_rsp = RC_INVALID_INFO_UNIT; + goto skip; + } + + if (iu->iu_id == IU_ID_TASK_MGMT) { + struct task_mgmt_iu *tm_iu; + + tm_iu = (struct task_mgmt_iu *)iu; + cmd->tmr_func = tm_iu->function; + goto skip; + } + + cmd_len = (cmd_iu->len & ~0x3) + 16; + if (cmd_len > USBG_MAX_CMD) { + target_free_tag(tv_nexus->tvn_se_sess, &cmd->se_cmd); + return -EINVAL; + } memcpy(cmd->cmd_buf, cmd_iu->cdb, cmd_len); switch (cmd_iu->prio_attr & 0x7) { @@ -1134,10 +1316,7 @@ static int usbg_submit_command(struct f_uas *fu, struct usb_request *req) break; } - cmd->unpacked_lun = scsilun_to_int(&cmd_iu->lun); - cmd->req = req; - cmd->flags = 0; - +skip: INIT_WORK(&cmd->work, usbg_cmd_work); queue_work(tpg->workqueue, &cmd->work); @@ -1270,6 +1449,9 @@ static void usbg_release_cmd(struct se_cmd *se_cmd) static void usbg_queue_tm_rsp(struct se_cmd *se_cmd) { + struct usbg_cmd *cmd = container_of(se_cmd, struct usbg_cmd, se_cmd); + + uasp_send_tm_response(cmd); } static void usbg_aborted_task(struct se_cmd *se_cmd) diff --git a/drivers/usb/gadget/function/tcm.h b/drivers/usb/gadget/function/tcm.h index adf4c415140f..d37358f09819 100644 --- a/drivers/usb/gadget/function/tcm.h +++ b/drivers/usb/gadget/function/tcm.h @@ -85,8 +85,13 @@ struct usbg_cmd { u16 tag; u16 prio_attr; struct sense_iu sense_iu; + struct response_iu response_iu; enum uas_state state; + int tmr_func; + int tmr_rsp; +#define RC_RESPONSE_UNKNOWN 0xff + /* BOT only */ __le32 bot_tag; unsigned int csw_code; From patchwork Wed Dec 11 00:33:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902664 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 8359422339 for ; Wed, 11 Dec 2024 00:34:04 +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=1733877246; cv=fail; b=B44zT+ABm5wCmnO/kcGg8r/dV2F9/wYrUGDTiqWnm4dHYYhROTiPgR8S6ITP6HkteD6pxFGVJ+KioDef2NK+r8SpoJ8top4fPMmKOLu3QfPpNAesrdC4MFI8RviOjWTKQe1qSTVkNtPIOTy3UjnWPMCPkDI4crcjvCXqPuv5tgE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877246; c=relaxed/simple; bh=dbAQUnC1izYOFoUbny3aT/bLDQGwx6Jqor3LDPMZkYk=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=Q0VXry/DrSHVz0W7E5OXvpeLGuC5gT74Cw9r26v5HyI4VRgfg6KG7xlvtXQ8gB3MGOk8yJ3fPs4NXus33uexWbQhdx/QNcAqsqo9fMV2FQD/uY6S3ivs1Fe3Gj0ksC8u1umW3sZpZRsNpIvLxUF5wgtlYcAOBpkv9DSN9oY+Sm8= 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=saDVUjKn; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=EY5WWDdK; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=XsskEE2L 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="saDVUjKn"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="EY5WWDdK"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="XsskEE2L" Received: from pps.filterd (m0098572.ppops.net [127.0.0.1]) by mx0b-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BAMtPgY000581; Tue, 10 Dec 2024 16:34:01 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=3Z4QLJrjh7iu4dKRFZjUzlHhnmWq84RJWby0PHV7H90=; b=saDVUjKntyMQ KAbRjq69oExSt66uVe2FF79MfHjbxpeml5jGdpbSVXAWuspZQ6yNKpdB7QCYRAtB B0JOowakpeBhgyni9m96O6r+cihYJM6QHg/Kc/PZA3OrACOWzqWQmbUWwQt+DNlN dn+NwOSZoes18RP+L5GrflZbQMG8wURxtYz1c8qbNjJnG3HmCsQPk+3qjaND5nPg yqazVw1W47aCkYtCbGJU0h0NeP92bnV8hPrPAV/Zqw7SgMTqa4BffJXyTYuw1PBm FlxfjKEZ1so1Xn4uTb8zmpuq+442HiU6itwJ3vf2dfReOz5bTxW6caL5FMmaQkz8 Lcef5jjnBg== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0b-00230701.pphosted.com (PPS) with ESMTPS id 43cnvka1b3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:34:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877239; bh=dbAQUnC1izYOFoUbny3aT/bLDQGwx6Jqor3LDPMZkYk=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=EY5WWDdKQ/vJ/N1dmuqAuBZ5FPRGcc6vehja4+lHp1rP1INTR5hEcJPMO1mqvo9y0 w20c6r/Sxuq0s+YdIwIAKMqRPYxg9UAlmWqUHY96WzIG0v1AfLx30kMwuEmaWJvZWz zpIlx3WXcjV9BwyGlxA7LerjrDTVo9W3zSoYoLuGPaFYuvANg33pA06EtrBpQvKUoX e27cCeDPQjI4yxmsvkxz0XX1FlQEGSnV9G8oHAJBSUjsjlVi4B/IE50QXMg+X9BpUQ bt2ryJXtPkJr4uVBeJGP1LZgoxwSYD3KtnANWpO13pMnEukXRWEUjXh9Smh5a2YHVn GKb6/RaSktJTQ== Received: from mailhost.synopsys.com (sv1-mailhost2.synopsys.com [10.205.2.132]) (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 9ED92404CE; Wed, 11 Dec 2024 00:33:59 +0000 (UTC) Received: from o365relay-in.synopsys.com (sv2-o365relay3.synopsys.com [10.202.1.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 8E31AA0078; Wed, 11 Dec 2024 00:33:59 +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=XsskEE2L; dkim-atps=neutral Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2043.outbound.protection.outlook.com [104.47.66.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) client-signature RSA-PSS (2048 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id 463DB401E9; Wed, 11 Dec 2024 00:33:59 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=m1dBfOGKkSpDTHDw2YuUk9QW2+d9Q7u8g3F+wcAfaafzQQCj3H0l0+G04a03+UaOt/KPt9N60P8OY+Ts1GtZBB0MXPWmwvuurPsGR/kswLd/RDA6LtCXDztVJxezs5JoJpW3ZP+JGLxoGBb208sU2gtWL8eA9mehIFYRl6k4y19rY9aqgfGi0XTWtYVFfldeBvKnbrBtpTavA3nmso5rfcrmHAx5l+6bospEAdppLIkHl+XfrjgVxl8E9sWoFxn+AyoOtmraHqAdR/TK9JCXiKVODJe7gnGgDm4EE9EGdNu7QnOiMoLsL2ed/q6X1eioKmvA98q0UY1HCjr75t36gg== 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=3Z4QLJrjh7iu4dKRFZjUzlHhnmWq84RJWby0PHV7H90=; b=rmr2cxoAi2y3gZiUYux0TXRhk6Fs/VELA+8nimL1T3KOy3tpuKIbtDhSbB8hXrbAqizbvJe+0aTESfSyhQgsGY2GzIEmFREBPkDiMba39WObic29aG+7Hm3JwuVZvPeB4VhB/RHmsePoRycukJTxsKBwLTJb3PUem0//GIHgo5DW2NOHb/cfaumzaXwOQLN5kcglX7rU++6zwbaCqsXc4yKqZ4/oRdvn57AREpVu0rg6MFegeznY9pelGl9LnEPDEYh0EAMJasGfzfW/V9VOuFVuBEHI5VckvfJGhb3/DJkNepSso8U+QygPPk1a5UTxkg19iCIRnqzfR0tKyD1Raw== 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=3Z4QLJrjh7iu4dKRFZjUzlHhnmWq84RJWby0PHV7H90=; b=XsskEE2L8TS30QjzhfWDrn1ebarqxMnAjF840dEs4+98sUOo8TBrVKpyK97VpCpyY/7NsBrLKO4GqDVi1SbGxYJB4K9nhPeIxT8FyA44FSpp1YufYFMwy7up8Dnv5qzy1hhnjtf+z8HdTsjtUTIvRWVpB/Fqo7VydmGbhQ6y/k8= Received: from LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) by CY8PR12MB7635.namprd12.prod.outlook.com (2603:10b6:930:9e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Wed, 11 Dec 2024 00:33:57 +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:33:56 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 24/28] usb: gadget: f_tcm: Check overlapped command Thread-Topic: [PATCH v3 24/28] usb: gadget: f_tcm: Check overlapped command Thread-Index: AQHbS2RdbqcIeOJElUCGpUAsYUcPKQ== Date: Wed, 11 Dec 2024 00:33:56 +0000 Message-ID: <6bffc2903d0cd1e7c7afca837053a48e883d8903.1733876548.git.Thinh.Nguyen@synopsys.com> References: In-Reply-To: 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_|CY8PR12MB7635:EE_ x-ms-office365-filtering-correlation-id: 6c815565-ff78-421c-4815-08dd197b7fa5 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?6w2STqr/hP5rl0n0p7ZzQlIBTE?= =?iso-8859-1?q?kGVC2q6+uKfCja3ltk8wwcBEL082cbGhxt1cwJHl8ihLSIAwfl5lmuUh2RAB?= =?iso-8859-1?q?voyIj+QK1H0tjKo++5gUU4fWMN4X6YdpiMbt7/GxMjRR1rhmrUWfANjtwDLr?= =?iso-8859-1?q?9NZLWR8z3AXeQNVNbkOVyc1LWPe8+DANUgu23qVV1CFFwimfgu6s/8QASHQh?= =?iso-8859-1?q?/5mpimHBLn7eJ/gn42ysJQc8rmz4JhVMOPIm6jmZZEZUb/wz6vDNFfb3643F?= =?iso-8859-1?q?Cy97Omnibyp+j6LHAa6giefjocn4q70RDR2IwPDKsWXMXX9eYG9eAKMx5vl2?= =?iso-8859-1?q?U4MTF7HItWio5rjoJihQAzAS0nLKQlw4SWHe9iRUb2sh1d2u8Z0yrRnBSlOa?= =?iso-8859-1?q?uahuNfgZk9ENVPOo68UZ/fLN7hjSsfr1vLwPSZT+XfyIXG5U+gTr+kNKY9uz?= =?iso-8859-1?q?OuSGqP2bU/GqkWKFof1wsyGMm40sQS3cjISIvgLTKVLLRstUUSV+f16BcfgK?= =?iso-8859-1?q?e8ZcW9lKF8WKh3sc9qeZ11pnYk9vZa7jt1QSdi0C+wURYlGjXRrvrTz8qHTw?= =?iso-8859-1?q?nCfHxTYATe1apu3UrSmc6FUBUAhnv54BKXtZjmveUm5N16EK0k1m+RniZROb?= =?iso-8859-1?q?rjhaaA+IzlDypOC2KW6iU+RdeTqD65eyK00BWZ9oznOr/psFciDNOMqv5Mnu?= =?iso-8859-1?q?6ydEFjK5ZNvLU8NoGpk4VlLlJ+nD2fdFb0vH7OthUrdQ2pevvHOrlkKrCpLZ?= =?iso-8859-1?q?yB8M60anTedbzGQ0qbXPxvUwQhD+69O3ZyljR3Kav57xMZ6aDQ0vx7EfKAra?= =?iso-8859-1?q?a7eIww7U2xiKd2UiIALoyVWYp5Yj/jLgKUD/z+aTHT0a1QpOPVIPpZSHpAt3?= =?iso-8859-1?q?gOs4IoyyVI+q4sdXPlUYBXnizoWNE0yKeBO/2683KEdbFUa164dOhEoYhWj2?= =?iso-8859-1?q?yJyx6dtl1GX98LEZM6QIICds9YJnZ+0wRknei6O7wRyb5XFTFNIAUSPtj13t?= =?iso-8859-1?q?4B/PT+xhnfykkNkjOIdzQ8htIkHGWhlNxDx2rRwBk7oiWEE2UwvST693Xxgj?= =?iso-8859-1?q?cVi7zk8vdDFeIMjzw6mTScq+bj0jMGE2Id8DOyyFY6kVDNaU/nWyDjveCilf?= =?iso-8859-1?q?EevxehXaLsoSuFrfQKTo8MsQcbEIFU/iGSEqSGqNFU89owKFdvYCIsTIdPCk?= =?iso-8859-1?q?A1QqBiCjcFv3y1GleE1LLJyyIm5YUI+MGZGBcQL6U/Hjk9cNYqamPMe1VX9I?= =?iso-8859-1?q?OmmAyCx57bebTPHvZXoX8BtM9oONTcVtXsCEsy5YeZ/N+uG1eVQxtLQaV9Kt?= =?iso-8859-1?q?cjo2E71m5lxUXUnHLAQxGSlYAjkgOR+eCe9eNlGJfzg+/SBfOB+FVc6yKwcD?= =?iso-8859-1?q?CxGdtPMWs3AAKT6EGzKcC/B+q6hVYtWyWIMdadCCM7dvbPbH+WB/Tum4n2jp?= =?iso-8859-1?q?bjlkG6dSJUczOnmqyoWevh4g=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)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?MyUP0H5DIdBz0k5sMw5yysZ?= =?iso-8859-1?q?1T4tzHh9evpcrJP3YLq0qJia4iHDZ1zIZ5VtAZFgx+npvzqaKrr1XrIyNJBW?= =?iso-8859-1?q?1Z7yQEXfdSBJcQJUssv8KzgbKiP28V1/MGXM7q2UoB8DGhNzH7JaxWE6B0Zj?= =?iso-8859-1?q?copIXMpFgzijDLPQ7olOiFWgYNP9fEf1zT53BQJSLI1F+u6tqPip4B6D/dLk?= =?iso-8859-1?q?A/x62GfCxMUnDM/45z/1qHbH49jbsgGWHtERSFlxSdQp6A2zQXPMLQxGz1xz?= =?iso-8859-1?q?m0kvhHCKFRUN/98xKskXqMZzRB2R19bS1u/0infRc4SmsyGc+jli1U7sWkXz?= =?iso-8859-1?q?QM1oUiyQWWXQ+IJSOt5I2UR3C5kqwFp5Yj370tvFa9PWXhHtS2uJMLZRVQLt?= =?iso-8859-1?q?4YV2Toq8E994ct9pCMHMaYbhncTrpZ3CwpPzJZYtCNatPxQmrIDxHQKV8qY/?= =?iso-8859-1?q?vaGph5klbIH6xD5SeR6300biDExlAePKN8F+MuQEvvTSnas3h1HHesxvma9a?= =?iso-8859-1?q?Kp43ReyZVEP0jynUwbwGl75NuePAE4BT7FgPqDYbkOfeOgU4YzLD9r3mg5Ea?= =?iso-8859-1?q?J9v7OS+WPo79Bhrzj3Z+m/sAzQDFZMSU/GZEuuxaDs15Bo9Q496Xyqz1AO4l?= =?iso-8859-1?q?AKYA3cF2CaaWMe9sQW20Yx2IBeadmEAfFWz2ys4qtpKvLxUjZt3D03kDVc9B?= =?iso-8859-1?q?GCIcoBdoSilxmKjRh1OLrR6UqIsJwH888INJ9x995skMpzECdbX1LDIk+Kj2?= =?iso-8859-1?q?NTbe2GDEEWE+oP700yp51SuXiPtRD0edVs47J9qQ0BlLEjXLzR/EXFCoC8dU?= =?iso-8859-1?q?z4IKArg5Uag5QvUWllPVVSf5F8g8/P7pMkRx09AEvgERfsify6K3byy87fbL?= =?iso-8859-1?q?xMJaxeSovOQ564sxtjD8YgqCw+Pxj3deUPnB4d+vFLxb0VO2NHHb89kpbY4e?= =?iso-8859-1?q?7Fr37vgz8eE35T9i3yYF+fpQHFSDxREmKUZsFqVZnY2fmWMNF3sSmQ+nCAb0?= =?iso-8859-1?q?wI0qTxYeloRZ/wbeSE9zBSnFReP0KIQtYt2d+8DY1xNt48zKESsnGFuO8AUW?= =?iso-8859-1?q?6oXbL23kadPPgciV4wOTzdlfj1nRx87SwfvtgD3rK94AbIb+4b7UPiaMmUMe?= =?iso-8859-1?q?kvCFvMWswrrmVHakCGMd1q8USs0VwEUMmBVKIk1mzaYzNwb2E1sZfJaplfrJ?= =?iso-8859-1?q?8gm9SDvzi+Ub9qrJFW7QvxMSIBXXqkDiWSzhfN5f65ACXDtUQWHuKcQGHRb4?= =?iso-8859-1?q?HaOM2ZzigxX51rGmCywc9fonJxO1WgImBsc3x7NKdlc7GhsNpvMP2ZXnTDSE?= =?iso-8859-1?q?jDzhdfbbMWIeBE68ZmkSg0x8TZhPMWdPvHQNjrCjwdWX7Kh1XGl295Pjf5ly?= =?iso-8859-1?q?6y7L01BEuA9uYB4KQVE7BZzUBWOFl53FxFZoinyglFClx7lFdsvFe4xmzOc+?= =?iso-8859-1?q?bmaidgT4ujyvcaM9vt2HeeYswk7M4AUWVMIdgufF3AehMVif1pmP1QzrFT2K?= =?iso-8859-1?q?TqSPmKH68zGz4ETcL/G4ju7O3/+nWJuhSpt/M6vTnLU7G2rkEVYK80ruZgUE?= =?iso-8859-1?q?9LAHkth0B7eSaL5G5a9u63t2ReG2O3H4OLKPxerLnxd+OTmFTsifv6wtG8Mf?= =?iso-8859-1?q?VMvkfWuuXms4drKt5Wn7EycD1yVi6lvSL4hsLGA=3D=3D?= 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: bLsTH7+oZygsb9WjbF8kBolhTqJhzpcY7vgVkI9OymXGZFssBGw32HFfLZ7k2DEk3+cjo8Jrwf4pIB81WQFydi9LAufKYe0FLIoZwDk4+ysK15sPimfjEq3MeXibRRpIZ52QO+o8AL1u5VB09aRv1V3yLyYOXIEE+PHXgu6CP+suSOPc1ob0EI+tHMU5WpyHEcjBnSKR2J2BWhrhJqkzXPGFneiiWgjaxRVnjq7JRygUbXopoVa3DjuvQztHp7+muA3z23g5U7vggXo9IOn+8bfQPMwjDHrDlX1ZB+YuSiKORll0gKeibbJkYben3WQl/H2jPkY4RzZt6n1qYJ0qIChYe3hPEp35Eb0PBkldX/R0fI9vW3dhe1w2/sLRU8duQascVEK+vHszRzMZOgWIXhYF5aCnx5IOvR/awaB4jAy22LcQNC0/fVQ0q+SSDphDRmND0tokFQeZkp+ZaxN3UZ37lKsXZdI5xtV0azxZRZpoZtzgxBemb3KvWh+QS46NcYcqR2dGR8RHuiX1tl9MbW75sPMgkMVkIfC/jN75wogJVe0I05EdiQ4jrIBFT+bP/gN5hf+BSvAa/94a8nV1R/R4QeRBTxTq250hUg9oJakKh+CBeF1CxCwBDpCA8AVGdVVOQQ5hxPQQvc38bkwBvQ== 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: 6c815565-ff78-421c-4815-08dd197b7fa5 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:33:56.9648 (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: ibqkhzY3dsimtA3oKxPOhOae0eak8/a/bTnDA/ZOdqbCRQwBcAGWHnVpotPCb+iXVlBNbiZ8/ntmlqy6ebfY9g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7635 X-Authority-Analysis: v=2.4 cv=fNPD3Yae c=1 sm=1 tr=0 ts=6758ddf8 cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==: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=jIQo8A4GAAAA:8 a=INPJFlJSa4UCX1VCkcwA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-ORIG-GUID: Bz-tCvcRE4mZLBRGlR0MUitteiWAYiox X-Proofpoint-GUID: Bz-tCvcRE4mZLBRGlR0MUitteiWAYiox 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 mlxlogscore=999 impostorscore=0 clxscore=1015 phishscore=0 spamscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 adultscore=0 malwarescore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110002 If there's an overlapped command tag, cancel the command and respond with RC_OVERLAPPED_TAG to host. Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 123 +++++++++++++++++++++++++++- drivers/usb/gadget/function/tcm.h | 5 ++ 2 files changed, 127 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index 3e04ce40a4a0..0c7a41568f40 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -685,12 +685,25 @@ static void uasp_status_data_cmpl(struct usb_ep *ep, struct usb_request *req) break; case UASP_QUEUE_COMMAND: + /* + * Overlapped command detected and cancelled. + * So send overlapped attempted status. + */ + if (cmd->tmr_rsp == RC_OVERLAPPED_TAG && + req->status == -ECONNRESET) { + uasp_send_tm_response(cmd); + return; + } + + hash_del(&stream->node); + /* * If no command submitted to target core here, just free the * bitmap index. This is for the cases where f_tcm handles * status response instead of the target core. */ - if (cmd->tmr_rsp != RC_RESPONSE_UNKNOWN) { + if (cmd->tmr_rsp != RC_OVERLAPPED_TAG && + cmd->tmr_rsp != RC_RESPONSE_UNKNOWN) { struct se_session *se_sess; se_sess = fu->tpg->tpg_nexus->tvn_se_sess; @@ -702,6 +715,7 @@ static void uasp_status_data_cmpl(struct usb_ep *ep, struct usb_request *req) } usb_ep_queue(fu->ep_cmd, cmd->req, GFP_ATOMIC); + complete(&stream->cmd_completion); break; default: @@ -710,6 +724,7 @@ static void uasp_status_data_cmpl(struct usb_ep *ep, struct usb_request *req) return; cleanup: + hash_del(&stream->node); transport_generic_free_cmd(&cmd->se_cmd, 0); } @@ -842,6 +857,8 @@ static void uasp_cmd_complete(struct usb_ep *ep, struct usb_request *req) static int uasp_alloc_stream_res(struct f_uas *fu, struct uas_stream *stream) { + init_completion(&stream->cmd_completion); + stream->req_in = usb_ep_alloc_request(fu->ep_in, GFP_KERNEL); if (!stream->req_in) goto out; @@ -1046,6 +1063,9 @@ static void usbg_data_write_cmpl(struct usb_ep *ep, struct usb_request *req) cmd->state = UASP_QUEUE_COMMAND; if (req->status == -ESHUTDOWN) { + struct uas_stream *stream = &cmd->fu->stream[se_cmd->map_tag]; + + hash_del(&stream->node); target_put_sess_cmd(se_cmd); transport_generic_free_cmd(&cmd->se_cmd, 0); return; @@ -1069,6 +1089,14 @@ static void usbg_data_write_cmpl(struct usb_ep *ep, struct usb_request *req) cleanup: target_put_sess_cmd(se_cmd); + + /* Command was aborted due to overlapped tag */ + if (cmd->state == UASP_QUEUE_COMMAND && + cmd->tmr_rsp == RC_OVERLAPPED_TAG) { + uasp_send_tm_response(cmd); + return; + } + transport_send_check_condition_and_sense(se_cmd, TCM_CHECK_CONDITION_ABORT_CMD, 0); } @@ -1137,6 +1165,8 @@ static int usbg_send_read_response(struct se_cmd *se_cmd) return uasp_send_read_response(cmd); } +static void usbg_aborted_task(struct se_cmd *se_cmd); + static void usbg_submit_tmr(struct usbg_cmd *cmd) { struct se_session *se_sess; @@ -1214,6 +1244,74 @@ static void usbg_cmd_work(struct work_struct *work) return; skip: + if (cmd->tmr_rsp == RC_OVERLAPPED_TAG) { + struct f_uas *fu = cmd->fu; + struct se_session *se_sess; + struct uas_stream *stream = NULL; + struct hlist_node *tmp; + struct usbg_cmd *active_cmd = NULL; + + se_sess = cmd->fu->tpg->tpg_nexus->tvn_se_sess; + + hash_for_each_possible_safe(fu->stream_hash, stream, tmp, node, cmd->tag) { + int i = stream - &fu->stream[0]; + + active_cmd = &((struct usbg_cmd *)se_sess->sess_cmd_map)[i]; + if (active_cmd->tag == cmd->tag) + break; + } + + /* Sanity check */ + if (!stream || (active_cmd && active_cmd->tag != cmd->tag)) { + usbg_submit_command(cmd->fu, cmd->req); + return; + } + + reinit_completion(&stream->cmd_completion); + + /* + * A UASP command consists of the command, data, and status + * stages, each operating sequentially from different endpoints. + * + * Each USB endpoint operates independently, and depending on + * hardware implementation, a completion callback for a transfer + * from one endpoint may not reflect the order of completion on + * the wire. This is particularly true for devices with + * endpoints that have independent interrupts and event buffers. + * + * The driver must still detect misbehaving hosts and respond + * with an overlap status. To reduce false overlap failures, + * allow the active and matching stream ID a brief 1ms to + * complete before responding with an overlap command failure. + * Overlap failure should be rare. + */ + wait_for_completion_timeout(&stream->cmd_completion, msecs_to_jiffies(1)); + + /* If the previous stream is completed, retry the command. */ + if (!hash_hashed(&stream->node)) { + usbg_submit_command(cmd->fu, cmd->req); + return; + } + + /* + * The command isn't submitted to the target core, so we're safe + * to remove the bitmap index from the session tag pool. + */ + sbitmap_queue_clear(&se_sess->sess_tag_pool, + cmd->se_cmd.map_tag, + cmd->se_cmd.map_cpu); + + /* + * Overlap command tag detected. Cancel any pending transfer of + * the command submitted to target core. + */ + active_cmd->tmr_rsp = RC_OVERLAPPED_TAG; + usbg_aborted_task(&active_cmd->se_cmd); + + /* Send the response after the transfer is aborted. */ + return; + } + uasp_send_tm_response(cmd); } @@ -1247,6 +1345,8 @@ static int usbg_submit_command(struct f_uas *fu, struct usb_request *req) struct usbg_cmd *cmd; struct usbg_tpg *tpg = fu->tpg; struct tcm_usbg_nexus *tv_nexus; + struct uas_stream *stream; + struct hlist_node *tmp; struct command_iu *cmd_iu; u32 cmd_len; u16 scsi_tag; @@ -1282,6 +1382,23 @@ static int usbg_submit_command(struct f_uas *fu, struct usb_request *req) goto skip; } + hash_for_each_possible_safe(fu->stream_hash, stream, tmp, node, scsi_tag) { + struct usbg_cmd *active_cmd; + struct se_session *se_sess; + int i = stream - &fu->stream[0]; + + se_sess = cmd->fu->tpg->tpg_nexus->tvn_se_sess; + active_cmd = &((struct usbg_cmd *)se_sess->sess_cmd_map)[i]; + + if (active_cmd->tag == scsi_tag) { + cmd->tmr_rsp = RC_OVERLAPPED_TAG; + goto skip; + } + } + + stream = &fu->stream[cmd->se_cmd.map_tag]; + hash_add(fu->stream_hash, &stream->node, scsi_tag); + if (iu->iu_id == IU_ID_TASK_MGMT) { struct task_mgmt_iu *tm_iu; @@ -1293,6 +1410,7 @@ static int usbg_submit_command(struct f_uas *fu, struct usb_request *req) cmd_len = (cmd_iu->len & ~0x3) + 16; if (cmd_len > USBG_MAX_CMD) { target_free_tag(tv_nexus->tvn_se_sess, &cmd->se_cmd); + hash_del(&stream->node); return -EINVAL; } memcpy(cmd->cmd_buf, cmd_iu->cdb, cmd_len); @@ -1443,6 +1561,7 @@ static void usbg_release_cmd(struct se_cmd *se_cmd) se_cmd); struct se_session *se_sess = se_cmd->se_sess; + cmd->tag = 0; kfree(cmd->data_buf); target_free_tag(se_sess, se_cmd); } @@ -2467,6 +2586,8 @@ static struct usb_function *tcm_alloc(struct usb_function_instance *fi) fu->function.disable = tcm_disable; fu->function.free_func = tcm_free; fu->tpg = tpg_instances[i].tpg; + + hash_init(fu->stream_hash); mutex_unlock(&tpg_instances_lock); return &fu->function; diff --git a/drivers/usb/gadget/function/tcm.h b/drivers/usb/gadget/function/tcm.h index d37358f09819..f6d6c86d10b3 100644 --- a/drivers/usb/gadget/function/tcm.h +++ b/drivers/usb/gadget/function/tcm.h @@ -4,6 +4,7 @@ #include /* #include */ +#include #include #include #include @@ -103,6 +104,9 @@ struct uas_stream { struct usb_request *req_in; struct usb_request *req_out; struct usb_request *req_status; + + struct completion cmd_completion; + struct hlist_node node; }; struct usbg_cdb { @@ -135,6 +139,7 @@ struct f_uas { struct usb_ep *ep_status; struct usb_ep *ep_cmd; struct uas_stream stream[USBG_NUM_CMDS]; + DECLARE_HASHTABLE(stream_hash, UASP_SS_EP_COMP_LOG_STREAMS); /* BOT */ struct bot_status bot_status; From patchwork Wed Dec 11 00:34:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902665 Received: from mx0a-00230701.pphosted.com (mx0a-00230701.pphosted.com [148.163.156.19]) (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 9689C179BD for ; Wed, 11 Dec 2024 00:34:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=148.163.156.19 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877253; cv=fail; b=Es9XoRQ/2md+Da6IHXKI/tJUIoyN0Zgg/y8lq8Tu6SNyCfRRModUcFstW6eER42W8yEPe1JCZu6vw4qVwzmT0BhussOQkJy4d9kww6iszyrRnOq2Zz7bfgE8vUo5ZAnSl9Z50GfqVgiAL/TmfeKMaIpsRbN+I8FGd2dxr9uRDFI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877253; c=relaxed/simple; bh=5jXeXpuL7S9DDm0b6gUnh4ARmdN4BnGmYjPEuXI+/no=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=Dt0U5fgQ+WXrqO/6lIqkMvDKKEmVsAeY4RujrHSQDXSBzFX4300uMQGRb7sbjS49rpNfHmZ/N/FmUAY73xFr+v7AV5h3nC9Yy/IikTh8e6rSYBbK34vMDJc5aHA93eDX65ksR7wl9BwILqBb/vL+4uJscEO4g6+qgD7dorNh6oo= 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=t4dM9rbv; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=cjb4Um+e; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=RChHFbaq reason="signature verification failed"; arc=fail smtp.client-ip=148.163.156.19 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="t4dM9rbv"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="cjb4Um+e"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="RChHFbaq" Received: from pps.filterd (m0098571.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BAMaLaS019443; Tue, 10 Dec 2024 16:34:07 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=hJ+fMSI1NZfbj+club3P96NT5wA1yHKB4MV7xa7ampI=; b=t4dM9rbvup7D 32SAuxohaxGP5SzfAm0z5le0bSqUq94jFRfQUKvP3A11GLk6elb7sttRigvxU4Le z44YPgD2DdhztQ8VIetd/gfSxsfw6gvD/CRT6HwX+BegBFAq8sq0tjGm4pwmcdK8 ZGWnxGcicY+qVRVx8QbMnlOiG25XlXflIFDwzjpXBiw9OQ/iMtDeQpAoOT+y9cyJ 2Dy68N8ydFXfnKhU8KN5fQud6s7fyUFllfSZTLQ4+mmkdzjuUGdkOGS5/srVG+hx zeEtc7O27FU1aM9AyYrvJdLYY+RD1ID0nWfBpGQIWsjtmHm2KygTWOcQ2JQYV3b6 SwghunVlPQ== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 43cp8t9vtw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:34:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877246; bh=5jXeXpuL7S9DDm0b6gUnh4ARmdN4BnGmYjPEuXI+/no=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=cjb4Um+ewsJTm8L79sp7fSNIdj9ltzvNVCAwF23Dy5bVp0+p8CWNcQ1zYVVWeDbqX FtIqAoApIy8BLy8wpfjHreJNyjmmuNh1wO8sDbBrkr28jWaptCuJxRqwJCLY7hllcK HyuFppWNf1SzRejn0TbMp+NoXghMFmi2Md/8NmPRhWp+59S5eLLOPit60RE/ryId2m UVsXsM5NTWOLUKrOWsGFa7jM2SPUiL0t/oJasYGzkM9+qvcxiYSQAoxO4UHJVW10gE //XILSjJbkFd63VSH1+x78QNgdElq19+LAL4Tu9r/nX4aHr8s4g2FM5+lQQPNSdFoS ZB7RM1HbcqeYw== Received: from mailhost.synopsys.com (badc-mailhost4.synopsys.com [10.192.0.82]) (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 B61CC401F8; Wed, 11 Dec 2024 00:34:06 +0000 (UTC) Received: from o365relay-in.synopsys.com (sv2-o365relay3.synopsys.com [10.202.1.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 580C1A005E; Wed, 11 Dec 2024 00:34:06 +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=RChHFbaq; dkim-atps=neutral Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2043.outbound.protection.outlook.com [104.47.51.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id 205ED4035D; Wed, 11 Dec 2024 00:34:06 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=folURxooVZRoE+OjfWUAO1edBWJEjedzQBe/hnWW00hrlFSUDKXQtmu+KJZr0wwm7a0rUd/TKGTk5X0xs2236ddFiMyk3eCcVQRwt4mUWUrNApDaMWtoBq7zWBvV4AMOmieXytlK3LUFKhK/8KiPZmqV7J4Jd33bB8/wpnIAZuKyIBwYXVTi1mgG5wEKct7X7Owu+CGbEBjyCUWf4gQNCHm1omqXqR1OEwtDZl7bwrbnyMGwlU+mNWN/VXypod7d7CyQIxMnYLH2Cy3IXrm9Z+qkqvS7KQhfsjO1mbXWZZ8elq5IPmw4hltscNr539XQKkpxkB3EWfei87lYcebaWA== 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=hJ+fMSI1NZfbj+club3P96NT5wA1yHKB4MV7xa7ampI=; b=ntRMFyWWtzrxdIFQZsahJ4V3t4NpVsE10y3pqi1g6oAWP9rfv4gDte5z37epxBBTfKeMPzn0cf6dnxPa3hB/zw/8OJmzvQofRUtRv2Whk/yG727kyA81cPOB3qbpQwcP+lGBVrG2wuy4ym9vthuVHWZYgeAU3dXKJAU1kmtqJUotM46dvCbbz468lB6hGmXzcJAU7JoPMvNOIL5/KKeBLVmkWwC4zWxmfCuVwKan3q1ugcAcQs2zQhdp7MJcATywgrXUZd9EH117S9cFKbRGc6bSYjb/NCi3U8DOZu6WKbfQ3aYU0QIkvnpz4Q0jmS8DnGN/jfnAZI9AJiD6zjh4kQ== 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=hJ+fMSI1NZfbj+club3P96NT5wA1yHKB4MV7xa7ampI=; b=RChHFbaqNM93UzC6V0ButvY7HClN/18SyirG+uQoA/EQDvXvdGc4woeyP4pYeVpoJ5pi0aq1K3GGal6ZOgvd3NczqfvoMUzUvG/UDSUs2grGa+2cGilrk7hJYtgANixOV7o57H4Ap1gw7c7b7VqlXEREiim/I6NMAMsBizEpubM= Received: from LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) by CY8PR12MB7635.namprd12.prod.outlook.com (2603:10b6:930:9e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Wed, 11 Dec 2024 00:34:03 +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:34:03 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 25/28] usb: gadget: f_tcm: Stall on invalid CBW Thread-Topic: [PATCH v3 25/28] usb: gadget: f_tcm: Stall on invalid CBW Thread-Index: AQHbS2RgSwPrd+p/1UqSq2xBtr3xrA== Date: Wed, 11 Dec 2024 00:34:03 +0000 Message-ID: <96022e2d5225f01a20263a4ba9c2e2c8a63328b8.1733876548.git.Thinh.Nguyen@synopsys.com> References: In-Reply-To: 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_|CY8PR12MB7635:EE_ x-ms-office365-filtering-correlation-id: 1c3d8f6c-1bbc-4139-f740-08dd197b8354 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?WfVbkIZB/pSQDbPzWVbNTyFD/j?= =?iso-8859-1?q?JHiNhgcw5w8athITVoLQw/rxsIy/m9BHLSq9iwXjChcUFZ0YqvOouN1FEVTi?= =?iso-8859-1?q?+mZ72aeaUNsO+hJuwWBItzYml+F9g9hpeJeyjZCMLqmJW4gsb9GPUw+Zk+aP?= =?iso-8859-1?q?NSE+bx5GeGCdzHCr6V/FC9KoFRbPGzx6eRbY8Nbd6XO0BX0rEYXfmF33SoP2?= =?iso-8859-1?q?0ldFjOrQtFTz8Iw6ZnuS/1tayVfOBn8A3rduu4be/M0G684OBFvSJkvHFrs6?= =?iso-8859-1?q?zIdE2dY6+ijxipyMpcG4t4ql0X0U3FPHcUKk5FGiJOkwpxzbNP9gMG7/gfq+?= =?iso-8859-1?q?IG0NR1ORdpwnisPqHS68hwzUbxozpGUbNleWdEgzwn8EsIr48Ime7HhT2nBD?= =?iso-8859-1?q?iQ0WSLh5n3b8Qj3YUQU8syfBzUVvw9E/Y94oE4U9qEYPU5tuHGRxQGLHK+yY?= =?iso-8859-1?q?xQhlCFBTWVlPtHtQ+0iXrqbecR/ix1/Ovz+e8W/RbBeeYwmwNIu4+iALmFrs?= =?iso-8859-1?q?MW4JlUlL+2E5bORpFP0J1/ppjRByOwPhJOkPN79PWoMK/2cbLvhoe+2Phum1?= =?iso-8859-1?q?UzobQtHj+vnTv1/2uuQdTAiI/81+D3WkumGIflPCkCUwV/kZm7bcBhTVFWbE?= =?iso-8859-1?q?9Ks7O10V7tW6GUWLKC2c7Aj3v1K1/yc1rfAevrsedXyYnab447nhwuUw9CL1?= =?iso-8859-1?q?f4mzlREeGXbRT6CCBmRzrIDhMf/IFMsi4Htqscc4Zuxwu1AiDBJFb4LIvrR+?= =?iso-8859-1?q?sq14qKWBkyblMKVQ9NirMkPQa4aSVqD6jxwNYLGYbEHTZZGvkBOGiTQl9WeG?= =?iso-8859-1?q?KLu8f0nyW0LvUTYkcCDBiAs5Cdu58Bqu2i3eYbIFzTsEUvtRoYkUe94lkv1o?= =?iso-8859-1?q?Oxrz/e4VXMUHBM9nEayv6/OmEIVUBomHhJ0WW7tiDnsLiy6hTbqe24lfqZr9?= =?iso-8859-1?q?jArKbPfES2zKu90joJnxrHkH2cieV8Fs4Cs0nWjKNACkTZlLcLn+Frjcs3qg?= =?iso-8859-1?q?wPWoUrjhOBYtrpRO9emvv1nk/Dz1Iaxl0O9HTP9Vw9OYCDEZA4nZnjeodPhw?= =?iso-8859-1?q?WOqHdGprMT0bImkcDm/z/cHfPCrrDn3UPYWVsXXisIKa0iL3m0Qvp+29Ibwp?= =?iso-8859-1?q?K8XG4JdTQEf5iPLm/BTda499iiiizXgr4P1FzHfZgFY+kJb+IJSjIKN+8kt7?= =?iso-8859-1?q?sU+po0L+2rk04Yqkpd2bgfAeuG75s0Sa2u7pPJkRFT07lYdXzi3kw/vuXKxp?= =?iso-8859-1?q?aNUy/coNx/JWvXIkRPJKyojjdY3gYKLs/QMFtARFMbILqW4sDk1X116F0fQl?= =?iso-8859-1?q?xxE9noHswMDq8F4dOzIfli3/Dk/0li+8McSN2/MctGxEyqJ9+ptbTt+JeSYf?= =?iso-8859-1?q?zzCzSI6WG8s8+HGZ2hTKiG7Oxj3rCkdWZmCTWFPLVszDqTV4hkXxkfkq1kts?= =?iso-8859-1?q?df0JS/0ETkH3oSHsQl9rMULg=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)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?nWXsbh2MxoxtapEW3d22deV?= =?iso-8859-1?q?Q14WvaZefRhv6xHc25+e89r1+WP/Gldb5pbSMWrpZ4wodODbSlXkLuyvFIwU?= =?iso-8859-1?q?wXLOEu2O0jl7ob6ARdTjhcpfHRgugZYVUrXHts0cO3rDODAsN2O5ud0+XEXh?= =?iso-8859-1?q?u1rU+MTIBXke5irZ5lhWOmjHgJIWzgwkGuT8DPy8JJd+QgrXIe4OskK7rXFA?= =?iso-8859-1?q?1mfbGmb4Oe+dxNjr1YIHBjd1kkX7eDIphSdhl6NYba0TywNTIcqj+sNl/Oia?= =?iso-8859-1?q?BBzMCGQA2EW1edcHN9+dJo1kfRHuwaDwJzTcfl9Yfr6Q1o2Vu3/fToAH0qtw?= =?iso-8859-1?q?iwSkzoFmlHqNiODxSiXfdBNZGBbrIzlIkQUnq0LzuGUFtrShdfMhhoU/BnkG?= =?iso-8859-1?q?qsD9TC7qLXGg1vYJzGmfgued+NNVifATumz/cQb3o2ukXlgA9aR9sDlzpdSN?= =?iso-8859-1?q?eEujI8K+r3h82g3Dsa7q5EvB2KOTZIVe0XhxLcGX5puS7M5Jht95IOi1iErY?= =?iso-8859-1?q?SGNorBj7Zqdo1lC/p74WgS98a9sY0ydjLstG71jPQYmokviFTURvjHGCqxuZ?= =?iso-8859-1?q?avp6Gtlwq+6Eu3q5FN6k1h8A876Vg+6549RMKsIqFZqK96VbCTDQV6m/VON7?= =?iso-8859-1?q?LxeIV1kS4feoyhKA6gfGPesIY4UyWIX+iP2lFuSajvJ395rMQP8JobcWFmHo?= =?iso-8859-1?q?9BH+ofhWczaesZSb2gSCCjGXj5H/3R7qsuUzeAaZNhDMMln2sbSDFBAKd4/Z?= =?iso-8859-1?q?78ggMK6IfqQyG8TAPtfc8NP/DlW370XoZN9cM9lUtXo3IXUlNm86rvzC+eKR?= =?iso-8859-1?q?7QYBW3+DQLfSF17sTbE16XzBn2CQZKr7wQr1yOOf8nX8OYlUxAgVyUAIQryb?= =?iso-8859-1?q?3o5jFeKXkEJSTk1A9vzhTOOXBaVMH4zbsGb4YVhcgE5TW+5mO4pvSFlczDMW?= =?iso-8859-1?q?1B4L7xx6Xm4P6B5piHQwkyZ/ubmnRXZSIoojtHJCMxmE7v6TuUUd1BX4D+3O?= =?iso-8859-1?q?E7yCu9cK6V70EFTu2KRPAAxhw98xuAl+kMU8X1aO5YI8jP5fiJOkig3Ik5vI?= =?iso-8859-1?q?FGFXTuU0tYLUMWPvn1dvIztF6aKtWiwG/m28hVUeItwvKxUi8+RxuKK+/LKI?= =?iso-8859-1?q?yawDybA27KEcS377TG+ycN4FIIJ+yXvxHs5U/s8/LhmxVzacCptKNE/BJOY0?= =?iso-8859-1?q?g3emLa4gSI9vhDQ046ELssNbZnPkb0Tcxuiwa2dTlr8U7foRs/qDEf8eFl3C?= =?iso-8859-1?q?mrzzGP3yVxs9SPemQPSidcD0Q2JPepFho6goUgmDFRC9mG/cBf0rTDj2g4vy?= =?iso-8859-1?q?vQxnazu5nzRbgYm7RQSXwnAdd4uDbev5MpHf97HWgaQlt9npq1k9QLZ4rYqT?= =?iso-8859-1?q?qdkPWHthpxaCruWUrSMK8I42VdtcnD2spNBr/migYCQLn8fcm1ixt65PD1Vk?= =?iso-8859-1?q?hS6GAl+kazksysib6mnxdWeIsh650MooKPBOiONnZz6G0/jdkCaHrfMzOKgb?= =?iso-8859-1?q?TGNf3lK9ZjfD5JJrHH3u7lF8nsC711YA3XS/bRybuP7gmH5Apl9I+iQqok+z?= =?iso-8859-1?q?2P0gySJI6ixTsi7mBaXL0EDkKSLDfgkaCZR7zWzutKaxJWdaJ22WvtGWMPmA?= =?iso-8859-1?q?XDkyKIoviqDdDyDcAHjcawZ7/u3gnVOHNVTuaCw=3D=3D?= 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: EMUU8IfsqWncCCjUxPApB8B0HwQgMk+ZtIRMGoCtALJvn22edeCpvcJcbQCUGuO3LRN6y3piYiuM5GeVmCH1b8yI7zwNXt+jpmG3UnczZkt1iVVgDgxHsO8arWoa4Hz9aEa/by7AUhqaApXVm2BgmIxGI8I+lnuuP6T5sxLUIoJabeIjh8usnEnXGHlbldx0sF0hsBTUojuNYBaIut/BXfMO5Z7TkC/mNL7vIf7Gnvt8gPCd5iR705DPuTc9/6/USFRTTav/l9WaQNM+7wi+M8qXOX3FbyOHfS4ZxQXY5yUHUohNiFN7CfZKwXyL3FeCg6ubZHolmR28F9nSfu3573kCODfEN4+CkV4Pt0D7nsrdsrlwCAhaSUdCY+sGetDUQ+4/C1UTk3/URtjg0Pea+SuB2ulPZI296hnWEdJBhaYsV6fEcePeBD3bF2BRMJv1RldBLurKJbUY23nl8owKZ8O4grwV73IkyBWDJxcMR24v/U2EitpOEYMwk8QOB2d+ZAkmpqFreUEEUG0euUsDESx74qgig5WPE3EHE8wYqohj6XYDISIBqMM9kU4JOthqXLg1KhoMKjp1apR19LMviephRDb3ynOzMLwT3CmYoZBCCQDZNdJFfQKq+8vgWhG7eHtcWfnWsghjNKSCl6qAmg== 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: 1c3d8f6c-1bbc-4139-f740-08dd197b8354 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:34:03.1262 (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: NM5MD/wtvmRHcpZvZqphhKIFce15sOLzfQqcBRdJ+vunP0G8DlGJAOzT2Ne5wsVi/aKltMtepMJ923FGPUgraA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7635 X-Proofpoint-GUID: Uoza1v-v8DoZGCQsp-9CKTHLxedETquw X-Proofpoint-ORIG-GUID: Uoza1v-v8DoZGCQsp-9CKTHLxedETquw X-Authority-Analysis: v=2.4 cv=KdsosRYD c=1 sm=1 tr=0 ts=6758ddff 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=jIQo8A4GAAAA:8 a=86P5cLNenNSuEYrntEkA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 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 adultscore=0 spamscore=0 bulkscore=0 impostorscore=0 priorityscore=1501 lowpriorityscore=0 malwarescore=0 clxscore=1015 mlxlogscore=968 suspectscore=0 phishscore=0 mlxscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110002 If the BOT command CBW is invalid, make sure to respond by setting status endpoint STALL until the next proper CBW or reset. Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 16 +++++++++++++++- drivers/usb/gadget/function/tcm.h | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index 0c7a41568f40..7ea48845f8c3 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -287,8 +287,17 @@ static void bot_cmd_complete(struct usb_ep *ep, struct usb_request *req) return; ret = bot_submit_command(fu, req->buf, req->actual); - if (ret) + if (ret) { pr_err("%s(%d): %d\n", __func__, __LINE__, ret); + if (!(fu->flags & USBG_BOT_WEDGED)) + usb_ep_set_wedge(fu->ep_in); + + fu->flags |= USBG_BOT_WEDGED; + bot_enqueue_cmd_cbw(fu); + } else if (fu->flags & USBG_BOT_WEDGED) { + fu->flags &= ~USBG_BOT_WEDGED; + usb_ep_clear_halt(fu->ep_in); + } } static int bot_prepare_reqs(struct f_uas *fu) @@ -442,6 +451,11 @@ static int usbg_bot_setup(struct usb_function *f, case US_BULK_RESET_REQUEST: /* XXX maybe we should remove previous requests for IN + OUT */ + if (fu->flags & USBG_BOT_WEDGED) { + fu->flags &= ~USBG_BOT_WEDGED; + usb_ep_clear_halt(fu->ep_in); + } + bot_enqueue_cmd_cbw(fu); return 0; } diff --git a/drivers/usb/gadget/function/tcm.h b/drivers/usb/gadget/function/tcm.h index f6d6c86d10b3..009974d81d66 100644 --- a/drivers/usb/gadget/function/tcm.h +++ b/drivers/usb/gadget/function/tcm.h @@ -130,6 +130,7 @@ struct f_uas { #define USBG_USE_STREAMS (1 << 2) #define USBG_IS_BOT (1 << 3) #define USBG_BOT_CMD_PEND (1 << 4) +#define USBG_BOT_WEDGED (1 << 5) struct usbg_cdb cmd[USBG_NUM_CMDS]; struct usb_ep *ep_in; From patchwork Wed Dec 11 00:34:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902666 Received: from mx0a-00230701.pphosted.com (mx0a-00230701.pphosted.com [148.163.156.19]) (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 2B55CCA4E for ; Wed, 11 Dec 2024 00:34:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=148.163.156.19 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877258; cv=fail; b=crHWWa2aFNBR03MuyvDx/12mJWLRBrHAzsnDRUKB5vqY/gB3OAlMEkGqtuy+LcdYHV4uNdh5954KWWFlSxyK5usZFoCRgwjT0FwbjtODiuJe0Kt9ScXIR4TO6qJnSxyBRkPEg/xB/kzKu/yGyHS1+f7kMyDXC2WGvdYyYXXt4qQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877258; c=relaxed/simple; bh=9L2IAuCjH/PEhYIKdck9J+rJoEsVBY/N7sMUVS34im8=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=jY5TCmcOCjroDVpT7q4IofuS8hwEHaZEpJJb6bLxZriz1RyHwufqGZR7txzLA5LuWuIOSNe0MN13Drsbi7BWa927OwheJRXZVTRL/94IT0ctm3IjqooKo8yKdPxvsAm9g4QXnuGd05nAqXcmMhf1GwlgrVxnKZdM+Cznplo/5bY= 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=lHwzgcEk; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=maSa7Iin; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=A2iVHweC reason="signature verification failed"; arc=fail smtp.client-ip=148.163.156.19 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="lHwzgcEk"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="maSa7Iin"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="A2iVHweC" Received: from pps.filterd (m0297266.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BAMb3X4010915; Tue, 10 Dec 2024 16:34:13 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=COZSMrh7Ppa1IKffqRR2qjKczBoB1qStFDrYh/Z+TkQ=; b=lHwzgcEkoFiK +MjF5sUlM3btMC1CaXohQci+q2DthaRfHDkVpyq4I+Kip9MRR6PUBUnbrJAzRjvY Ys0PCjdEv6X5xbtP2LP7mWgyGktPI/WnFvC0NfA7bpU+ej4XFTryxNMV2RVyMDuF LkBG1o1YR+emU6muXqub7wM6Dfxkc9NeXq0NoWbIUqoKtdYTgd7GS9NedF9/hxS8 31WagbMoSzA5h3pE0dBO8mgjpU6leEyp+OTqa9G5vfJAr4ibTpqHqW0rQqLcin3V yfZ9xa0y4IRDxys3jLsUnMltq+/hWiQE61tWMy6sQTYaSp5gcQ/LtfSRTdgAotVS Dbgvpj0BrA== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 43cpgb9q6x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:34:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877252; bh=9L2IAuCjH/PEhYIKdck9J+rJoEsVBY/N7sMUVS34im8=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=maSa7IineQabjLCt9yCcrliTxfhpxHJjTnBci+Z1ZsW1VXZZXvoc0VmstMADeM/WO B7l5Api6qZzgVHk9DejZFa43Xp1NyJfysCQDeqhA2rFxq5hAUh3t+OH1nvLLJ86trs 6kIW3xWm5dXfv8HvoiPVvMDy6tT2GlOZ0wpDfj/V0WxBFaW2zbgeyJTxnFZPrnw6Cw a5zcOOZSqvlZrJwfW2kjgQoi3mmytajtUWZAtuiqCOFiD2t3U6vI90t1n+t5PQnggH efqakiuhVJwtJ/MtMpYm3/NJGs46xcjqP4VtUVntC9Oi/GDA94g+V1S6ZZEmEZ8nHR Dt6BPxhWTGdEw== Received: from mailhost.synopsys.com (us03-mailhost2.synopsys.com [10.4.17.18]) (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 1C1D24012B; Wed, 11 Dec 2024 00:34:12 +0000 (UTC) Received: from o365relay-in.synopsys.com (sv2-o365relay3.synopsys.com [10.202.1.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 EE142A008F; Wed, 11 Dec 2024 00:34:11 +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=A2iVHweC; dkim-atps=neutral Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2048.outbound.protection.outlook.com [104.47.51.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id 941D6401E9; Wed, 11 Dec 2024 00:34:11 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lIpSDlv9Ptg+aphtbSMsy7KZSLkwMVHDLlapVTVEzyP9LElFhAxYa2MVm/OsbXd3Yh1RT7jN3mxqBas/r3rengUFSmpgU0Vn+2fADzI0Beme93cFziT0jY/mvTilkE20ORQ1xuJytn06EXowR/44RaeJFGiVfnO/xkgNPi8c1sSutgvEDurQh1Rf5ocAL7MlVkRQonSEWBCg6G1gK+45s4oTGkZWuVJQatWFq+IcDds4bTpREgDVO3pdhbGWqj2yPhpSioUahHLeoncas39pZYYQBWHSyWNTAu7vaT7fCpx/wyC7llyuJWFuEbTy+boA4Ej6Pez2ANMMVaTBsfzNYA== 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=COZSMrh7Ppa1IKffqRR2qjKczBoB1qStFDrYh/Z+TkQ=; b=Al+XEFy4vBDqrxyDHqVAGC6QWXrK2GhcY3c+CqSOEkLe0dS0QeFpZaH/DXmJdso1N1at7gJaxwwXGdXVwsnpc3kucUIbLiqsu/PW/sAMqEC/1Wo9t4WQrMlMk1VJDPbGHeyRyVlZfKM9uec/QbkYRU8Rz99dE/BGVJYAU+5XCCNWrYe087oaM6uasWbzeJSMqDfXaaK2ZJn4Gaap3wJGANnWR04bRZKQBU9aaBwFeOU4ddU+x3zFmcDaCGb029aokhB5qhepfqRs1Nov5B62xDWrPjH6fFPDw8T+eapc57V+6lKf6UVkw9h0jgIK2Wl7tyV1GyPEbw7DFkYBjLHoeg== 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=COZSMrh7Ppa1IKffqRR2qjKczBoB1qStFDrYh/Z+TkQ=; b=A2iVHweCz1SIWdGUk8lSntXdSzAHUCtjZeCwPIR+mm0nXHctCd52uioTg9K3ci1ZHXSJY5Ug2bg14PC0NuunmLU8+8nUipMsujAvz4YJrlJq3JnIb8kGgKm0uxe1LHYu4FwQ80xN35cC3CVxmRD41yvbM6Uhe2SSZTSu1F+NgTc= Received: from LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) by CY8PR12MB7635.namprd12.prod.outlook.com (2603:10b6:930:9e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Wed, 11 Dec 2024 00:34:09 +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:34:09 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 26/28] usb: gadget: f_tcm: Requeue command request on error Thread-Topic: [PATCH v3 26/28] usb: gadget: f_tcm: Requeue command request on error Thread-Index: AQHbS2Rkq59gyV7T7EKgSHPIgOy4XA== Date: Wed, 11 Dec 2024 00:34:09 +0000 Message-ID: References: In-Reply-To: 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_|CY8PR12MB7635:EE_ x-ms-office365-filtering-correlation-id: f9e4dec9-c342-4d08-41f2-08dd197b86df x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?lbD4nf8HRMET/rY9+ze9TTthMs?= =?iso-8859-1?q?Odfy+GB6QPcAqzFJFkuR/XUAvEIjM2JEagqygKKzNQen0kIuPTtjSqq9L2dz?= =?iso-8859-1?q?nFLPhSeHVFEyk+ghwLB+VtPE8Eqyk1S0+JfUEYR8INmKbojJrJUjgByPQQtt?= =?iso-8859-1?q?5WbMItekaPjhNKNWgYU4+huQnp5jo1O9ceCi5psD6BJyMYU1P9UoYsVjCVNM?= =?iso-8859-1?q?GaKrp1v30Wmse2vV6S97nq+WYp3YNBodEdcu45HojfNjS+3J8KaYOKYwcJx8?= =?iso-8859-1?q?Ks+tUNSoZ73e6fhj/lazLM5mDiwO4VqDprtH99WI9sCpIXL8sWykw1vrTXq5?= =?iso-8859-1?q?6ykMW1Ng9azJYjTwSJhyzRVYn0ZYN6rskQA7RqTLgHFt1QxizormBZiws1RC?= =?iso-8859-1?q?/DMUz/gu4XE3gRWp6ASpyKBX2twGp1fLX+KMAya6ERqNN+5q3hPPIdn3LPba?= =?iso-8859-1?q?Q3xRCuIKOAwNp+OtCKX7oX6nuye0fkWXTLHIf2GF7NVwTNO7aMu94tf6Br9i?= =?iso-8859-1?q?jM4OZr7X5fEpZu/ewZ72+a+d6CUeQKk0MCJe53Lewg7UIOCKtZwsqIYNcpeg?= =?iso-8859-1?q?nJbEjVNlu3/9MsbIwsmOG1asDUsH4GHVYjtieePDIRHy4vbWjozBFpZjqKar?= =?iso-8859-1?q?QbnRj+lvm79VI4pCQDqEI0z+/N7u7yzwqx+pgS0bbipFs1vdFnxKkU68qgZy?= =?iso-8859-1?q?EIogXM9650mn8L9r7S1VdJtGrj+MdeWjJvBi6jdBfCXCyqCqa+BSnHoMsTGx?= =?iso-8859-1?q?48Gmjr7Ka9ZYmFy42xZDx7oxZ1KbPc/5LP6NQn+m5f6zSnVriLyZ0ryVd1RP?= =?iso-8859-1?q?CS9SILC5f8dYp71bbzm5/IyCwq0G9kDDdgZrffjM9imIk+vDvy+gSSwnRZYt?= =?iso-8859-1?q?1Mri4whtX2XYHBcK08q3J8pOUAHyKibk1D3GcjUwn4NQTB4iUTAVmJXvfTCD?= =?iso-8859-1?q?H0cO9LC0N62eXnvMPxCW2C0oDCkSFEzKk6Vu25tu6qaKgixBu3lvB8WOC9G1?= =?iso-8859-1?q?2aE4KA7bNn1VuPrcrVQxwrEjKGsH/cnajS5JcM1AAfNZ/uW4wPgFL5XHLNif?= =?iso-8859-1?q?B3EaIuzxBROEETdqa7YJtKH+F2TDzzhJ69yadwINUaCA2j/LUrCZP47qV6fd?= =?iso-8859-1?q?FR9hZNTqZSgdKCHcHYEOisfqTev4b6aQUTRrN6/K9XNLJf8s3vldr/EbETVa?= =?iso-8859-1?q?jb710gY9kBMJStR9JnJ6nbprFgN/TGONyj+WoOknyNjDFKr7PLS4krB6EpIL?= =?iso-8859-1?q?zgAiyiWHC1SfL3F5rYg0g9VtSXeFmqNWC0kdCwwPzwLHq9R05on8MlJeepOJ?= =?iso-8859-1?q?6QQ+ytLFxXIx4qsk0AEVVWhBdI2dTCMGgDatxWMbsDUGQpjfa2FhbRJkkIMe?= =?iso-8859-1?q?XAJ6vfAakAGnqn+fp3WCnaz82Tkb3+jYEN7MMZsWz6xCeD/1jTUjyyPMCN/K?= =?iso-8859-1?q?f6bBXDl+hExFLUaOuIC8I9Tg=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)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?jCVyOrSz2W75z5Tq7CT57wP?= =?iso-8859-1?q?WClUyikMCQk4Rv0HvvuG+22uozAQJMChDB5JGJTEBRI4H/DacuNeyr+7FKEV?= =?iso-8859-1?q?aOVIBefoMF1tY//tg7xDjWjCqfxUBCcALPb2GtQXPSTMZzs/6a+9oQoXFgK1?= =?iso-8859-1?q?KppXBH4cxe6Pdx1gCCPclR5gJ1OCkO03JAmYitZkTZwuDdfxIZTaIdv/nzWr?= =?iso-8859-1?q?Mh6mx7ldw2mtWdoJlTMd6VE6rxHQxNLU2yPzKTJ1ZSwvXI/5PXxIvzqDFoBX?= =?iso-8859-1?q?8fn8wgj9JQ657ENXOrOo0RJvq4rGkswrcOWIthT0LRfUFiQW9D9Qq5e+aKXe?= =?iso-8859-1?q?wDSVA7g9aeIrs+JXXoW+/SD+aPq5833oA4HRhjA1/4zrj5nuHpKM4UzgvqsV?= =?iso-8859-1?q?3iR6n++P8sw1+n1Rm0IuXemhaDwvc3m7ixzDJ5iBqNmBI3h+++9o/+qMo/S8?= =?iso-8859-1?q?n2kgDRgNWMBwM1xNHM+pwi2LsK6gpe3wtiT6xfbfwfhEM58ax5kmMvDhSrvX?= =?iso-8859-1?q?8uPb69zMZjXXofYWnrva69TQpgIcbVatBNh6atbpCdN2A8p5VSvp3zs+Jmwh?= =?iso-8859-1?q?KxqubMihkFf2QuPHaa22VRYupWrl7Ya6TxgYmZOL/q6opnthemDiVt4qU8TR?= =?iso-8859-1?q?l3g/NV2lBmfUTia5DH7YC+tGIW1mjwqwJTWCAk2Kl1HPG4V7aSs7TzxVeor3?= =?iso-8859-1?q?Y678Tk0B6f+lawxc2Sa8G+PSqLq098UHd9cYqwk+KUIlrEw0ES4xDSkIOt27?= =?iso-8859-1?q?5a6RI4OnncuY9b68gHqcT7t77G1TpkBM2uStMSUVlF+62SXDat/GuT/7qY5r?= =?iso-8859-1?q?oqnxoH1F33vCVzC9ZcWW4zbvPjNyKM2Gd6YKaHFmZYfxqU4hrrPF4GkZe+lc?= =?iso-8859-1?q?Wg26+d/mU/VO+c7zWzg5X9M2mXuE4q0bmca4ix58ujjK/QoWEIPOWUVX1aTl?= =?iso-8859-1?q?jbC2ttlEJNYkfmGKSR9spQ+Vd6rh17/XCBotF+WO0fycdpwtoXZTwF2vv/Uy?= =?iso-8859-1?q?QK3E+725z8GjnvKeqX7v+K1Z8H5yti6L5KE2DUPP3mjvcIxWYWAyO1H3bNKx?= =?iso-8859-1?q?W0VLgn68A6AKXqD59p40FImCD0MZiXVmx52jCy830vXGyLGGeoNjd+wKEBvF?= =?iso-8859-1?q?YnBuyYzk081n1OYVQohgH/AWVZxB6R7stjAvCIua6yFrLNQIYTnZHjLoZCWq?= =?iso-8859-1?q?yW8adzC4sM+o/t2Yvw/ZtiHCT8eyyeVVE8stgOcg83bKLj3Swnxiznjhr6P/?= =?iso-8859-1?q?f+HdLzzKuknW7cfgh5J3Y9HPeRkg3oX5bRxyf1fGMwpnfnU7RIjeOA6+l/zd?= =?iso-8859-1?q?hCn7wrM3i0I8ENqWnqNI+MQDL+9XpQP3O0OP64FlrNQOyH7cmHgUyHjpZQ/a?= =?iso-8859-1?q?q4oKY6PR/cD4pX3eNj0a+HMxPoyuxRMXzYcV5zixUFMsUigfiToVeDG/o3Z4?= =?iso-8859-1?q?h6CGnuGOFDK7xUDUwFNsjS5EdpiU0gh8hoCLQz4xNAVXd99Wm51P/rsBJWQP?= =?iso-8859-1?q?yXHADysRrScOSuWw4eS713/HLPOej0fZs/kuUwU/Z8V+0iVpWmK0rAdS8FN7?= =?iso-8859-1?q?fL/krlTVoG+0twL1KywXzLQKFntukgQ0cFKIarYAjEV9MqYOl8UVe5Y7ujsY?= =?iso-8859-1?q?pJ9/gngNm6a5KLvlXc0no4iXN/jU3eIEYBhDDQg=3D=3D?= 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: G2Np1HJgK7hEXOMhc/m+xN8qZ7c+0aGvDYmxohw6SVP2GByCDuMToisLIQ7dBcDOsvwg0w2EMjaEjzutjVcDJYTto/0xnKiQWi25bBu42Eii2wiq/1s5CdhwCnYDifMkYoiUFqkNsTH8n4DrLZhPebIWJczUCA7UTZoUQhrEswN4EFXJdhIZ3qoZz6gk9ePV3lN2034iW9vAdTiwjwoYVUqkNEfN7uyYR+7c1sszRf2mwwlvESRdFmjPaJJGS/hb4Q/vinhmCWXgMfY9KmDgYsNmkWITYqUSvYVbb/HcK6ID/JMFHeDeH+1yV/0vdtuyo6cHqop2wDkhZ956NrdrAXOGzxJqRafcx9f7A5h9PpwzPvEArqwxE7j5Q7IJxGtgBsEWP+7xvku6ZtkUfYs0oJgM/VeCK7/2F4Hok7seghmnYQVFoMiMfCWhRIuo4jMzXAFCSR+IrMqmgo29Xda3uboenKoB4zQHSgIZ7Te43BRZpqqXBbCb3d13SvEYbUKMv0fjs+fj6ul27hSIqfg9H1pr4XdWIO2X3R9vLQLCKuAv+8oe+7+nZn9mW2EEg6fI9Or1IAmCnGtkmYQI5ibxjgJpspl31HzvSSK6QQflPMySW0RYjx7GWJFayMQiCcDF2L8Mj+kkCHQYKx062OWIeQ== 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: f9e4dec9-c342-4d08-41f2-08dd197b86df X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:34:09.0824 (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: LLpNu14j9JtjuFpGBfE8ZNP89e//oijstrSGyk0dw1g7O9g1MCSxWst2FQ8//dhkY7xERl57H0XR4jvMF79dyg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7635 X-Authority-Analysis: v=2.4 cv=d+8PyQjE c=1 sm=1 tr=0 ts=6758de04 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=jIQo8A4GAAAA:8 a=1q4YP0GZM9u6_G6hc2UA:9 a=wPNLvfGTeEIA:10 a=4SauJWYdb0nqdwkJk2DW:22 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-GUID: LdmOkPlTiIEkBSIpR6Ez8XSykFPMElEC X-Proofpoint-ORIG-GUID: LdmOkPlTiIEkBSIpR6Ez8XSykFPMElEC 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 mlxlogscore=999 suspectscore=0 spamscore=0 clxscore=1015 adultscore=0 phishscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 mlxscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110002 If there's error on command request, make sure to requeue to receive the next one. Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index 7ea48845f8c3..be7d8df360d9 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -283,8 +283,13 @@ static void bot_cmd_complete(struct usb_ep *ep, struct usb_request *req) fu->flags &= ~USBG_BOT_CMD_PEND; - if (req->status < 0) + if (req->status < 0) { + struct usb_gadget *gadget = fuas_to_gadget(fu); + + dev_err(&gadget->dev, "BOT command req err (%d)\n", req->status); + bot_enqueue_cmd_cbw(fu); return; + } ret = bot_submit_command(fu, req->buf, req->actual); if (ret) { From patchwork Wed Dec 11 00:34:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902669 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 49B26182B4 for ; Wed, 11 Dec 2024 00:34:23 +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=1733877265; cv=fail; b=b+O3VhGLbK+sa2UI7mX5AsGygusr/AwqNNm8sK2DKDJLnFvPbq9AzUjYHm+zOA9L6+9MXFkLRtoPy1ny7f8ArJpBAzy1w/KrXIZAUh/FwWTLNkXghmpvf/p7MlpqlhbI0chfQ07jnIIuLBf8o3vFLX3oa6cyWwr7nYSo8lbUsAc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877265; c=relaxed/simple; bh=ZT/CGhrWnIEYnEtMGoSvrM0+3Qyd14UZB8WzzX0g7qE=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=ZD07evAzTQKAUOh5g7vzcvN6bsguFo8trBPIuKbvd9ItuNKXsz/ITSfaq232JaWgK/pzCq57DZYZK+pS50TIAf+XZ8H1MlR/I3KFG0yQbyg0zSj0Bp1pptgPDH9eN1BSCmVyPxdZwz4WIKwHU2ewL/EI2ju7DGRH+pIEMvjwWog= 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=cI19LNg4; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=XRlqdeUd; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=rv3wvmgZ 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="cI19LNg4"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="XRlqdeUd"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="rv3wvmgZ" Received: from pps.filterd (m0098572.ppops.net [127.0.0.1]) by mx0b-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BAMtPgZ000581; Tue, 10 Dec 2024 16:34:19 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=OorLWglAtFMuZwdRR5RYlQCQMOc4uR7iM8/c3phCHMo=; b=cI19LNg4Xi1g IZcXqBNglz3fyOK1U6fcoYzI4XhpmY8du2dzmpP4BgtVuefONftbmHdY/cXHYaeH XjTI8GIO6hv4g9qbN+cGqn5cw9ujji7UWAh2bFEckDTm2wpLgqO8Wrl63IgdmK+b tSYGt/OlqezqggHKvrLOATHzjtlwPZ08iGytu7wkBXduTSynnxcotLgnpJYRUHkz e+fLhvPMnAOkHcaHGECwJq6YLcOhOesml0OclDR3Cy7IyoTdfoZYC0Mnqzh6c0H9 80uyzP4VPfsvvoYp1RRpZTIiOxmmI4jm5hTDm6rhd4O+zBMlq/po6/7JtKXkCZad iLf/C3yVqw== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0b-00230701.pphosted.com (PPS) with ESMTPS id 43cnvka1cx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:34:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877258; bh=ZT/CGhrWnIEYnEtMGoSvrM0+3Qyd14UZB8WzzX0g7qE=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=XRlqdeUd5a9eqjthWXau5VfV+y1NPH6STiPU/dtwIB34/abxjVD8iOEXXjhiHdvt8 xg7gXkQocTLI5ou4EiAa6Zt/UOdu2YEQyWt5jOAWSW+zgOC3SWwzTWKccXXhWn2zDi Z3TvJ+MAkPmquaGY0X24jns3MKkvRO7sj81iZkFDakuokJGU37hT7cxkQxqEFn2sw6 QAkdGsNKF9C4Jnk8pu3szYR9yJtvf7JHXRu/HX66NvwLap9VHhp59O+eiCv3K7rqas SwkqM1MfkxWftpB4adeyG6hs+HAHRQQOSN+LRsn37G504AawSOlOj22DwpvpxmVB2O PtuOxXO3OJGRA== Received: from mailhost.synopsys.com (us03-mailhost2.synopsys.com [10.4.17.18]) (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 22E52405EA; Wed, 11 Dec 2024 00:34:18 +0000 (UTC) Received: from o365relay-in.synopsys.com (sv2-o365relay3.synopsys.com [10.202.1.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 E77FCA0090; Wed, 11 Dec 2024 00:34:17 +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=rv3wvmgZ; dkim-atps=neutral Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2040.outbound.protection.outlook.com [104.47.51.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id 9A0F5401E9; Wed, 11 Dec 2024 00:34:17 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Eo/MZbftmjvnl+nRF5vjowo5a2pyqmvOwzEdY+7tvXVFRJAutlxvSLUR8iD5AU3Wo/C6kPj72L1ugV8M+qIEF9LX1NXH/hF5awvwcPGnVzq57ErxErnNL1MH3Pkr5yodUrJZ7OBKWmbickgEmUrL2Lc+etOM08REH+4XrK9lK9T6ao0sp1QWU9oub/kIn1bnw3eEPO6lmm47lfXZ1K/2QakzceQogajghf/8aEwqrG+zLT+qBfJjEU01BDS7yoOLFChjyWNH4GI4bkD17Bg/wNF87CK8o/06e04yEBntVoR4+/nkW9cN95XpIBjgr7PvPkk6qL6t23k7GSlWLqsUPQ== 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=OorLWglAtFMuZwdRR5RYlQCQMOc4uR7iM8/c3phCHMo=; b=vZ9lFEKY+bL43TooKy7iu5uy0NHDv8cnUSSnEw5O03gfR+RoqEkQhov/I3J6ukavGYGCqfd7Ru/Jpw64LCGmPeOmN+qV5mCRrLxV8icAcZcBy9DNCFXtCtrWXc1kBbzOD54hQAGtwjtx7Fq/T2LkJLTDeRsECIBOsupVoCqLzLsrFYflE5/o4UcUGhwLPp792p7lg1ndrrmdFgKDBJt71ZDx056verB5qexpZruA+riC5jD8m+ZQQosyYrpIeP3d0ykVg1Zz+ylRnDoVYqBkj54XDP5EYPXrZlVEvus/ydz3tqvCeudJazpVMQ5xEQ+VHgrlpuaAKz/MqCTJt2bvgA== 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=OorLWglAtFMuZwdRR5RYlQCQMOc4uR7iM8/c3phCHMo=; b=rv3wvmgZ+xkuz/PjBrcMVBTtp6Lmbs0VsFVA8YXCNbb6x0RbgFyf9luAGfHquFmYtyb3z++yKQ9cgTv84niYslOYpWDCCChlA6MFEOsTDUqH6rzU5NPXczB3CFBkSx4fdD6EvJKNCaOsXMpRYI6tXOx7n2P27aWF5lzPuKz9VfI= Received: from LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) by CY8PR12MB7635.namprd12.prod.outlook.com (2603:10b6:930:9e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Wed, 11 Dec 2024 00:34:15 +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:34:15 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 27/28] usb: gadget: f_tcm: Track BOT command kref Thread-Topic: [PATCH v3 27/28] usb: gadget: f_tcm: Track BOT command kref Thread-Index: AQHbS2Rn4316DqFVMUKTZO0txWRBIg== Date: Wed, 11 Dec 2024 00:34:15 +0000 Message-ID: References: In-Reply-To: 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_|CY8PR12MB7635:EE_ x-ms-office365-filtering-correlation-id: 240d1729-a6f3-429c-0163-08dd197b8a69 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?YAQgNwP7s5aiaHRkzi56v++0Oz?= =?iso-8859-1?q?zAgZE7WV7XvZBeZYKOxqkbBaZwgliCzBNIYpxMCde7pC/GvtgQuIU2jr6zjI?= =?iso-8859-1?q?9eTnHyQgA27t0f9ntRHhqiqZcBOW2B0O1I8cSuoFcIp3XZFVlVt7IHxelM/0?= =?iso-8859-1?q?g0bA5yEOTt76nKs5oipIqI3jOhwRyOjEl+OYAEvpru1a6DomBAQ2X9wvrTOp?= =?iso-8859-1?q?fGij6/yiPVSLRKRQ4lPkji1UD5KXnLDQp9aQkyJEpM1eGacWbUnPSvmSuthh?= =?iso-8859-1?q?JPKZPW3zbENmrYGOtsbl38fL+V+sFy0nIaFIkiz1g90hlMy5nccm7PcEoiuU?= =?iso-8859-1?q?JB1YFKAcv2KSWX91MYtd5sA2gPGhi7fRZ0Fk6mFD7TYZ8TkV8sNlCsXaBpAr?= =?iso-8859-1?q?8GgZUABi5ryW7irGz3+0sBxj66kYH50bMcfCJiFTPghqSaUJ9BUzZP9PUtxD?= =?iso-8859-1?q?yeaudaB8LpmOlZln2yoE/fZyos2fqNNVjtMIGWkosZ8buwWmdhSIF6zFCMqD?= =?iso-8859-1?q?PGtTCXttOB2/XpIBLPvYOXGeCYdi7omFHlx/hrDEGX1+tdOgjeJ2Dw/gpTtj?= =?iso-8859-1?q?JbCnQDqwV1A9ZPVHKlPGpEsEbyTOpkl3hC4DIAv3zLVRfVZBN9kw/JB4kHaA?= =?iso-8859-1?q?Boqw03B1+NVKPHczfkb7nd89LbBmmO7nuED2kaMkm1TmJOZHorN5Yqf5Ta7h?= =?iso-8859-1?q?x+zUkHm7EDb4Vo9TV2BwKmETpQGg1GyJqQArUyxhDV8c0Z/5CZU+GuEarMsW?= =?iso-8859-1?q?8A9843nVqHoTJ3j28TigYxrTZARl2ZZ6AI7wZC0V9Vvnb7zvfsdIViM6saBl?= =?iso-8859-1?q?cWhi4rdr+8ix1wgR8vpVQIvbVP1cojxQWH7+dJRa6IG74OUC4sS2hwOzvET7?= =?iso-8859-1?q?tISAFOeIgSN+jPJVGzy8tvWI23pg3NPBO4MdXyJVQ3ntamy4E51WwmVVYnwd?= =?iso-8859-1?q?Bp9WIdACCv8oJcfb+JU3Qg6CNbGKdW6K2hHYOkR7aaDjSxCM9/8EjOzlR/es?= =?iso-8859-1?q?V69NemWOExS2e0KhXB6AhQKPiXCXHewGDdSzGjJQ70nJZkuS4dJ8L4o3l5nS?= =?iso-8859-1?q?0gBtPLYbAqqSC4wXyFAR3jk6hVFU17TVFZRSHttcFIVAHFzsr/hVOFY7YKcO?= =?iso-8859-1?q?3sgFe3cuNC2UtyWLy2PjDxd+XJ3mzGCTydG8Rmf/dsKjNvW6S2t8qZD3kzXk?= =?iso-8859-1?q?HF4agoprC3wZkbZL8sya74y7ZRUK+A2Ioywm96VRrMyZZYdHsU/f+voU6fqu?= =?iso-8859-1?q?7/5VmmgaWG2BWZ3EEviTfMvwb6UFPInFmkxVUMwP2IDUTxs2RLUJb1uupYc0?= =?iso-8859-1?q?YaG6bcHJxkWQSNqbpdjYu1FMrO5SGYsYmLL3LgUoXWK55GA4UttjXk5C9vOA?= =?iso-8859-1?q?qJPTFGzOhWqhsdPr0NsombKSoE887OaAx3TFcKFr6RDzZZF1Y/g4ndACJIbq?= =?iso-8859-1?q?3IUK9ACBll9mOIJqHd5J3BuQ=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)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?963nRJu+q8Gcw9pcc82u83G?= =?iso-8859-1?q?Taa8gEuHvD0bxVFnYhUOgV9dhsWROGZbHWTBoCN0KTxja+3oa3wrFUX3GYYn?= =?iso-8859-1?q?6Crrz1vCzqUGvjtV9kn69fAXb09c6CrKkfQCkn6gBBCJaiRqNGmZzDbYzhgO?= =?iso-8859-1?q?UaSIli1D5+GAYDaaopUUR+HPOEoV7C9zIyMq7HxCU/QkWgm2iyTsUvQ9u4E4?= =?iso-8859-1?q?1tYjpeQFvYXnbUP+VaB6/1E6ypOo7PfZDNihXLUCc39Y3BcVeVMd5lAAHxQv?= =?iso-8859-1?q?qmm9l93fq/pAFekFpmGUrLEvwivjTd+PJkv75vRzEfRKIqibCDH2tURuKRV3?= =?iso-8859-1?q?O4Y2uTWChPpZRSacIstTu21mGbOmz/LGI8QCsoE4SPKzQZY3vsQZj+I3CSLt?= =?iso-8859-1?q?JMCYVd8xvnK9qGklsmWBwrY2czB19rW54edyNYr7FPGkfkLOv9YZx6qcm5Ql?= =?iso-8859-1?q?nE6+NsLn148LvfC6fmUf8O2OaZf2rr0lmwvsBVgKiVc+4noBrnT3peRsZQvY?= =?iso-8859-1?q?b1d4r/Ehp4XeuT8hy+Gyxw/8oqwGC6SCNSHlPtziInEEhcLHW13d/0flUiDa?= =?iso-8859-1?q?w4XXi5UmMDvNuZzLFFFSd3g9Nftx3rK9QYOJ/eKwQL/ibiYuC5CG5Am+xPSn?= =?iso-8859-1?q?j25JXkDpbLu4aYEmXOejrCN+zsEJWG/TztkNMMLquRPoVeWkF3uEEWgSxneA?= =?iso-8859-1?q?jPwSjtNrzSi6cKP7OefQJbdhb87Kc6Cr7lS95EYcLaBa5T59kUE28sOPnSoU?= =?iso-8859-1?q?47szZX5NDNJWoK5ROqQ8oPTFWCA4OYbHTstMGxVmNuHbz20PNyOoRwowOFu7?= =?iso-8859-1?q?Gz5gbkUYO3Whz3EWuFK/0p7U1Vmi54RY4hX/DQ5VzlNG1b4ZHvJIQoEPsyTR?= =?iso-8859-1?q?tXdZVvCl0PmbjhV1d74isrMGOieZQnIwXjMbRxlZyrgpFCFBLG6oyly+fC6y?= =?iso-8859-1?q?/b07J3sLuvYV0y/Wpnbawr94FIVXEWmN2pHbAZt9CMR6hkPibyD1GsALo96x?= =?iso-8859-1?q?7aYhNADJnivPlk5eeeN2TzvsswjCL9wrIwnZdHYPG978xSB+PkWeo9PYSl4B?= =?iso-8859-1?q?KnsYDix2HwJH6NTMEWaS+3X30ULCyXXcz2LG7R5YNbU7vhpbh/OVuYMc8lkQ?= =?iso-8859-1?q?qgZDoZ0Rct8UZU1qLtLR75rh/bhTug7TH8mNW7UOWk+pS8wPKcV4kwAEI5c+?= =?iso-8859-1?q?wHKxW35c6LSJE2y0pxPclDB69eueJWk277ds8nq6P/MDew7LOWCjf0F4xtUQ?= =?iso-8859-1?q?AWOWa2eBQ7EzBha1SH60Uu9rJSKujkn8r3ZHePent6wgmTJ43M0WRGDPUBlD?= =?iso-8859-1?q?amohFvcW7joK37QWWZRiU3Rw9iRCDIEVKSOb9jhMplwbeMuKQeMwlI5v05Vw?= =?iso-8859-1?q?spZipphD0kNQnUKOahh9RoRNO1sR4RtMZCjx0zQdEWme16PkS9YaaPt53etu?= =?iso-8859-1?q?nFThIN5JYcOFQlXjDx7KRHBawsgNLPS+wSLc7LvTjCVFYo8hKCWF2EH5RmNQ?= =?iso-8859-1?q?W543epLtHk93BLPcBEFZk8k0s75W6l3niyIwgz5JN15nFWkC3MOrVuwREuAi?= =?iso-8859-1?q?BzFKnFhePQuG1nlpJdF9tZDmjAKO/UrUgiMvcYKKy1yond/nTLrvzvBe/ekD?= =?iso-8859-1?q?EvZ5Tjn2JG1bATtxJNbTa1tETKt5KOzDiLJzbUQ=3D=3D?= 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: AvDtu7sctZqq1AjIAI4J6yRcugEeV1/MTWHTbOlRApBEg9i71hLrxf0GwcJ56eosOxVobtrY/JeFQIjEOxfIl1Nv0QcO6/prbynh/ERIlXJ9zVsrneokEL3l5mMyp9BdlBr8eEVPELKaA5qtbisImNpqceKFlnsIqHe5Z461QCJty3u13kyzNqcNxymEF2SE+Nh7UOsCEvTs/SWzV1IJh+VUzK0zIXWsBK6avLbPU2kzgYdcpfTrQkAyEHn3vr5tq8FaxeiHscYnLzINZyuzvKi7DPOCDRD7DTW6oPLrquOa3jD5XUAZisjmcJntZwcimF1V49zxfDDWTUlaulWan8AIRxuaXrBz/MbpjmDkuKWze1zBeVw3h+L/oN3yvCgOGHhISjGh0WbMLliMMAd21fUpe0/AHBcfuGsxunLxkYu7bjaak0tox8nrx2NDyaHATQOLHjCEwmO1rMkneJP8VpcK3MchXIxI1I5gcoEgQtTeMvsQnUF+hByDT9kZlxBjC+3AMmQpEvUZDdsiVkats4hnroV8WR0YeyVIqCetLF2/AolYeX2w4ZRql1zyxJ424pk4bOpNiNKZzSHBY9W855cMZ2SthiXkI19RkQBWQEvoW25bKi7uP0pkIwcEzP7uJ1RSNqULAqwa+VD98n5WTw== 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: 240d1729-a6f3-429c-0163-08dd197b8a69 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:34:15.0250 (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: LZdql8UPyZUAyK+gaG/3OckTcmV0+c4yrYx6O1qXu7mRPtK4mTFD0xtqQisGqvMbbfc40VQF6yDmJs1+kohRww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7635 X-Authority-Analysis: v=2.4 cv=fNPD3Yae c=1 sm=1 tr=0 ts=6758de0b cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==: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=jIQo8A4GAAAA:8 a=c0npTWfPIdM5zqziQOMA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-ORIG-GUID: QPB5G-VMb5iqUTKh869aCAvXafkazbx- X-Proofpoint-GUID: QPB5G-VMb5iqUTKh869aCAvXafkazbx- 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 mlxlogscore=999 impostorscore=0 clxscore=1015 phishscore=0 spamscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 adultscore=0 malwarescore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110002 Set TARGET_SCF_ACK_KREF flag and allow f_tcm to take the BOT command reference. A usb request may be canceled, the f_tcm knows this. Let it decides if the command should be freed. This is the same as how the UAS interface is done. Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index be7d8df360d9..72e7d4558eef 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -1466,6 +1466,7 @@ static void bot_cmd_work(struct work_struct *work) struct se_cmd *se_cmd; struct tcm_usbg_nexus *tv_nexus; struct usbg_tpg *tpg; + int flags = TARGET_SCF_ACK_KREF; int dir; /* @@ -1494,7 +1495,7 @@ static void bot_cmd_work(struct work_struct *work) target_submit_cmd(se_cmd, tv_nexus->tvn_se_sess, cmd->cmd_buf, cmd->sense_iu.sense, cmd->unpacked_lun, - cmd->data_len, cmd->prio_attr, dir, 0); + cmd->data_len, cmd->prio_attr, dir, flags); return; out: From patchwork Wed Dec 11 00:34:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13902670 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 DF0971CF96 for ; Wed, 11 Dec 2024 00:34:28 +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=1733877270; cv=fail; b=X8qUcvIPPRzY8fhjLnDfLghbq4BJ4MCiw20QMHvbSWtTkOyJRks3TO0v7nuNZ2umcx3RZG3gZXitQS+V7nuSWeBBTl03fqfb1ilw2Trgz5/mCl2IcokoXVqdr2SUvcbC+XY/192lK3WJqcKmQ1GxZ4TCGGEw5DDaJ+tocg3xnng= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733877270; c=relaxed/simple; bh=lIznTCoEIJkzpfgBe1i2JrPO1IyBOZOAI6NFXLkn094=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=EavvwT8fk88mwePke5P/WPlVYcgqgtXiVwQGY5FXnp3EMFsJbm5kcO8troDEeaAgegZjW1oaLHlh/w/W5EAiYmjVPFICuuMGveHucyLN/qKdN0f2Go4VLpxM1CahWnPqjXZde0XVGRufdjDOP4qp17sEV7fr8GGFZRq4IKGBaRs= 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=GvWUavv9; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=k50iAmuP; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=dJpZehZe 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="GvWUavv9"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="k50iAmuP"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="dJpZehZe" Received: from pps.filterd (m0098572.ppops.net [127.0.0.1]) by mx0b-00230701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BALFNFd000621; Tue, 10 Dec 2024 16:34:25 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfptdkimsnps; bh=eF7AdIpJilRWnqukgEa9PaTfHSbUOTS/C+GNnaZ4/aA=; b=GvWUavv9+N0i oKEtWReVsVqlZlleYkc88jrlOo5lYZDdxWoEj+mcavpV2HbL2MAVY1CeWhE6HOsz +/P2KfzCmUEX/qCdDdfEsMOXzuAXZS+RyVtVVmO/powSysWDEepDhFilJ0SquA8/ P7TCl+Aki1sHzjXSsIw/0nrTuW7SZmE4KwPZZmNOYBQQ7+6ZpnsE411lRuMoz9Vv hq6zITIAhirWFvbOyDFA7SNoR0likfkkhjtZkEqPhPFYdwIkrMBhJQ9XdNPne2DB is9K0DGRlOyi7sWm12p2LQvLEC4aF1plxUwCYy8IuSHlzeaT0aquTQt4yXMIey8a 9z8vsvkvAw== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0b-00230701.pphosted.com (PPS) with ESMTPS id 43cnvka1d8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2024 16:34:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1733877264; bh=lIznTCoEIJkzpfgBe1i2JrPO1IyBOZOAI6NFXLkn094=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=k50iAmuPupqnBEDk3cBr2PBdJpzGQEYumXr4zSCdstyY6vx5hsjTPnTu7+pL7QiuE 1NdlrKmxXeWuT6aJ1n1YOez/bhJTUULf82yQ70RcxDISf8+aFwn1x83NbTt1Po8sYr x5bNugy7vY71MKr2DAgKzq2I14pxbdEe1+hM7mo5srbAw7eXniFr+b9WYVBV5dNVn8 9sHG1i8pk/16KGBFdczsFERzdvieoPXRoKxMlWJm2lKBKuBlCB5BBFfqPoYLJcK/+o HHYi1aqhUmPSRA1ovyxhRFzg1rifX5pE6fyvpjO4JtqIZe6N+e2cm+I15si8EUlkjE lJ7RpH7S3R93w== Received: from mailhost.synopsys.com (badc-mailhost4.synopsys.com [10.192.0.82]) (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 5EFFD401F2; Wed, 11 Dec 2024 00:34:24 +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 0C3ECA005E; Wed, 11 Dec 2024 00:34:24 +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=dJpZehZe; dkim-atps=neutral Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2046.outbound.protection.outlook.com [104.47.51.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by o365relay-in.synopsys.com (Postfix) with ESMTPS id A54EA404CF; Wed, 11 Dec 2024 00:34:23 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cjujbtdBnrV6r8y02SM7Fbijofn8HYB/PFizemo0QKM7/33fWqWYZz7pjk/+kayLOinOHNZXiqBSAA7BAksew0/kyCTAKhYxZMNH6d8j1OIJLVc+v1fQUxcq5DfF4738EFhdMvb5UvBc2XZmwiyuMCrLAxCv2ZQrSLcYWDdol8M6z/q5kREA2vYPIla/AiV55kgbDWSmH3y0b4j0BCxFE2q0Q9GUwf0+ezPKCWU4mM6eGaIqHKaV4pSonPMixN3skNh6QSGubOPA6uAsFt0EROujSrMX05kn+ujTdtQuOJzunmuSFiov+vu3nFGp/MTkwpeLBUOXUzI16XKE0XcPrg== 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=eF7AdIpJilRWnqukgEa9PaTfHSbUOTS/C+GNnaZ4/aA=; b=ScN/4Xt6EGbS2zcgTYx0PVstGHGyOXZlpv+8MAeTaInaQTs4FHrHqkp1L3b5BD0borhOXfSNMpnTnYrYf345GxlhfPt5yiqbwnjtDPP7SOyNWlMrnWwtj7XDwt8oEfr9DZkDpVtNZaJC7TL9vlqi2EntpqCe0K+d0tt51wZVEvxg3++wWR1Vg0+kvWFpkfdtQz5Nre8gRuUNllutv+L5MXD49x3666lOpd0EkN/Ivb2utUhKHLkrcLxtJnnQYjy2ilAmPqYJb/GVpdSTIWAbTIwMgiWjnWp4waXxeo0nCKUcgL1WTZU9GiEBao8TZZk8UdAGpVpLgKuh3zi4VFSnPw== 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=eF7AdIpJilRWnqukgEa9PaTfHSbUOTS/C+GNnaZ4/aA=; b=dJpZehZejQ7vST3TKIZ2ad17LbN/+cePbGGxDxNfHLCFcJGzvaKI6NcZGR6PJZCJEsCB3mLtupRxxLDOkfOuL0xlyGb5KnKOL84PWp0tZrLQX6qsHMWQwrfdwgJN56RiwgAuvQRN/cMcB/136FpEnQ6xD5XQrGn0QolYo/WtvHk= Received: from LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) by CY8PR12MB7635.namprd12.prod.outlook.com (2603:10b6:930:9e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Wed, 11 Dec 2024 00:34:21 +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:34:21 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , Sebastian Andrzej Siewior CC: "linux-usb@vger.kernel.org" , Homura Akemi Subject: [PATCH v3 28/28] usb: gadget: f_tcm: Refactor goto check_condition Thread-Topic: [PATCH v3 28/28] usb: gadget: f_tcm: Refactor goto check_condition Thread-Index: AQHbS2RrD6OM9L5Az0eXkpJxO9GO4g== Date: Wed, 11 Dec 2024 00:34:20 +0000 Message-ID: <8442364f51f2788d2a191997581a8eda7a143272.1733876548.git.Thinh.Nguyen@synopsys.com> References: In-Reply-To: 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_|CY8PR12MB7635:EE_ x-ms-office365-filtering-correlation-id: 78b72ba0-af44-45f0-de2b-08dd197b8df7 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?mgjHqzMcNTCGWOTQTetdZQACeM?= =?iso-8859-1?q?yMGrJG4bcPOYzoAZK1rAFIe6Rw2iNDGb4Ce5LMz93o/pnU+qcqLjeuX1aZjs?= =?iso-8859-1?q?+0khS6PsyV/73ymU/n1q2qhTGYsaXf188ozcxNo0ZsrbaBom5dcFrKXRoNEo?= =?iso-8859-1?q?KBXu5+6EgvbT/QK9aZrb8bgNUPiZS2s4NQQARWFU143QMUvRXBbO9MsUBYLi?= =?iso-8859-1?q?F9DrffBjDAWF/S0JOrBWBiu4x+0yHlwBonhh1+VlwV4ZScUsOiIt5DrAwJTG?= =?iso-8859-1?q?WKNkaHCUu/7tDLUTqa1xpIfExB0vZeoOhvTcoWdTslpfZYobrcuPyPHZOG4f?= =?iso-8859-1?q?1zW5qvt+FO0NpijPWWdxOA9AaryUuGi9MmbVxt9r19ioOY+Js2ivWIPmsfRP?= =?iso-8859-1?q?/kLjC7ZJND4cHR1l7r3XiVuihw7AxUgRjW1/MlyayRRjla8tlr82g/Wj0kwH?= =?iso-8859-1?q?xrRDIeFzf7A1+/GwS18GmZP8dFRujbxF1gqXZOVygEJpjTnCs7vPHWFPrOTK?= =?iso-8859-1?q?w/wGPeagxQdAzI34C0jmQVc568x4+DpQ8b3/hmcDXanZpH2LdwiYFDPtjRF8?= =?iso-8859-1?q?ZWBHLZ9j/inUKxpoazJbi894Zl4NVXXl2XKM2g3gJD2kZqh0QmvaLWcvLl2q?= =?iso-8859-1?q?Hphpu7SbP2P/SU7+IN8Ayqyg/UUmmvIyEn4KJTHGGA0t/s6MUsx4VjlUht/+?= =?iso-8859-1?q?kDXq+AGBoK7hX7fnxZ1NgqrR72Of2A7SsKPniClhcNt+gpQqjVoeNeZZ7vuD?= =?iso-8859-1?q?6NnsdG5dfTugDmUipGegeSSUA4YHBGvKavs4yiRpGT37tIftkIpayCqVlxJu?= =?iso-8859-1?q?W6nhZVuwVPa1u9G2x2EHZozKnuifUcrtTJA3u5n/KGeWRPYQ7f7lTuHe8bau?= =?iso-8859-1?q?6dc/puG+zkCjaGdWeybD8y3aUece8zM8RkkyrCTCXRUqEPkYCe+wxfRM/rcz?= =?iso-8859-1?q?Pu4l1bp/KgM0NSm1FZ5Qaf6lSfCxiJqkJ17N4TW5mR2U7mnj7CC7NTjvVMRE?= =?iso-8859-1?q?haWotIjlP82OuYZQcd7xaCje8x95RmfDqIwfw4hIeNqQT27htDXVYRIiAga5?= =?iso-8859-1?q?lV5tQxNwc3JT+gaxrtuLC1I4o+Zad8EmzkD+OzWtQf/5nmWSck3njQvp7ovW?= =?iso-8859-1?q?uGtsf0EKSqhmu/rmXNGFH5fNtw6d7/ZNH4fyaM/7AFEZvot04I6Kckyocvwa?= =?iso-8859-1?q?GLtpUYG9LqS4eP2mCVsLacveuJxupCEoCPTnBjCUx5/eDLcT741yrYXPrdpq?= =?iso-8859-1?q?NBmqWYyWiT9/sorYdFOHEgbgHLAQSjZ32QYgp83xzp0pEqlyQpC9Wh2+g3vB?= =?iso-8859-1?q?tcEydPz1PyyLJwiLQ6T9VapwS+7xJoHgoc4K3gjSSUclB19dRB1I6qO6SKJp?= =?iso-8859-1?q?5t+xPXdPLSeIkK7dV7zpLbevSiiS7GzzyeW7S3A552mEFHoAxTp3iPaWpnG1?= =?iso-8859-1?q?vKD0Ok8hRJYB+6EHuRl8J4rQ=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)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?RkWqPjmIlta21Ai/P1yEijQ?= =?iso-8859-1?q?G7PogOzFJ6HJNSH/24lOFcLTPLCGoD36FzClkS2fiGXId9l+FNB3qF0x08mT?= =?iso-8859-1?q?GMy2tz0UE2KQ3uR+hREW5Jm2peT7+PF/RgsisPKf5C+JSoJMsC1RCBPa3WL6?= =?iso-8859-1?q?eO1SxU2pkh2YRg7jkjKH/Av2nJeMZWyv1ttoeK82Iuqywjno4IEjOujdjXUI?= =?iso-8859-1?q?v+HGAv0RlfTOxPZC4TJ0/ONqgXvGHw8NxzfDVaOAKtz3XrzaxTNXF64D3+Z0?= =?iso-8859-1?q?FytCX2yTJN9ISD/W9/ztjy1iX8qazUlmSJplHJXekRIF0ulIcl2++NJBmx24?= =?iso-8859-1?q?LB6H9XiFpimZOjwObvG1FTC5eSYov/6q2sTzERks+6vLca0Nb+9d99nMXapC?= =?iso-8859-1?q?To5bQ0J2kzvtl3gg7WXALXspUmn3KVooSBJU6E6gJ0w+ycVTqRU5hdu92U8g?= =?iso-8859-1?q?jh3hdgpJ3aokmuaVBc6k+XO6l4K3V9SahfJ3GgMoTZ2jJl8QtFmH2CIRSNFI?= =?iso-8859-1?q?Vex1RkcbeRhtAOkl40srsWsxJnsKfrOXFzFsg/ilaOvQVtbPZ3KK12FfE85y?= =?iso-8859-1?q?uC8YxPpYEsqPDq1v5ZLPhxc7aVmltTH2uyu1TxW2YRUR1R5q5R3qsI4hAGEE?= =?iso-8859-1?q?clpyIpTf/IUpqcLtldnxjKMYOdeuaaUUXqag0d1a43dOa3iEkuQQvh+EcVHr?= =?iso-8859-1?q?u46NYkmEvsIe3YBs4kRlNs9zWQjhhAuMcQeQyOPZSPF5efIrSh1GOnBUN/oU?= =?iso-8859-1?q?YVEP50U2ouq9ckkbDU3XeBMrt5Q6eBNyuzamdj7iMsZre/beDq8WdfpR4G9c?= =?iso-8859-1?q?UKQ3Tb0jTkqR6JmOz6Ses21WN3hoia6nBKSokWsvTd50AYy1J6nw+InVbSVI?= =?iso-8859-1?q?GSe5gv8U4lknxd3V69s9zCMGbzUCUWzUtWLW76aCeqTbH646r6AU3HT6QMgC?= =?iso-8859-1?q?GfG8feVklklhR0schZ6k9sITv18z88qSRdTM7g+r/A4LDTt7/LeoNnvehxXN?= =?iso-8859-1?q?NiLKtgsDFPSVle8GZg5ummg0e3GJ11aVDcx5AK7VNIjJqbz7qzcTnvH5jQDo?= =?iso-8859-1?q?L2LhYO0lmrlQHWPzDzQjAzkLRm+GbTahXaNzx3EGIUVMLyiFNgkkNkfU3nna?= =?iso-8859-1?q?AdJ0MFOboKP/HwC8RxMQYpHlDAhDW1kbWRK10nYlA/ywz+DIJu1diVS08aJc?= =?iso-8859-1?q?kJGzqWKNklMqGHtsZPeiUnUqPTVJr6nMqny4AEM+AnicQeQK2yshYAgY4ASA?= =?iso-8859-1?q?z70CF3NuHuVaG3qn+rFLemlBhJDpZYJQsFdlvfZ6LobZ3brqTGrxHwOSjKrn?= =?iso-8859-1?q?vwY9ytZx7x+C1q56/I6eq/dSY5xgriwnhlro0Jur/nG2no94rHz4h90mbfFg?= =?iso-8859-1?q?bs3sui4CWUsrSziGGIm47AJFgYHw96s5B2FZ61UEQwgPTPwAeSAiq+mBQO88?= =?iso-8859-1?q?eYnCJlLFFmMbAQbocGTJ9CZGWpdJZBWMlACb1HYgLl315VL7qkOM88PweSS4?= =?iso-8859-1?q?TvwmeyaDcwLVAw3j6isUH/IZePZa8mW6DH0u4qPSE6ejclXH3Uft414NLv21?= =?iso-8859-1?q?swunCWZozHwkEgTdkzrP2XEvRXY6N8xndda+n5HUMYK4ovKXtMneymF33xxS?= =?iso-8859-1?q?v5DBB+JxeW9Tr97QB0AHPE87DuiZITnnUi5p8iw=3D=3D?= 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: gNnCbjQnKv6QIknkSrSYKVYeoVsAyf2tPXZLz91YMGzwik5C9XYl3NNTwbwOfa3u8/GYaCFr2VlK04XIKa6GPLQ51m00yScYGZH3ijY1wWtas6tgVCkDH9yJBAPoFmI1LSf+HxRHPH8aiMZ+QBeyh0nU1mxeb5/kl8X/sAsr7UEcPf+Kfcei+NFWDKN3YRnYMZRYpwh21R1lZ1LlrtBvlO3E3K4TMMlec16YDL3plNvyUfs75MUla44VBbimCPHtSBz3N9vxIVTtsi6C9ZrWmpALZ5sDIafScYhwOe/grV/9vTwJb1E3zn+qu3se911QLe+l1AquCk5by9AYVDnkInUw7ndzIkR935yYOdm74QDKtCHBPQieZAWdh7eM0ZsTS63ISRTnlelyf1dAFjRkm4O6ZbYrYn+tNPp6uyfj5GT1TeeM+A7yTuKrAn7aASN6sAzBOIntBeTew5KHYMZ0c5I+5etYY9hFsi7mt6VzcVNntQGvlcvqFOYK/hmot5kVDB3zRXG/jPryQFlOnZOS4gBsq8sLy6M53seROX6BXUB6Y5Cp3P6rlXMdRm8csS9YqkyiVVAWuofw/PeCepO7tUCE/5IL8oO8SkwScYpC6+tqxmKgWQn1QWw6rIrT7QcFsUTYjEGjWQkqJodG2NEeLA== 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: 78b72ba0-af44-45f0-de2b-08dd197b8df7 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2024 00:34:20.9802 (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: V0CRt3TOVWyO+Bs8XUnrz+l55BcHDrpq8hhTXXLnp+e1V1tBb8/KMODcPk1GwRhn5fwp6/aF8pM1Osp2C9TWBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7635 X-Authority-Analysis: v=2.4 cv=fNPD3Yae c=1 sm=1 tr=0 ts=6758de11 cx=c_pps a=8EbXvwLXkpGsT4ql/pYRAw==:117 a=8EbXvwLXkpGsT4ql/pYRAw==: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=jIQo8A4GAAAA:8 a=Y8aRv1srGp9X5m9hZioA:9 a=wPNLvfGTeEIA:10 a=EEFIF99-17FBX5V1_l-D:22 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-ORIG-GUID: kEMSI4M19t97bzhwZKDdoV7wJibX9TjV X-Proofpoint-GUID: kEMSI4M19t97bzhwZKDdoV7wJibX9TjV 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 mlxlogscore=999 impostorscore=0 clxscore=1015 phishscore=0 spamscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 adultscore=0 malwarescore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110002 Move the command initialization before the check_condition to after the goto statement for a cleaner look. No functional change here. Signed-off-by: Thinh Nguyen --- drivers/usb/gadget/function/f_tcm.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index 72e7d4558eef..5a2e1237f85c 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -1223,14 +1223,8 @@ static void usbg_submit_cmd(struct usbg_cmd *cmd) tpg = cmd->fu->tpg; tv_nexus = tpg->tpg_nexus; dir = get_cmd_dir(cmd->cmd_buf); - if (dir < 0) { - __target_init_cmd(se_cmd, - tv_nexus->tvn_se_sess->se_tpg->se_tpg_tfo, - tv_nexus->tvn_se_sess, cmd->data_len, DMA_NONE, - cmd->prio_attr, cmd->sense_iu.sense, - cmd->unpacked_lun, NULL); + if (dir < 0) goto out; - } target_submit_cmd(se_cmd, tv_nexus->tvn_se_sess, cmd->cmd_buf, cmd->sense_iu.sense, cmd->unpacked_lun, 0, @@ -1239,6 +1233,11 @@ static void usbg_submit_cmd(struct usbg_cmd *cmd) return; out: + __target_init_cmd(se_cmd, + tv_nexus->tvn_se_sess->se_tpg->se_tpg_tfo, + tv_nexus->tvn_se_sess, cmd->data_len, DMA_NONE, + cmd->prio_attr, cmd->sense_iu.sense, + cmd->unpacked_lun, NULL); transport_send_check_condition_and_sense(se_cmd, TCM_UNSUPPORTED_SCSI_OPCODE, 0); } @@ -1484,14 +1483,8 @@ static void bot_cmd_work(struct work_struct *work) tpg = cmd->fu->tpg; tv_nexus = tpg->tpg_nexus; dir = get_cmd_dir(cmd->cmd_buf); - if (dir < 0) { - __target_init_cmd(se_cmd, - tv_nexus->tvn_se_sess->se_tpg->se_tpg_tfo, - tv_nexus->tvn_se_sess, cmd->data_len, DMA_NONE, - cmd->prio_attr, cmd->sense_iu.sense, - cmd->unpacked_lun, NULL); + if (dir < 0) goto out; - } target_submit_cmd(se_cmd, tv_nexus->tvn_se_sess, cmd->cmd_buf, cmd->sense_iu.sense, cmd->unpacked_lun, @@ -1499,6 +1492,11 @@ static void bot_cmd_work(struct work_struct *work) return; out: + __target_init_cmd(se_cmd, + tv_nexus->tvn_se_sess->se_tpg->se_tpg_tfo, + tv_nexus->tvn_se_sess, cmd->data_len, DMA_NONE, + cmd->prio_attr, cmd->sense_iu.sense, + cmd->unpacked_lun, NULL); transport_send_check_condition_and_sense(se_cmd, TCM_UNSUPPORTED_SCSI_OPCODE, 0); }