[Replicant] [libsamsung-ril] [PATCH 21/23] ipc: ipc_rfs_loop: Complete logging

Denis 'GNUtoo' Carikli GNUtoo at cyberdimension.org
Thu Mar 4 12:42:48 UTC 2021


This enables to distinguish different kind of loop failures.

The loop handler comes directly from libsamsung-ipc device
drivers, which in turn wrap the vendor kernel interfaces.

Given that there is some possible variation between the way
that the .loop implementations behaves, it's a good idea to
add prints to understand better what is going on in case of
issues.

With the development of a new set of kernel drivers and
libsamsung-ipc device driver for Replicant 11, we had a
situation where that code was triggered.

Note that, at the time of writing, we are not (yet) aware
of any behavior difference with the different .loop
implementations, but it would be worth checking if they all
behave in the same way.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at cyberdimension.org>
---
 ipc.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/ipc.c b/ipc.c
index e41823f..812926a 100644
--- a/ipc.c
+++ b/ipc.c
@@ -1062,13 +1062,23 @@ int ipc_rfs_loop(struct ril_client *client)
 
 		if (fds.fds[0] == data->event_fd && fds.count > 0) {
 			rc = eventfd_recv(data->event_fd, &event);
-			if (rc < 0)
+			if (rc < 0) {
+				RIL_LOGE("Receiving %s data with eventfd_recv "
+					 "failed with error %d",
+					 client->name, rc);
 				return -1;
+			}
 
 			switch (event) {
 				case IPC_CLIENT_CLOSE:
+					RIL_LOGE("Closing %s due to "
+						 "IPC_CLIENT_CLOSE",
+						 client->name);
 					return 0;
 				case IPC_CLIENT_IO_ERROR:
+					RIL_LOGE("Exiting %s due to "
+						 "IPC_CLIENT_IO_ERROR",
+						 client->name);
 					return -1;
 			}
 		}
-- 
2.30.1



More information about the Replicant mailing list