[Skiboot] [PATCH 1/4] libflash/ipmi-hiomap: Improve event handling
Andrew Jeffery
andrew at aj.id.au
Thu Nov 1 23:47:24 AEDT 2018
The host firmware side of the hiomap protocol has two input sources:
1. Requests to adjust the flash mappings from itself or the kernel
2. State change events received from the BMC
The handling of BMC state change events (2.) is asynchronous in two ways:
a. The BMC pushes the state change event to the host, which is recorded
but not acted on
b. When handling requests to adjust the flash mapping, skiboot first
addresses any new BMC state changes before servicing the mapping
request
Further, the hiomap protocol sends a mix of ackable and stateful events,
where ackable events are only relevant until skiboot's hiomap event
handler (b. above) cleans them up, whereas stateful events persist until
the BMC provides a subsequent state change event.
As we handle the ackable events asynchronous to receiving notification
(b. vs a. above), OR in the received event state rather than directly
assign to ensure we don't lose events that we must not miss. As an
example, without the OR we may lose ackable events if the daemon
restarts and pushes a new state change event during initialisation,
which will necessarily bear no relation to the previous state change
event value.
Similarly, don't close active windows in a. based on the event content,
as we need the window type information to handle state restoration in b.
Signed-off-by: Andrew Jeffery <andrew at aj.id.au>
---
libflash/ipmi-hiomap.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/libflash/ipmi-hiomap.c b/libflash/ipmi-hiomap.c
index 95c49b3203f3..2d49443163eb 100644
--- a/libflash/ipmi-hiomap.c
+++ b/libflash/ipmi-hiomap.c
@@ -469,12 +469,11 @@ static void hiomap_event(uint8_t events, void *context)
{
struct ipmi_hiomap *ctx = context;
+ prlog(PR_DEBUG, "Received events: 0x%x\n", events);
+
lock(&ctx->lock);
- ctx->bmc_state = events;
+ ctx->bmc_state |= events;
ctx->update = true;
-
- if (events & (HIOMAP_E_PROTOCOL_RESET | HIOMAP_E_WINDOW_RESET))
- ctx->window_state = closed_window;
unlock(&ctx->lock);
}
--
2.19.1
More information about the Skiboot
mailing list