提交 8aea991d 编写于 作者: B Bhaumik Bhatt 提交者: Zheng Zengkai

bus: mhi: core: Clear context for stopped channels from remove()

stable inclusion
from stable-5.10.36
commit 2ed4d587539e122ff4d5cf53adc44bb2548f13dd
bugzilla: 51867
CVE: NA

--------------------------------

[ Upstream commit 4e44ae3d ]

If a channel was explicitly stopped but not reset and a driver
remove is issued, clean up the channel context such that it is
reflected on the device. This move is useful if a client driver
module is unloaded or a device crash occurs with the host having
placed the channel in a stopped state.
Signed-off-by: NBhaumik Bhatt <bbhatt@codeaurora.org>
Reviewed-by: NHemant Kumar <hemantk@codeaurora.org>
Reviewed-by: NManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/1617311778-1254-3-git-send-email-bbhatt@codeaurora.orgSigned-off-by: NManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 e396eaa5
...@@ -1280,7 +1280,8 @@ static int mhi_driver_remove(struct device *dev) ...@@ -1280,7 +1280,8 @@ static int mhi_driver_remove(struct device *dev)
mutex_lock(&mhi_chan->mutex); 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_chan->offload_ch)
mhi_deinit_chan_ctxt(mhi_cntrl, mhi_chan); mhi_deinit_chan_ctxt(mhi_cntrl, mhi_chan);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册