From 9858186353f2203fe477f316964e03609d12fd1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Date: Thu, 4 Apr 2019 15:47:29 +0200 Subject: ipmi: call check_timers() while waiting for synchronous messages to complete MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BT responses are handled using a timer doing the polling. To hope to get an answer to an IPMI synchronous message, the timer needs to run. This issue shows up very quickly under QEMU when loading the first flash resource with the IPMI HIOMAP backend. Adding a timeout would also help in reporting errors instead of looping indefinitely waiting for a response. Signed-off-by: Cédric Le Goater --- core/ipmi.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/ipmi.c b/core/ipmi.c index 2bf3f4da..78b410fd 100644 --- a/core/ipmi.c +++ b/core/ipmi.c @@ -182,8 +182,16 @@ void ipmi_queue_msg_sync(struct ipmi_msg *msg) ipmi_queue_msg_head(msg); unlock(&sync_lock); - while (sync_msg == msg) + /* + * BT response handling relies on a timer. Run timers once in + * a while. + * + * TODO (clg): implement a timeout for IPMI synchronous messages + */ + while (sync_msg == msg) { + check_timers(0); time_wait_ms(10); + } } static void ipmi_read_event_complete(struct ipmi_msg *msg) -- cgit v1.2.1