Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72cd412f authored by Arun Prakash's avatar Arun Prakash
Browse files

net: ipc_router: Fix for system hang during graceful shutdown



During the graceful shutdown(using reboot command)
qmi client will get the remove server message
and client will release the handle. Immediately
after release client will lookup for service
and it is succeeding. So client will try to
communicate with service and hit on error callback.
Again same process will continue which blocks the
graceful shutdown.

The issue is due to server blocked on mutex to get the
access to send data over usb to remote processor. The
mutex is acquired by other service and blocked on USB
write API which will cause shutdown failure. So this 
is workaround which will help to resolve the issue or
reduce the frequency of issue. This need to be reverted
once real fix identified.

Change-Id: I927987b2cc4b4717ff4f709fcd0b7e228a9cf5cd
Signed-off-by: default avatarArun Prakash <app@codeaurora.org>
parent 6cd3a25c
Loading
Loading
Loading
Loading
+13 −10
Original line number Diff line number Diff line
@@ -3572,16 +3572,6 @@ int msm_ipc_router_close_port(struct msm_ipc_port *port_ptr)
			ipc_router_destroy_rport(rport_ptr);
		}

		if (port_ptr->type == SERVER_PORT) {
			memset(&msg, 0, sizeof(msg));
			msg.cmd = IPC_ROUTER_CTRL_CMD_REMOVE_SERVER;
			msg.srv.service = port_ptr->port_name.service;
			msg.srv.instance = port_ptr->port_name.instance;
			msg.srv.node_id = port_ptr->this_port.node_id;
			msg.srv.port_id = port_ptr->this_port.port_id;
			broadcast_ctl_msg(&msg);
		}

		/* Server port could have been a client port earlier.
		 * Send REMOVE_CLIENT message in either case.
		 */
@@ -3611,6 +3601,19 @@ int msm_ipc_router_close_port(struct msm_ipc_port *port_ptr)
						  port_ptr->this_port.node_id,
						  port_ptr->this_port.port_id);
		}
		/**
		 * released server information from hash table, now
		 * it is safe to broadcast remove server message so that
		 * next call to lookup server will not succeed until
		 * server open the port again
		 */
		memset(&msg, 0, sizeof(msg));
		msg.cmd = IPC_ROUTER_CTRL_CMD_REMOVE_SERVER;
		msg.srv.service = port_ptr->port_name.service;
		msg.srv.instance = port_ptr->port_name.instance;
		msg.srv.node_id = port_ptr->this_port.node_id;
		msg.srv.port_id = port_ptr->this_port.port_id;
		broadcast_ctl_msg(&msg);
	}

	mutex_lock(&port_ptr->port_lock_lhc3);