public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg/PciBusDxe: Fix a bug in ProcessOptionRomLight
@ 2021-01-13 19:01 Park, Aiden
  2021-01-29  1:55 ` Park, Aiden
  0 siblings, 1 reply; 5+ messages in thread
From: Park, Aiden @ 2021-01-13 19:01 UTC (permalink / raw)
  To: hao.a.wu, ray.ni, devel; +Cc: aiden.park, maurice.ma, guo.dong

From: Aiden Park <aiden.park@intel.com>

The ProcessOptionRomLight() assumes that OpRom has already been
processed in the previous full enumeration and updates
AllOpRomProcessed flag to TRUE by default. However, this may not
be applicable with other pre-stage boot firmwares.

This will update AllOpRomProcessed flag properly by checking
PciRomGetImageMapping().

Signed-off-by: Aiden Park <aiden.park@intel.com>
---
 MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
index 1b64924b7b..e8337e865e 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
@@ -1168,12 +1168,7 @@ ProcessOptionRomLight (
       ProcessOptionRomLight (Temp);
     }
 
-    PciRomGetImageMapping (Temp);
-
-    //
-    // The OpRom has already been processed in the first round
-    //
-    Temp->AllOpRomProcessed = TRUE;
+    Temp->AllOpRomProcessed = PciRomGetImageMapping (Temp);
 
     CurrentLink = CurrentLink->ForwardLink;
   }
-- 
2.20.1


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

* Re: [PATCH] MdeModulePkg/PciBusDxe: Fix a bug in ProcessOptionRomLight
  2021-01-13 19:01 [PATCH] MdeModulePkg/PciBusDxe: Fix a bug in ProcessOptionRomLight Park, Aiden
@ 2021-01-29  1:55 ` Park, Aiden
  2021-01-29  9:00   ` Ni, Ray
  0 siblings, 1 reply; 5+ messages in thread
From: Park, Aiden @ 2021-01-29  1:55 UTC (permalink / raw)
  To: Wu, Hao A, Ni, Ray, devel@edk2.groups.io; +Cc: Ma, Maurice, Dong, Guo

Hello,

Can you please review this?

> -----Original Message-----
> From: Park, Aiden <aiden.park@intel.com>
> Sent: Wednesday, January 13, 2021 11:01 AM
> To: Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>;
> devel@edk2.groups.io
> Cc: Park, Aiden <aiden.park@intel.com>; Ma, Maurice
> <maurice.ma@intel.com>; Dong, Guo <guo.dong@intel.com>
> Subject: [PATCH] MdeModulePkg/PciBusDxe: Fix a bug in
> ProcessOptionRomLight
> 
> From: Aiden Park <aiden.park@intel.com>
> 
> The ProcessOptionRomLight() assumes that OpRom has already been processed
> in the previous full enumeration and updates AllOpRomProcessed flag to TRUE
> by default. However, this may not be applicable with other pre-stage boot
> firmwares.
> 
> This will update AllOpRomProcessed flag properly by checking
> PciRomGetImageMapping().
> 
> Signed-off-by: Aiden Park <aiden.park@intel.com>
> ---
>  MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> index 1b64924b7b..e8337e865e 100644
> --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> @@ -1168,12 +1168,7 @@ ProcessOptionRomLight (
>        ProcessOptionRomLight (Temp);
>      }
> 
> -    PciRomGetImageMapping (Temp);
> -
> -    //
> -    // The OpRom has already been processed in the first round
> -    //
> -    Temp->AllOpRomProcessed = TRUE;
> +    Temp->AllOpRomProcessed = PciRomGetImageMapping (Temp);
> 
>      CurrentLink = CurrentLink->ForwardLink;
>    }
> --
> 2.20.1

Best Regards,
Aiden

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

* Re: [PATCH] MdeModulePkg/PciBusDxe: Fix a bug in ProcessOptionRomLight
  2021-01-29  1:55 ` Park, Aiden
