diff options
author | Andrew Jeffery <andrew@aj.id.au> | 2019-11-28 16:37:42 +1030 |
---|---|---|
committer | Oliver O'Halloran <oohall@gmail.com> | 2019-12-04 14:19:21 +1100 |
commit | 7853fc53cfccc20e7cca0b0bf18c5e84cd5d306c (patch) | |
tree | 5347ab5d1de8c1ac8beb30a828ff9aceff303643 | |
parent | dc85bd46d20db4d878216283f818573cb0c8c05b (diff) | |
download | skiboot-7853fc53cfccc20e7cca0b0bf18c5e84cd5d306c.zip skiboot-7853fc53cfccc20e7cca0b0bf18c5e84cd5d306c.tar.gz skiboot-7853fc53cfccc20e7cca0b0bf18c5e84cd5d306c.tar.bz2 |
libflash: ipmi-hiomap: Document error handling strategy in write path
Reads explicitly validate window state after the LPC operations have
completed, but this is not necessary in the write path. Explicitly
document the behaviour to make the implicit behaviour clear to future
readers.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
-rw-r--r-- | libflash/ipmi-hiomap.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libflash/ipmi-hiomap.c b/libflash/ipmi-hiomap.c index 7327b83..0328101 100644 --- a/libflash/ipmi-hiomap.c +++ b/libflash/ipmi-hiomap.c @@ -810,6 +810,15 @@ static int ipmi_hiomap_write(struct blocklevel_device *bl, uint64_t pos, if (rc) return rc; + /* + * Unlike ipmi_hiomap_read() we don't explicitly test if the + * window is still valid after completing the LPC accesses as + * the following hiomap_mark_dirty() will implicitly check for + * us. In the case of a read operation there's no requirement + * that a command that validates window state follows, so the + * read implementation explicitly performs a check. + */ + rc = hiomap_mark_dirty(ctx, pos, size); if (rc) return rc; |