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

Commit 0c96fc99 authored by Alok Chauhan's avatar Alok Chauhan
Browse files

msm: camera: ope: Delay releasing of resources for last context



OPE driver update the bandwidth as part of each release context.
As part of last context it disabled the irq as well. But in some
corner case, pending IRQ routines gets called very late as part
of disable IRQ callback and causes unclock access.

Hence delay the bw update for last context to avoid unclock access
during pending IRQ callbacks.

CRs-Fixed: 2611400
Change-Id: I6620b5fc218282af280eac41f276fccd7ff0c4b0
Signed-off-by: default avatarAlok Chauhan <alokc@codeaurora.org>
parent a8004108
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -2433,10 +2433,6 @@ static int cam_ope_mgr_release_ctx(struct cam_ope_hw_mgr *hw_mgr, int ctx_id)
	hw_mgr->ctx[ctx_id].req_cnt = 0;
	cam_ope_put_free_ctx(hw_mgr, ctx_id);

	rc = cam_ope_mgr_remove_bw(hw_mgr, ctx_id);
	if (rc)
		CAM_ERR(CAM_OPE, "OPE remove bw failed: %d", rc);

	rc = cam_ope_mgr_ope_clk_remove(hw_mgr, ctx_id);
	if (rc)
		CAM_ERR(CAM_OPE, "OPE clk update failed: %d", rc);
@@ -2509,6 +2505,21 @@ static int cam_ope_mgr_release_hw(void *hw_priv, void *hw_release_args)
		cam_ope_device_timer_stop(hw_mgr);
	}

	rc = cam_ope_mgr_remove_bw(hw_mgr, ctx_id);
	if (rc)
		CAM_ERR(CAM_OPE, "OPE remove bw failed: %d", rc);

	if (!hw_mgr->ope_ctx_cnt) {
		for (i = 0; i < ope_hw_mgr->num_ope; i++) {
			dev_intf = hw_mgr->ope_dev_intf[i];
			rc = dev_intf->hw_ops.stop(
				hw_mgr->ope_dev_intf[i]->hw_priv,
				NULL, 0);
			if (rc)
				CAM_ERR(CAM_OPE, "stop failed: %d", rc);
		}
	}

	mutex_unlock(&hw_mgr->hw_mgr_mutex);

	CAM_DBG(CAM_OPE, "Release done for ctx_id %d", ctx_id);
+23 −8
Original line number Diff line number Diff line
@@ -96,7 +96,29 @@ int cam_ope_start(void *hw_priv, void *start_args, uint32_t arg_size)

int cam_ope_stop(void *hw_priv, void *start_args, uint32_t arg_size)
{
	return 0;
	struct cam_hw_info *ope_dev = hw_priv;
	struct cam_ope_device_core_info *core_info = NULL;
	int rc = 0;

	if (!hw_priv) {
		CAM_ERR(CAM_OPE, "Invalid cam_dev_info");
		return -EINVAL;
	}

	core_info = (struct cam_ope_device_core_info *)ope_dev->core_info;
	if (!core_info) {
		CAM_ERR(CAM_OPE, "core_info = %pK", core_info);
		return -EINVAL;
	}

	if (core_info->cpas_start) {
		if (cam_cpas_stop(core_info->cpas_handle))
			CAM_ERR(CAM_OPE, "cpas stop is failed");
		else
			core_info->cpas_start = false;
	}

	return rc;
}

int cam_ope_flush(void *hw_priv, void *flush_args, uint32_t arg_size)
@@ -251,13 +273,6 @@ int cam_ope_deinit_hw(void *device_priv,
		CAM_ERR(CAM_OPE, "soc disable is failed : %d", rc);
	core_info->clk_enable = false;

	if (core_info->cpas_start) {
		if (cam_cpas_stop(core_info->cpas_handle))
			CAM_ERR(CAM_OPE, "cpas stop is failed");
		else
			core_info->cpas_start = false;
	}

	return rc;
}