diff options
author | Alistair Popple <alistair@popple.id.au> | 2015-02-19 15:37:37 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-02-19 15:52:30 +1100 |
commit | 6b968dd2977f615eaa434706bd8669f39ec95dec (patch) | |
tree | 90cd5a1de004cdce64be68d2af98b1aea4185afb | |
parent | c5375d0870086e1bd65c9b6845c83934b8299eab (diff) | |
download | skiboot-6b968dd2977f615eaa434706bd8669f39ec95dec.zip skiboot-6b968dd2977f615eaa434706bd8669f39ec95dec.tar.gz skiboot-6b968dd2977f615eaa434706bd8669f39ec95dec.tar.bz2 |
ipmi: Fix locking for synchronous message sending
Skiboot now doesn't run the running pollers while holding a lock to
avoid dead-locks. The current implementation of ipmi_queue_msg_sync()
does exactly that while it waits for the pollers to be called.
This patch fixes the problem by releasing the lock prior to calling
the pollers.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | core/ipmi.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/core/ipmi.c b/core/ipmi.c index 39997f6..6c1179f 100644 --- a/core/ipmi.c +++ b/core/ipmi.c @@ -126,15 +126,13 @@ void ipmi_cmd_done(uint8_t cmd, uint8_t netfn, uint8_t cc, struct ipmi_msg *msg) void ipmi_queue_msg_sync(struct ipmi_msg *msg) { lock(&sync_lock); - - assert(!sync_msg); + while (sync_msg); sync_msg = msg; ipmi_queue_msg(msg); + unlock(&sync_lock); - while (sync_msg) + while (sync_msg == msg) time_wait_ms(100); - - unlock(&sync_lock); } static void ipmi_read_event_complete(struct ipmi_msg *msg) |