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

Commit dee6cdb0 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "diag: Do not close the server in case for peripheral restart"

parents 11ed542d ef4ecee0
Loading
Loading
Loading
Loading
+12 −13
Original line number Diff line number Diff line
@@ -442,6 +442,9 @@ static void __socket_close_channel(struct diag_socket_info *info)
	diagfwd_channel_close(info->fwd_ctxt);

	atomic_set(&info->opened, 0);

	/* Don't close the server. Server should always remain open */
	if (info->port_type != PORT_TYPE_SERVER) {
		write_lock_bh(&info->hdl->sk->sk_callback_lock);
		info->hdl->sk->sk_user_data = NULL;
		info->hdl->sk->sk_data_ready = NULL;
@@ -449,6 +452,7 @@ static void __socket_close_channel(struct diag_socket_info *info)
		sock_release(info->hdl);
		info->hdl = NULL;
		wake_up(&info->read_wait_q);
	}
	DIAG_LOG(DIAG_DEBUG_PERIPHERALS, "%s exiting\n", info->name);

	return;
@@ -460,12 +464,7 @@ static void socket_close_channel(struct diag_socket_info *info)
		return;

	__socket_close_channel(info);
	/*
	 * Open the servers again after closing. The servers must always be
	 * active.
	 */
	if (info->port_type == PORT_TYPE_SERVER)
		socket_open_server(info);

	DIAG_LOG(DIAG_DEBUG_PERIPHERALS, "%s exiting\n", info->name);
}