diff options
author | Sunny Wang <Sunny.Wang@arm.com> | 2021-07-23 17:01:01 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-07-29 10:13:32 +0000 |
commit | 8e6bb64fe43e5be7bf3becfbc5dbcdc90ab6425c (patch) | |
tree | bec199a5e67708ac8827dd296d98243ef2349a11 /Conf | |
parent | 514b3aa08ece52140b769a8676595655691c7cb3 (diff) | |
download | edk2-8e6bb64fe43e5be7bf3becfbc5dbcdc90ab6425c.tar.gz |
EmbeddedPkg/VirtualRealTimeClockLib: Fix SetTime issues
This patch fixes two issues below:
1. SCT SetTime_Func failures.
- https://github.com/pftf/RPi4/issues/164
2. Using shell time and date commands to set time can't work.
The problem is that gRT->SetTime always returns EFI_INVALID_PARAMETER
error status.
The root cause is that LibSetTime() sets RtcEpochSeconds variable with
inconsistent attributes. One is without EFI_VARIABLE_NON_VOLATILE,
the other one is with EFI_VARIABLE_NON_VOLATILE. That caused that the
variable driver returns EFI_INVALID_PARAMETER. Per UEFI spec, if a
preexisting variable is rewritten with different attributes,
SetVariable() shall not modify the variable and shall return
EFI_INVALID_PARAMETER.
Therefore, the solution is to add EFI_VARIABLE_NON_VOLATILE attribute
to the first EfiSetVariable() call to make two calls consistent.
By the way, this patch also fix a minor issue with a debug message.
Signed-off-by: Sunny Wang <sunny.wang@arm.com>
Reviewed-by: Pete Batard <pete@akeo.ie>
Tested-by: Pete Batard <pete@akeo.ie>
Diffstat (limited to 'Conf')
0 files changed, 0 insertions, 0 deletions