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

Commit 9623c63f authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ais: Flush the request slot queue in CRM"

parents 2539702b 5db3a85a
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -280,7 +280,7 @@ static void __cam_isp_ctx_dump_list(struct list_head *p_list)
	list_for_each_entry_safe(req, req_temp,
			p_list, list){
		req_isp = (struct cam_isp_ctx_req *) req->req_priv;
		CAM_WARN(CAM_ISP, "= req %d sts %d sync %d (bbl %d %d %d)",
		CAM_DBG(CAM_ISP, "= req %d sts %d sync %d (bbl %d %d %d)",
				req->request_id, req->status,
				req_isp->fence_map_out[0].sync_id,
				req_isp->bubble_detected,
@@ -291,16 +291,16 @@ static void __cam_isp_ctx_dump_list(struct list_head *p_list)

static void __cam_isp_ctx_dump_lists(struct cam_context *ctx)
{
	CAM_WARN(CAM_ISP, "== DUMP ACTIVE LIST ==");
	CAM_DBG(CAM_ISP, "== DUMP ACTIVE LIST ==");
	__cam_isp_ctx_dump_list(&ctx->active_req_list);

	CAM_WARN(CAM_ISP, "== DUMP PENDING LIST ==");
	CAM_DBG(CAM_ISP, "== DUMP PENDING LIST ==");
	__cam_isp_ctx_dump_list(&ctx->pending_req_list);

	CAM_WARN(CAM_ISP, "== DUMP WAIT LIST ==");
	CAM_DBG(CAM_ISP, "== DUMP WAIT LIST ==");
	__cam_isp_ctx_dump_list(&ctx->wait_req_list);

	CAM_WARN(CAM_ISP, "== DUMP FREE LIST ==");
	CAM_DBG(CAM_ISP, "== DUMP FREE LIST ==");
	__cam_isp_ctx_dump_list(&ctx->free_req_list);
}

@@ -756,7 +756,7 @@ static int __cam_isp_ctx_handle_buf_done_in_activated_state(
		req_isp = (struct cam_isp_ctx_req *) req->req_priv;

		for (j = 0; j < req_isp->num_fence_map_out; j++) {
			CAM_ERR(CAM_ISP,
			CAM_DBG(CAM_ISP,
				"Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u",
				req->request_id,
				req_isp->fence_map_out[j].resource_handle,
@@ -1565,7 +1565,7 @@ static int __cam_isp_ctx_handle_error(struct cam_isp_context *ctx_isp,

		for (i = 0; i < req_isp->num_fence_map_out; i++) {

			CAM_ERR(CAM_ISP,
			CAM_DBG(CAM_ISP,
				"Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u",
				req->request_id,
				req_isp->fence_map_out[i].resource_handle,
@@ -2365,7 +2365,7 @@ static int __cam_isp_ctx_flush_req(struct cam_context *ctx,
		req_isp = (struct cam_isp_ctx_req *) req->req_priv;
		for (i = 0; i < req_isp->num_fence_map_out; i++) {
			if (req_isp->fence_map_out[i].sync_id != -1) {
				CAM_INFO(CAM_ISP, "Flush req 0x%llx, fence %d",
				CAM_DBG(CAM_ISP, "Flush req 0x%llx, fence %d",
					 req->request_id,
					req_isp->fence_map_out[i].sync_id);
				rc = cam_sync_signal(
@@ -2817,7 +2817,7 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state(
		CAM_DBG(CAM_ISP, "signal fence in active list. req %lld",
				req->request_id);
		for (i = 0; i < req_isp->num_fence_map_out; i++) {
			CAM_ERR(CAM_ISP,
			CAM_DBG(CAM_ISP,
				"Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u",
				req->request_id,
				req_isp->fence_map_out[i].resource_handle,
+17 −2
Original line number Diff line number Diff line
@@ -1908,6 +1908,10 @@ int cam_req_mgr_process_flush_req(void *priv, void *data)
		}
		in_q->wr_idx = 0;
		in_q->rd_idx = 0;
		complete(&link->workq_comp);
		mutex_unlock(&link->req.lock);

		return rc;
	} else if (flush_info->flush_type ==
		CAM_REQ_MGR_FLUSH_TYPE_CANCEL_REQ) {
		idx = __cam_req_mgr_find_slot_for_req(in_q, flush_info->req_id);
@@ -2263,7 +2267,7 @@ static int cam_req_mgr_process_trigger(void *priv, void *data)
			trigger_data->req_id);
		if (idx >= 0) {
			if (idx == in_q->last_applied_idx) {
				CAM_INFO(CAM_REQ,
				CAM_DBG(CAM_REQ,
				"Reset last applied idx (%d) from req_id %llu",
				in_q->last_applied_idx, trigger_data->req_id);
				in_q->last_applied_idx = -1;
@@ -2294,7 +2298,7 @@ static int cam_req_mgr_process_trigger(void *priv, void *data)
					}
				}
#endif
				CAM_INFO(CAM_REQ,
				CAM_DBG(CAM_REQ,
				"Increment rd_idx %d from req_id %llu",
				in_q->rd_idx,
				trigger_data->req_id);
@@ -3430,10 +3434,21 @@ int cam_req_mgr_flush_requests(
	init_completion(&link->workq_comp);
	rc = cam_req_mgr_workq_enqueue_task(task, link, CRM_TASK_PRIORITY_0);

	if (rc < 0) {
		CAM_ERR(CAM_CRM, "Enqueue workq task failed for flush slotq");
		goto end;
	}

	/* Blocking call */
	rc = wait_for_completion_timeout(
		&link->workq_comp,
		msecs_to_jiffies(CAM_REQ_MGR_SCHED_REQ_TIMEOUT));
	if (rc <= 0) {
		CAM_ERR(CAM_CRM, "Flushing CRM slot queue timedout rc=%d", rc);
		rc = -ETIMEDOUT;
	} else {
		rc = 0;
	}
end:
	mutex_unlock(&g_crm_core_dev->crm_lock);
	return rc;