[Skiboot] [PATCH] libflash: ipmi-hiomap: Document error handling strategy in write path

Andrew Jeffery andrew at aj.id.au
Thu Nov 28 17:07:42 AEDT 2019


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 at aj.id.au>
---
 libflash/ipmi-hiomap.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libflash/ipmi-hiomap.c b/libflash/ipmi-hiomap.c
index 7327b83a320c..0328101c69d6 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;
-- 
2.20.1



More information about the Skiboot mailing list