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

Commit 9324896e authored by Manoj Prabhu B's avatar Manoj Prabhu B
Browse files

diag: Cleanup control channel status when peripheral goes down



Cleanup control channel status variables after PIL notification
of peripheral going down.

Change-Id: Ic60782cf5d2a843ca1cf40d2e78545616484a6ec
Signed-off-by: default avatarManoj Prabhu B <bmanoj@codeaurora.org>
parent 959e0698
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2019, 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
@@ -1436,9 +1436,6 @@ int diagfwd_channel_close(struct diagfwd_info *fwd_info)
	if (!fwd_info)
		return -EIO;

	if (fwd_info->type == TYPE_CNTL)
		flush_workqueue(driver->cntl_wq);

	mutex_lock(&driver->diagfwd_channel_mutex[fwd_info->peripheral]);
	fwd_info->ch_open = 0;
	if (fwd_info && fwd_info->c_ops && fwd_info->c_ops->close)
+10 −3
Original line number Diff line number Diff line
@@ -504,9 +504,10 @@ static void __socket_close_channel(struct diag_socket_info *info)
		return;
	}

	if (info->type != TYPE_CNTL) {
		memset(&info->remote_addr, 0, sizeof(struct sockaddr_msm_ipc));
		diagfwd_channel_close(info->fwd_ctxt);

	}
	atomic_set(&info->opened, 0);

	/* Don't close the server. Server should always remain open */
@@ -955,6 +956,7 @@ static int restart_notifier_cb(struct notifier_block *this, unsigned long code,
	void *_cmd)
{
	struct restart_notifier_block *notifier;
	struct diag_socket_info *info = NULL;

	notifier = container_of(this,
			struct restart_notifier_block, nb);
@@ -968,6 +970,7 @@ static int restart_notifier_cb(struct notifier_block *this, unsigned long code,
	"%s: ssr for processor %d ('%s')\n",
	__func__, notifier->processor, notifier->name);

	info = &socket_cntl[notifier->processor];
	switch (code) {

	case SUBSYS_BEFORE_SHUTDOWN:
@@ -984,6 +987,10 @@ static int restart_notifier_cb(struct notifier_block *this, unsigned long code,
	case SUBSYS_AFTER_SHUTDOWN:
		DIAG_LOG(DIAG_DEBUG_PERIPHERALS,
		"diag: %s: SUBSYS_AFTER_SHUTDOWN\n", __func__);
		mutex_lock(&driver->diag_notifier_mutex);
		memset(&info->remote_addr, 0, sizeof(struct sockaddr_msm_ipc));
		diagfwd_channel_close(info->fwd_ctxt);
		mutex_unlock(&driver->diag_notifier_mutex);
		break;

	case SUBSYS_BEFORE_POWERUP: