From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-x236.google.com (mail-wr0-x236.google.com [IPv6:2a00:1450:400c:c0c::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 213498029F for ; Thu, 9 Mar 2017 08:31:24 -0800 (PST) Received: by mail-wr0-x236.google.com with SMTP id g10so48667191wrg.2 for ; Thu, 09 Mar 2017 08:31:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=PxRkR39OH5nT18lznTquaJy6JW0BUJ4SYlOv+FDaSGE=; b=eOsHTMGhCYoewjEhVl3V1hAEg9WSwh6QG2c4o9oR9KF5zUV9U8JoAhROO1NfBVYDuB r9oeRhIO2u5cPdNDMnkGZn/A7r5fwntQmWrwCJ+Ub4jn6XaOGQo2JLQyPpz75Jyf0obV 1zBiM/J9TR5HP56/kcmxn+QqAkR0jSOIixxL8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=PxRkR39OH5nT18lznTquaJy6JW0BUJ4SYlOv+FDaSGE=; b=KkvwVfQ8kdOkezFsiRbmLrjq7NQEaZq41FDCcG5zAaa+JIFAKJFSQvlGRtpGcSqXh2 ql8xubCWU8zo7fFFIzcf3Z/M1dhzig5ON9KtchkkaVn5wCHjYU+In+/sl5WL+naQ6cZE Tp4v+PbGhZx1mR02kh3c6cqNyvpv+/o33/kazT6yrmHeHSCJX8hI/NaOP7LboyhVHsNq P/gyaHmZZ6JbQQUayf2DL8wye2ILEsm6/bZqLCj9i0pHQEMUf6DraWWgCaup8a8XlN7K cZkis8eGXsorDJd7WhZA/bJMMraVl53S8xOVwVh+TlL6U8LzsjV/CP5A5EaDHkUq0Jj9 hNOw== X-Gm-Message-State: AMke39nKxwI37x0+qDq/iKLEigKw/XVVAjV+aGV/9YJ/2R7zwDA+Y0anUoHRZqgpekmSntXD X-Received: by 10.223.135.85 with SMTP id 21mr11503967wrz.93.1489077082295; Thu, 09 Mar 2017 08:31:22 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id m83sm27823323wmc.33.2017.03.09.08.31.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Mar 2017 08:31:21 -0800 (PST) Date: Thu, 9 Mar 2017 16:31:20 +0000 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org, lersek@redhat.com, drjones@redhat.com Message-ID: <20170309163120.GG16034@bivouac.eciton.net> References: <1489075441-23745-1-git-send-email-ard.biesheuvel@linaro.org> <1489075441-23745-3-git-send-email-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <1489075441-23745-3-git-send-email-ard.biesheuvel@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [PATCH 2/3] ArmVirtPkg/FdtClientDxe: install DT configuration table at ReadyToBoot X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Mar 2017 16:31:24 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 > --- > 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 > + 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 >