From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by mx.groups.io with SMTP id smtpd.web11.881.1610628532808973666 for ; Thu, 14 Jan 2021 04:48:56 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: huawei.com, ip: 45.249.212.190, mailfrom: cenjiahui@huawei.com) Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DGkcM1rfrz15sxB; Thu, 14 Jan 2021 20:47:47 +0800 (CST) Received: from [10.174.184.155] (10.174.184.155) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Thu, 14 Jan 2021 20:48:43 +0800 Subject: Re: [edk2-devel] [PATCH v4 8/9] ArmVirtPkg/FdtPciHostBridgeLib: Refactor GetRootBridges() / FreeRootBridges() To: , CC: Jordan Justen , Ard Biesheuvel , Rebecca Cran , Peter Grehan , Anthony Perard , "Julien Grall" , Leif Lindholm , Sami Mujawar , , , "Yubo Miao" References: <20210112094549.10238-1-cenjiahui@huawei.com> <20210112094549.10238-9-cenjiahui@huawei.com> <53ba0660-0251-9fa9-9a82-243f518f200f@redhat.com> From: "Jiahui Cen" Message-ID: <90f7ef27-d44b-d862-0e3c-b6fc596de12c@huawei.com> Date: Thu, 14 Jan 2021 20:48:41 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <53ba0660-0251-9fa9-9a82-243f518f200f@redhat.com> X-Originating-IP: [10.174.184.155] X-CFilter-Loop: Reflected Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit Hi Laszlo, On 2021/1/14 19:01, Laszlo Ersek wrote: > On 01/12/21 10:45, Jiahui Cen via groups.io wrote: >> Rebase ArmVirtPkg/FdtPciHostBridgeLib with the new >> PciHostBridgeUtilityGetRootBridges() / PciHostBridgeUtilityFreeRootBridges() >> functions. > > (1) This commit message is utterly useless. > > This is the patch where the entire series culminates -- where you > actually bring pxb support to ArmVirtPkg. Do you think you should > perhaps elaborate on the *WHOLE GOAL* of this series, in this commit > message? > Right, I will add some more detailed commit message. Thanks, Jiahui >> >> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3059 >> >> Cc: Laszlo Ersek >> Cc: Ard Biesheuvel >> Cc: Leif Lindholm >> Signed-off-by: Jiahui Cen >> Signed-off-by: Yubo Miao >> --- >> ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c | 24 +++++--------------- >> 1 file changed, 6 insertions(+), 18 deletions(-) >> >> diff --git a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c b/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c >> index 95166d18c82d..89582ef76eb3 100644 >> --- a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c >> +++ b/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c >> @@ -272,8 +272,6 @@ ProcessPciHost ( >> return Status; >> } >> >> -STATIC PCI_ROOT_BRIDGE mRootBridge; >> - >> /** >> Return all the root bridge instances in an array. >> >> @@ -361,8 +359,10 @@ PciHostBridgeGetRootBridges ( >> PMemAbove4G.Base = MAX_UINT64; >> PMemAbove4G.Limit = 0; >> >> - Status = PciHostBridgeUtilityInitRootBridge ( >> - Attributes, >> + *Count = 0; > > (2) As noted earlier, this assignment should be pushed down into > PciHostBridgeUtilityGetRootBridges(). > > Thanks > Laszlo > >> + >> + return PciHostBridgeUtilityGetRootBridges ( >> + Count, >> Attributes, >> AllocationAttributes, >> TRUE, >> @@ -373,19 +373,8 @@ PciHostBridgeGetRootBridges ( >> &Mem, >> &MemAbove4G, >> &PMem, >> - &PMemAbove4G, >> - &mRootBridge >> + &PMemAbove4G >> ); >> - if (EFI_ERROR (Status)) { >> - DEBUG ((EFI_D_ERROR, "%a: failed to initialize PCI host bridge: %r\n", >> - __FUNCTION__, Status)); >> - *Count = 0; >> - return NULL; >> - } >> - >> - *Count = 1; >> - >> - return &mRootBridge; >> } >> >> /** >> @@ -402,8 +391,7 @@ PciHostBridgeFreeRootBridges ( >> UINTN Count >> ) >> { >> - ASSERT (Count == 1); >> - PciHostBridgeUtilityUninitRootBridge (Bridges); >> + PciHostBridgeUtilityFreeRootBridges (Bridges, Count); >> } >> >> /** >> > > > > > > > . >