From: "Samer El-Haj-Mahmoud" <samer.el-haj-mahmoud@arm.com>
To: Grzegorz Bernacki <gjb@semihalf.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "leif@nuviainc.com" <leif@nuviainc.com>,
"ardb+tianocore@kernel.org" <ardb+tianocore@kernel.org>,
Sunny Wang <Sunny.Wang@arm.com>,
"mw@semihalf.com" <mw@semihalf.com>,
"upstream@semihalf.com" <upstream@semihalf.com>,
"pete@akeo.ie" <pete@akeo.ie>,
Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Subject: Re: [edk2-platforms PATCH] Platform/RaspberryPi: Check for Boot Discovery Policy change.
Date: Wed, 18 Aug 2021 19:42:22 +0000 [thread overview]
Message-ID: <PAXPR08MB69874C52D8DD27FA1D9FE45290FF9@PAXPR08MB6987.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <20210818073811.3571796-1-gjb@semihalf.com>
Thanks for the patch!
Reviewed-By: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
> -----Original Message-----
> From: Grzegorz Bernacki <gjb@semihalf.com>
> Sent: Wednesday, August 18, 2021 3:38 AM
> To: devel@edk2.groups.io
> Cc: leif@nuviainc.com; ardb+tianocore@kernel.org; Samer El-Haj-Mahmoud
> <Samer.El-Haj-Mahmoud@arm.com>; Sunny Wang
> <Sunny.Wang@arm.com>; mw@semihalf.com; upstream@semihalf.com;
> pete@akeo.ie; Grzegorz Bernacki <gjb@semihalf.com>
> Subject: [edk2-platforms PATCH] Platform/RaspberryPi: Check for Boot
> Discovery Policy change.
>
> This patch adds checks if Boot Discovery Policy has been
> changed. Only in that case EfiBootManagerRefreshAllBootOption()
> should be called.
>
> Signed-off-by: Grzegorz Bernacki <gjb@semihalf.com>
> ---
> Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c | 24
> +++++++++++++++++++-
> 1 file changed, 23 insertions(+), 1 deletion(-)
>
> diff --git
> a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c
> b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c
> index c8305ce4f5..378ba0ebf4 100644
> --- a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c
> +++ b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c
> @@ -617,6 +617,7 @@ BootDiscoveryPolicyHandler (
> {
> EFI_STATUS Status;
> UINT32 DiscoveryPolicy;
> + UINT32 DiscoveryPolicyOld;
> UINTN Size;
> EFI_BOOT_MANAGER_POLICY_PROTOCOL *BMPolicy;
> EFI_GUID *Class;
> @@ -678,7 +679,28 @@ BootDiscoveryPolicyHandler (
> return Status;
> }
>
> - EfiBootManagerRefreshAllBootOption();
> + //
> + // Refresh Boot Options if Boot Discovery Policy has been changed
> + //
> + Size = sizeof (DiscoveryPolicyOld);
> + Status = gRT->GetVariable (
> + BOOT_DISCOVERY_POLICY_OLD_VAR,
> + &gBootDiscoveryPolicyMgrFormsetGuid,
> + NULL,
> + &Size,
> + &DiscoveryPolicyOld
> + );
> + if ((Status == EFI_NOT_FOUND) || (DiscoveryPolicyOld != DiscoveryPolicy))
> {
> + EfiBootManagerRefreshAllBootOption();
> +
> + Status = gRT->SetVariable (
> + BOOT_DISCOVERY_POLICY_OLD_VAR,
> + &gBootDiscoveryPolicyMgrFormsetGuid,
> + EFI_VARIABLE_NON_VOLATILE |
> EFI_VARIABLE_BOOTSERVICE_ACCESS,
> + sizeof (DiscoveryPolicyOld),
> + &DiscoveryPolicy
> + );
> + }
>
> return EFI_SUCCESS;
> }
> --
> 2.25.1
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
next prev parent reply other threads:[~2021-08-18 19:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-18 7:38 [edk2-platforms PATCH] Platform/RaspberryPi: Check for Boot Discovery Policy change Grzegorz Bernacki
2021-08-18 19:42 ` Samer El-Haj-Mahmoud [this message]
2021-08-22 21:23 ` [edk2-devel] " Mario Bălănică
2021-08-31 12:11 ` Ard Biesheuvel
2021-09-01 8:45 ` Grzegorz Bernacki
2021-09-01 8:48 ` Ard Biesheuvel
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=PAXPR08MB69874C52D8DD27FA1D9FE45290FF9@PAXPR08MB6987.eurprd08.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