Linux/TransportRpmsg: Shutdown only on MessageQ_E_SHUTDOWN
authorSuman Anna <s-anna@ti.com>
Fri, 1 May 2015 00:23:41 +0000 (19:23 -0500)
committerRobert Tivy <rtivy@ti.com>
Wed, 6 May 2015 23:35:00 +0000 (16:35 -0700)
The transportGet() function returns a specific error code
MessageQ_E_SHUTDOWN to denote that a remote processor has
crashed. Revise the logic in rpmsgThreadFxn to perform the
receive socket cleanup and passing on the message to MessageQ
clients _only_ on this error code. The MessageQ shutdown behavior
was introduced in commit 067ad27 ("Add fault tolerance for
TransportRpmsg socket failure"), and caused the shutdown to
be executed for all other error codes on transportGet() as
well.

Fixes: 067ad27 ("Add fault tolerance for TransportRpmsg socket failure")
Signed-off-by: Suman Anna <s-anna@ti.com>
linux/src/transport/TransportRpmsg.c

index ed3de5e4488aafa917e4d6a7ef5ffd895594c661..fcc6fb6b26bb08362f8d048757bc7fc0cc5dde1b 100644 (file)
@@ -522,7 +522,11 @@ void *rpmsgThreadFxn(void *arg)
 
                 /* transport input fd was signalled: get the message */
                 tmpStatus = transportGet(fd, &retMsg);
 
                 /* transport input fd was signalled: get the message */
                 tmpStatus = transportGet(fd, &retMsg);
-                if (tmpStatus < 0) {
+                if (tmpStatus < 0 && tmpStatus != MessageQ_E_SHUTDOWN) {
+                    printf("rpmsgThreadFxn: transportGet failed on fd %d,"
+                           " returned %d\n", fd, tmpStatus);
+                }
+                else if (tmpStatus == MessageQ_E_SHUTDOWN) {
                     printf("rpmsgThreadFxn: transportGet failed on fd %d,"
                            " returned %d\n", fd, tmpStatus);
 
                     printf("rpmsgThreadFxn: transportGet failed on fd %d,"
                            " returned %d\n", fd, tmpStatus);