aboutsummaryrefslogtreecommitdiff
path: root/hw/bt.c
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2023-05-13 22:12:25 +1000
committerReza Arbab <arbab@linux.ibm.com>2023-06-06 13:32:12 -0500
commitd2689980a3207508a8737c286ff0ab404bd482bc (patch)
tree4bd22a47cf21996d33e1e5e51924d409abb0937c /hw/bt.c
parent47488feb70d3fea5325174a391451e6e1d0c3cf1 (diff)
downloadskiboot-d2689980a3207508a8737c286ff0ab404bd482bc.zip
skiboot-d2689980a3207508a8737c286ff0ab404bd482bc.tar.gz
skiboot-d2689980a3207508a8737c286ff0ab404bd482bc.tar.bz2
ipmi: flush the ipmi message queue before booting a kernel
Bring ipmi to a consistent state before booting a kernel by flushing all outstanding messages. The OS may not start kicking the IPMI state machine for some time. For example, without this change, when booting in QEMU, the IPMI command issued by ipmi_wdt_final_reset() to disable the watchdog is not sent to the BMC before the OS boots, effectively leaving the watchdog enabled until the OS begins to drive OPAL pollers. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Reviewed-by: Stewart Smith <stewart@flamingspork.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
Diffstat (limited to 'hw/bt.c')
-rw-r--r--hw/bt.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/bt.c b/hw/bt.c
index 5016fea..1912cd3 100644
--- a/hw/bt.c
+++ b/hw/bt.c
@@ -519,9 +519,14 @@ static void bt_poll(struct timer *t __unused, void *data __unused,
bt.irq_ok ? TIMER_POLL : msecs_to_tb(BT_DEFAULT_POLL_MS));
}
-static void bt_ipmi_poll(void)
+static bool bt_ipmi_poll(void)
{
+ if (!lpc_ok())
+ return false;
+
bt_poll(NULL, NULL, mftb());
+
+ return bt.queue_len > 0;
}
static void bt_add_msg(struct bt_msg *bt_msg)