public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch 1/1] MdeModulePkg/Bus/Pci/PciBusDxe: Support platform PCI ROM override
@ 2022-01-22  1:40 Michael D Kinney
  2022-01-25  6:55 ` Zeng, Star
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michael D Kinney @ 2022-01-22  1:40 UTC (permalink / raw)
  To: devel; +Cc: Hao A Wu, Ray Ni, Star Zeng

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3811

Remove ASSERT() statements that are triggered if a platform provides
an override of PCI ROM attached to a PCI Controller.  The PCI Platform
Protocol allows the platform to provide a PCI ROM image for a PCI
Controller.  This works for PCI Controllers that do not have an attached
PCI ROM, but the platform is not allowed to replace the PCI ROM for a
PCI Controller that has its own PCI ROM.  Removing these ASSERT()
statements enables this additional use case.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.c
index 5535bd3013b8..cb845ec2b186 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.c
@@ -58,10 +58,9 @@ PciRomAddImageMapping (
     {
       //
       // Expect once RomImage and RomSize are recorded, they will be passed in
-      // later when updating ImageHandle
+      // later when updating ImageHandle. They may also be updated with new
+      // values if the platform provides an override of RomImage and RomSize.
       //
-      ASSERT ((mRomImageTable[Index].RomImage == NULL) || (RomImage == mRomImageTable[Index].RomImage));
-      ASSERT ((mRomImageTable[Index].RomSize  == 0) || (RomSize  == mRomImageTable[Index].RomSize));
       break;
     }
   }
-- 
2.32.0.windows.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Patch 1/1] MdeModulePkg/Bus/Pci/PciBusDxe: Support platform PCI ROM override
  2022-01-22  1:40 [Patch 1/1] MdeModulePkg/Bus/Pci/PciBusDxe: Support platform PCI ROM override Michael D Kinney
@ 2022-01-25  6:55 ` Zeng, Star
  2022-01-27  3:34 ` Ni, Ray
  2022-01-27 12:45 ` [edk2-devel] " Ard Biesheuvel
  2 siblings, 0 replies; 4+ messages in thread
From: Zeng, Star @ 2022-01-25  6:55 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io; +Cc: Wu, Hao A, Ni, Ray, Zeng, Star

Reviewed-by: Star Zeng <star.zeng@intel.com>

-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@intel.com> 
Sent: Saturday, January 22, 2022 9:41 AM
To: devel@edk2.groups.io
Cc: Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>; Zeng, Star <star.zeng@intel.com>
Subject: [Patch 1/1] MdeModulePkg/Bus/Pci/PciBusDxe: Support platform PCI ROM override

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3811

Remove ASSERT() statements that are triggered if a platform provides an override of PCI ROM attached to a PCI Controller.  The PCI Platform Protocol allows the platform to provide a PCI ROM image for a PCI Controller.  This works for PCI Controllers that do not have an attached PCI ROM, but the platform is not allowed to replace the PCI ROM for a PCI Controller that has its own PCI ROM.  Removing these ASSERT() statements enables this additional use case.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.c
index 5535bd3013b8..cb845ec2b186 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.c
@@ -58,10 +58,9 @@ PciRomAddImageMapping (
     {
       //
       // Expect once RomImage and RomSize are recorded, they will be passed in
-      // later when updating ImageHandle
+      // later when updating ImageHandle. They may also be updated with new
+      // values if the platform provides an override of RomImage and RomSize.
       //
-      ASSERT ((mRomImageTable[Index].RomImage == NULL) || (RomImage == mRomImageTable[Index].RomImage));
-      ASSERT ((mRomImageTable[Index].RomSize  == 0) || (RomSize  == mRomImageTable[Index].RomSize));
       break;
     }
   }
