Loading drivers/char/diag/diagfwd_mhi.c +21 −8 Original line number Diff line number Diff line /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-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 Loading Loading @@ -552,6 +552,8 @@ static void mhi_notifier(struct mhi_cb_info *cb_info) struct mhi_result *result = NULL; struct diag_mhi_ch_t *ch = NULL; void *buf = NULL; struct diag_mhi_info *mhi_info = NULL; unsigned long flags; if (!cb_info) return; Loading Loading @@ -603,13 +605,6 @@ static void mhi_notifier(struct mhi_cb_info *cb_info) queue_work(diag_mhi[index].mhi_wq, &(diag_mhi[index].open_work)); break; case MHI_CB_MHI_DISABLED: DIAG_LOG(DIAG_DEBUG_BRIDGE, "received mhi disabled notifiation port: %d ch: %d\n", index, ch->type); atomic_set(&(ch->opened), 0); __mhi_close(&diag_mhi[index], CHANNELS_CLOSED); break; case MHI_CB_XFER: /* * If the channel is a read channel, this is a read Loading @@ -636,6 +631,24 @@ static void mhi_notifier(struct mhi_cb_info *cb_info) result->bytes_xferd, diag_mhi[index].id); break; case MHI_CB_MHI_DISABLED: case MHI_CB_SYS_ERROR: case MHI_CB_MHI_SHUTDOWN: DIAG_LOG(DIAG_DEBUG_BRIDGE, "received mhi link down cb: %d port: %d ch: %d\n", cb_info->cb_reason, index, ch->type); mhi_info = &diag_mhi[index]; if (!mhi_info->enabled) return; spin_lock_irqsave(&mhi_info->lock, flags); mhi_info->enabled = 0; spin_unlock_irqrestore(&mhi_info->lock, flags); atomic_set(&(mhi_info->read_ch.opened), 0); atomic_set(&(mhi_info->write_ch.opened), 0); flush_workqueue(mhi_info->mhi_wq); mhi_buf_tbl_clear(mhi_info); diag_remote_dev_close(mhi_info->dev_id); break; default: pr_err("diag: In %s, invalid cb reason 0x%x\n", __func__, cb_info->cb_reason); Loading Loading
drivers/char/diag/diagfwd_mhi.c +21 −8 Original line number Diff line number Diff line /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-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 Loading Loading @@ -552,6 +552,8 @@ static void mhi_notifier(struct mhi_cb_info *cb_info) struct mhi_result *result = NULL; struct diag_mhi_ch_t *ch = NULL; void *buf = NULL; struct diag_mhi_info *mhi_info = NULL; unsigned long flags; if (!cb_info) return; Loading Loading @@ -603,13 +605,6 @@ static void mhi_notifier(struct mhi_cb_info *cb_info) queue_work(diag_mhi[index].mhi_wq, &(diag_mhi[index].open_work)); break; case MHI_CB_MHI_DISABLED: DIAG_LOG(DIAG_DEBUG_BRIDGE, "received mhi disabled notifiation port: %d ch: %d\n", index, ch->type); atomic_set(&(ch->opened), 0); __mhi_close(&diag_mhi[index], CHANNELS_CLOSED); break; case MHI_CB_XFER: /* * If the channel is a read channel, this is a read Loading @@ -636,6 +631,24 @@ static void mhi_notifier(struct mhi_cb_info *cb_info) result->bytes_xferd, diag_mhi[index].id); break; case MHI_CB_MHI_DISABLED: case MHI_CB_SYS_ERROR: case MHI_CB_MHI_SHUTDOWN: DIAG_LOG(DIAG_DEBUG_BRIDGE, "received mhi link down cb: %d port: %d ch: %d\n", cb_info->cb_reason, index, ch->type); mhi_info = &diag_mhi[index]; if (!mhi_info->enabled) return; spin_lock_irqsave(&mhi_info->lock, flags); mhi_info->enabled = 0; spin_unlock_irqrestore(&mhi_info->lock, flags); atomic_set(&(mhi_info->read_ch.opened), 0); atomic_set(&(mhi_info->write_ch.opened), 0); flush_workqueue(mhi_info->mhi_wq); mhi_buf_tbl_clear(mhi_info); diag_remote_dev_close(mhi_info->dev_id); break; default: pr_err("diag: In %s, invalid cb reason 0x%x\n", __func__, cb_info->cb_reason); Loading