From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web11.62211.1671757217202722522 for ; Thu, 22 Dec 2022 17:00:17 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=aBYwKT4h; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: hao.a.wu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671757217; x=1703293217; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=fsqIxuatLDsTnbqWb8BHwtwo8x06e72vE4rdq2CqTac=; b=aBYwKT4hKaamAD8jCBucc3le51kCsIIqsqf5VdSmB43QsCqNuyDHs2Ux VIEYQBHQYGc7pM9IYwDE87hz65tdaqnAH2l1r0rXh/c/3h2HgyiLYX97j OneZgfy33Gl59LUAT42S3eSWCrMbJOrMv3lADsYF/n96Dwzx+qaXlt3ut rkmGfgYOXnhy/rq2RBetnEupKwOruw+WW3j2AFaWFHi/ONL5Ea8XOJuW4 2k/JbdTf2tdb2XWw/oyK6urdrM3fr0bAFWcC7jw7UMluMKuy0NuS660N+ auSIupztslNQ4wo7YQPeHefWY6X2r5vWg1wlDtNktU3DJ+rQH/jhK9Q0E w==; X-IronPort-AV: E=McAfee;i="6500,9779,10569"; a="347401559" X-IronPort-AV: E=Sophos;i="5.96,267,1665471600"; d="scan'208";a="347401559" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2022 17:00:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10569"; a="826150996" X-IronPort-AV: E=Sophos;i="5.96,267,1665471600"; d="scan'208";a="826150996" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga005.jf.intel.com with ESMTP; 22 Dec 2022 17:00:14 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 22 Dec 2022 17:00:13 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 22 Dec 2022 17:00:13 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Thu, 22 Dec 2022 17:00:13 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.171) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Thu, 22 Dec 2022 17:00:12 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FOtVVv0DGqr+wWLUk/Ta/+59sLFiQTeG4HkmzRvl+P9XuqGQG5WFd4HunUYA3T9PzWBEwIv/novbUu6wJ5pCBt5MUIZB/usm2hXWywty7Y7hWdssb+5i5S1FQeo6x2L4mq+jl424Dk0ZCnWMT/y/AxpZzy9CWi72R/IZszREDFtZW8z31iEjvj5q+Nc5nHu0yFWLXMSG986AfkQJVjthYMsxRW8ELbzcpQ2Npv72acRPfHH0LhyI7oY4Hydorgpz8FY+B6uG1skgNLBK1Tf8NpxaE12Apg0EPsTU9K8c/Pv5QZahx7GoMXrnTuN8W7SOKAzqeC+Sk2etozKipqm4KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=urfo8EdTzTK6xVG/ldzP8MYAoOQinjsYwpek/6GiCsI=; b=TnA4bME7vkz8PdpgsghCLNaRhdyD1pnOuru16p+/PPRrOV00IVKOpFf/qPU+OyaKemPoTsnbccPRwbgY9aOm3MWsRTURbKZKjbVGl/5bnTxjWvd9dq8DDIGKdfabVuopia3XMkYGJczm0iKcI3iSEuMGtORQUCZtKSlf6+72qV/JaHTVj3AUiWXY8/oTv3PvhN9MOC+1kE9m8qqR/hpys8BkhNIDHEx0yUF2na3OGxytUZemL/wC2KiwW4o1RkwVvPN9vasBUVkKBnpJE9sya8RlFAzjHI2FJKeQ0XDwM8dF07wwwcl8Ms7GhXhJOZm8HuSoYFQ+qhiFfwe1UOkjqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM6PR11MB4025.namprd11.prod.outlook.com (2603:10b6:5:197::31) by MW4PR11MB6617.namprd11.prod.outlook.com (2603:10b6:303:1ed::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.12; Fri, 23 Dec 2022 01:00:05 +0000 Received: from DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::6129:7158:18dd:761c]) by DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::6129:7158:18dd:761c%3]) with mapi id 15.20.5924.016; Fri, 23 Dec 2022 01:00:05 +0000 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "abner.chang@amd.com" CC: "Ni, Ray" , Garrett Kirkendall , Kuei-Hung Lin Subject: Re: [edk2-devel] [PATCH 3/3] MdeModulePkg/XhciPei: Unlinked XhciPei memory block Thread-Topic: [edk2-devel] [PATCH 3/3] MdeModulePkg/XhciPei: Unlinked XhciPei memory block Thread-Index: AQHZFVLn1PcDDcWd5kqrxdn7ohLVM656p+RQ Date: Fri, 23 Dec 2022 01:00:05 +0000 Message-ID: References: <20221221154218.1624-1-abner.chang@amd.com> In-Reply-To: <20221221154218.1624-1-abner.chang@amd.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM6PR11MB4025:EE_|MW4PR11MB6617:EE_ x-ms-office365-filtering-correlation-id: c26d9059-2e84-42df-5d06-08dae4810766 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: nxH6PgtlUHBsUoef7gb+c2b1hHzYaDmqoZ2aCDVmaDi4a/ER64/bfWwVkqVnbZ8xsKyvEORLYzci7rIX+Mo4J8Nn2fAL2LgyN8W05yTMeNEko0Y/wt4byxmr3m3yHN0mwJgecJ8afkzCzHQh4I7Yb23FJ/uaR6Vx5jRTTJuHIMTjnvSSGHMaZKZYrjSEEKZvGYHYA6iBncITbVLlFVA/un//X2jgnZh0T1edxErWW4DwvRPW+45nEP7vWx7SqHtu0cHoV0ReGWmoEGB/tD3uWAyGmlCfUrWURa2siigBgUZI1Knb+OMMd/EmgwovTxqA8nNrWBczhGTK8Sakhoty8244T5ZSxqmBfgjwf0MIE7SmdKwNEPbgZguy+XWiHg/R/J76zH73V1DVFw0drrsAM1UvUX9uuqma9pjJPBi4WjVCoEHfyVur30bMKzYF8rZTKvDwU6m9FaNjRYlOH6MLWwsMVgIX/PKtjkDzo3zBZyEoI4s/m4HTzq0dVG2H7WOj1jxHXvZHW50ZKa6HgsEqqlgojS0rBlb83Jw3eomPxdpyLn1ZcNPDomftnoRplF5ZD+IfoR73wg1lJTVxaZukfYV9GB62Z9S0SaZ/Zp0Xgl2rB6wcYlwjE2rNU4j6e/dSv07lAgubhv4qQ154C++Ilr0DTx0+QCxNjZVnZjCewBLiXsuGWDRsO9y5cZg7rhmqTSh304K+QrTJ5tvlQ02PbLHZCymG5RyAXxXQuhYhdazUz9O7nub86v5YwDQFAvlF+9acxIgEWi/wdSX1cBRoew== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4025.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(39860400002)(376002)(346002)(136003)(366004)(396003)(451199015)(82960400001)(2906002)(38100700002)(122000001)(33656002)(55016003)(38070700005)(86362001)(71200400001)(54906003)(110136005)(66899015)(7696005)(6506007)(53546011)(26005)(186003)(9686003)(966005)(478600001)(5660300002)(76116006)(83380400001)(66946007)(66446008)(41300700001)(66556008)(66476007)(64756008)(8676002)(8936002)(52536014)(4326008)(19627235002)(316002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?4QfUt3rQvR4WTnUtlKn6z8+6nSjGPBd306Xdu2V89CqwNuP8qO/O4k5KiIxq?= =?us-ascii?Q?tYjdFScBOMJ0YsW/aY64IcyjXtsO0CkfT9LhXA4KPmZyf4397YKEimaSOwdi?= =?us-ascii?Q?qkTxIHh6ofrlOkM+42LG8SlZOpnmwortvXFvwTqPd7/f/QobvCRT755JHYE7?= =?us-ascii?Q?ew0ZPkx2QX1kOTGwAidFe6atbw8hZ4JItiv8i7wcA6wpskiAxPwuFgWJ7Jj8?= =?us-ascii?Q?6ILVga2aZ3a+khzDnmklJC1lUH8hYyk1gP4FSbwdXdFuu3jjmmVpQsGe+1Nn?= =?us-ascii?Q?OoEsfUmbSfcK5455+sYDFRwnV8HJBwS3iExrYmMeYRJtfegubOkWC6kFvwA0?= =?us-ascii?Q?BxIx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Gl0tdjq?= =?us-ascii?Q?5Od4tco1DEJWLr+jPZXp129FsJVi1i+hSn6jdBZEsxLLdc3e4R5Tp8BwV8MR?= =?us-ascii?Q?1WpbVZPx0QlLyp8ATIqAA9FD4d17cyjX4aSCwdvPa/qL5hpFLbCtobnmMg9j?= =?us-ascii?Q?Aa7gNwDRUl+k0LXXjIWwgPokJMERih6zEXry2T4GjTyQDGOQdbc9nqJheBOr?= =?us-ascii?Q?CdnmHb+OtddhouzwfxQT5/Dk8QnvzkIX+t4GX5MhA6F/2Ymnl4UEiT2NJS7Q?= =?us-ascii?Q?qcFj1N+Y/w4OlQ0nQaQrq+twwc5MRTSHDazCxn8wqW9SEs/nhl58MvN1UjG7?= =?us-ascii?Q?u8P450KDx8B4nIPaH2nKRVyctIYaRL2tCCaPxbRj?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4025.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c26d9059-2e84-42df-5d06-08dae4810766 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Dec 2022 01:00:05.1784 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: dINpL83QwcK7tG0fkloObaXlaq3iKbPUycHzAMbVz37ArAyLAjOJE2x1ITNwhjMJgSEmjyqrMxHfDPSdFuV2NA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR11MB6617 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Sorry, I found that I missed pointing out in the previous discussion that within f= unction UsbHcFreeMem(), below snippet of code should be updated as well: // // Release the current memory block if it is empty and not the head // if ((Block !=3D Head) && UsbHcIsMemBlockEmpty (Block)) { // UsbHcUnlinkMemBlock (Head, Block); UsbHcFreeMemBlock (Pool, Block); } Could you help to double check if the above UsbHcUnlinkMemBlock() call shou= ld be uncommented? Thanks in advance. Best Regards, Hao Wu > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Chang, > Abner via groups.io > Sent: Wednesday, December 21, 2022 11:42 PM > To: devel@edk2.groups.io > Cc: Wu, Hao A ; Ni, Ray ; Garrett > Kirkendall ; Abner Chang > ; Kuei-Hung Lin > Subject: [edk2-devel] [PATCH 3/3] MdeModulePkg/XhciPei: Unlinked XhciPei > memory block >=20 > From: Abner Chang >=20 > Unlink the XhciPei memory block when it has been freed. >=20 > Signed-off-by: Jiangang He > Cc: Hao A Wu > Cc: Ray Ni > Cc: Garrett Kirkendall > Cc: Abner Chang > Cc: Kuei-Hung Lin > --- > MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c | 29 > ++++++++++++++++++++++++- > 1 file changed, 28 insertions(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c > b/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c > index c64b38fcfc8..7dc014e465d 100644 > --- a/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c > +++ b/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c > @@ -3,6 +3,7 @@ PEIM to produce gPeiUsb2HostControllerPpiGuid based > on gPeiUsbControllerPpiGuid > which is used to enable recovery function from USB Drivers. >=20 > Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
> +Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -365,6 +366,32 @@ UsbHcInitMemPool ( > return Pool; > } >=20 > +/** > + Unlink the memory block from the pool's list. > + > + @param Head The block list head of the memory's pool. > + @param BlockToUnlink The memory block to unlink. > + > +**/ > +VOID > +UsbHcUnlinkMemBlock ( > + IN USBHC_MEM_BLOCK *Head, > + IN USBHC_MEM_BLOCK *BlockToUnlink > + ) > +{ > + USBHC_MEM_BLOCK *Block; > + > + ASSERT ((Head !=3D NULL) && (BlockToUnlink !=3D NULL)); > + > + for (Block =3D Head; Block !=3D NULL; Block =3D Block->Next) { > + if (Block->Next =3D=3D BlockToUnlink) { > + Block->Next =3D BlockToUnlink->Next; > + BlockToUnlink->Next =3D NULL; > + break; > + } > + } > +} > + > /** > Release the memory management pool. >=20 > @@ -386,7 +413,7 @@ UsbHcFreeMemPool ( > // first block. > // > for (Block =3D Pool->Head->Next; Block !=3D NULL; Block =3D Pool->Head= ->Next) { > - // UsbHcUnlinkMemBlock (Pool->Head, Block); > + UsbHcUnlinkMemBlock (Pool->Head, Block); > UsbHcFreeMemBlock (Pool, Block); > } >=20 > -- > 2.37.1.windows.1 >=20 >=20 >=20 >=20 >=20