From: Leif Lindholm <leif.lindholm@linaro.org>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: edk2-devel@lists.01.org, lersek@redhat.com, drjones@redhat.com
Subject: Re: [PATCH 2/3] ArmVirtPkg/FdtClientDxe: install DT configuration table at ReadyToBoot
Date: Thu, 9 Mar 2017 16:31:20 +0000 [thread overview]
Message-ID: <20170309163120.GG16034@bivouac.eciton.net> (raw)
In-Reply-To: <1489075441-23745-3-git-send-email-ard.biesheuvel@linaro.org>
On Thu, Mar 09, 2017 at 05:04:00PM +0100, Ard Biesheuvel wrote:
> Wait for ReadyToBoot to install the FDT configuration table. This allows
Semantic nitpicking: "Wait for" sounds a little like a delay.
"Defer FDT configuration table installation until ReadyToBoot is
signaled."?
Fold in if you agree that's an improvement.
> any driver to make modifications in the mean time, and will also allow us
> to defer the decision of whether to install it in the first place to later
> on in the boot.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
> ArmVirtPkg/FdtClientDxe/FdtClientDxe.c | 41 ++++++++++++++++----
> ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf | 1 +
> 2 files changed, 34 insertions(+), 8 deletions(-)
>
> diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c
> index 7cc0c44ca12a..0327af5739f2 100644
> --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c
> +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c
> @@ -303,6 +303,30 @@ STATIC FDT_CLIENT_PROTOCOL mFdtClientProtocol = {
> GetOrInsertChosenNode,
> };
>
> +STATIC
> +VOID
> +EFIAPI
> +OnReadyToBoot (
> + EFI_EVENT Event,
> + VOID *Context
> + )
> +{
> + EFI_STATUS Status;
> +
> + if (!FeaturePcdGet (PcdPureAcpiBoot)) {
> + //
> + // Only install the FDT as a configuration table if we want to leave it up
> + // to the OS to decide whether it prefers ACPI over DT.
> + //
I was going to complain about how it felt pointless to introduce this
only to delete it in 2/3, but I really like how it improves the
clarity of 3/3.
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
> + Status = gBS->InstallConfigurationTable (&gFdtTableGuid, mDeviceTreeBase);
> + ASSERT_EFI_ERROR (Status);
> + }
> +
> + gBS->CloseEvent (Event);
> +}
> +
> +STATIC EFI_EVENT ReadyToBootEvent;
> +
> EFI_STATUS
> EFIAPI
> InitializeFdtClientDxe (
> @@ -330,14 +354,15 @@ InitializeFdtClientDxe (
>
> DEBUG ((EFI_D_INFO, "%a: DTB @ 0x%p\n", __FUNCTION__, mDeviceTreeBase));
>
> - if (!FeaturePcdGet (PcdPureAcpiBoot)) {
> - //
> - // Only install the FDT as a configuration table if we want to leave it up
> - // to the OS to decide whether it prefers ACPI over DT.
> - //
> - Status = gBS->InstallConfigurationTable (&gFdtTableGuid, DeviceTreeBase);
> - ASSERT_EFI_ERROR (Status);
> - }
> + Status = gBS->CreateEventEx (
> + EVT_NOTIFY_SIGNAL,
> + TPL_CALLBACK,
> + OnReadyToBoot,
> + NULL,
> + &gEfiEventReadyToBootGuid,
> + &ReadyToBootEvent
> + );
> + ASSERT_EFI_ERROR (Status);
>
> return gBS->InstallProtocolInterface (&ImageHandle, &gFdtClientProtocolGuid,
> EFI_NATIVE_INTERFACE, &mFdtClientProtocol);
> diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
> index 3a0cd37040eb..00017727c32c 100644
> --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
> +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
> @@ -42,6 +42,7 @@ [Protocols]
> gFdtClientProtocolGuid ## PRODUCES
>
> [Guids]
> + gEfiEventReadyToBootGuid
> gFdtHobGuid
> gFdtTableGuid
>
> --
> 2.7.4
>
next prev parent reply other threads:[~2017-03-09 16:31 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-09 16:03 [PATCH 0/3] ArmVirtQemu: make DT vs ACPI support mutually exclusive Ard Biesheuvel
2017-03-09 16:03 ` [PATCH 1/3] ArmVirtPkg/ArmVirtPL031FdtClientLib: unconditionally disable DT node Ard Biesheuvel
2017-03-09 16:25 ` Leif Lindholm
2017-03-09 16:51 ` Laszlo Ersek
2017-03-09 16:04 ` [PATCH 2/3] ArmVirtPkg/FdtClientDxe: install DT configuration table at ReadyToBoot Ard Biesheuvel
2017-03-09 16:31 ` Leif Lindholm [this message]
2017-03-09 16:55 ` Laszlo Ersek
2017-03-09 16:04 ` [PATCH 3/3] ArmVirtPkg/FdtClientDxe: make DT table installation !ACPI dependent Ard Biesheuvel
2017-03-09 16:33 ` Leif Lindholm
2017-03-09 17:07 ` Laszlo Ersek
2017-03-11 5:55 ` Laszlo Ersek
2017-03-11 6:57 ` Ard Biesheuvel
2017-03-11 7:38 ` Laszlo Ersek
2017-03-11 10:26 ` Leif Lindholm
2017-03-13 10:23 ` Ard Biesheuvel
2017-03-13 14:53 ` Laszlo Ersek
2017-03-13 14:59 ` Ard Biesheuvel
2017-03-13 20:39 ` Laszlo Ersek
2017-03-13 20:55 ` Laszlo Ersek
2017-03-13 20:55 ` Ard Biesheuvel
2017-03-11 7:21 ` Laszlo Ersek
2017-03-11 7:30 ` Ard Biesheuvel
2017-03-11 7:41 ` Laszlo Ersek
2017-03-11 9:19 ` Ard Biesheuvel
2017-03-11 10:06 ` Laszlo Ersek
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=20170309163120.GG16034@bivouac.eciton.net \
--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