diff options
author | Laszlo Ersek <lersek@redhat.com> | 2018-04-11 22:18:24 +0200 |
---|---|---|
committer | Laszlo Ersek <lersek@redhat.com> | 2018-04-12 21:24:32 +0200 |
commit | 0f87c53d0d0eb7e7c003e209705ec79264e0852b (patch) | |
tree | 7b3d07bf4d0b37fd2c9ad858f6ae39a47f753caf /BaseTools/Source/Python/CommonDataClass/Exceptions.py | |
parent | 7ab26d51808bd4ffab2510091b062a91cf6a8c81 (diff) | |
download | edk2-0f87c53d0d0eb7e7c003e209705ec79264e0852b.tar.gz edk2-0f87c53d0d0eb7e7c003e209705ec79264e0852b.tar.bz2 edk2-0f87c53d0d0eb7e7c003e209705ec79264e0852b.zip |
ArmPlatformPkg/NorFlashDxe: initialize varstore headers eagerly
The lazy initialization of the varstore FVB makes no longer sense at this
point:
- "mNorFlashInstanceTemplate.Initialize" is NULL;
- in NorFlashCreateInstance(), we only set Instance->Initialize to
non-NULL -- namely NorFlashFvbInitialize() -- if the FVB stands for the
variable store (see "ContainVariableStorage" / "SupportFvb");
- we call Instance->Initialize() from three places:
- from NorFlashWriteSingleBlock(), which is too late for the variable
read service ("variable write" depends on "variable read");
- from InitializeFvAndVariableStoreHeaders(), but that is only reachable
from NorFlashFvbInitialize(), i.e. recursively from
Instance->Initialize() itself;
- and from FvbRead(), which is never called by the variable driver, only
by the FTW driver. However, the variable driver may read (not write)
the memory-mapped varstore flash chip before the FTW driver is
dispatched.
Therefore the lazy initialization is both superfluous and insufficient.
Initialize the varstore headers eagerly, before we install the FVB
protocol interface.
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Steve Capper <steve.capper@linaro.org>
Cc: Supreeth Venkatesh <Supreeth.Venkatesh@arm.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Steve Capper <steve.capper@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'BaseTools/Source/Python/CommonDataClass/Exceptions.py')
0 files changed, 0 insertions, 0 deletions