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: 849691 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?OY1soiCv2AvvaODQi7DQGYRi5TLRlWls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TNKXt/?= =?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+KLhzP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0KjJu33Tb3a?= =?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;