summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2015-05-13 14:48:35 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-06-08 13:30:31 -0500
commit131fe4ebed0dfd679c30c7f13a218628f1b97d1f (patch)
tree8a162cd11213aaf36b080a90b652c784f3f4f0b9 /src/lib
parent3e271df498c46f0e532052662fe02715d0898bf4 (diff)
downloadtalos-hostboot-131fe4ebed0dfd679c30c7f13a218628f1b97d1f.tar.gz
talos-hostboot-131fe4ebed0dfd679c30c7f13a218628f1b97d1f.zip
Avoid deadlock in cross-node IPC messaging
Move poll for empty queue out of kernel space to allow for the primary thread to see new interrupts and clear out incoming messages. This will prevent 2 nodes from deadlocking one another while they wait for each other to handle the last message that was sent to them. Change-Id: Icbe4e0f621661a37c704b4ac4cdf111664b2039d CQ: SW298667 Backport: release-fips820 Backport: release-fips830 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/17788 Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/syscall_msg.C11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/lib/syscall_msg.C b/src/lib/syscall_msg.C
index 1f9478cc4..e5a63920f 100644
--- a/src/lib/syscall_msg.C
+++ b/src/lib/syscall_msg.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2010,2014 */
+/* Contributors Listed Below - COPYRIGHT 2010,2015 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -121,7 +123,12 @@ msg_t* msg_allocate()
int msg_send(msg_q_t q, msg_t* msg)
{
- return (int64_t)_syscall2(MSG_SEND, q, msg);
+ int64_t rc = 0;
+ do
+ {
+ rc = (int64_t)_syscall2(MSG_SEND, q, msg);
+ } while( rc == -EAGAIN );
+ return rc;
}
int msg_sendrecv(msg_q_t q, msg_t* msg)
OpenPOWER on IntegriCloud