From 6f8f44cd5dd3ee10c3f6602efb46dc242fa1e902 Mon Sep 17 00:00:00 2001 From: Manoj Prabhu B Date: Mon, 22 Jul 2019 15:57:12 +0530 Subject: [PATCH] diag: Update hdlc mode for peripherals after mdlog exit Presently hdlc mode is not getting updated for a peripheral after multimode mdlog exit. Update the peripheral's hdlc mode while closing the mdlog session. Change-Id: I255db98b592648df00e779027232a55c4585de6a Signed-off-by: Manoj Prabhu B --- drivers/char/diag/diagchar_core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/char/diag/diagchar_core.c b/drivers/char/diag/diagchar_core.c index cb23bb704a7ed..8c370f111494f 100644 --- a/drivers/char/diag/diagchar_core.c +++ b/drivers/char/diag/diagchar_core.c @@ -498,9 +498,11 @@ static void diag_close_logging_process(const int pid) } } } + mutex_lock(&driver->hdlc_disable_mutex); mutex_lock(&driver->md_session_lock); diag_md_session_close(pid); mutex_unlock(&driver->md_session_lock); + mutex_unlock(&driver->hdlc_disable_mutex); diag_switch_logging(¶ms); mutex_unlock(&driver->diagchar_mutex); } @@ -1436,6 +1438,8 @@ static void diag_md_session_close(int pid) driver->md_session_map[proc][i] = NULL; driver->md_session_mask[proc] &= ~session_info->peripheral_mask[proc]; + driver->p_hdlc_disabled[i] = + driver->hdlc_disabled; } } diag_log_mask_free(session_info->log_mask);