From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (NAM02-SN1-obe.outbound.protection.outlook.com [40.107.96.68]) by mx.groups.io with SMTP id smtpd.web10.123196.1671070306490721835 for ; Wed, 14 Dec 2022 18:11:47 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=wBTAYyHx; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.96.68, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HA6nzN5+e0XHW56AtPZhenawTmgt2sSMusMJmX4qMVAZHqwEIA6qfSjAD0PyneUqH0c364aJRXMwVGi9GH+eqrn01uOJaAaOYgFVtXdNvjK86uhIU0kPiD1R5zIZ9epr9N0+VBsOESXRL6IjQoknL+wCW1OBXPec6OZ1FlXEwNIgtfwD1MI33l115Mk9KKPgatMs/V+zNNDIw9gWVoSAmJQgXXEKFSL3ai7rRamGEJFPT8DX1E6ZsxcDh1v5oXI3GC2az299OcjWAssOGUaxAsLkvkaYFegXfuqHsC4t5j3JVCuVAsxjup2cHowzar5++d2Oc9sddl0oorSQHDT3aQ== 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=3tK8GwWzsCUyiuAGdcO8L65Cx2+EuVh2X5R0csUG9j0=; b=QVhRKkC+GWlFeCPIeRCnCw8FsixSmwbGSwrRIQ8Kc2NfF60gHJbcTK5WqMdyN+oqXrky8pt/ux2jYrS0qk8BGotMq+BIheI9z/cymYQ0d03mYWt5+bFj2E8ZCR6B6eqgg5NueiSq+Cm/uQb2soF1qz0/zaIp7uVAxAY5kUdH6WgOHoDVzo2m/6R5xpngb6Y2nCHa3eolAKoE+i4z8JDisssklPXy+oykqUcPru159uzMcH89NycEe/yRch/WsTUg7G+JzImnztwnMeOqx2MNwreg7vN9GEvKUIbWXqDRUiTdgfjNg/+2QGdHRJ6XYKnWErXTaOUTlAJzKJi7YruGsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3tK8GwWzsCUyiuAGdcO8L65Cx2+EuVh2X5R0csUG9j0=; b=wBTAYyHxz0HXsaic7+F/18nzdMiTgn7thgiI4GPQHFR0vQ++aNh0vEJ6/oZUrrt4YieN5FeKKv01tUio0c0iOW+PZsEa4Q2wZVxkuonWQhTnz8d1Mpyyl7BjAyT4X5g2TpCT09cqebE+neM2B1G4WjGnq7U/mjSTvAqUcsJ3p7k= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by BL3PR12MB6619.namprd12.prod.outlook.com (2603:10b6:208:38e::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.11; Thu, 15 Dec 2022 02:11:43 +0000 Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::ce0a:283e:839:34bd]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::ce0a:283e:839:34bd%3]) with mapi id 15.20.5880.019; Thu, 15 Dec 2022 02:11:43 +0000 From: "Chang, Abner" To: "Wu, Hao A" , "devel@edk2.groups.io" CC: "Lin, Kuei-Hung (Timothy)" , "Ni, Ray" , "Zeng, Star" , "Sun, Zhikai" , "Kirkendall, Garrett" , "He, Jiangang" Subject: Re: [PATCH V2] MdeModulePkg/XhciPei: Unlinked XhciPei memory block Thread-Topic: [PATCH V2] MdeModulePkg/XhciPei: Unlinked XhciPei memory block Thread-Index: AQHZDKno0DYnXuJIl0m31zK+lceR8a5pmfcAgASf6dA= Date: Thu, 15 Dec 2022 02:11:43 +0000 Message-ID: References: <20221210151240.1548-1-abner.chang@amd.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2022-12-15T02:11:41Z; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=13d80729-4da6-44d7-bcc8-e332e37b7689; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB3966:EE_|BL3PR12MB6619:EE_ x-ms-office365-filtering-correlation-id: b543566e-686e-4930-c4e5-08dade41b631 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sTnr5ZV4z1+5xnwyXMuJhJFXavZozNzBe6pO8yxqV0942EL0t7RKem9tc8YjzlBMCF9sT0qoNV0lb/R3abpPI8WlmjtFDlGtmXGU38vQKy0f041lV54wGXrZVmTuvBQFW2AobbpB3tuag5pr/8MdTuhxwl3FW7rBK6UEp0EPYIzW7V4Q6tx8llkLmH/Gi0COVuz/JCJWvDTSnoJ3iSz1wZTFlDAwNTOhZzJpGgbFN6hOh3HA+mBGqjpRVIO/XuSn/hx3E9OxVmnNFYRRDrGbo5uSo6J5nSEgd7EtRhThf1YHR4Np+ZEFHRM1L31MG9dIUygUN7fe+D9Vy97eUAXjxzC5/JS73HfaLCkr55AayycElGws7jXGVztLx9niySq9Lbti9bJbI6Cm/FdkyTAPLjnzvFNbNaF01DhuJjAOfzGJEeR14PkunFbJotBGeFmpwUqXL3Zw18DVL0y8jnRhe/smerCyK63+OS56QOFbLXSFnl69TxgaBO+Nk8Zu/t2FNfRYfuagwV7Vfs6aOxl3sb/PtQrTJgEE9eEU+OkHwIxPq2+vfgRTnfNeKi9T4de/RCHNT9KqrwkeBzMYvxU5lIeLgrabqqKuQNbhDBbjfZ5+Qc83Ee+4yiGpaZ+hgJvWEzAiyZHqr74hVu/YKyxr9NNEka1qFVAiicU0fD48M/JAURwE3kCE7pjmnb8Hlhcj9iNSrfei6uz45xElF0+BG5LYzVavQB4f//t/n3QZKIc= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB3966.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(346002)(376002)(366004)(396003)(39860400002)(136003)(451199015)(76116006)(66946007)(52536014)(66556008)(66446008)(41300700001)(8676002)(64756008)(4326008)(66476007)(5660300002)(2906002)(316002)(8936002)(19627235002)(45080400002)(7696005)(71200400001)(110136005)(53546011)(9686003)(6506007)(186003)(26005)(966005)(54906003)(478600001)(55016003)(86362001)(83380400001)(38100700002)(38070700005)(33656002)(122000001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ENAD5NgCLGqRJA/VwEqj5AzhECRr1fex0i0T6WSgw5p1Ot5sexTXirRsMNYs?= =?us-ascii?Q?U5RVNewYEPK6JdVHvIqtnax3QWQmDOq8g4I4x8p3fhotbhNvS/z0hiowPfUL?= =?us-ascii?Q?MzPhDe6E0T2dPjFyR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ii?Q?R342cZQgoXUwc6rIxtgDBqvc52+PuA2AD/k+cBd/9DgvtenWgcVLeA/xHZ66?= =?us-ascii?Q?9dL6ArepJIzwBQJJkqInW3tP8kK41r4EtWtfj4UKF+UXUp3W/0aIxCKvgfnY?= =?us-ascii?Q?PqChjaTWeMzitEFW2BevSyQlsldEHnKkA4+LHELCU5xBChmpruLgki1zw6ou?= =?us-ascii?Q?kxqqDHl9TVOKrnENnhJ1KAGBBl771yCDDHZuwZgJbQRTAlvRm0ZEcSMte2d8?= =?us-ascii?Q?XsoUM+MgUwU+TtI+LoaJBYCzwhAWb8eqxFSyVhf5dRNooDcIjlTsBt1DwXP0?= =?us-ascii?Q?th7I15/2efIgpZq0NGhVARNQiHp8rSylpYx2ePUYvNsOVWDZbhnE5CDroNsg?= =?us-ascii?Q?klpWiLb1lPkrYiuy7be5lJWXJ0MK9vXr52cP4xkhek67pWs4pulPvnfMjB0A?= =?us-ascii?Q?sWv4yqQDB54Ou131DJQuAL9/+QRLKicrcJmzNtH+GgeimNj3fLouIaDbgiH6?= =?us-ascii?Q?+lEUcEFkJTAZ7hcWrW7j4jaNC1qPTRuQ+Ajnqqx5+V1fkPsCQnUsMBMHHtsC?= =?us-ascii?Q?ZNW//o7wPVwIofmth+nZcxrIyJLI8+ZEr8FQolA4?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b543566e-686e-4930-c4e5-08dade41b631 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Dec 2022 02:11:43.7145 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: YWtOhW1oy4oVvVxbmUfQsfqHTlxrnohLCiERZREprsIMceZ3OPUHd1YEzMSAeNVSC6APX2XL16pwMxrGQyVBkw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6619 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - General] Hi Jiangang, Could you please provide the context of this patch? Thanks Abner > -----Original Message----- > From: Wu, Hao A > Sent: Monday, December 12, 2022 11:27 AM > To: Chang, Abner ; devel@edk2.groups.io > Cc: Lin, Kuei-Hung (Timothy) ; Ni, Ray > ; Zeng, Star ; Sun, Zhikai > ; Kirkendall, Garrett > Subject: RE: [PATCH V2] MdeModulePkg/XhciPei: Unlinked XhciPei memory > block >=20 > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. >=20 >=20 > Sorry for a question, may I know what issue was met that leads to the pro= posed > patch? > Could you help to check if it is related with the topic discussed in > https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fedk2.= gr > oups.io%2Fg%2Fdevel%2Ftopic%2F92833071%2392165&data=3D05%7C01%7 > Cabner.chang%40amd.com%7Ccac49c2820e741b8c48a08dadbf0cc24%7C3dd8 > 961fe4884e608e11a82d994e183d%7C0%7C0%7C638064124512265992%7CUnk > nown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1h > aWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3Dz1Q7NRxN4GMA%2 > FBxYd2D7Gnkc3aTD23mRnwNF3H5wE0k%3D&reserved=3D0? Thanks in > advance. >=20 > Best Regards, > Hao Wu >=20 > > -----Original Message----- > > From: abner.chang@amd.com > > Sent: Saturday, December 10, 2022 11:13 PM > > To: devel@edk2.groups.io > > Cc: Kuei-Hung.Lin@amd.com; Wu, Hao A ; Ni, Ray > > ; Garrett Kirkendall ; > > Abner Chang > > Subject: [PATCH V2] MdeModulePkg/XhciPei: Unlinked XhciPei memory > > block > > > > From: Abner Chang > > > > In V2: Add AMD copyright. > > > > Unlink the XhciPei memory block when it has been freed. > > > > Signed-off-by: Kuei-Hung Lin > > Cc: Hao A Wu > > Cc: Ray Ni > > Cc: Garrett Kirkendall > > Cc: Abner Chang > > --- > > MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c | 29 > > ++++++++++++++++++++++++- > > 1 file changed, 28 insertions(+), 1 deletion(-) > > > > diff --git a/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c > > b/MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c > > index c64b38fcfc8..39ba31b0913 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. > > > > Copyright (c) 2014 - 2016, Intel Corporation. All rights > > reserved.
> > +Copyright (C) 2022 Advanced Micro Devices, Inc. All rights > > +reserved.
> > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > @@ -365,6 +366,32 @@ UsbHcInitMemPool ( > > return Pool; > > } > > > > +/** > > + 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. > > > > @@ -386,8 +413,8 @@ UsbHcFreeMemPool ( > > // first block. > > // > > for (Block =3D Pool->Head->Next; Block !=3D NULL; Block =3D > > Pool->Head->Next) { > > - // UsbHcUnlinkMemBlock (Pool->Head, Block); > > UsbHcFreeMemBlock (Pool, Block); > > + UsbHcUnlinkMemBlock (Pool->Head, Block); > > } > > > > UsbHcFreeMemBlock (Pool, Pool->Head); > > -- > > 2.37.1.windows.1