diff options
author | Stewart Smith <stewart@linux.ibm.com> | 2019-05-01 17:05:56 +1000 |
---|---|---|
committer | Oliver O'Halloran <oohall@gmail.com> | 2019-05-09 15:06:39 +1000 |
commit | f01cd777adb16cbab93215d26159aa1c4606112c (patch) | |
tree | de841e5f2ddf3543003d34f5f4297bddc2b05a7b /hw/bt.c | |
parent | 22057f868f3b2b1fd02647a738f6da0858b5eb6c (diff) | |
download | skiboot-f01cd777adb16cbab93215d26159aa1c4606112c.zip skiboot-f01cd777adb16cbab93215d26159aa1c4606112c.tar.gz skiboot-f01cd777adb16cbab93215d26159aa1c4606112c.tar.bz2 |
ipmi: ensure forward progress on ipmi_queue_msg_sync()
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.
We can't just check all timers though as there may be a timer that
wants a lock that's held by a code path calling ipmi_queue_msg_sync(),
and if we did enforce that as a requirement, it's a pretty subtle
API that is asking to be broken.
So, if we just run a poll function to crank anything that the IPMI
backend needs, then we should be fine.
This issue shows up very quickly under QEMU when loading the first
flash resource with the IPMI HIOMAP backend.
Reported-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'hw/bt.c')
-rw-r--r-- | hw/bt.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -526,6 +526,11 @@ 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) +{ + bt_poll(NULL, NULL, mftb()); +} + static void bt_add_msg(struct bt_msg *bt_msg) { bt_msg->tb = 0; @@ -647,6 +652,7 @@ static struct ipmi_backend bt_backend = { .queue_msg_head = bt_add_ipmi_msg_head, .dequeue_msg = bt_del_ipmi_msg, .disable_retry = bt_disable_ipmi_msg_retry, + .poll = bt_ipmi_poll, }; static struct lpc_client bt_lpc_client = { |