msm: camera: isp: Move req out of pending list before start

This change moves init request out of pending list before
starting hardware. Currently if we receive the first SOF and
RUP IRQs before start_dev routine has completed, we miss
pushing out the init request to free list on the first RUP as
wait list will be empty.

Change-Id: Icd53e0ebe0d12e264172058d836e6ccfcb7df0c2
Signed-off-by: Venkat Chinta <vchinta@codeaurora.org>
Signed-off-by: Jigarkumar Zala <jzala@codeaurora.org>
This commit is contained in:
Venkat Chinta 2019-07-17 17:24:18 -07:00 committed by Gerrit - the friendly Code Review server
parent 45125cf020
commit a6efb05c3f

View File

@ -3368,6 +3368,21 @@ static int __cam_isp_ctx_start_dev_in_ready(struct cam_context *ctx,
goto end;
}
/*
* In case of CSID TPG we might receive SOF and RUP IRQs
* before hw_mgr_intf->hw_start has returned. So move
* req out of pending list before hw_start and add it
* back to pending list if hw_start fails.
*/
list_del_init(&req->list);
if (req_isp->num_fence_map_out) {
list_add_tail(&req->list, &ctx->active_req_list);
ctx_isp->active_req_cnt++;
} else {
list_add_tail(&req->list, &ctx->wait_req_list);
}
start_isp.hw_config.ctxt_to_hw_map = ctx_isp->hw_ctx;
start_isp.hw_config.request_id = req->request_id;
start_isp.hw_config.hw_update_entries = req_isp->cfg;
@ -3401,18 +3416,12 @@ static int __cam_isp_ctx_start_dev_in_ready(struct cam_context *ctx,
CAM_ERR(CAM_ISP, "Start HW failed");
ctx->state = CAM_CTX_READY;
trace_cam_context_state("ISP", ctx);
list_del_init(&req->list);
list_add(&req->list, &ctx->pending_req_list);
goto end;
}
CAM_DBG(CAM_ISP, "start device success ctx %u", ctx->ctx_id);
list_del_init(&req->list);
if (req_isp->num_fence_map_out) {
list_add_tail(&req->list, &ctx->active_req_list);
ctx_isp->active_req_cnt++;
} else {
list_add_tail(&req->list, &ctx->wait_req_list);
}
end:
return rc;
}