From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web08.214.1610622128201564852 for ; Thu, 14 Jan 2021 03:02:08 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=b06X0Llw; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610622127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fsynN2s1S6b30KEEuDmnic/yfqud+ba+t+9ZJ8zZUsQ=; b=b06X0Llw9FNPkMg74CzrVhalB97TmXDumvqvWMvupzLNunqS2eX/tHlfKSm5jhpCKaiN/i stzwJwJC/6RPJmJ05YB4sOyHDJwUovEekGaVSl3CeSbKHcIggCVB8DW4YVNUEKIM0iBbdA ggJANcu17HlqV3ZoZ4Dq44fYw3LayWU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-229-nfUvrFBLPWyTgi6YFWajNQ-1; Thu, 14 Jan 2021 06:02:03 -0500 X-MC-Unique: nfUvrFBLPWyTgi6YFWajNQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 147BF425C8; Thu, 14 Jan 2021 11:02:00 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-110.ams2.redhat.com [10.36.114.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6FEA671D60; Thu, 14 Jan 2021 11:01:55 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v4 8/9] ArmVirtPkg/FdtPciHostBridgeLib: Refactor GetRootBridges() / FreeRootBridges() To: devel@edk2.groups.io, cenjiahui@huawei.com Cc: Jordan Justen , Ard Biesheuvel , Rebecca Cran , Peter Grehan , Anthony Perard , Julien Grall , Leif Lindholm , Sami Mujawar , xieyingtai@huawei.com, wu.wubin@huawei.com, Yubo Miao References: <20210112094549.10238-1-cenjiahui@huawei.com> <20210112094549.10238-9-cenjiahui@huawei.com> From: "Laszlo Ersek" Message-ID: <53ba0660-0251-9fa9-9a82-243f518f200f@redhat.com> Date: Thu, 14 Jan 2021 12:01:55 +0100 MIME-Version: 1.0 In-Reply-To: <20210112094549.10238-9-cenjiahui@huawei.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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? > > 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); > } > > /** >