[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1607044997-19577-3-git-send-email-bbhatt@codeaurora.org>
Date: Thu, 3 Dec 2020 17:23:11 -0800
From: Bhaumik Bhatt <bbhatt@...eaurora.org>
To: manivannan.sadhasivam@...aro.org, hemantk@...eaurora.org
Cc: linux-arm-msm@...r.kernel.org, loic.poulain@...aro.org,
jhugo@...eaurora.org, linux-kernel@...r.kernel.org,
Bhaumik Bhatt <bbhatt@...eaurora.org>
Subject: [PATCH v4 2/8] bus: mhi: core: Allow channel to be disabled from stopped state
If a channel was explicitly stopped but not reset, allow it to
move to a disabled state so that the channel context can be
cleaned up after a driver remove is issued. Since the channel
remained in stopped state, its context on the device is not
cleared. Allow this move if a client driver module is unloaded
or a device crash occurs.
Signed-off-by: Bhaumik Bhatt <bbhatt@...eaurora.org>
Reviewed-by: Hemant Kumar <hemantk@...eaurora.org>
---
drivers/bus/mhi/core/init.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c
index f0697f4..5c93a61 100644
--- a/drivers/bus/mhi/core/init.c
+++ b/drivers/bus/mhi/core/init.c
@@ -1288,7 +1288,8 @@ static int mhi_driver_remove(struct device *dev)
mutex_lock(&mhi_chan->mutex);
- if (ch_state[dir] == MHI_CH_STATE_ENABLED &&
+ if ((ch_state[dir] == MHI_CH_STATE_ENABLED ||
+ ch_state[dir] == MHI_CH_STATE_STOP) &&
!mhi_chan->offload_ch)
mhi_deinit_chan_ctxt(mhi_cntrl, mhi_chan);
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Powered by blists - more mailing lists