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

Commit 8c8dd7a3 authored by Arun Prakash's avatar Arun Prakash
Browse files

net: ipc_router: Handling msm ssr scenario



Ipc router core won't forward client/service remove
control messages behalf of remote end in case of msm
ssr as ipc router not registering the remote port
information if ports are not intended to communicate
with local host. Which will keep the client/service
information on modem even after msm ssr and will cause
communication error after msm reboot.

Saving remote port reference in message forward path
will solve this issue as ipc router using this remote
port entry table to cleanup client/service during ssr.

Change-Id: I068445319b0b52640439476c9413c331a66b5675
Signed-off-by: default avatarArun Prakash <app@codeaurora.org>
parent 022f44a6
Loading
Loading
Loading
Loading
+28 −1
Original line number Diff line number Diff line
/* Copyright (c) 2011-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -2793,6 +2793,33 @@ static void do_read_data(struct kthread_work *work)
				     hdr->control_flag, hdr->src_node_id,
				     hdr->src_port_id, hdr->dst_node_id,
				     hdr->dst_port_id);
			/**
			 * update forwarding port information as well in routing
			 * table which will help to cleanup clients/services
			 * running in modem when MSM goes down
			 */
			rport_ptr = ipc_router_get_rport_ref(hdr->src_node_id,
							     hdr->src_port_id);
			if (!rport_ptr) {
				rport_ptr =
				ipc_router_create_rport(hdr->src_node_id,
							hdr->src_port_id,
							xprt_info);
				if (!rport_ptr) {
					IPC_RTR_ERR(
					"%s: Rmt Prt %08x:%08x create failed\n",
					__func__, hdr->src_node_id,
					hdr->src_port_id);
				}
			}
			/**
			 * just to fail safe check is added, if rport
			 * allocation failed above we still forward the
			 * packet to remote.
			 */
			if (rport_ptr)
				kref_put(&rport_ptr->ref,
					 ipc_router_release_rport);
			forward_msg(xprt_info, pkt);
			goto read_next_pkt1;
		}