--
2.32.0.windows.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Patch 1/1] MdeModulePkg/Bus/Pci/PciBusDxe: Support platform PCI ROM override
  2022-01-22  1:40 [Patch 1/1] MdeModulePkg/Bus/Pci/PciBusDxe: Support platform PCI ROM override Michael D Kinney
  2022-01-25  6:55 ` Zeng, Star
@ 2022-01-27  3:34 ` Ni, Ray
  2022-01-27 12:45 ` [edk2-devel] " Ard Biesheuvel
  2 siblings, 0 replies; 4+ messages in thread
From: Ni, Ray @ 2022-01-27  3:34 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io; +Cc: Wu, Hao A, Zeng, Star

Reviewed-by: Ray Ni <ray.ni@intel.com>

-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@intel.com> 
Sent: Saturday, January 22, 2022 9:41 AM
To: devel@edk2.groups.io
Cc: Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>; Zeng, Star <star.zeng@intel.com>
Subject: [Patch 1/1] MdeModulePkg/Bus/Pci/PciBusDxe: Support platform PCI ROM override

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3811

Remove ASSERT() statements that are triggered if a platform provides an override of PCI ROM attached to a PCI Controller.  The PCI Platform Protocol allows the platform to provide a PCI ROM image for a PCI Controller.  This works for PCI Controllers that do not have an attached PCI ROM, but the platform is not allowed to replace the PCI ROM for a PCI Controller that has its own PCI ROM.  Removing these ASSERT() statements enables this additional use case.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.c
index 5535bd3013b8..cb845ec2b186 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.c
@@ -58,10 +58,9 @@ PciRomAddImageMapping (
     {
       //
       // Expect once RomImage and RomSize are recorded, they will be passed in
-      // later when updating ImageHandle
+      // later when updating ImageHandle. They may also be updated with new
+      // values if the platform provides an override of RomImage and RomSize.
       //
-      ASSERT ((mRomImageTable[Index].RomImage == NULL) || (RomImage == mRomImageTable[Index].RomImage));
-      ASSERT ((mRomImageTable[Index].RomSize  == 0) || (RomSize  == mRomImageTable[Index].RomSize));
       break;
     }
   }
--
2.32.0.windows.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] [Patch 1/1] MdeModulePkg/Bus/Pci/PciBusDxe: Support platform PCI ROM override
  2022-01-22  1:40 [Patch 1/1] MdeModulePkg/Bus/Pci/PciBusDxe: Support platform PCI ROM override Michael D Kinney
  2022-01-25  6:55 ` Zeng, Star
  2022-01-27  3:34 ` Ni, Ray
@ 2022-01-27 12:45 ` Ard Biesheuvel
  2 siblings, 0 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2022-01-27 12:45 UTC (permalink / raw)
  To: edk2-devel-groups-io, Michael Kinney; +Cc: Hao A Wu, Ray Ni, Star Zeng

On Sat, 22 Jan 2022 at 02:41, Michael D Kinney
<michael.d.kinney@intel.com> wrote:
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3811
>
> Remove ASSERT() statements that are triggered if a platform provides
> an override of PCI ROM attached to a PCI Controller.  The PCI Platform
> Protocol allows the platform to provide a PCI ROM image for a PCI
> Controller.  This works for PCI Controllers that do not have an attached
> PCI ROM, but the platform is not allowed to replace the PCI ROM for a
> PCI Controller that has its own PCI ROM.  Removing these ASSERT()
> statements enables this additional use case.
>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Star Zeng <star.zeng@intel.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>

Acked-by: Ard Biesheuvel <ardb@kernel.org>

> ---
>  MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.c
> index 5535bd3013b8..cb845ec2b186 100644
> --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.c
> +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciRomTable.c
> @@ -58,10 +58,9 @@ PciRomAddImageMapping (
>      {
>        //
>        // Expect once RomImage and RomSize are recorded, they will be passed in
> -      // later when updating ImageHandle
> +      // later when updating ImageHandle. They may also be updated with new
> +      // values if the platform provides an override of RomImage and RomSize.
>        //
> -      ASSERT ((mRomImageTable[Index].RomImage == NULL) || (RomImage == mRomImageTable[Index].RomImage));
> -      ASSERT ((mRomImageTable[Index].RomSize  == 0) || (RomSize  == mRomImageTable[Index].RomSize));
>        break;
>      }
>    }
> --
> 2.32.0.windows.1
>
>
>
> 
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-27 12:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-22  1:40 [Patch 1/1] MdeModulePkg/Bus/Pci/PciBusDxe: Support platform PCI ROM override Michael D Kinney
2022-01-25  6:55 ` Zeng, Star
2022-01-27  3:34 ` Ni, Ray
2022-01-27 12:45 ` [edk2-devel] " Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox