diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2018-03-26 15:02:44 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2018-03-27 00:42:50 -0500 |
commit | a1c3dcca81cec2755c64b97305a045382b74d2aa (patch) | |
tree | 602e3a059aff3e5c53f476801b0ded2dfb25ae10 /core/nvram.c | |
parent | c32943bfc1e254176ecab564fdb4752403a48cab (diff) | |
download | skiboot-a1c3dcca81cec2755c64b97305a045382b74d2aa.zip skiboot-a1c3dcca81cec2755c64b97305a045382b74d2aa.tar.gz skiboot-a1c3dcca81cec2755c64b97305a045382b74d2aa.tar.bz2 |
nvram: run nvram_validate() after nvram_reformat()
nvram_reformat() sets nvram_valid = true, but it does not set
skiboot_part_hdr. Call nvram_validate() instead, which sets
everything up properly.
Reviewed-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/nvram.c')
-rw-r--r-- | core/nvram.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/nvram.c b/core/nvram.c index de6cbdd..1c3cdfa 100644 --- a/core/nvram.c +++ b/core/nvram.c @@ -69,8 +69,10 @@ opal_call(OPAL_WRITE_NVRAM, opal_write_nvram, 3); bool nvram_validate(void) { - if (!nvram_valid) - nvram_valid = !nvram_check(nvram_image, nvram_size); + if (!nvram_valid) { + if (!nvram_check(nvram_image, nvram_size)) + nvram_valid = true; + } return nvram_valid; } @@ -87,7 +89,7 @@ static void nvram_reformat(void) if (platform.nvram_write) platform.nvram_write(0, nvram_image, nvram_size); - nvram_valid = true; + nvram_validate(); } void nvram_reinit(void) |