summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohit Aggarwal <maggarwa@codeaurora.org>2017-07-24 14:03:56 +0530
committerMohit Aggarwal <maggarwa@codeaurora.org>2017-07-27 14:10:04 +0530
commitbf74f23874703cd423f38621ee14bb78a00a939f (patch)
tree9c0e1fc656047baf2b2e467a930af5eeef3677ab
parent9023a992a898bf03eccc0c1bab50093259181557 (diff)
diag: Flush control workqueue immediately on channel close
Currently, flushing of control workqueue is happening under protection which is causing a deadlock. The patch fixes the issue by flushing the control workqueue on immediate closure of channel. CRs-Fixed: 2081948 Change-Id: I6a7b1ee7cbabf2974700e28fc62c6d8fa3d464ed Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
-rw-r--r--drivers/char/diag/diagfwd_cntl.c1
-rw-r--r--drivers/char/diag/diagfwd_peripheral.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/char/diag/diagfwd_cntl.c b/drivers/char/diag/diagfwd_cntl.c
index 4ae2158b5a6b..74777212e4cf 100644
--- a/drivers/char/diag/diagfwd_cntl.c
+++ b/drivers/char/diag/diagfwd_cntl.c
@@ -67,7 +67,6 @@ void diag_cntl_channel_close(struct diagfwd_info *p_info)
driver->feature[peripheral].sent_feature_mask = 0;
driver->feature[peripheral].rcvd_feature_mask = 0;
- flush_workqueue(driver->cntl_wq);
reg_dirty |= PERIPHERAL_MASK(peripheral);
diag_cmd_remove_reg_by_proc(peripheral);
driver->feature[peripheral].stm_support = DISABLE_STM;
diff --git a/drivers/char/diag/diagfwd_peripheral.c b/drivers/char/diag/diagfwd_peripheral.c
index 6860de0d2288..78b8452b19b3 100644
--- a/drivers/char/diag/diagfwd_peripheral.c
+++ b/drivers/char/diag/diagfwd_peripheral.c
@@ -1285,6 +1285,9 @@ 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)