diag: Close cmd socket after receiving remove channel
Closing of the cmd socket channel after receiving remove channel
from IPC router is dependent on restart notifier, which can cause
not closing cmd channel client when peripheral is up and channel
will keep using the old server address. The patch closes the
command channel after receiving notification from IPC router
without checking status of peripheral.
Change-Id: I0ce99550d2505731a1659ae57c6c4a166cd5cb48
Signed-off-by: Hardik Arya <harya@codeaurora.org>
diff --git a/drivers/char/diag/diagfwd_socket.c b/drivers/char/diag/diagfwd_socket.c
index 401dbb0f..d7d7366 100644
--- a/drivers/char/diag/diagfwd_socket.c
+++ b/drivers/char/diag/diagfwd_socket.c
@@ -1,4 +1,4 @@
-/* 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
@@ -496,7 +496,8 @@
if (!atomic_read(&info->opened))
return;
- if (bootup_req[info->peripheral] == PEPIPHERAL_SSR_UP) {
+ if ((bootup_req[info->peripheral] == PEPIPHERAL_SSR_UP) &&
+ (info->port_type == PORT_TYPE_SERVER)) {
DIAG_LOG(DIAG_DEBUG_PERIPHERALS,
"diag: %s is up, stopping cleanup: bootup_req = %d\n",
info->name, (int)bootup_req[info->peripheral]);