@ 2021-01-29  9:00   ` Ni, Ray
  2021-02-01  8:32     ` [edk2-devel] " Patrick Rudolph
  2021-02-02  6:34     ` Wu, Hao A
  0 siblings, 2 replies; 5+ messages in thread
From: Ni, Ray @ 2021-01-29  9:00 UTC (permalink / raw)
  To: Park, Aiden, Wu, Hao A, devel@edk2.groups.io; +Cc: Ma, Maurice, Dong, Guo

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


> -----Original Message-----
> From: Park, Aiden <aiden.park@intel.com>
> Sent: Friday, January 29, 2021 9:55 AM
> To: Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>; devel@edk2.groups.io
> Cc: Ma, Maurice <maurice.ma@intel.com>; Dong, Guo <guo.dong@intel.com>
> Subject: RE: [PATCH] MdeModulePkg/PciBusDxe: Fix a bug in ProcessOptionRomLight
> 
> Hello,
> 
> Can you please review this?
> 
> > -----Original Message-----
> > From: Park, Aiden <aiden.park@intel.com>
> > Sent: Wednesday, January 13, 2021 11:01 AM
> > To: Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>;
> > devel@edk2.groups.io
> > Cc: Park, Aiden <aiden.park@intel.com>; Ma, Maurice
> > <maurice.ma@intel.com>; Dong, Guo <guo.dong@intel.com>
> > Subject: [PATCH] MdeModulePkg/PciBusDxe: Fix a bug in
> > ProcessOptionRomLight
> >
> > From: Aiden Park <aiden.park@intel.com>
> >
> > The ProcessOptionRomLight() assumes that OpRom has already been processed
> > in the previous full enumeration and updates AllOpRomProcessed flag to TRUE
> > by default. However, this may not be applicable with other pre-stage boot
> > firmwares.
> >
> > This will update AllOpRomProcessed flag properly by checking
> > PciRomGetImageMapping().
> >
> > Signed-off-by: Aiden Park <aiden.park@intel.com>
> > ---
> >  MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 7 +------
> >  1 file changed, 1 insertion(+), 6 deletions(-)
> >
> > diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> > b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> > index 1b64924b7b..e8337e865e 100644
> > --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> > +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> > @@ -1168,12 +1168,7 @@ ProcessOptionRomLight (
> >        ProcessOptionRomLight (Temp);
> >      }
> >
> > -    PciRomGetImageMapping (Temp);
> > -
> > -    //
> > -    // The OpRom has already been processed in the first round
> > -    //
> > -    Temp->AllOpRomProcessed = TRUE;
> > +    Temp->AllOpRomProcessed = PciRomGetImageMapping (Temp);
> >
> >      CurrentLink = CurrentLink->ForwardLink;
> >    }
> > --
> > 2.20.1
> 
> Best Regards,
> Aiden

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

* Re: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Fix a bug in ProcessOptionRomLight
  2021-01-29  9:00   ` Ni, Ray
@ 2021-02-01  8:32     ` Patrick Rudolph
  2021-02-02  6:34     ` Wu, Hao A
  1 sibling, 0 replies; 5+ messages in thread
From: Patrick Rudolph @ 2021-02-01  8:32 UTC (permalink / raw)
  To: devel, Ni, Ray; +Cc: Park, Aiden, Wu, Hao A, Ma, Maurice, Dong, Guo

I can confirm that it provides the same fix as my patch "MdeModulePkg:
Fix OptionROM scanning" sent earlier.
Tested on QEMU and Intel CFL board using coreboot as bootloader.

Kind Regards,
Patrick Rudolph

On Fri, Jan 29, 2021 at 10:00 AM Ni, Ray <ray.ni@intel.com> wrote:
>
> Reviewed-by: Ray Ni <ray.ni@intel.com>
>
>
> > -----Original Message-----
> > From: Park, Aiden <aiden.park@intel.com>
> > Sent: Friday, January 29, 2021 9:55 AM
> > To: Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>; devel@edk2.groups.io
> > Cc: Ma, Maurice <maurice.ma@intel.com>; Dong, Guo <guo.dong@intel.com>
> > Subject: RE: [PATCH] MdeModulePkg/PciBusDxe: Fix a bug in ProcessOptionRomLight
> >
> > Hello,
> >
> > Can you please review this?
> >
> > > -----Original Message-----
> > > From: Park, Aiden <aiden.park@intel.com>
> > > Sent: Wednesday, January 13, 2021 11:01 AM
> > > To: Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>;
> > > devel@edk2.groups.io
> > > Cc: Park, Aiden <aiden.park@intel.com>; Ma, Maurice
> > > <maurice.ma@intel.com>; Dong, Guo <guo.dong@intel.com>
> > > Subject: [PATCH] MdeModulePkg/PciBusDxe: Fix a bug in
> > > ProcessOptionRomLight
> > >
> > > From: Aiden Park <aiden.park@intel.com>
> > >
> > > The ProcessOptionRomLight() assumes that OpRom has already been processed
> > > in the previous full enumeration and updates AllOpRomProcessed flag to TRUE
> > > by default. However, this may not be applicable with other pre-stage boot
> > > firmwares.
> > >
> > > This will update AllOpRomProcessed flag properly by checking
> > > PciRomGetImageMapping().
> > >
> > > Signed-off-by: Aiden Park <aiden.park@intel.com>
> > > ---
> > >  MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 7 +------
> > >  1 file changed, 1 insertion(+), 6 deletions(-)
> > >
> > > diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> > > b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> > > index 1b64924b7b..e8337e865e 100644
> > > --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> > > +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> > > @@ -1168,12 +1168,7 @@ ProcessOptionRomLight (
> > >        ProcessOptionRomLight (Temp);
> > >      }
> > >
> > > -    PciRomGetImageMapping (Temp);
> > > -
> > > -    //
> > > -    // The OpRom has already been processed in the first round
> > > -    //
> > > -    Temp->AllOpRomProcessed = TRUE;
> > > +    Temp->AllOpRomProcessed = PciRomGetImageMapping (Temp);
> > >
> > >      CurrentLink = CurrentLink->ForwardLink;
> > >    }
> > > --
> > > 2.20.1
> >
> > Best Regards,
> > Aiden
>
>
> 
>
>

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

