Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0a73a6c authored by Tony Lijo Jose's avatar Tony Lijo Jose
Browse files

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: default avatarTony Lijo Jose <tjose@codeaurora.org>
parent e5d41356
Loading
Loading
Loading
Loading
+21 −13
Original line number Diff line number Diff line
@@ -589,17 +589,10 @@ int32_t cam_csiphy_config_dev(struct csiphy_device *csiphy_dev)
	return rc;
}

void cam_csiphy_shutdown(struct csiphy_device *csiphy_dev)
void cam_csiphy_clear_secbits(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;

	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(
@@ -611,6 +604,21 @@ void cam_csiphy_shutdown(struct csiphy_device *csiphy_dev)

		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;

	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;

		cam_csiphy_reset(csiphy_dev);
		cam_soc_util_disable_platform_resource(soc_info, true, true);