public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Wu, Hao A" <hao.a.wu@intel.com>
To: Daniel Schaefer <daniel.schaefer@hpe.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Trammell Hudson <hudson@trmm.net>,
	"Wang, Jian J" <jian.j.wang@intel.com>,
	"Ni, Ray" <ray.ni@intel.com>,
	"Gao, Zhichao" <zhichao.gao@intel.com>
Subject: Re: [edk2-devel] [PATCH v1 1/1] RamDiskDxe: Initialize list head before registering RAM disk protocol
Date: Wed, 14 Jul 2021 03:09:41 +0000	[thread overview]
Message-ID: <BN8PR11MB3666583041BB4C7D5361192ECA139@BN8PR11MB3666.namprd11.prod.outlook.com> (raw)
In-Reply-To: <087ace9a-06e5-86a4-c20f-b141e6444b27@hpe.com>

Patch merged via:
PR - https://github.com/tianocore/edk2/pull/1814
Commit - https://github.com/tianocore/edk2/commit/d0b6596b8e7ad72c86de0b9faa342a7a866bc87e

Best Regards,
Hao Wu

> -----Original Message-----
> From: Daniel Schaefer <daniel.schaefer@hpe.com>
> Sent: Tuesday, July 13, 2021 5:31 PM
> To: Wu, Hao A <hao.a.wu@intel.com>; devel@edk2.groups.io
> Cc: Trammell Hudson <hudson@trmm.net>; Wang, Jian J
> <jian.j.wang@intel.com>; Ni, Ray <ray.ni@intel.com>; Gao, Zhichao
> <zhichao.gao@intel.com>
> Subject: Re: [edk2-devel] [PATCH v1 1/1] RamDiskDxe: Initialize list head
> before registering RAM disk protocol
> 
> On 7/13/21 11:44 AM, Wu, Hao A wrote:
> >> -----Original Message-----
> >> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> Daniel
> >> Schaefer
> >> Sent: Tuesday, July 13, 2021 9:10 AM
> >> To: devel@edk2.groups.io
> >> Cc: Trammell Hudson <hudson@trmm.net>; Daniel Schaefer
> >> <daniel.schaefer@hpe.com>; Wang, Jian J <jian.j.wang@intel.com>; Wu,
> >> Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>; Gao, Zhichao
> >> <zhichao.gao@intel.com>
> >> Subject: [edk2-devel] [PATCH v1 1/1] RamDiskDxe: Initialize list head
> >> before registering RAM disk protocol
> >>
> >> From: Trammell Hudson <hudson@trmm.net>
> >>
> >> This patch initializes the linked list RegisteredRamDisks in
> >> RamDiskDxeEntryPoint before the registration of
> >> gEfiRamDiskProtocolGuid with InstallMultipleProtocolInterfaces,
> >> allowing ramdisks to be created via a callback installed with
> >> RegisterProtocolNotify as soon as the protocol is registered.
> >>
> >> Without this, calling RamDisk->Register() in the callback causes a crash:
> >>
> >> ASSERT [RamDiskDxe] MdePkg/Library/BaseLib/LinkedList.c(75): List-
> >>> ForwardLink != ((void *) 0)
> >>
> >> Signed-off-by: Trammell Hudson <hudson@trmm.net>
> >> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
> >> Cc: Jian J Wang <jian.j.wang@intel.com>
> >> Cc: Hao A Wu <hao.a.wu@intel.com>
> >> Cc: Ray Ni <ray.ni@intel.com>
> >> Cc: Zhichao Gao <zhichao.gao@intel.com>
> >
> >
> > Thanks a lot for the fix.
> > Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
> >
> > I will modify the subject a little bit when merging:
> > MdeModulePkg/RamDiskDxe: Init list head before registering RamDisk
> > protocol
> 
> Sure, that's good. Thanks!
> 
> >
> > Best Regards,
> > Hao Wu
> >
> >
> >>
> >> ---
> >>   MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c | 11
> ++++++-
> >> ----
> >>   1 file changed, 6 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c
> >> b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c
> >> index fcbf4f117dc6..13e2aed87cef 100644
> >> --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c
> >> +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c
> >> @@ -154,6 +154,12 @@ RamDiskDxeEntryPoint (
> >>       goto ErrorExit;
> >>     }
> >>
> >> +  //
> >> +  // Initialize the list of registered RAM disks maintained by the
> >> + driver  // before installing the protocol  //  InitializeListHead
> >> + (&RegisteredRamDisks);
> >> +
> >>     //
> >>     // Install the EFI_RAM_DISK_PROTOCOL and RAM disk private data onto
> a
> >>     // new handle
> >> @@ -170,11 +176,6 @@ RamDiskDxeEntryPoint (
> >>       goto ErrorExit;
> >>     }
> >>
> >> -  //
> >> -  // Initialize the list of registered RAM disks maintained by the
> >> driver
> >> -  //
> >> -  InitializeListHead (&RegisteredRamDisks);
> >> -
> >>     Status = EfiCreateEventReadyToBootEx (
> >>                TPL_CALLBACK,
> >>                RamDiskAcpiCheck,
> >> --
> >> 2.31.1
> >>
> >>
> >>
> >> 
> >>
> >

      reply	other threads:[~2021-07-14  3:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13  1:09 [PATCH v1 0/1] RamDiskDxe: Initialize list head before registering RAM disk protocol Daniel Schaefer
2021-07-13  1:09 ` [PATCH v1 1/1] " Daniel Schaefer
2021-07-13  3:44   ` [edk2-devel] " Wu, Hao A
2021-07-13  9:30     ` Daniel Schaefer
2021-07-14  3:09       ` Wu, Hao A [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BN8PR11MB3666583041BB4C7D5361192ECA139@BN8PR11MB3666.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox