]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - rpmsg/rpmsg.git/commit
net/rpmsg: unblock reader threads operating on errored sockets
authorSuman Anna <s-anna@ti.com>
Mon, 4 Mar 2019 21:00:35 +0000 (15:00 -0600)
committerSuman Anna <s-anna@ti.com>
Sat, 22 Feb 2020 06:54:32 +0000 (00:54 -0600)
commitfdffa8ccb8f1605937d359a088b896158eaa8ab2
tree35ca5b3d120db47ab3ebbdedc38f5d2dd24adb5f
parentf798b9b8eec35af37ba79dd4e6be6c456fd49737
net/rpmsg: unblock reader threads operating on errored sockets

The rpmsg_proto driver is used to provide a socket interface
to userspace under the AF_RPMSG address family, and is used
by the TI IPC MessageQ stack. The typical usage for receiving
messages include a thread blocked on a select() call with
appropriate socket fds, followed by a recvfrom() on the fd
returned/marked ready by select().

The rpmsg_sock_poll() function implements the logic needed
by the select() call, and marks a socket ready only when there
is data to be read currently. Any reader thread waiting on the
select() call to return is currently not unblocked when a remote
processor goes through an error recovery, and can remain blocked
forever as its remote processor peer thread may never send it
another message. Enhance the rpmsg_proto driver so that a waiting
thread can be unblocked by waking it up during the process of
marking the open sockets with the error status RPMSG_ERROR. This
is achieved by using the socket's .sk_error_report() ops, and is
preferred over the .sk_state_change() ops to wakeup only a single
exclusive thread.

Signed-off-by: Suman Anna <s-anna@ti.com>
net/rpmsg/rpmsg_proto.c