From patchwork Thu Nov 14 01:02:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 843457 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 E57CC1C3045; Thu, 14 Nov 2024 01:02:14 +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=1731546136; cv=fail; b=vF/mGRthY1gHSW5DkLP7Ku/M56S2g0xi8xlkGyN7Kd0TuyfF0JGXAYiomWdUVo7Ovo8NPiyV9JejzxUxZdl/Ci6W+hM1/hdYQ6mA/FLdjF9AlHemfUtLZ0/diXhWXugoErNhKh0BqO1+9PG0+xThsQbzwftDNNcmDhTEFhnwY5E= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731546136; c=relaxed/simple; bh=D9NrUQWM6ig3Xfgr9K9voYdPv1enmUGl50vaCUc4d2s=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=fTFyEoaT3FvktwxLI1vEWKcCCqozWKPtkyqNujYM2eoi4TsAoprami7Z4UEY/0sKyzttq9AoruWBp1fQv7SsdNlGacghNCy+s8YWTBSPoRSJ07gbvKMxpyiXu6u8ImoCnDeIyaNz5Ix3pXr1RR6ZGSw67rNlXSUNspDD/VwrztU= 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=tfqcnSw5; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=UtLP9ZLd; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=fPGld+7m 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="tfqcnSw5"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="UtLP9ZLd"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="fPGld+7m" 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 4ADI9D8j013119; Wed, 13 Nov 2024 17:02: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=SzRyBh8TktTqS1eEjX7Dq0+VO8Td4AwIXQKwKEanIjI=; b=tfqcnSw5gO9u d9xeLUjz9cMQxxOqx2QGgv42wkfLU54wNxd2/86JQsiQ5VIGDIBoGgyVzUPgDKxN la7w6zga2KEp8QMkN6W5b95bSD9HGI0qbwHfhYnXDqOCvdT9Ta4MQwsSldr2Rxp2 7xf1mIZsxeVCAq7pHUskeZrehmHsmx7qqb/YNfIBpwlnprzVBdkG15uRqahnt+eX STT8xYZhqgGYMLvSvWt6gVr7MDRie0BltHdMhT7dyi6Dhmxo/nHbaUq/+bsUswo9 FQBpeHJhrSXwqxDXXIW4iSGEl8RdQnwTkH1yiBETlgdPPmligJRhOD/thmRSv9Vi W0qrdj4pFQ== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 42t7mu9yu0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Nov 2024 17:02:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1731546132; bh=D9NrUQWM6ig3Xfgr9K9voYdPv1enmUGl50vaCUc4d2s=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=UtLP9ZLdCUEF9RW9mJnrvVaKI53vhDBnXgMv+IZ5wB+kHVqSoplUyo4NC/udero3a OYlv4wgLRojMjb3ZmSQ2cdvqUiAiPKsZ2TKnOVSkdBNHPquqJfF1yJt50aJ0wxZvPa AxmySXWXloWVkn/1cjEuk2HEt/LAY7m3t9xd/vYVhmlicC2F09R2pnbF4OnVQZE6j/ AGsIB4R3/UkA5l4zmvoCDXyaHAQOPz7R6ghbUgCotxfP8FgH/LcSVl3uQI+GXsyL5P ydimmtCgbNSsoQbnGytnQIRDG5aXvzi+rtbe8SBnZeSJmFDfPAMH5xG5wjoh1JKOU7 v8/faN5mtkkiQ== 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 A33614034F; Thu, 14 Nov 2024 01:02:12 +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 218CBA007E; Thu, 14 Nov 2024 01:02: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=fPGld+7m; dkim-atps=neutral Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2048.outbound.protection.outlook.com [104.47.66.48]) (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 AD37D40424; Thu, 14 Nov 2024 01:02:10 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gT7/v7FJFnfR4tZlIHxdlCeW79lTa0WbaEo1WdCVPit9XHhbD3RG644iOmtYNHoqYy5KyxSqwF/Y59pee0oYfXcp2XFPVCSi1sT+0DVxApLiCptMP0ouLHNwbIYihiusYTFcMCrqzQ43ZhyoaUTbUrAb8SXz8L29CEwQ20pYMBOkWuWbUydkfAfViXsM4UHGIjxtDk77l18udZFPM324Kba60O5qDJi8/+LJxm6zNWdYCrMlBUoGm6sjN+iCN6GVlgWRX0MkUFBU3XtdxRG/Sisv7DS/QDFQmCDOhWysoXfnarU6PRFkWw/82dRON1U0P8Cob1yLXw3uXUEOMa3NNA== 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=SzRyBh8TktTqS1eEjX7Dq0+VO8Td4AwIXQKwKEanIjI=; b=nYXbZu7kxROITiNYXGFN3p6CNPmeMupIkA/9xUVZdOhpoKI0DHpPMto1u0O7oNLEtspaYdE77/W/HRvMinV7SrORMGNBSvWZBgT+DDVglUg7+ADybxkQ0spVPQ1sQ4dTCez94i/KNA4/JfypDk8iTwNhi2e1gj36ezDn47reZhzN946nuZkwRcSF7w7+vnopzTUihM/Jy06HLRyUwAb0ToBLi8RfJHv0Fzsx6nEip5Qf1ZLBivX7h0yoRUH7UdWX6YgcM1V8qKLIeUfQ+oAKN8xFLjN39eS2qx7/UfrO74Rq1zKs0qUADvpz265p2upNUGXRQyN0UlCFkmY4+4qTUw== 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=SzRyBh8TktTqS1eEjX7Dq0+VO8Td4AwIXQKwKEanIjI=; b=fPGld+7mgWF4TxwswZexNMWu++ZvP2+LksMNjmo3HKpet0829CaL8Mf5LkwCW+z8KLpVTnzKquVEMKO1oMKVcOIqaT0QIdLTpfCRrhOJ3Is9QmR73INjp2+vfLT3WQfUOmk4zYqX7Xe/AKK8NBqHY9CS+/p7K98NCXVLqYLt43g= 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:06 +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:06 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , "linux-usb@vger.kernel.org" CC: John Youn , "stable@vger.kernel.org" Subject: [PATCH 1/5] usb: dwc3: ep0: Don't clear ep0 DWC3_EP_TRANSFER_STARTED Thread-Topic: [PATCH 1/5] usb: dwc3: ep0: Don't clear ep0 DWC3_EP_TRANSFER_STARTED Thread-Index: AQHbNjDTA4t+gtEQZEqWcTkch/A3og== Date: Thu, 14 Nov 2024 01:02:06 +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_|SA3PR12MB7950:EE_ x-ms-office365-filtering-correlation-id: 7e2c01ea-6193-4e1e-aac7-08dd0447f58b 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?PHc3Isitl/zwK8vrmhOWDo15w7?= =?iso-8859-1?q?kB6vITjctEEAudml2lHasnigFfxUgqxQm7xyKbfgmm9AoFmwzw1+QrF7gfQp?= =?iso-8859-1?q?Nt3HhNXPNKEz0pggY32eqN5JzyDrDDG3IkRDKIAeJZUahyywrr/TFm5WqrEM?= =?iso-8859-1?q?dKgJ6OF4fHkDXME5jFEDgaf6XoIXAMxVL280zhfYCSIVUy0EIN2UpbAHylRa?= =?iso-8859-1?q?NusAgp5/8CUeUXwQBKsEZUo3Uv5j+6zPuVg0TnaGAxOo/dk/mz4dyy64eLJo?= =?iso-8859-1?q?RME+6I/der8MWeu44K2Ns+17mjU2HHtU7RiFvXkrA2gjR7S5mk5g1qYA2veT?= =?iso-8859-1?q?BwcIpuzBvx4faiuJmUN5oVa5drnkTbd5Vz95OSLu6S5ps1KBY06Bjkcm2zBB?= =?iso-8859-1?q?noAbMuGrpv9vo2FnB5lqgebGYk9jhnQ40NJG7U+YkhTVAJS/8BvazeJoPkC7?= =?iso-8859-1?q?pby3+fWna/xWoj/ixkVcXdVZmGWownISy5e0SpScbwhrfxSDte9K5OFF3g+z?= =?iso-8859-1?q?Sg5ePT50dTO579FrxJTXq2lyHJYpNgmd/eyPeT4IGGy3StlgIWdEQVnZhYCA?= =?iso-8859-1?q?CdrMJsthc/8Wyithoyfh8nM+C6TAG2N/yQUXUw3EAkRRGFUzA12OGWemRApf?= =?iso-8859-1?q?xz1GMrQuXF8afOG6DWUIRlLV2HMFhYWz6mvhlNWuQaZYleDFDdc6hcZu3+hv?= =?iso-8859-1?q?d3Hynx2O7/QmRY9kg7a1sYy+Qoof251KV3ZUEiE0sErwu8JE1sODQbQiGXv+?= =?iso-8859-1?q?GEtC5g30heReIEDjmk12uOp9gO7YLbShatHmWC1vkeoFDsxsGqZ/xc7hztCA?= =?iso-8859-1?q?V3dNOBzxB/W0aGNo4ioVjECGHcHFYaoSrMWf3+Gl3mcr1jB70A4pUrepoZwX?= =?iso-8859-1?q?owPas85/eON8RwOX+trdc+mT3UFtdIwXthmIkqLjil+vNrFI6FKoM/QF3TRw?= =?iso-8859-1?q?Q1b7uuzHzrdDLjM0oyEL2iRnhJcYgWBpaSE/FKk43jJGoe3QfFW6ZMVc98ah?= =?iso-8859-1?q?aZYCAv8niEoPE0xIWPy/FSvZ1KAeTjCJZ/IsMgGZgCBuiNjFonthi8ukKcEE?= =?iso-8859-1?q?F/cjWx+hLo6abht6UiNWtO/p0rhKlSa7fqC1DFStITS61V9/PWHm2cYoyI5A?= =?iso-8859-1?q?Qm+rpHeB9BiJ15OHnFfWDgkyTSo0/x8JpIZ+BQhiZ9VYOTjTP/NsePmKpoj1?= =?iso-8859-1?q?YeR1Y9CZp+cIiAyHTS9hYX8JS21Wz0C8ngzait7Qbu8+fy7DsPxjdS/Hwsht?= =?iso-8859-1?q?ZTd9IawJ9YjRJNbxZMljIyl1+tICsCTGTACIdWi9sa5mrmB1RuFSzGnSAFro?= =?iso-8859-1?q?Y4MjLkOka+2A2phcxK2bOVkVFYhszVNAarRcxKl/ti9/iflZWM4WVAvQH2EG?= =?iso-8859-1?q?iWat1P0lW3/yRJ4Fd2SC28FMAarapf2NiaN0mUJaA=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?3R1mMmcsG6mIQyPMsmxlDLJ?= =?iso-8859-1?q?ETcvhy32axytjJMOxnWVrmtqLIz3AAFXpdB+BuHvh85U9qP5XuSdNWxoC/Zd?= =?iso-8859-1?q?+IL3RGliYIfDVuz7DyFiW9GneoeNS2AzQNWutyMcPMC1xbuQ5e/ILuLv9kQa?= =?iso-8859-1?q?Jsx1TsXVImwxbEToFuOUFPyEpEttf+MkWCCg//1fl8RHR+NR8jJeuJxEvC5x?= =?iso-8859-1?q?pgTV3B/Ci6MhL7ODN+L48Q9OfAi7s2pdF1mzU0vq42U9HtLg/z2L+8BPrgJB?= =?iso-8859-1?q?87vmbLCzCNJNfQ008iweqPldG8gjL6sQvYkDMpUiwtxjMMUrISvmXUW2mp5E?= =?iso-8859-1?q?gIJDEravR3/Xcx8hCYsuo3ZJCE3i+M5l+yNdT6MNq7BAVFcpuZiPMVKv6T8n?= =?iso-8859-1?q?mEgHnaa2Rq7drrHcYbGKvl9sfvh76svJ2BiQdsVYCJydqog7n56OQcmhNv2R?= =?iso-8859-1?q?eFBpTlxcg4dS7gZPhrcH/7U2FfC89OzqT2g8Xgj/AGCf2XkoUk2xsSoqZvAH?= =?iso-8859-1?q?i8yOm7EQjFU02aU7B74Yr70pGB18suW6PvN8LWnHtOuVfGEO3OCHLUDtDhBL?= =?iso-8859-1?q?26jAPyZz08v42AGHsg97DgEuwlxdPnkvXQDSxR5rxFStDHhT3nvZNzmxvFYv?= =?iso-8859-1?q?hLBUSh/z/rylXQ/BAT/kijPqTCexjOfuuKU5mRzVZqrerOPEeZv8ZhGd7h8d?= =?iso-8859-1?q?R3+mdVSxQ7y9A/Y/f9Xa9KM7CLLHa3UuJSisiE2pv6nRG7b97nsfbr2PJsVY?= =?iso-8859-1?q?WhGNJgl4mOW/xSyuD79XHFZiWTmKFFlP5qpBs/IPQHhCtTjvFH/s78wYUUXl?= =?iso-8859-1?q?lSiysRNq6Ob1TcdFypYWfDIp+iZjefLJCon7v9uGZ7DYnhbdhiA6LJfgZx0X?= =?iso-8859-1?q?yGmqmqGxLvMhfKzMPQGvsosyYIBmJLvNRrlcRn3fuoHZJAH4zjMZiT7aIF0I?= =?iso-8859-1?q?bhWFkR2kbEAOc1Famy9CThDd8Bi68SEU2b9o19+sQ0QX5l3w91j42feDIZye?= =?iso-8859-1?q?F5vcCct7a3MwBJWErX+D8Jjmi7koL0iIwYJxyJ4bVYifW5GXRyKNUXgtOwtf?= =?iso-8859-1?q?lentlJ8l5zuuOKl2IBAb8HUrvD8oScGiCL8Ergi99qiLyIT2Ctkjcezzlk6l?= =?iso-8859-1?q?HI8eRfCqLdBLzBatqUrDV02H4FX1PabVvedx4SSfYiaEe43HCkiIr7pCE/M4?= =?iso-8859-1?q?sfraNsGDp3mAYFB8wADUnamReBnIFdOt8V3rmE76b0NmgSkw+T44KnW4Skdg?= =?iso-8859-1?q?3mJWU6BO2Sdpx14MLtZIj0ynX1t456mIFCdt078y7ZC359GBUFMl4RpXbOMH?= =?iso-8859-1?q?EgUg9EyuzpuObGs1Zkyjebh0per8uazo89e24YryRfjND8RRqekQXkgBufZ7?= =?iso-8859-1?q?SjenUOYplGVXxr2s6tWrkcURy2UvdnKYam3Dfkv891rVHQmi5XxriAfZWiN4?= =?iso-8859-1?q?SBoSaOboTD/ceEP+LNXXwo3VGXm/gOhOw+1+64chFu29JTHg3H6jjQYPzIxx?= =?iso-8859-1?q?RCGVKX+QuLlVEQ9Ebo9limCPV/K2ZnrA6V7MxQ7jQDfu0+H3b8ShMSFLV5xX?= =?iso-8859-1?q?2EOpVHOk48y5twjUSZrCFxV+YxVt2pFLBOH0HuvkdrCg4JR1WAZXGU7A+JWw?= =?iso-8859-1?q?HTPPP6bAeZ9u4W1pQ?= 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: j+ZorLAwpbiKMyUlKRjHk71bCI8mmwvobTQBOjyy0aJUr05/W2YW0yTihVZS/8RmSH8A04AhUOxxOB1rJ5PraPPfjsmpl3gTs9ZO4Dwd5NATC96ANaQ87hslwspctWPOW+9t1tCcxWNOhSgbOiT8Bd7ywGyMIuo53Rq98s/xT9pWY0g5D8J6EVMmuUT/T4ZcZeM1+VgjKRLwRIGpXvt03PVsFnDAhm/xBdGxltkWYuhlyDmZ4UPzof7U9t7TiIqgMoF2YhhS2YUnPr3/tfktN0ROOI0IssKs1IorN5kPWi1u3sTJ8XUiZaYGCNqZPaLGKbnjJAszn7Knh8roHf1FX6J6m2Kjz9fMw/U5cSIxAinXN249iT0tYee4CarCuxjzxi6Ie2MKnc0naqbhdWlxBat1Scl4i4MFwrpITwIjxZpQ/tNanenpPMgyRKLaC8+HG8osvz0xc0NKk7Bq6RskBB6wnIhAIHxs4z1k9HdmOevnYUBjsDxSjqK56uDNy/XCL0LOOedlfSwFlhhNpYMmjnUCF1Y9HXfAlxN5vDb58DC48/fFPi3gj55uw0+Pw5iZ3Pz10SrbtwFgR5rzZVmgTTHWf483MS6Uqb3rQxOG2ervVBybTKMN9+BzvkkdlXmOIKSenLkEz3p/9/ixW+RdSQ== 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: 7e2c01ea-6193-4e1e-aac7-08dd0447f58b X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Nov 2024 01:02:06.4723 (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: Lw8KpSBSaJv+YJU4yb4YprDOu9Zzc/8R3Zwp3ZHWAFSJEJFjNLz6INDtBarnJDmGx18QsnTpS7njT+EF3kDd4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7950 X-Proofpoint-GUID: JN-pv9gGG3-VPz5z1TtCIJIx7V4OYVfk X-Proofpoint-ORIG-GUID: JN-pv9gGG3-VPz5z1TtCIJIx7V4OYVfk X-Authority-Analysis: v=2.4 cv=Y5mqsQeN c=1 sm=1 tr=0 ts=67354c15 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=VlfZXiiP6vEA:10 a=nEwiWwFL_bsA:10 a=qPHU084jO2kA:10 a=VwQbUJbxAAAA:8 a=jIQo8A4GAAAA:8 a=ekUo5NEpdgRYIMB-EUUA: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 phishscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 mlxscore=0 clxscore=1015 adultscore=0 malwarescore=0 lowpriorityscore=0 suspectscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2411140005 The driver cannot issue the End Transfer command to the SETUP transfer. Don't clear DWC3_EP_TRANSFER_STARTED flag to make sure that the driver won't send Start Transfer command again, which can cause no-resource error. For example this can occur if the host issues a reset to the device. Cc: stable@vger.kernel.org Fixes: 76cb323f80ac ("usb: dwc3: ep0: clear all EP0 flags") Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/ep0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index f3d97ad5156e..666ac432f52d 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c @@ -232,7 +232,7 @@ void dwc3_ep0_stall_and_restart(struct dwc3 *dwc) /* stall is always issued on EP0 */ dep = dwc->eps[0]; __dwc3_gadget_ep_set_halt(dep, 1, false); - dep->flags &= DWC3_EP_RESOURCE_ALLOCATED; + dep->flags &= DWC3_EP_RESOURCE_ALLOCATED | DWC3_EP_TRANSFER_STARTED; dep->flags |= DWC3_EP_ENABLED; dwc->delayed_status = false; From patchwork Thu Nov 14 01:02:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 843456 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 085E61C3045; Thu, 14 Nov 2024 01:02:30 +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=1731546152; cv=fail; b=mobfGOFa2fgC8N8F4/NVRxfGu9jlQ4SDv17b9CGi5320BVFNmWIDHBcNFfagsaaLUxi2CMRMBhPOw0XDZifMZ8ZZJ6gS8OUfQYW7ttWn4uXbrrX/CZjeKWfuDLRhva7HXec46sEIx02yLvbk4NMkdLrFNcL2SLurxjVdBQWzMfs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731546152; c=relaxed/simple; bh=iyjSWeyHKgmn446zlVIp9RUghsXQBwOc70mz8065Z30=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=u9c4AWnR+ISH0V3B+xJAyu2+rPDLo30NmxYpGDNMMPQPSsud0g80rdEe7VX3yYbcFRbkfndeTTFq0qZtWhWpN668/r2BUFTh8mLyBBEM5Ce4XNOThDnQQ09lPG6yIkpefzQ42scYJ20pTFTA62FootyGH4PZHEOrCCz8P3G8/+w= 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=VJSPMR6F; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=GrNwBTXj; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=e1P79vtm 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="VJSPMR6F"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="GrNwBTXj"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="e1P79vtm" 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 4ADMc6sK016901; Wed, 13 Nov 2024 17:02:23 -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=GqL8/oKnzCuF2Z3LGMS2Iq4ItonGZ5ovjU5dzrsFR00=; b=VJSPMR6F3lQ+ ABnZUi/a1s4UEBs4lYXQASN8qaxq9Jblcj7NLezVEaWwrHAih3Vikwi2k+CGnAub Pczi2RV2QYsyZszaShRu34oh2gCuJW4JvnOM7YTCXlTAu4bx2vXpN1LPJ0lv2A68 XL/aa92+zR5n5b9UZkw/o8btFeMHpCAa97IXMM1fASYliLN7j3V/M5KOaXHzxxEb 4aZW/e+TeAFSkjJUohI18xLgiFOBvCi5c7/2dsr3Z4UahsFQLoWImBeJPPT8sbxP I/AlFQCu7W3qlHRRciL2HE/xtYZyW6bXVKhtCgfNoRh9Y3I9OOX0A5upP8yp7ULW /U1nbmjSrw== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 42w52s8h9d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Nov 2024 17:02:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1731546141; bh=iyjSWeyHKgmn446zlVIp9RUghsXQBwOc70mz8065Z30=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=GrNwBTXjgs4RVYQqtV9L4KtFsWV2ZxcpI64ousX+lOgi5bdDOhwBlC1Uw51ynSXhB 4GnH+1PoD/XlbJrE0Pof+V0KCj0VXhxgEdZh80oA9h/cOCA8CVBLSQJksj1qrukmBH 41yaJsmm6InYD5oMkUMbEcnnunKsE7FVUxxWxXfSvdZV1o//f2ByS0KGMN0ZXrUERl ZyxaBCRdzzccJxz62Pjk+fU3ZDlWsS9W4PCGWem7k6hc6KPB2boP5X5mANHjpaefcW MwXmKL8/Hy4IEw2epS2JctAkMdBhmxHFgd4D9yfHmfCDZJL5dgegy4MZJVkZ1ZnhwH HqtnMHI8xNJag== 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 CA631401F8; Thu, 14 Nov 2024 01:02:21 +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 B7AE5A0082; Thu, 14 Nov 2024 01:02:21 +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=e1P79vtm; dkim-atps=neutral Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2042.outbound.protection.outlook.com [104.47.66.42]) (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 8C0CA40424; Thu, 14 Nov 2024 01:02:21 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CVRqiNnP+mB6H3lfz3KCO4bHP73t5ZwHzAjB3G0p/vhMS04hJfA+PO+8br+FiWE0Rx0SM5ZmBep//nvgSC0rXdyC0dul6rL/hO92Itg9hNdmbgUqOZai6JJNdVd0W8RvP4DnOQMqkAl0Bo4wAoDLstURRCh4Aj12z7KVAH/oIm7KHcqRPAV+AZabPu4FlQNdxen38U3MwFLFB68xtKgDfQgNcpiPS7ObUp+RWf4/r+h9+VYLzWV2HKyvNE1oheo5XoS4CH0Hk6r4bsDQEuh/id2o+W6ibeazjhH/NWsVy3CajA4ilV5wQmLg2cLUZ0rpX6ljMxryVcLxQYsYl4NbyA== 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=GqL8/oKnzCuF2Z3LGMS2Iq4ItonGZ5ovjU5dzrsFR00=; b=Q/rwih5WhW/X0ymLQLbeXom5w7LwKjfz33FR+CB0fT8wGWsMpmpIVWUtdPShWjeNAIlyAOKqyjzP3iQDfkQ20fFFlUdoekaStADfTu3fER1g0LZlpJ/0Yo/P5AikN6q60qlCrsL2+PfWOd52VRa7gQdfuj6hsQAPAkFaYEq+HyKpf9qfBoasm5SbF/wT37lRD1HJRnldJMqWPv0WilEVxzwMjhwAsmxy7VZGGoQRZddo2MQnDnlEE9v2TLPjN/DzPQRZhsRHUVCC9mJDxYSuaqtqQ6RUToEaXQhUSE6PKobjqrSg2VV3fCFHFh7Tpb/c55N83UKK6CkmS6uFTidFUQ== 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=GqL8/oKnzCuF2Z3LGMS2Iq4ItonGZ5ovjU5dzrsFR00=; b=e1P79vtmKks+3BHRfl+6HVCueweNnde+Qe6DK4JoWI0gzNWFOsytEDT5//NNrOIm9YPttU3aHUyt7yZJYTpRuwn+4l3z4yTWKfsQjTyJovNhj5epO8QcVNdwPhReq1A5ns5FDSG8wRL75sMRm+2bVTHBWcrvSBy2xC2FdBWw35A= 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:18 +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:18 +0000 X-SNPS-Relay: synopsys.com From: Thinh Nguyen To: Greg Kroah-Hartman , Thinh Nguyen , "linux-usb@vger.kernel.org" CC: John Youn , "stable@vger.kernel.org" Subject: [PATCH 3/5] usb: dwc3: gadget: Fix looping of queued SG entries Thread-Topic: [PATCH 3/5] usb: dwc3: gadget: Fix looping of queued SG entries Thread-Index: AQHbNjDaKoOF76BebUSIN2kMbnoZ1Q== Date: Thu, 14 Nov 2024 01:02:18 +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_|SA3PR12MB7950:EE_ x-ms-office365-filtering-correlation-id: 255f6e3b-316f-4c39-9cdd-08dd0447fcca 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?f/tFAhgYS3PtJIgZQr7Nv6RhH3?= =?iso-8859-1?q?Zn8JjKPEB/ZJOkT0kOqQj9F2WB6c0tf94gNdJxHYoiM8CLC1I6kEUwDYCBxE?= =?iso-8859-1?q?C8tn5UJFljQ0/3iPfUD382iAuVK3pgUxCLmVtd/GBjuaa9NGX96j0MrX7sgg?= =?iso-8859-1?q?K86+v9EqJ3TjIBJxwf4D56uxrirRUrtHlufdnPC48iUJaeFfqePQSwZCDgNO?= =?iso-8859-1?q?59AzjmZE9G9QagHWYrqe9U5DKleAWyVtVw1V7HCdvFN+7aGJg2HDky1mmRmR?= =?iso-8859-1?q?sSclEibb1mR32bT/MItI8vwMvHs/cjRLrTxk9jk/FudgGIamXRkXbe0SLReP?= =?iso-8859-1?q?eSV+B6h4ZLqdIoY3GVuOhVAVfes5XdA0Tb8HeVjYg5Fek/grn7Tr7baMQUsv?= =?iso-8859-1?q?y8tovvuBJjR/4TDMxTl/lK7AeAXOfgPEvfbhqShjWE5Q0woaL5RKW65VCJYG?= =?iso-8859-1?q?7n7GIGWquUa9tQNicQ02Vtlu79/kIUcrO4EESZprf3rKOQ8mx/QPkIS60pbD?= =?iso-8859-1?q?hxGUHL7BHS+gCJ3/fNSnZG2JIGqOsFW2Hm2u6rr3j5HjQKcREDsdOK08JG6f?= =?iso-8859-1?q?sUdYkRboz11h6w+8qDuETYwpL2nFcBmEkhm8uD2BZxgXFKK7HB3c0F6fq7rR?= =?iso-8859-1?q?TNUOUj8weSmM1nLKOIjlPn+eYN2xaMpdI+tbrCXJGF/2VPG2JaPBnRSD5SXP?= =?iso-8859-1?q?ypyi0TbX8CkvTM5tk77SJmTRZpj6aoLKeOQH0ePtMvZxi88aHrxgDJVA4oxT?= =?iso-8859-1?q?X596uLrvLKsyWJd8odOTuwuR/V2+UgfKziXOSILGJUMYoFDDSLcxCaCNQrmj?= =?iso-8859-1?q?5ZmJNcaa58TxWcN/8pt7PpBCo4A8kQ2l0SM5F7cxSbyXTnX48FAMt9Pm479U?= =?iso-8859-1?q?obcESJO5PONxm15DfMHzrjmvLccLf/NqFaW5iyAeX5dkiBMkASUlw2+m/Thl?= =?iso-8859-1?q?J/i41qZ9UxF9WGxz9fiZyOu8qzlqgqephEKlmFlBNfT/VFp5mq7G/JABgiAO?= =?iso-8859-1?q?3728RBH9duKU4R24t6MqBh05NU6KdE2B1qNgkHNBQfkhB8iGY9i1yvdO3yNY?= =?iso-8859-1?q?lwnnRN47KEWeW/8jnmwVJz1oAetEP24jR2rp5dPULPdwZ2x+XdUOLbUeCvDF?= =?iso-8859-1?q?V3hojNrUIldY2AnkfkQQJf/k5wnI7mhQtJu6V1/EMGyDOhKYcyCVUWWw3Y59?= =?iso-8859-1?q?Muox9CvZckKaoChTVFP0kB03qPvE9KzyQZelAY7z3A3Elk4l3TQpc1iVkapB?= =?iso-8859-1?q?lx6/Xa1kwNRy6eaTPf8jkBfYRT3PuKE1e9GRyAO4x4cLHZ9CaDit5U41cihx?= =?iso-8859-1?q?+CDrp0TQ9NGIu2hr5NhR1waleOFRntUZlUvW3+6pZkOpxLxvDWnhi8iOsEZf?= =?iso-8859-1?q?/R1FXAFlijZ4V1GnR6TJMf+fDAh1xa2Gk+STtX03k=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?HfYiaIuqFog2Udc5SRyH4Dg?= =?iso-8859-1?q?1HyAu3SeVg+3AAVoRkIfavUa50kiq4UMeYgVOFEsaOJ/cIax9QsAHZBJ/OFq?= =?iso-8859-1?q?vmMayxDmNJWcD+h8sUCX2REQj/Bdj31uS4n6dx5Pa6NF1ulsPgelHAEIc8Ui?= =?iso-8859-1?q?LhWqiB6sQeMfZu6lFLwJIznu+24aufBaOfC41nfqwmWkbxDgv2XxASN/838Q?= =?iso-8859-1?q?wm62eea6+4o9bA1BfF72DRjz5n46szvf8k0qt1kTi6r42NewDJaOnSHJQx7f?= =?iso-8859-1?q?Qvzec+w1diliXpXgash7cJVQKrMkJurd7Frm6SgYG7FgvpGT3Jg+ViYOU2xw?= =?iso-8859-1?q?RQ7vSGQZZiGNihzCQDDlKm1wAeJNImrGu/RUCA0q0ei2IxH08eJlY7JXj16O?= =?iso-8859-1?q?CD+cY/Y2OH2ZJSGUVyDfwq2FujUC9ati3H4yRVhbrgOYdZKUZEvIzvJFYkim?= =?iso-8859-1?q?IvfH4xU7ukP1TX9pXhT0uDIvtz2kpXB6IO+x9tqnpL9WWlpdsaAjla3h7dfJ?= =?iso-8859-1?q?PQ7h0gkFruaec7bb1F5RhRUhOfyBQ8hY4D1PZnrs38TH5S9emvQBNGgy1bHO?= =?iso-8859-1?q?NT0HUHhwgsKMMpf6u+ofFkpsJ31RUW64NoVa/MMeWAoxi0/ahWiqhqg40fQE?= =?iso-8859-1?q?vkpRbJNm3LiydU/wdYBhnPxWBcviWS4LI9gguqZ4W5bgHM50Cwu1WXkQ3ltY?= =?iso-8859-1?q?1Eb2kAI1Td6FBKGhw7CCpsUxN2bx+S8So9VjM/SFPc3e2GF1UKyuPZsUWp/0?= =?iso-8859-1?q?ml/ufE12FD4dNuCZ4QBQKbtQUpXJnqEwCz9pldBSKq29FbxVRuEuz4Rc32VL?= =?iso-8859-1?q?+sljkMXGP0iWASVa5iHEf+KzKIahNWW481A++uosmQuG7eI3j4sxr3RljHTw?= =?iso-8859-1?q?9c7v2AxaL/q5YSfZ6T2eHy1VpCDl6g2y2aHi5b8fG86XAdAf1N2+1ZwWLJME?= =?iso-8859-1?q?AoUrIORP+VMrMhy1IvpUN6Lb2w7Aa29ZaOZBigkOtJ7zHsRvpz2a7/CAFMzm?= =?iso-8859-1?q?fimKoLR4tGtqhYq5eyCv3z7HMEOT5VMHj0eU6pbc6A5i+FPA1oUWXfPFa6AY?= =?iso-8859-1?q?owqkdqKHmsHQCZPBTUxp/QOkav5UKFBqebmzusOLjx59cCj/bgY0zuH4rdHl?= =?iso-8859-1?q?duGEiaQNDvGxDEm2Y/ZX7at/kqobsFfRQDFJWRHhQb3VeH7SmrN4Iyr4HWL8?= =?iso-8859-1?q?rB5Fd1QrwVpqgzNQ31r8+NvBsZeuAiEAG7o+jrXRcv/KKW+96wQ+Lq9/AK/f?= =?iso-8859-1?q?WvGtUb7OLqdL2gJGava6HP4HAC8kj4MEAeaKQX8tLTtHRJZAUcYTy8I4ezSc?= =?iso-8859-1?q?RV6iDKSDdiStPyUhYoznCa6F+5vmDdL0Qyjjo8aG+TfUxKeVBIOoxBD7p/Ke?= =?iso-8859-1?q?dGH1t3VADQB6zcIL+SHOybJgoFzpzqjJh0kz8f6tvE83EsURmnAhm2Maom4s?= =?iso-8859-1?q?s9O7P17pcmB4Kv3IFBcJsvEbtWzl4gZhgNhFfmLuFVbh9Eb1fi3MQlBp6W8u?= =?iso-8859-1?q?WRRqNn/hGTe/dAF4jV2PlST+ezY1MzqJCiNJy0TfD25aDsbZZ20Iqvq6slqp?= =?iso-8859-1?q?mJiQunVXT82fDgLRaidMOabLaGFcUCmi5M154HAxhLxhWim6EKPBTF6Szv6d?= =?iso-8859-1?q?3k7J63lOorQ4OxV4N?= 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: GNKOFYQ0Y7PrHiP5Lu4+r0TODrSoxvzWCCmcW4923BxyETLSi3sRca4oAULho5kftzo04meZYZ0EF/7IBaTR4bB5KYf8PElt8wcwftu/LRAlnuABPPHBUcT94gALj1uyuXaXinJHpeuMqiYSDo6mIH34jPlonRFqpW0K/Bxh9Cmdk1FLnUanKmieIEROXiRMP7HX4TQqvDgtBIIiNwbTUmrTdsmURZH07aBsHAVBrp6UPXLU39myZccaR69EMX8OzPf+hKRVCHBRL90DWXqxfNyX9WAnRgBgntMc4vKVQ7gjfYuQar+SMH1Y852uggfoyOtpEfFCRgy8461svzf4aheXuMQ8OqY22+kN0fqjLhnyw/HjHHFAQ3LA7GUZy5GX083WG9HEIF0c0g6u4Hs/ouJgaZoz4WT2L7KoPfNr1zyhGAC5NWaW63wbVCrmBtYufmmmarOZNihnDBQJ+1SnXnhRqjUlsRIC/j5hAKv7tcO/74of9ocBawUNAFfPYnu7uEDhGGQR4srtZZw6dOdBJf4vrh5QSn+JxWvU4brUbvlRhDtsUVHLI8PUVpK8f96IB1UdpAVeD2sTMiTx8APGkPqCVjlXAYX/PwnUf44/ZjbE5WVfDoS9ebA0q05Mz4Sjz2Ay6apEveSuZFzBgbF4Cg== 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: 255f6e3b-316f-4c39-9cdd-08dd0447fcca X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Nov 2024 01:02:18.6708 (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: FZ8Eo1/0pIuopUHibh1Za69ETGVF7GfaPuTVAP9Lu/Z7RH2NqolXAe7yhx4H2KB+EvELEUh17lRRXSMYUhBiYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7950 X-Authority-Analysis: v=2.4 cv=UvMxNPwB c=1 sm=1 tr=0 ts=67354c1e 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=VwQbUJbxAAAA:8 a=jIQo8A4GAAAA:8 a=G-WRxraSjgDgK3-KZ7kA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-GUID: 0F8NQY8sLdZpGYkm0VmQS6CUu3j2YFyu X-Proofpoint-ORIG-GUID: 0F8NQY8sLdZpGYkm0VmQS6CUu3j2YFyu 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=919 priorityscore=1501 malwarescore=0 adultscore=0 clxscore=1015 impostorscore=0 suspectscore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 bulkscore=0 phishscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2411140005 The dwc3_request->num_queued_sgs is decremented on completion. If a partially completed request is handled, then the dwc3_request->num_queued_sgs no longer reflects the total number of num_queued_sgs (it would be cleared). Correctly check the number of request SG entries remained to be prepare and queued. Failure to do this may cause null pointer dereference when accessing non-existent SG entry. Cc: stable@vger.kernel.org Fixes: c96e6725db9d ("usb: dwc3: gadget: Correct the logic for queuing sgs") Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/gadget.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 38c3769a6c48..3a5a0d8be33c 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1470,8 +1470,8 @@ static int dwc3_prepare_trbs_sg(struct dwc3_ep *dep, struct scatterlist *s; int i; unsigned int length = req->request.length; - unsigned int remaining = req->request.num_mapped_sgs - - req->num_queued_sgs; + unsigned int remaining = req->num_pending_sgs; + unsigned int num_queued_sgs = req->request.num_mapped_sgs - remaining; unsigned int num_trbs = req->num_trbs; bool needs_extra_trb = dwc3_needs_extra_trb(dep, req); @@ -1479,7 +1479,7 @@ static int dwc3_prepare_trbs_sg(struct dwc3_ep *dep, * If we resume preparing the request, then get the remaining length of * the request and resume where we left off. */ - for_each_sg(req->request.sg, s, req->num_queued_sgs, i) + for_each_sg(req->request.sg, s, num_queued_sgs, i) length -= sg_dma_len(s); for_each_sg(sg, s, remaining, i) { From patchwork Thu Nov 14 01:02:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thinh Nguyen X-Patchwork-Id: 843455 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 F370D1BD4E2 for ; Thu, 14 Nov 2024 01:02:37 +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=1731546159; cv=fail; b=Hgmco5OmWJmrN/xJJckdzOBNf2gTNjlz+D6kuuVHlz56yCEBh+46PJ1LpCYS1BJDyaW5jytxqtSlf7gzy0vg/kS9Bg4nAypyrrcfEJwPkoUldzQBoqnoKuI4o257zsv97yLXYcHq0b8e+bXPxx6TrwYqHToRDryF7Z3MyNF3n2A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731546159; c=relaxed/simple; bh=jQUTHCaZneDB/DfGtKWjIVjcoo+UaN155TL/6xhUixk=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=bzi2fBQTYAnI/PFtovdRMNo8nyV7/QdbNIyFgsw8LAO9yoG+P8rPWQVfsKbVvdhk7rFeuXf3mNNsx/RuqgMg3gvq+SIReBkVAjK3mBdktNKPW50zf+H1tjs984jx6h+BQQiZSjKfdyDSlU2bAIpoAspQwGQz+tkZbel+r/1actA= 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=kkJznl/L; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=cfO39Jdh; dkim=fail (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b=qhWZwMJw 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="kkJznl/L"; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="cfO39Jdh"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="qhWZwMJw" 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 4ADMcEw0016957; Wed, 13 Nov 2024 17:02: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=oZ/q2Il1L3TJ8NR3L+XWQgf8rKBVgkzUBDxR7BZJA9Y=; b=kkJznl/LCjdU GCiFDo4Db9pjAtZZg5dyFY+p8b3iVNNm6nH9FsQGzAk6pFEgwcLbjIYQWsCiUUj+ A+qIkQK+UHkME26f7isLaiJgeX0o9kK8xvAn0OasSgTaZFmXC5ZA9OqfHqssf4+j V5z4OGeEvlByolno5N0F1nZZU/0H5k5G9EfL0PPgZy8lIhCduXAUOTs3/6mMrZC2 +y31byRzlJ6XQHtnqF356sxO9C5khpGY5CusQ/+fMZsq4J1ymot40nytB1HE78dJ Hz2kFhBKx5bemgtUnG46YVyx8ODWyJlYRpmSJznt08GI5SaVghNs9LTRE1hPeMlo FYDGXJcU9Q== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 42w52s8ha3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Nov 2024 17:02:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1731546155; bh=jQUTHCaZneDB/DfGtKWjIVjcoo+UaN155TL/6xhUixk=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=cfO39Jdhsulvh2QvIVYLENoe3J+sf/4q7twaAdQtPdqHNSBe+cYjDnQuWQg424mH6 H/oh7p/vhg/CLFX49WfWSe2mtoRXyq1aunbMP0gofgYwnRyCG32ETbmW2eLnwVmvU2 fozVNvb6Lixg30x+9usiNXeY3z1uEwewvTBXbZVh24+wOJ7CX6jc+dLMrF4cyb70Wl HEMGtQPfP5Rm8CdDFzmn6HZ7Uyyisro8b22gGPZplCVFBfIsHoLwx/vTGKFwsmyV6c RH+QS1qLBnoshNUsnurno0dYTBmsowOfKQ5krjjwKHOXNPZtWsbLCZTIG6J9T2Erpn QCms8dZluzlQw== 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 D5F4540126; Thu, 14 Nov 2024 01:02:34 +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 9DEC7A0084; Thu, 14 Nov 2024 01:02: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=qhWZwMJw; dkim-atps=neutral Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) (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 66C7740424; Thu, 14 Nov 2024 01:02:34 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mm0M6bxbdgBAAKfEgV36M5wwdtFsR1/bfGLYan6qcpiLvAySYJzOJhwZOLTk8lJU5QjnCsH0lAcGvR8zHF/E/Ai1U/pRrnzrbAnhgesfHL6gChd9icg/A0bK0jqavXiMIVZfoXC391JexCC9u/I1Na0QGcCeG/o9iH0hl7udFnDiFqr1yKvBLHhH97KIQeZzRb6wHIVCE25LQpEU78XsMUuVgAqxJyWat7djgevLNc7TB7arw6Zk0AD68DqBQsPIncm8hYIdZwrlQvf5XDXvu2XjASfC44LI6ptN93sUpb3PEbBsjMXgLw5Eg8n6VvmnGH6BnZJ7VA7pVq5qYO9iig== 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=oZ/q2Il1L3TJ8NR3L+XWQgf8rKBVgkzUBDxR7BZJA9Y=; b=FnEdNrGFwROlbJNLCdKG5quRyj2r2K6KmD0byiB89A6Kh3ZT+o35wdl4Zmvfgg70L7E4FeU5nSWCjWG9y1U/3c4XrKMNZ5Uy2V0NIG9K9ea/1R6EdL9XzuL93bsXgWt8UMla5UQm18LL90IRvpQ7mJmDKLcJpOuB2tTxI2WbNu5Ne4jRMWd+ZpYCaroLfsWvdCs0W/7QKE/O/YK3WHb4+zrcTsEv35PdLJ0+tM7vfTf6P3oqyqY8kHKaY8deaVv8E+Vh56ANPcsNEbQKZ1URP79tFxobXN0bJBBae/hPHGLjnPcfiuM1FRLdVyJT+QadL/gGfL+hLDyBkCmuwAZ8IQ== 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=oZ/q2Il1L3TJ8NR3L+XWQgf8rKBVgkzUBDxR7BZJA9Y=; b=qhWZwMJwr7yqfk/+8bewVrhGQv5+/lP2eSupMpAT4DTXpHflQLK92YSQ4WwnnHki8XqR2dS+JoeRcjSlW58ZTS9UfcY69r/xKDZO6uZSEuXz5QGxPVEMeEP8YXJxQBvD2k1uIl8VguCqxedmWFdWpYtAm6knExx2LY+BS31tsEc= 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:30 +0000 Received: from LV2PR12MB5990.namprd12.prod.outlook.com ([fe80::3d09:f15f:d888:33a8]) by LV2PR12MB5990.namprd12.prod.outlook.com ([fe80::3d09:f15f:d888:33a8%4]) with mapi id 15.20.8137.027; Thu, 14 Nov 2024 01:02:30 +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 5/5] usb: dwc3: gadget: Remove dwc3_request->needs_extra_trb Thread-Topic: [PATCH 5/5] usb: dwc3: gadget: Remove dwc3_request->needs_extra_trb Thread-Index: AQHbNjDhMgwt2K3oO0GTaYtg7vPrHQ== Date: Thu, 14 Nov 2024 01:02:30 +0000 Message-ID: <08dd88a3308ac7894267c52340eaf0e1564bbf36.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: f938bc2a-4e4c-43b2-638f-08dd04480402 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?qS4oR3n97X+y3J1HMuU3/HBC6U?= =?iso-8859-1?q?/2f0JKxdikzLttNO1ReVv2daH8eXgz8abjyrYR4QjK4S0OxUuEdKlt4DXWIg?= =?iso-8859-1?q?7qw3bmQ6HW9A2SipcWNfr4M0R1EDZh7c9XHAaDXB3saHKvtI8Y1ien3lzRzB?= =?iso-8859-1?q?HKbZxo6tNJTfPqFHmCcZbeMUqyHlszGNnCN+3fGa8BFTI5rYjLCd9939+qLl?= =?iso-8859-1?q?uHX2zEyD89nKJ2Vdf3fKrqfb/PXMmeFYPgY1hXEKdGdrYqls+e4awlyKV5WZ?= =?iso-8859-1?q?2NC/PbuFVspkI3rauNyN09yUbFbiYq7nIclpUEMYcrCt98BkVMSYsg8EO/tM?= =?iso-8859-1?q?np8onF2vZFm8KdvaqQCpLUQhumj8IZaLlvFUfdFHC2tAlohcAfPLrljcoJ3H?= =?iso-8859-1?q?LM6uUsLS+tcw884Q5fJJoATNJejDMtUOpgSVk0ZHdUR+wCiBSs+MsEvRsx6P?= =?iso-8859-1?q?Dj1g6APZZwmToAiwXtNUl0FBBS/gmzbwbt7VVfeh0n4Qi57QxWpRohFefx9W?= =?iso-8859-1?q?SsSSblOOtY3+pSjl3Qe46IigQUORiKiCULRNxFs0Fdc5mwQNQSp+I5Ydp7ne?= =?iso-8859-1?q?7RuYvl2fZvZ8YZuskeKsOZn+hw/ss1ZvSoKWkJ8x/sFcuGSB0uq8OU37Agex?= =?iso-8859-1?q?5wNpcNJX7pNzdGUlBR7Tzydxz6K3uwfJr8w/2hzAn33trUb+rPwSNTfA7xrh?= =?iso-8859-1?q?2bbty1G5u17FeOCh1WZe7CcsbGDohL+DkxRsfDbGLOsyUg3XwZKR5R3ZT2TM?= =?iso-8859-1?q?QU1a/VGU3ADgEsp2LjvUENsm0G516a0ozV1Iw9tgJcWlKkqwzkyTwwIkfMUr?= =?iso-8859-1?q?RLsrCUlPYlIdyn7g9SDxY6bj6rChUd/gf7o18LfyYFOOnhN80H0nKy3aGnO0?= =?iso-8859-1?q?Dw4PlQoXhfUr7Q5oCgKJvbDR5Z7lVEewJt3z7JPg6E2vzams1tBexwmvZfh5?= =?iso-8859-1?q?/f/X0VPap1gZBO1Q1HgtGiEACh/qPOLWrP0zrbRfzIK2aLY1SDDG1Q9425/6?= =?iso-8859-1?q?1GIkvsQAxoDO2k/jK1/QImNIQzRjMu5oGWNyLLzqXwxikkSA2lCbNOozO3gw?= =?iso-8859-1?q?ckgQWVeo9aH/ZyV3fQHafV8qae1ELxY5q2eOAb6/iZsIv/VstmESqT63UJOB?= =?iso-8859-1?q?bc/sZ0F8NezuelEtVTWn8mOdzvKV6/CYVjYTQHRiY8xL8PYCvRz3fjM/sQ44?= =?iso-8859-1?q?Xhyl0xb7Y9voGJHDDgMK1UMrFNohxAP4eib7o35wKD29aAN6qusO02uzquZS?= =?iso-8859-1?q?hzJKK6d4H352JfLmrCbwoeVzjoTzGVH6Vu70azi4zyl50DltPkrBXSXBniGg?= =?iso-8859-1?q?FCotXP27PSrvESHF6Q/Pt7QAyYCCGItqbusi5WSTyYOOCR17DawRie9dJ+Yd?= =?iso-8859-1?q?M+H4qDkO5M6STPEbhsQUKJLBSlAggDjxKLx9kqciA=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?ObohOE9lViIv+1KGXZinEgB?= =?iso-8859-1?q?fMpzL7xfHVFi+jYxcYHtpoqyPPARNZOY1x2yTMDH+8hu1WPIySE5d42svqMl?= =?iso-8859-1?q?ldFLJm1UFBJpHcPDrsY7GFcrVPTDEEf94TJHzt0ZISE1kIAdRkLNqVYAT4U6?= =?iso-8859-1?q?gysEc/YLXUY8q2PjoF9ZZCFGhnqJdnzzkEzB9TXvB2fhiPdz5s5JFGIi2im5?= =?iso-8859-1?q?GPprIICUAxTh8gdbA3qo3m00LmoNc+qgVNZDRyhYuhs1NApdam/czcxuaQor?= =?iso-8859-1?q?MVqCxKQZS17fDFHZuLzg6oMt7WupXS2GXppI65Y9inFd+JWuCRvcJ1R/OYks?= =?iso-8859-1?q?W7nElw2hb3zH+yriu4ClzFLQp9Fa2RDSIj27dbS1DHubbqUgOuJByDPp7Hln?= =?iso-8859-1?q?+IfMwjzo9iwO/6PtOT8GNwGq6eTYPvoD6NmO8fyfGyTGpxrKsBjLf45ndwYI?= =?iso-8859-1?q?3WmHarUyHIuOC8wU8AacMzDCerGuqmKXcEBjgplx4A3wOB7605I2IvoH/qZq?= =?iso-8859-1?q?pMjim3/OWsTvr6/q144N/3y8uOtc0TvOhMpXWR8rLFDWdUV+Cv/jsYMPIGzT?= =?iso-8859-1?q?m9k2X6IBFQI4cblwIHVae9AQY48QvK0mm20HEVFGNDDsn4t4E9eh9AI8/ONh?= =?iso-8859-1?q?qBXUA51y3Bw/IsKW1jiLtybzzKDsN7u9XPyPV98RhVjwMk1Tg/a9wmtj5jxG?= =?iso-8859-1?q?9SA+Aa3n9dA3kZ+CfJ/zr37X2wVd0du6b55CdNr51tWjYOxzxf1vYR9WYMo4?= =?iso-8859-1?q?HmqKB3cNrkc4AJ9NeBluGqLfxRVL1SHZhP1ZKKd9jYbjSgQvJYCoJUZVZmKM?= =?iso-8859-1?q?1ShEICndbvoDt0YZ9KV/5TACd/TBjHdg36dG+L6G88eKQXJQKVLHARHxF/qO?= =?iso-8859-1?q?KSH06gdWXT3gDLiaJvnPZRW+6iKXkVqQzIVfoN1KuG3zERetzrm+bT4byAzX?= =?iso-8859-1?q?yu4oDYB2II4goguwTN7v9vEvfnFaPzMjLGqQcMrxfbE6qlaY922KdX5NJi15?= =?iso-8859-1?q?D7wZM6rBD9r5OuWClG90mxLtiMv96dDNYo4HVjt7zgrA1jmOuzfZygWegamY?= =?iso-8859-1?q?sZWuo4yRFEoYcYjRbjohRYvuNZFMqlHB2JB3hNYid8Sd7a3qk2KDIfyHjnAH?= =?iso-8859-1?q?2t+fYiF642s9FFJINhwkqMIG4EzMGUEINA90WJMZD7CnnZoFzXCcoAVWPjrX?= =?iso-8859-1?q?+ZVIB563YWP8wB1EAQ7syYVmYMtHe1XJeVcD6bEJZt605JLrNVS5wPfPXesP?= =?iso-8859-1?q?P573zHLG/+3NMI6sgfTrdcfbKTREwzXJU8TYBaGOJDxNPyjXT2tEDZVMraKa?= =?iso-8859-1?q?npdhESVXFQXFiK1ZlskucCZFGJdZWPBuZ5bCf/uJFIImEAJZ5RKqK3pI8Eij?= =?iso-8859-1?q?ONmTMBV/fN/KdsLBfhJqPW0X3lP2F6IL0rZT/7sq6sQ4NSZHGtGpcuVRm99K?= =?iso-8859-1?q?MF4Mk9mUoSitpTK765BNBQf78ak1O2oAyFTc2ePaKAyHNDKLNFnYprN6BJHE?= =?iso-8859-1?q?JoMT3Z/7XO0b5OLM0hncjoYC8tDDUIhHYi/XYODwTA6X+9i/fdFf1CI1XO3c?= =?iso-8859-1?q?GHRc28i/G2Mv4DkExA4SMiLWohSuGofJnq+aA/C5T3Fl8GyDcs8u4p4QgpZG?= =?iso-8859-1?q?J9rTwHeAutDvopE2p?= 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: geqbiHo8sPQ1hXfiIesqBzVMZagu75olY+T7jcSXZD+RWD6JLCPi4JAAhdgSGYOPszHcY+Bhu4TmaDRc2LpLNrE15M9qu/0iuw8CeQTUM/acdNgDH5XAFUnAw8HPCVuj2hF0NpFVsCKgfnIs2FRQpSgYta1iudP6hahcOscOFdpNelMlQi4a10SBJk0RpyMCjthaWr/1mlVgnDTOb3qP5xg48Oy+tcIugljG0KelteYTu2Vp2OTuLVlytm3ME4lwIipelQr1Mlgy5O1BdI4d5OGaZuv7dkmJPoODRMM5armVt1yqkgDsYa1bj+w4ZEBtH5Xok7s6m256z4dvzmxXwyPNWQ8cNtcsi7Ad4uu1YKbZdT7JuON9e4KSCbrp30p+geZ3pKxl38DstxpdPgc/Ls2mZScy8s1gv16QKftdBF+R7WbTVb0AHtwMzaHqkL6QLBtj0IQtDLf0HVrER8qeaoJWjTLJF//LhWasFpLNzYCeEydfpmKUogWAxAsKclewkL7HXxwlUHMfxnQ88XUqTlzuie6yyQbFLwdLk6bZHRsjWZzsslUtmIdyxCojemEmQUquPDRYR1+R4o/KA805f3CFoQZ09in2ZzA/y0lXVd9aw6qECyyfYC0Q3tWzrtTRJN7QreVSaL5bmR8VHwgqsQ== 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: f938bc2a-4e4c-43b2-638f-08dd04480402 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Nov 2024 01:02:30.7617 (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: g+hy79fYI5M3oDBm3QNRuUr3RvKapZKlolWnZgvALCZDakETMv+ahc4G3g3Etrw5T57JAR255z7Qh1JkLgLp1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7950 X-Authority-Analysis: v=2.4 cv=UvMxNPwB c=1 sm=1 tr=0 ts=67354c2c 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=VlfZXiiP6vEA:10 a=nEwiWwFL_bsA:10 a=qPHU084jO2kA:10 a=jIQo8A4GAAAA:8 a=M3LnWOeIi3LTSXqGCcYA:9 a=wPNLvfGTeEIA:10 a=Lf5xNeLK5dgiOs8hzIjU:22 X-Proofpoint-GUID: d2l7RpX7w9rvpxJQGZVyQ7e-ECeWzMFq X-Proofpoint-ORIG-GUID: d2l7RpX7w9rvpxJQGZVyQ7e-ECeWzMFq 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 priorityscore=1501 malwarescore=0 adultscore=0 clxscore=1015 impostorscore=0 suspectscore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 bulkscore=0 phishscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2411140005 Now that we track TRBs base on request->num_trbs on reclaim, we don't need to save the dwc3_request->needs_extra_trb check. Remove it. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/core.h | 3 --- drivers/usb/dwc3/gadget.c | 8 ++++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index aa09ccbf34a5..ee73789326bc 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -949,8 +949,6 @@ struct dwc3_hwparams { * @trb: pointer to struct dwc3_trb * @trb_dma: DMA address of @trb * @num_trbs: number of TRBs used by this request - * @needs_extra_trb: true when request needs one extra TRB (either due to ZLP - * or unaligned OUT) * @direction: IN or OUT direction flag * @mapped: true when request has been dma-mapped */ @@ -979,7 +977,6 @@ struct dwc3_request { unsigned int num_trbs; - unsigned int needs_extra_trb:1; unsigned int direction:1; unsigned int mapped:1; }; diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 687bb8cc4114..83dc7304d701 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -197,7 +197,6 @@ static void dwc3_gadget_del_and_unmap_request(struct dwc3_ep *dep, list_del(&req->list); req->remaining = 0; - req->needs_extra_trb = false; req->num_trbs = 0; if (req->request.status == -EINPROGRESS) @@ -1440,6 +1439,7 @@ static int dwc3_prepare_last_sg(struct dwc3_ep *dep, unsigned int maxp = usb_endpoint_maxp(dep->endpoint.desc); unsigned int rem = req->request.length % maxp; unsigned int num_trbs = 1; + bool needs_extra_trb; if (dwc3_needs_extra_trb(dep, req)) num_trbs++; @@ -1447,15 +1447,15 @@ static int dwc3_prepare_last_sg(struct dwc3_ep *dep, if (dwc3_calc_trbs_left(dep) < num_trbs) return 0; - req->needs_extra_trb = num_trbs > 1; + needs_extra_trb = num_trbs > 1; /* Prepare a normal TRB */ if (req->direction || req->request.length) dwc3_prepare_one_trb(dep, req, entry_length, - req->needs_extra_trb, node, false, false); + needs_extra_trb, node, false, false); /* Prepare extra TRBs for ZLP and MPS OUT transfer alignment */ - if ((!req->direction && !req->request.length) || req->needs_extra_trb) + if ((!req->direction && !req->request.length) || needs_extra_trb) dwc3_prepare_one_trb(dep, req, req->direction ? 0 : maxp - rem, false, 1, true, false);