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.28133.1611151611114227925 for ; Wed, 20 Jan 2021 06:06:51 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Kvk/WEUg; 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=1611151610; 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=NF4pgmtUOpe9WjaOQCj3V+Pz3CTpaLdyT6h5EE4llDU=; b=Kvk/WEUgVU4CBZT+cD2LlllVyd+wKCkG8m8uIiodlLvILi1w2qMtP2nSKvlT8TIEzA8uel M/u2kd1cYujvjYx+xetpgdSY+eOkMUOFVpJXrXCKWvSmqrw2qxGxIcHEQ3OaqOsoobMg9m Ospnzt7Yk1mH+cnloeJTLby/jIKt1eo= 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-235-NB-KcBbMOWOHtU_MMBX1sg-1; Wed, 20 Jan 2021 09:06:48 -0500 X-MC-Unique: NB-KcBbMOWOHtU_MMBX1sg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7DCECC7400; Wed, 20 Jan 2021 14:06:45 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-115-96.ams2.redhat.com [10.36.115.96]) by smtp.corp.redhat.com (Postfix) with ESMTP id D899260C69; Wed, 20 Jan 2021 14:06:42 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v6 10/11] ArmVirtPkg/FdtPciHostBridgeLib: Add extra pci root buses support 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: <20210119011302.10908-1-cenjiahui@huawei.com> <20210119011302.10908-11-cenjiahui@huawei.com> From: "Laszlo Ersek" Message-ID: <65f3a717-eb3d-735b-d716-83084d6fc621@redhat.com> Date: Wed, 20 Jan 2021 15:06:41 +0100 MIME-Version: 1.0 In-Reply-To: <20210119011302.10908-11-cenjiahui@huawei.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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/19/21 02:13, Jiahui Cen via groups.io wrote: > In order to take advantages of extra pci root buses in ArmVirtPkg, it is > necessary to scan extra root buses when getting root briges. And now > PciHostBridgeUtilityLib already provides a set of utility functions that > support for extra pci root buses, like PciHostBridgeUtilityGetRootBridges() > / PciHostBridgeUtilityFreeRootBridges(). So let's rebase > ArmVirtPkg/FdtPciHostBridgeLib to PciHostBridgeUtilityGetRootBridges() / > PciHostBridgeUtilityFreeRootBridges() to extend ArmVirtPkg with extra > pci root buses support. > > 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 | 22 ++++---------------- > 1 file changed, 4 insertions(+), 18 deletions(-) > > diff --git a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c b/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c > index 3ec7992b6331..0099b8e3c391 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,8 @@ PciHostBridgeGetRootBridges ( > PMemAbove4G.Base = MAX_UINT64; > PMemAbove4G.Limit = 0; > > - Status = PciHostBridgeUtilityInitRootBridge ( > - Attributes, > + return PciHostBridgeUtilityGetRootBridges ( > + Count, > Attributes, > AllocationAttributes, > TRUE, > @@ -373,19 +371,8 @@ PciHostBridgeGetRootBridges ( > &Mem, > &MemAbove4G, > &PMem, > - &PMemAbove4G, > - &mRootBridge > + &PMemAbove4G > ); > - if (EFI_ERROR (Status)) { > - DEBUG ((DEBUG_ERROR, "%a: failed to initialize PCI host bridge: %r\n", > - __FUNCTION__, Status)); > - *Count = 0; > - return NULL; > - } > - > - *Count = 1; > - > - return &mRootBridge; > } > > /** > @@ -402,8 +389,7 @@ PciHostBridgeFreeRootBridges ( > UINTN Count > ) > { > - ASSERT (Count == 1); > - PciHostBridgeUtilityUninitRootBridge (Bridges); > + PciHostBridgeUtilityFreeRootBridges (Bridges, Count); > } > > /** > Reviewed-by: Laszlo Ersek