msm: camera: csiphy: reset the secure bits on provider exit

If camera service exits after configdev and before startdev the phy
variables to keep track of the secure bits will be modified and the next
session will be based on this secure bits that was previously set. This
change clears the phy secure bits if the service exits.

CRs-Fixed: 2726185
Change-Id: I69420aed164f66f221569ff60f8771eff40e1548
Signed-off-by: Tony Lijo Jose <tjose@codeaurora.org>
This commit is contained in:
Tony Lijo Jose committed 2020-07-21 23:44:34 +05:30
1 parent e5d41356bd
commit f0a73a6c75
1 file changed
+21 -13
@@ -589,29 +589,37 @@ int32_t cam_csiphy_config_dev(struct csiphy_device *csiphy_dev)
return rc;
}
void cam_csiphy_clear_secbits(struct csiphy_device *csiphy_dev)
{
int32_t i = 0;
for (i = 0; i < csiphy_dev->acquire_count; i++) {
if (csiphy_dev->csiphy_info.secure_mode[i])
cam_csiphy_notify_secure_mode(
csiphy_dev,
CAM_SECURE_MODE_NON_SECURE, i);
csiphy_dev->csiphy_info.secure_mode[i] =
CAM_SECURE_MODE_NON_SECURE;
csiphy_dev->csiphy_cpas_cp_reg_mask[i] = 0;
}
}
void cam_csiphy_shutdown(struct csiphy_device *csiphy_dev)
{
struct cam_hw_soc_info *soc_info;
int32_t i = 0;
if (csiphy_dev->csiphy_state == CAM_CSIPHY_INIT)
return;
/*
* clear the secure bits if the provider crashed
*/
cam_csiphy_clear_secbits(csiphy_dev);
if (csiphy_dev->csiphy_state == CAM_CSIPHY_START) {
soc_info = &csiphy_dev->soc_info;
for (i = 0; i < csiphy_dev->acquire_count; i++) {
if (csiphy_dev->csiphy_info.secure_mode[i])
cam_csiphy_notify_secure_mode(
csiphy_dev,
CAM_SECURE_MODE_NON_SECURE, i);
csiphy_dev->csiphy_info.secure_mode[i] =
CAM_SECURE_MODE_NON_SECURE;
csiphy_dev->csiphy_cpas_cp_reg_mask[i] = 0;
}
cam_csiphy_reset(csiphy_dev);
cam_soc_util_disable_platform_resource(soc_info, true, true);