From patchwork Thu Nov 14 01:02:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 13874421 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 A147A1BD4E2 for ; Thu, 14 Nov 2024 01:02:31 +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=1731546153; cv=fail; b=sVghIDL/CXn2RdZWz6VkimYMjNf7WclnXC0JaaLInCV8U3tS/GtDp9FkC3mRuQndvLoP3aRzdzCD3/G2C3SzZP1biOqjHoQ0YFPtRN2YKw/klRODzuuNQSDQzNKsT6Sd160sFDiq1yAUXrj+MXNtyuF0DI444vCnybjx/Afr9+o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731546153; c=relaxed/simple; bh=FHTUUJ7qKEZA/q5TIky9WmrO6KJtNZEJrx1+RI4/bpM=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=pUMHho2hoN6a1ti3Qp9w21vB3x9yqfW6bjqvXQzFZXknkFULbKjm69MoLWCivTTc2ZvIz3WRxAhIo9gawfGqgz1IZXMoQDes6vrV23mza8IaVZztjZQ3t3gLdtXmYzisYTVgxRm4CB4KIc6fcQ2KDnZldxmZD4QNhnTlSkmNrjo= 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=VLRuEl9Y; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=GzW3awP4; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=XnmbqLNV 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="VLRuEl9Y"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="GzW3awP4"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="XnmbqLNV" 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 4ADI8MjY025589; Wed, 13 Nov 2024 17:02:30 -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=pCx4DzcQ1qvgYLFQfd70bRciH4JDFqV1FeqKAmaYRiQ=; b=VLRuEl9Ynmvn q23smoSdUxczOfuT/W3pJqqe8iCdIzz+KNx+S1aQqRApKiGohjLfrlGzxMs+fzO2 O3hkRgeraw0z7sInHJoFYv4ISELl4pBVcEqj95KD7+EmAhNE/YftYfmoZEqXZ+eg UZwLzR/UAknZtCRegL6fAOIfz2tT3cIvCfUsgaIIDMIXg9ycn2+c7AMjtfu1rTSO N099YRiAic+V+ynEpm0uBR5++E4dlh08h7hr5BpYaHNhApbzYgb1JeMavfPOY5xK GeFzolsIS/XSFHJW88PTJSLTu3Wy/2ZUtwBUjAqm7Tjn+Q7pCdO7iqxvyHEGOdXK RONmxM4wTA== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0b-00230701.pphosted.com (PPS) with ESMTPS id 42t78m26rh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Nov 2024 17:02:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1731546148; bh=FHTUUJ7qKEZA/q5TIky9WmrO6KJtNZEJrx1+RI4/bpM=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=GzW3awP4faPQ07cuwPq0KtHrgZkLfS3/MqpLvRWwmPNQiK2Ltz3x3x8n0WkpNYUBD +x6WwTvLlMT6/0bLHxO5vT1mGq/2nxqPcndxo7Nu9XWx0ay3x1I2gdjBzNuDzEpajX LdML9S82aXTk3Hb7ZRaUVLYjEam9+2u44gExvySvOm4Mru+oL9jCtAg8X58HWzzPS/ Y7/w7aUSsCL61tO8vaPgV1DOZJ3kLutLlYqGtBBwuadoNDCR56Fqr18Wsw5HNdRHY8 2s2HUFRu78aeT6yiWPOOkfGmGv0/TFPL+/SBqhUaa8mkHry+a80GsWIsUqkZBLwsHf GVPpjQ4KaIiXA== 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 6CE1B40107; Thu, 14 Nov 2024 01:02:28 +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 38FFCA006F; Thu, 14 Nov 2024 01:02:28 +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=XnmbqLNV; 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 E1F9B4045D; Thu, 14 Nov 2024 01:02:27 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qc3urZxiro1V+qcVIx6diHIxcNGVPGihR0AHFq7y9/qlk+Ko9CBGBTyedO4lbyFiD/uUEEQXLhQLyG+FY8QK8QS2rlBzgGg1vwro7fznO74o/Gy+gBREZ1CXYriBd0Bd+oftmTT/IZcJ0v749LP0pwXpzmXYnv4DXFB62d5Zh/Mc5zMioO1VcQEHPEPLu3gDlR8XHzgPsh7Cwg1D4IsQqHTQgl5NLpkQtwd+4IYmoZpKoUNnKBUNgmHWUbivEt9jArchPO1EMy6pjLvr8YpilMAoGgiu8XsNmsmwGNyHMYbMqVT0a95AHWS4QSZ7mP6zOTLuxV6T2zeQCOSXPYswnw== 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=pCx4DzcQ1qvgYLFQfd70bRciH4JDFqV1FeqKAmaYRiQ=; b=IJxspEx/4iW88c8UIqmrDGyi2SkCbP9pYdoGhrrYExSvYhBQCIwQh6GCrdun/EvUkblrEaz03rEyUDctjtRF0bO4tV0t2nEFb6KyuQhXrUT95H2sv0T2+7NLRvTRoM4NwRH638RU18qiqTC2ABREHlc/3HjUb0aoZPMpCbFTCqbYLjIx9yz/91rzS2ddGZtDYjZ9iuMkuOUzAnyMrLIXqoRWT8ysrJSzGHbY9MJgXz3cSJrcnBbV0qm3Q4369HKpTwmAlMw8SBJcXyxFmSsthlk5iidwLoM7ymFm20PjcpduIQw5aBscnUm5jA9SiY45T2vbL9A5bP2DOqGI1PWm4Q== 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=pCx4DzcQ1qvgYLFQfd70bRciH4JDFqV1FeqKAmaYRiQ=; b=XnmbqLNVfvXQdsNRT1+sBu+n4F52u8i+mDKXDPdyeRv3qd5bRCHSjcEKhPA/VYydJ1W7mQpaf37/jMazRnqClJ4eXSLqd+QQjGhsGdtHSCw+P/cleTkhlVia5+jaRw6HBTa6vMwgHLmK4A1T6lO2PagNMLVejivlOFr3/+Bas/k= Received: from LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) by SA3PR12MB7950.namprd12.prod.outlook.com (2603:10b6:806:31c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28; Thu, 14 Nov 2024 01:02:24 +0000 Received: from LV2PR12MB5990.namprd12.prod.outlook.com ([fe80::3d09:f15f:d888:33a8]) by LV2PR12MB5990.namprd12.prod.outlook.com ([fe80::3d09:f15f:d888:33a8%4]) with mapi id 15.20.8137.027; Thu, 14 Nov 2024 01:02:24 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , "linux-usb@vger.kernel.org" CC: John Youn Subject: [PATCH 4/5] usb: dwc3: gadget: Cleanup SG handling Thread-Topic: [PATCH 4/5] usb: dwc3: gadget: Cleanup SG handling Thread-Index: AQHbNjDdzdsm46mJS0eT4Iz6c7PlNw== Date: Thu, 14 Nov 2024 01:02:24 +0000 Message-ID: <96c7bf8f6b3e91e607d5b78ea51cb1d00c614eaf.1731545781.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_|SA3PR12MB7950:EE_ x-ms-office365-filtering-correlation-id: a232daa4-4c20-438c-5dcc-08dd04480065 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|376014|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?YHFv+bAtYHXWbUhIZo2gX7rckr?= =?iso-8859-1?q?nHeHlfiIDAwydwPHd0lVcZ+BmS0Bwrx688ZAfTYnpg/M8oDYgJuMFoojlo28?= =?iso-8859-1?q?YcCcOSHlN6Bt3Krd/Ch7Kf+fgrl5S/B1S7JHxPKtpaWmvndQok/qDB2LibmQ?= =?iso-8859-1?q?Wh/nvfBrcuqDR3jTj5hBD3wP7smf6LTUNwzd1U69RGmV0aFDMMjQEnAcdMcr?= =?iso-8859-1?q?Ik7gPI8dcxZPAzsOYs0F/H6fnZcwSKOUdCss7eTjc2idcq98Pf44wAE9e/nV?= =?iso-8859-1?q?oE1dy7NEgU1qBWw1w0AfYaP0MXAeLW8pIvE18xXSftptj3p2X4tHFCDx/xOg?= =?iso-8859-1?q?v/aQ7CaN5d+w9+cPiX1oG4phNK2s6G2Ee+W8UjOZKOG2D0tAmgSj+52m3aKK?= =?iso-8859-1?q?Yydi4z0XqnaIAHzzlfXdKYZ4MEICXcs4cAq3l75Ui5mNw+QiB70iN00q5bWF?= =?iso-8859-1?q?OosLgYIUZy/d9Ys8jSKkF8TvzQMMQNh9JYqcY1BM9Z+Dd+sRRppvifYMw+Tr?= =?iso-8859-1?q?k4/MHknl7A1YfwDEgmO/4I1rPDG/hb0lo5RbODyXoQ1XBJeHO3XuF5QlBdHs?= =?iso-8859-1?q?xxGWgKcpc4w+6FnZ2uBiQ7CaxfYrrSy6FZglUnwpOv0gSHZpmb4zpFxOvK9b?= =?iso-8859-1?q?3uaeamghLTWCFjt4u84EL5avY8tlH6v18xUZ1LCBmCDFzsDNkCC5pD6isnBM?= =?iso-8859-1?q?JFHnh9II0Iy8lLnJElyEySDqbVSmaGSJfpedv7zapc6ABTvWqF0ZvwjsWOXT?= =?iso-8859-1?q?QmkLl0C5Q/TVA1gg2woMM142ZAjAmeDKwyNXe26rtabM4uCBJC6QTZ3qA3en?= =?iso-8859-1?q?HdbH9KdUc4jQGt6LUAyfFPAUemKCSRnCGm+zzepvmlkzGrNc8XPNUrtq5WbK?= =?iso-8859-1?q?EIm7ZY6C+tucu35FilE2UJDlU/mj7TKsNyiLpxCGrjMrlekoO1A/rWcm4yQC?= =?iso-8859-1?q?73hU3xqLRaYHWSBVPKvFwh2WxogxVkyPtusDyjw/uvIkAIAsIL6NC5lKV8eo?= =?iso-8859-1?q?7rRPcYZclY5+y9/RUyrA9faFrPDQ9Jkjn+T3sY1btvtTltOjsFFZju1OAbHp?= =?iso-8859-1?q?px384bf/RzmaLbUVpWTWeZnxlwCvbdYIwpXkMumEa/jYHRaQ7B+vCxxw0ltr?= =?iso-8859-1?q?p900DiHzm//+lrdufNNUfiXOptmj/U2C0YAek3lWRkrfzjNsUQns7lOLooay?= =?iso-8859-1?q?xwj8CtPsuPKAQHWCqdt2Cmf+mu1Bu26f0eT/22kFuXYgwcCFvskU+dAIT3ly?= =?iso-8859-1?q?CSKt4tKufF2yKzBhkZ+fTJeKnkOh6ZPIvMap9X7Xfw8+2wC90/eKPxbAkCSW?= =?iso-8859-1?q?7fFkEyyJ03mMOFheevgKA8tPBo0hCy/j0jFex6/tGu77aHsIFQPu8CJc2l6D?= =?iso-8859-1?q?4jvyjsLzFW4YQjNjT1kyJqYcp43QDMfnG+I0GsGsM=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)(1800799024)(376014)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?2kBK5staA9RHlOIWtaq+3gt?= =?iso-8859-1?q?Pqk5mjJKSw2XS7ZheChsyfyTK/wP7z9KXyMzbqJ6zttH9w+lv9NYN38UbrVv?= =?iso-8859-1?q?pnIkVXXnoolw78F3HBiK0+N53Abmhqcym8iaKnFEvEdqznoIL7SYvjcm1R9Z?= =?iso-8859-1?q?28KCvcvVQlTzFkEoTPmSQKw6C2sSHfYrjxDYYZSAGXyFvOaksul9GqBi4GFb?= =?iso-8859-1?q?TDmLeBc77eU1GCs9Yhjn8rjJxhmelcI4MrXMRkQQgB9qfu0J5Nw2ID4tsJ+3?= =?iso-8859-1?q?TAAxomEAeH2yMuuGDbljzigI6TNkMLMJS1y3VtU76RZsVMHgc06y4yLgVWE1?= =?iso-8859-1?q?YMnR/szgFUJndCjUom1nfzPhBiQMgHbp7sNZqd+hX4KPFUieyGDeUWnYtgEU?= =?iso-8859-1?q?iJyjuUPGtBIrsSYfyvkbZDFqMxJNfCcYAOEiFULu6SIiH9xgzWuDsLDgOa5F?= =?iso-8859-1?q?uKCp26c0+Qmiv/oKKpbQpeR64n/tH0OK3LZXTw3+7Gp4dZ/+uJAwcjtpd91E?= =?iso-8859-1?q?t2mZu+IyjT+7oXzjwp5DqQCxA7TIlamf+2KE7PJk9q9TK6BD7G48poJlXlTu?= =?iso-8859-1?q?kRRUeIAl9xcJnBIqF78aSty/nBrKBF7qT8Y20r/V5nDKHuFqMCbeqLmvMk8A?= =?iso-8859-1?q?vpYK9c/e9vtsCG9/YDv9xepe0rG4QPEAyl6xnZAQ5OFgjwtzvpzytWpctgWF?= =?iso-8859-1?q?6KtDVB5F3TmOeilq+h3yt/RRvKQkmEpPCxabTjDNAl7wYJTl9YRccBTjy5eH?= =?iso-8859-1?q?4l//GoeIDzk7Rn7Ed8d/zhcDyBJFUGFZAWzjUZdrtQa5aJO9cTnEWqKp0c5Y?= =?iso-8859-1?q?gr+KAcaOyl5vM8A0rXQwgAVclnXbcX8uqFt/RjUZ4hIacWvuHnq6Onmj8YUH?= =?iso-8859-1?q?SSSlj89LTGC1QaMBFheLCR5unvt62n1laUI4WS6ArJbKez9zf70gqNrdktRl?= =?iso-8859-1?q?UCfdoJk725LljIGsS7EWXIHVYMMFlJlhrvtpqysvMYBgLevswpYAvKBxFT44?= =?iso-8859-1?q?j5DmUxZbeYGqozNBj10bF4hMLu9fwjRuWwUCcTxXwUDDGYBmKBJ1Sve4lvk2?= =?iso-8859-1?q?URCLzw57uZKRBg1L8Z/BI7VPHD7EfUnuNv+7WHJmuKQYLOXndqeG/32G2Za6?= =?iso-8859-1?q?B8rIyAXr6bFEJvEqm51/j0HotB4257XFYmGSBTbJ/KgEPXUN+KScMK280VWP?= =?iso-8859-1?q?7pB0Az19TSU1L2O6ph+NCMkjX7wyUDms6ApmWuwpdv3MqpuLBV00b5jcrsLU?= =?iso-8859-1?q?osIL6C+L8mwgaVzTejZLGchwmazfBk1ScebGO9dkTswKnNmNRIwnn9erkawL?= =?iso-8859-1?q?FIVBcWQLv9+qqudntkH4M7gJ+pETq5zHFxRWp8LKM1Kxh1Ire3yJdFRpyz+O?= =?iso-8859-1?q?BrDb7cP/UAlrnuLNbTlhWdCcafJ9G3j4EhT30cPcwMFl013LRG/o5a2EAMYl?= =?iso-8859-1?q?ZVsfSZLos9au6ds0sap7I/silNC9dcCesezO6unP2ooZN5Hm0+rXD5Aadhwh?= =?iso-8859-1?q?ORTV2KFhKSObKpian69pneCbGcU/rCBr+FmRM3fSC5xOgY3cJ8WSP5JgV0aC?= =?iso-8859-1?q?5637hiN3Rdi/5nqW1/16iujHYHMFLSM3KpXvLOhu2xZo36oRdM01YbZXKxg7?= =?iso-8859-1?q?/KhkplOwycxaD1Hzc?= 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: 4/7l8tm1II9UYKHsGtVsLuWg1fg5ubMySc0ZyKeTPCP+inxjHpM5PJi+YkKPxYlNI+MNIJd7oM75iLG+WPooB7e5pSreeYB9+OAeajR7a9VYdP7Qf3OCWAcwz/csbRjhA3TeAH1iuNi0GupFOcEJkbuckQ1zhc8gwMUIo0uceaUx1lpgq/LhEam8qWjexTPeLw5v6IBj8APISL7oYEWmctPMZDXvtumQxFeTmUW8WfRJBxxDdhVmZPolSDO1fafIsXrIPgYDDHm1GKRKE2zOLK9QBMOvsNFP2NfUcvpsXvjZK5Se8zUygNrbyyPF1i0ticpJgpQ2W9XnuezKUAA8b/+sdZAVN8Tt8Du+sej7H43YutySrw18KpH9Eza8DZi4/rR21H49WffjpMewADyBI46AgqPlRTYIBlAXP4kp/htvLjHJhB0DOt9H0+XhcQRjtmhCIWZr30nEqWHw5o18J2mGriPZFsfVVyTr/j28cUuMGEfpOBges6XNVrMm3EKJwYdlSs2JG20I8ZeYOdTqIHpDACf5CiMaUXWN4PMsb62EXDRhtAqfv/a1Vqyso8hDLMoZNblcTZ+SgqC+r4nEYT/0o2xvjdkO6p5BTltMuiANqc3WR2XGD2n/+PNNMRJYLgMz8UkqO2qbQgfKftIe+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: a232daa4-4c20-438c-5dcc-08dd04480065 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Nov 2024 01:02:24.6767 (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: 9azI3k6Or2o2KD0fiIHyPWG1WJYRZIuSACld5Va8GBEcERkgJrMCTUoCOk4++dmP8MFc0YGlF3/HQSBdZfB9dw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7950 X-Proofpoint-ORIG-GUID: lYUxVgDzwscraqvXiDJNNkbgMeermTJ2 X-Authority-Analysis: v=2.4 cv=NPuH+F6g c=1 sm=1 tr=0 ts=67354c25 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=VlfZXiiP6vEA:10 a=nEwiWwFL_bsA:10 a=qPHU084jO2kA:10 a=jIQo8A4GAAAA:8 a=9dXq-v3q9CYHDsQcqtMA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-GUID: lYUxVgDzwscraqvXiDJNNkbgMeermTJ2 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 clxscore=1015 mlxscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 spamscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 impostorscore=0 bulkscore=0 phishscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2411140005 The current logic in dwc3 driver is tracking req->num_queued_sgs and req->sg. But they can be checked base on the num_pending_sgs and num_trbs. They are redundant and can complicate the SG logic. Let's remove them. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/core.h | 3 --- drivers/usb/dwc3/gadget.c | 42 +++++++-------------------------------- 2 files changed, 7 insertions(+), 38 deletions(-) diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 2dccd8fa7efd..aa09ccbf34a5 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -941,10 +941,8 @@ struct dwc3_hwparams { * @request: struct usb_request to be transferred * @list: a list_head used for request queueing * @dep: struct dwc3_ep owning this request - * @sg: pointer to first incomplete sg * @start_sg: pointer to the sg which should be queued next * @num_pending_sgs: counter to pending sgs - * @num_queued_sgs: counter to the number of sgs which already got queued * @remaining: amount of data remaining * @status: internal dwc3 request status tracking * @epnum: endpoint number to which this request refers @@ -964,7 +962,6 @@ struct dwc3_request { struct scatterlist *start_sg; unsigned int num_pending_sgs; - unsigned int num_queued_sgs; unsigned int remaining; unsigned int status; diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 3a5a0d8be33c..687bb8cc4114 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1544,7 +1544,6 @@ static int dwc3_prepare_trbs_sg(struct dwc3_ep *dep, if (!last_sg) req->start_sg = sg_next(s); - req->num_queued_sgs++; req->num_pending_sgs--; /* @@ -1625,9 +1624,7 @@ static int dwc3_prepare_trbs(struct dwc3_ep *dep) if (ret) return ret; - req->sg = req->request.sg; - req->start_sg = req->sg; - req->num_queued_sgs = 0; + req->start_sg = req->request.sg; req->num_pending_sgs = req->request.num_mapped_sgs; if (req->num_pending_sgs > 0) { @@ -3472,20 +3469,16 @@ static int dwc3_gadget_ep_reclaim_trb_sg(struct dwc3_ep *dep, int status) { struct dwc3_trb *trb; - struct scatterlist *sg = req->sg; - struct scatterlist *s; - unsigned int num_queued = req->num_queued_sgs; + unsigned int num_completed_trbs = req->num_trbs; unsigned int i; int ret = 0; - for_each_sg(sg, s, num_queued, i) { + for (i = 0; i < num_completed_trbs; i++) { trb = &dep->trb_pool[dep->trb_dequeue]; - req->sg = sg_next(s); - req->num_queued_sgs--; - ret = dwc3_gadget_ep_reclaim_completed_trb(dep, req, - trb, event, status, true); + trb, event, status, + !!(trb->ctrl & DWC3_TRB_CTRL_CHN)); if (ret) break; } @@ -3493,19 +3486,9 @@ static int dwc3_gadget_ep_reclaim_trb_sg(struct dwc3_ep *dep, return ret; } -static int dwc3_gadget_ep_reclaim_trb_linear(struct dwc3_ep *dep, - struct dwc3_request *req, const struct dwc3_event_depevt *event, - int status) -{ - struct dwc3_trb *trb = &dep->trb_pool[dep->trb_dequeue]; - - return dwc3_gadget_ep_reclaim_completed_trb(dep, req, trb, - event, status, false); -} - static bool dwc3_gadget_ep_request_completed(struct dwc3_request *req) { - return req->num_pending_sgs == 0 && req->num_queued_sgs == 0; + return req->num_pending_sgs == 0 && req->num_trbs == 0; } static int dwc3_gadget_ep_cleanup_completed_request(struct dwc3_ep *dep, @@ -3515,24 +3498,13 @@ static int dwc3_gadget_ep_cleanup_completed_request(struct dwc3_ep *dep, int request_status; int ret; - if (req->request.num_mapped_sgs) - ret = dwc3_gadget_ep_reclaim_trb_sg(dep, req, event, - status); - else - ret = dwc3_gadget_ep_reclaim_trb_linear(dep, req, event, - status); + ret = dwc3_gadget_ep_reclaim_trb_sg(dep, req, event, status); req->request.actual = req->request.length - req->remaining; if (!dwc3_gadget_ep_request_completed(req)) goto out; - if (req->needs_extra_trb) { - ret = dwc3_gadget_ep_reclaim_trb_linear(dep, req, event, - status); - req->needs_extra_trb = false; - } - /* * The event status only reflects the status of the TRB with IOC set. * For the requests that don't set interrupt on completion, the driver