summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSreelakshmi Gownipalli <sgownipa@codeaurora.org>2016-12-19 23:31:05 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-02-03 14:43:16 -0800
commit837039b26f2dfe27985a62600851fd75981d3850 (patch)
treef279e3139ce2b1aad1149a86d5a0676e2c274fe8
parent147b2394be6d487f75445ed84794b60c4dc8cfc8 (diff)
diag: Do not close MHI channels when usb is disconnected
Do not close MHI channels when usb is disconnected and a process is running in memory device mode. Change-Id: I043fc25542e432a9fa294d4f433945718b2e5878 Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
-rw-r--r--drivers/char/diag/diagfwd_bridge.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/char/diag/diagfwd_bridge.c b/drivers/char/diag/diagfwd_bridge.c
index 0462a64614f3..3342984eb795 100644
--- a/drivers/char/diag/diagfwd_bridge.c
+++ b/drivers/char/diag/diagfwd_bridge.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2017, 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
@@ -90,6 +90,18 @@ static int diagfwd_bridge_mux_disconnect(int id, int mode)
{
if (id < 0 || id >= NUM_REMOTE_DEV)
return -EINVAL;
+
+ if ((mode == DIAG_USB_MODE &&
+ driver->logging_mode == DIAG_MEMORY_DEVICE_MODE) ||
+ (mode == DIAG_MEMORY_DEVICE_MODE &&
+ driver->logging_mode == DIAG_USB_MODE)) {
+ /*
+ * Don't close the MHI channels when usb is disconnected
+ * and a process is running in memory device mode.
+ */
+ return 0;
+ }
+
if (bridge_info[id].dev_ops && bridge_info[id].dev_ops->close)
bridge_info[id].dev_ops->close(bridge_info[id].ctxt);
return 0;