bus: mhi: host: Prevent warnings on clearing channel context twice

Do not allow clearing the channel context twice from
mhi_driver_remove(), if already done before disable transition is
initiated. This prevents kernel warnings such as "trying to free
invalid coherent area" from occurring.

Change-Id: I85dec0557a287c9207b56d2b2243d53b6a40ff1c
Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
Signed-off-by: Lazarus Motha <quic_lmotha@quicinc.com>
This commit is contained in:
Bhaumik Bhatt 2021-01-05 17:52:00 -08:00 committed by Lazarus Motha
parent 21f3a2eb36
commit d3dd2a1713

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
*
*/
@ -1359,6 +1359,7 @@ static int mhi_driver_remove(struct device *dev)
if ((ch_state[dir] == MHI_CH_STATE_ENABLED ||
ch_state[dir] == MHI_CH_STATE_STOP) &&
mhi_chan->ch_state != MHI_CH_STATE_DISABLED &&
!mhi_chan->offload_ch)
mhi_deinit_chan_ctxt(mhi_cntrl, mhi_chan);