Message ID | 20180925040635.5233-5-andrew@aj.id.au |
---|---|
State | Superseded |
Headers | show |
Series | Add and integrate an IPMI flash implementation | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/apply_patch | success | master/apply_patch Successfully applied |
Andrew Jeffery <andrew@aj.id.au> writes: > This ensures progress when we don't have interrupts available for > IPMI. I gather this is because we end up not running pollers because we have locks held? I wonder how we should document such calls, it's a semi decent gotcha I guess.
On Sat, 6 Oct 2018, at 20:09, Stewart Smith wrote: > Andrew Jeffery <andrew@aj.id.au> writes: > > This ensures progress when we don't have interrupts available for > > IPMI. > > I gather this is because we end up not running pollers because we have > locks held? Yep. > I wonder how we should document such calls, it's a semi > decent gotcha I guess. It's a whole lot less annoying to debug with the try_lock_caller() fix :) But yeah, a semi-decent gotcha. Not sure how often people will run into it though? I feel like if they do they're probably well equipped enough to debug it. Andrew
diff --git a/core/flash.c b/core/flash.c index 15eb7443faac..83c1112636e6 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;
This ensures progress when we don't have interrupts available for IPMI. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> --- core/flash.c | 11 +++++++++++ 1 file changed, 11 insertions(+)