bus: mhi: core: Destroy SBL devices when moving to mission mode
authorBhaumik Bhatt <bbhatt@codeaurora.org>
Wed, 24 Feb 2021 23:23:02 +0000 (15:23 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 May 2021 12:47:16 +0000 (14:47 +0200)
commit298a44f3817167b99bbc06a9e6a5a7770b561ae8
tree1b5fbaba6b6b1a24432245bccf20ced3e7621613
parent2e40d8cd3db5ce25ec11544daa6c699469c1aeba
bus: mhi: core: Destroy SBL devices when moving to mission mode

[ Upstream commit 925089c1900f588615db5bf4e1d9064a5f2c18c7 ]

Currently, client devices are created in SBL or AMSS (mission
mode) and only destroyed after power down or SYS ERROR. When
moving between certain execution environments, such as from SBL
to AMSS, no clean-up is required. This presents an issue where
SBL-specific channels are left open and client drivers now run in
an execution environment where they cannot operate. Fix this by
expanding the mhi_destroy_device() to do an execution environment
specific clean-up if one is requested. Close the gap and destroy
devices in such scenarios that allow SBL client drivers to clean
up once device enters mission mode.

Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
Reviewed-by: Hemant Kumar <hemantk@codeaurora.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/1614208985-20851-2-git-send-email-bbhatt@codeaurora.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bus/mhi/core/main.c
drivers/bus/mhi/core/pm.c