diff options
author | Andrew Jeffery <andrew@aj.id.au> | 2018-10-09 00:32:30 -0700 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2018-10-10 18:09:26 -0500 |
commit | c0b84547521da5be92eea9e4bef60a1971cca283 (patch) | |
tree | 5eb4a3a793adc9aa17b43dbd6490d256d25ae3ef | |
parent | 3aa5394f4da1ae9c95ab2d061d28b4db8298de20 (diff) | |
download | skiboot-c0b84547521da5be92eea9e4bef60a1971cca283.zip skiboot-c0b84547521da5be92eea9e4bef60a1971cca283.tar.gz skiboot-c0b84547521da5be92eea9e4bef60a1971cca283.tar.bz2 |
core/flash: Unlock around blocklevel calls in NVRAM accessors
This ensures progress when we don't have interrupts available for IPMI.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r-- | core/flash.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/flash.c b/core/flash.c index 15eb744..83c1112 100644 --- a/core/flash.c +++ b/core/flash.c @@ -118,8 +118,13 @@ static int flash_nvram_start_read(void *dst, uint32_t src, uint32_t len) goto out; } + nvram_flash->busy = true; + unlock(&flash_lock); + rc = blocklevel_read(nvram_flash->bl, nvram_offset + src, dst, len); + lock(&flash_lock); + nvram_flash->busy = false; out: unlock(&flash_lock); if (!rc) @@ -147,8 +152,14 @@ static int flash_nvram_write(uint32_t dst, void *src, uint32_t len) rc = OPAL_PARAMETER; goto out; } + + nvram_flash->busy = true; + unlock(&flash_lock); + rc = blocklevel_write(nvram_flash->bl, nvram_offset + dst, src, len); + lock(&flash_lock); + nvram_flash->busy = false; out: unlock(&flash_lock); return rc; |