* Re: [PATCH] MdeModulePkg/PciBusDxe: Fix a bug in ProcessOptionRomLight
  2021-01-29  9:00   ` Ni, Ray
  2021-02-01  8:32     ` [edk2-devel] " Patrick Rudolph
@ 2021-02-02  6:34     ` Wu, Hao A
  1 sibling, 0 replies; 5+ messages in thread
From: Wu, Hao A @ 2021-02-02  6:34 UTC (permalink / raw)
  To: Ni, Ray, Park, Aiden, devel@edk2.groups.io; +Cc: Ma, Maurice, Dong, Guo

> -----Original Message-----
> From: Ni, Ray <ray.ni@intel.com>
> Sent: Friday, January 29, 2021 5:01 PM
> To: Park, Aiden <aiden.park@intel.com>; Wu, Hao A <hao.a.wu@intel.com>;
> devel@edk2.groups.io
> Cc: Ma, Maurice <maurice.ma@intel.com>; Dong, Guo <guo.dong@intel.com>
> Subject: RE: [PATCH] MdeModulePkg/PciBusDxe: Fix a bug in
> ProcessOptionRomLight
> 
> Reviewed-by: Ray Ni <ray.ni@intel.com>


The patch has been pushed via:
PR - https://github.com/tianocore/edk2/pull/1400
Commit - https://github.com/tianocore/edk2/commit/3f90ac3ec03512e2374cd2968c047a7e856a8965

Best Regards,
Hao Wu


> 
> 
> > -----Original Message-----
> > From: Park, Aiden <aiden.park@intel.com>
> > Sent: Friday, January 29, 2021 9:55 AM
> > To: Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>;
> > devel@edk2.groups.io
> > Cc: Ma, Maurice <maurice.ma@intel.com>; Dong, Guo
> <guo.dong@intel.com>
> > Subject: RE: [PATCH] MdeModulePkg/PciBusDxe: Fix a bug in
> > ProcessOptionRomLight
> >
> > Hello,
> >
> > Can you please review this?
> >
> > > -----Original Message-----
> > > From: Park, Aiden <aiden.park@intel.com>
> > > Sent: Wednesday, January 13, 2021 11:01 AM
> > > To: Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>;
> > > devel@edk2.groups.io
> > > Cc: Park, Aiden <aiden.park@intel.com>; Ma, Maurice
> > > <maurice.ma@intel.com>; Dong, Guo <guo.dong@intel.com>
> > > Subject: [PATCH] MdeModulePkg/PciBusDxe: Fix a bug in
> > > ProcessOptionRomLight
> > >
> > > From: Aiden Park <aiden.park@intel.com>
> > >
> > > The ProcessOptionRomLight() assumes that OpRom has already been
> > > processed in the previous full enumeration and updates
> > > AllOpRomProcessed flag to TRUE by default. However, this may not be
> > > applicable with other pre-stage boot firmwares.
> > >
> > > This will update AllOpRomProcessed flag properly by checking
> > > PciRomGetImageMapping().
> > >
> > > Signed-off-by: Aiden Park <aiden.park@intel.com>
> > > ---
> > >  MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 7 +------
> > >  1 file changed, 1 insertion(+), 6 deletions(-)
> > >
> > > diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> > > b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> > > index 1b64924b7b..e8337e865e 100644
> > > --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> > > +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
> > > @@ -1168,12 +1168,7 @@ ProcessOptionRomLight (
> > >        ProcessOptionRomLight (Temp);
> > >      }
> > >
> > > -    PciRomGetImageMapping (Temp);
> > > -
> > > -    //
> > > -    // The OpRom has already been processed in the first round
> > > -    //
> > > -    Temp->AllOpRomProcessed = TRUE;
> > > +    Temp->AllOpRomProcessed = PciRomGetImageMapping (Temp);
> > >
> > >      CurrentLink = CurrentLink->ForwardLink;
> > >    }
> > > --
> > > 2.20.1
> >
> > Best Regards,
> > Aiden

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

end of thread, other threads:[~2021-02-02  6:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-13 19:01 [PATCH] MdeModulePkg/PciBusDxe: Fix a bug in ProcessOptionRomLight Park, Aiden
2021-01-29  1:55 ` Park, Aiden
2021-01-29  9:00   ` Ni, Ray
2021-02-01  8:32     ` [edk2-devel] " Patrick Rudolph
2021-02-02  6:34     ` Wu, Hao A

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