From 46df49384f9458fc03b0a94e7baaf30393bc266b Mon Sep 17 00:00:00 2001 From: Stuti Saxena Date: Mon, 17 Oct 2022 08:50:31 -0700 Subject: [PATCH] msm: camera: isp: Add logs for debug enhancement Problem Description: Missing context details in logs and mapping of hw_mgr context id with isp context id during acquire. Solution: Add context id and link handle in ife_hw_mgr and isp_context files. Add hw_id in csid, vfe top and vfe bus files. Also add hw_mgr context id in isp_context file to map ISP context with IFE hw mgr context during acquire, for better debuggability. CRs-Fixed: 3354324 Change-Id: I455d5a6a5d6ec892899f6f84d73459faab0ceef2 Signed-off-by: Stuti Saxena --- drivers/cam_isp/cam_isp_context.c | 1315 +++++----- drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c | 2116 +++++++++-------- .../isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c | 523 ++-- .../isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver3.c | 587 ++--- .../isp_hw/vfe_hw/vfe_top/cam_vfe_top_ver4.c | 184 +- 5 files changed, 2593 insertions(+), 2132 deletions(-) diff --git a/drivers/cam_isp/cam_isp_context.c b/drivers/cam_isp/cam_isp_context.c index 32022f9395..78d414e61a 100644 --- a/drivers/cam_isp/cam_isp_context.c +++ b/drivers/cam_isp/cam_isp_context.c @@ -656,7 +656,8 @@ static int cam_isp_context_info_dump(void *context, break; } default: - CAM_DBG(CAM_ISP, "DUMP id not valid %u", id); + CAM_DBG(CAM_ISP, "DUMP id not valid %u, ctx_idx: %u, link: 0x%x", + id, ctx->ctx_id, ctx->link_hdl); break; } @@ -943,8 +944,8 @@ static int __cam_isp_ctx_enqueue_request_in_order( continue; } else if (req->request_id == req_current->request_id) { CAM_WARN(CAM_ISP, - "Received duplicated request %lld", - req->request_id); + "Received duplicated request %lld, ctx_idx: %u link: 0x%x", + req->request_id, ctx->ctx_id, ctx->link_hdl); } break; } @@ -981,8 +982,8 @@ static int __cam_isp_ctx_enqueue_init_request( spin_lock_bh(&ctx->lock); if (list_empty(&ctx->pending_req_list)) { list_add_tail(&req->list, &ctx->pending_req_list); - CAM_DBG(CAM_ISP, "INIT packet added req id= %d", - req->request_id); + CAM_DBG(CAM_ISP, "INIT packet added req id= %d, ctx_idx: %u, link: 0x%x", + req->request_id, ctx->ctx_id, ctx->link_hdl); goto end; } @@ -995,15 +996,16 @@ static int __cam_isp_ctx_enqueue_init_request( if ((req_isp_old->num_cfg + req_isp_new->num_cfg) >= ctx->max_hw_update_entries) { CAM_WARN(CAM_ISP, - "Can not merge INIT pkt num_cfgs = %d", + "Can not merge INIT pkt num_cfgs = %d, ctx_idx: %u, link: 0x%x", (req_isp_old->num_cfg + - req_isp_new->num_cfg)); + req_isp_new->num_cfg), ctx->ctx_id, ctx->link_hdl); rc = -ENOMEM; } if (req_isp_old->num_fence_map_out != 0 || req_isp_old->num_fence_map_in != 0) { - CAM_WARN(CAM_ISP, "Invalid INIT pkt sequence"); + CAM_WARN(CAM_ISP, "Invalid INIT pkt sequence, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); rc = -EINVAL; } @@ -1062,8 +1064,8 @@ static int __cam_isp_ctx_enqueue_init_request( } } else { CAM_WARN(CAM_ISP, - "Received Update pkt before INIT pkt. req_id= %lld", - req->request_id); + "Received Update pkt before INIT pkt. req_id= %lld, ctx_idx: %u, link: 0x%x", + req->request_id, ctx->ctx_id, ctx->link_hdl); rc = -EINVAL; } end: @@ -1233,8 +1235,8 @@ static int __cam_isp_ctx_get_hw_timestamp(struct cam_context *ctx, uint64_t *pre return rc; if (isp_hw_cmd_args.u.sof_ts.prev >= isp_hw_cmd_args.u.sof_ts.curr) { - CAM_ERR(CAM_ISP, "ctx:%u previous timestamp is greater than current timestamp", - ctx->ctx_id); + CAM_ERR(CAM_ISP, "ctx:%u link:0x%x prev timestamp greater than curr timestamp", + ctx->ctx_id, ctx->link_hdl); return -EINVAL; } @@ -1254,7 +1256,8 @@ static int __cam_isp_ctx_recover_sof_timestamp(struct cam_context *ctx, uint64_t rc = __cam_isp_ctx_get_hw_timestamp(ctx, &prev_ts, &curr_ts, &boot_ts); if (rc) { - CAM_ERR(CAM_ISP, "ctx:%u Failed to get timestamp from HW", ctx->ctx_id); + CAM_ERR(CAM_ISP, "ctx:%u link: 0x%x Failed to get timestamp from HW", + ctx->ctx_id, ctx->link_hdl); return rc; } @@ -1269,21 +1272,21 @@ static int __cam_isp_ctx_recover_sof_timestamp(struct cam_context *ctx, uint64_t if (a == prev_ts) { /* Hardware is at frame B */ b = curr_ts; - CAM_DBG(CAM_ISP, "ctx:%u recovered timestamp (last:0x%llx, curr:0x%llx) req: %llu", - ctx->ctx_id, a, b, request_id); + CAM_DBG(CAM_ISP, "ctx:%u link:0x%x recover time(last:0x%llx,curr:0x%llx)req:%llu", + ctx->ctx_id, ctx->link_hdl, a, b, request_id); } else if (a < prev_ts) { /* Hardware is at frame C */ b = prev_ts; c = curr_ts; CAM_DBG(CAM_ISP, - "ctx:%u recovered timestamp (last:0x%llx, prev:0x%llx, curr:0x%llx) req: %llu", - ctx->ctx_id, a, b, c, request_id); + "ctx:%u link:0x%x recover time(last:0x%llx,prev:0x%llx,curr:0x%llx)req:%llu", + ctx->ctx_id, ctx->link_hdl, a, b, c, request_id); } else { /* Hardware is at frame A (which we supposedly missed) */ CAM_ERR_RATE_LIMIT(CAM_ISP, - "ctx:%u erroneous call to SOF recovery (last:0x%llx, prev:0x%llx, curr:0x%llx) req: %llu", - ctx->ctx_id, a, prev_ts, curr_ts, request_id); + "ctx:%u link: 0x%x erroneous call to SOF recovery(last:0x%llx, prev:0x%llx, curr:0x%llx) req: %llu", + ctx->ctx_id, ctx->link_hdl, a, prev_ts, curr_ts, request_id); return 0; } @@ -1392,13 +1395,14 @@ static void __cam_isp_ctx_send_sof_timestamp( if (ctx_isp->reported_frame_id == ctx_isp->frame_id) { if (__cam_isp_ctx_recover_sof_timestamp(ctx_isp->base, request_id)) - CAM_WARN(CAM_ISP, "Missed SOF. Unable to recover SOF timestamp."); + CAM_WARN(CAM_ISP, "Missed SOF.No SOF timestamp recovery,ctx:%u,link:0x%x", + ctx->ctx_id, ctx->link_hdl); } if (request_id == 0 && (ctx_isp->reported_frame_id == ctx_isp->frame_id)) { CAM_WARN_RATE_LIMIT(CAM_ISP, - "Missed SOF Recovery for invalid req, Skip notificaiton to userspace Ctx: %u frame_id %u", - ctx->ctx_id, ctx_isp->frame_id); + "Missed SOF Recovery for invalid req, Skip notificaiton to userspace Ctx: %u link: 0x%x frame_id %u", + ctx->ctx_id, ctx->link_hdl, ctx_isp->frame_id); return; } @@ -1422,15 +1426,15 @@ static void __cam_isp_ctx_send_sof_timestamp( req_msg.u.frame_msg.frame_id_meta = ctx_isp->frame_id_meta; CAM_DBG(CAM_ISP, - "request id:%lld frame number:%lld SOF time stamp:0x%llx status:%u", + "request id:%lld frame number:%lld SOF time stamp:0x%llx status:%u ctx_idx: %u, link: 0x%x", request_id, ctx_isp->frame_id, - ctx_isp->sof_timestamp_val, sof_event_status); + ctx_isp->sof_timestamp_val, sof_event_status, ctx->ctx_id, ctx->link_hdl); if (cam_req_mgr_notify_message(&req_msg, V4L_EVENT_CAM_REQ_MGR_SOF, V4L_EVENT_CAM_REQ_MGR_EVENT)) CAM_ERR(CAM_ISP, - "Error in notifying the sof time for req id:%lld", - request_id); + "Error in notifying the sof time for req id:%lld, ctx_idx: %u, link: 0x%x", + request_id, ctx->ctx_id, ctx->link_hdl); end: __cam_isp_ctx_send_sof_boot_timestamp(ctx_isp, @@ -1598,16 +1602,16 @@ static int __cam_isp_ctx_handle_buf_done_for_req_list( list_add_tail(&req->list, &ctx->free_req_list); CAM_DBG(CAM_REQ, - "Move active request %lld to free list(cnt = %d) [flushed], ctx %u", + "Move active request %lld to free list(cnt = %d) [flushed], ctx %u, link: 0x%x", buf_done_req_id, ctx_isp->active_req_cnt, - ctx->ctx_id); + ctx->ctx_id, ctx->link_hdl); ctx_isp->last_bufdone_err_apply_req_id = 0; } else { list_add(&req->list, &ctx->pending_req_list); CAM_DBG(CAM_REQ, - "Move active request %lld to pending list(cnt = %d) [bubble recovery], ctx %u", + "Move active request %lld to pending list(cnt = %d) [bubble recovery], ctx %u, link: 0x%x", req->request_id, ctx_isp->active_req_cnt, - ctx->ctx_id); + ctx->ctx_id, ctx->link_hdl); } } else { if (!ctx_isp->use_frame_header_ts) { @@ -1636,8 +1640,8 @@ static int __cam_isp_ctx_handle_buf_done_for_req_list( } CAM_DBG(CAM_REQ, - "Move active request %lld to free list(cnt = %d) [all fences done], ctx %u", - buf_done_req_id, ctx_isp->active_req_cnt, ctx->ctx_id); + "Move active request %lld to free list(cnt = %d) [all fences done], ctx %u link: 0x%x", + buf_done_req_id, ctx_isp->active_req_cnt, ctx->ctx_id, ctx->link_hdl); ctx_isp->req_info.last_bufdone_req_id = req->request_id; ctx_isp->last_bufdone_err_apply_req_id = 0; } @@ -1673,8 +1677,8 @@ static int __cam_isp_ctx_handle_buf_done_for_request( req_isp = (struct cam_isp_ctx_req *) req->req_priv; - CAM_DBG(CAM_ISP, "Enter with bubble_state %d, req_bubble_detected %d", - bubble_state, req_isp->bubble_detected); + CAM_DBG(CAM_ISP, "Enter with bubble_state %d, req_bubble_detected %d, ctx %u link: 0x%x", + bubble_state, req_isp->bubble_detected, ctx->ctx_id, ctx->link_hdl); done_next_req->resource_handle = 0; done_next_req->timestamp = done->timestamp; @@ -1730,11 +1734,11 @@ static int __cam_isp_ctx_handle_buf_done_for_request( * bound to it, we needn't process it. */ CAM_DBG(CAM_ISP, - "BUF_DONE for res %s not active in Req %lld ", + "BUF_DONE for res %s not active in Req %lld ctx %u link: 0x%x", __cam_isp_resource_handle_id_to_type( ctx_isp->isp_device_type, comp_grp->res_id[i]), - req->request_id); + req->request_id, ctx->ctx_id, ctx->link_hdl); continue; } @@ -1745,8 +1749,8 @@ static int __cam_isp_ctx_handle_buf_done_for_request( req_isp->fence_map_out[j].resource_handle); CAM_WARN(CAM_ISP, - "Duplicate BUF_DONE for req %lld : i=%d, j=%d, res=%s", - req->request_id, i, j, handle_type); + "Duplicate BUF_DONE for req %lld : i=%d, j=%d, res=%s, ctx %u link: 0x%x", + req->request_id, i, j, handle_type, ctx->ctx_id, ctx->link_hdl); trace_cam_log_event("Duplicate BufDone", handle_type, req->request_id, ctx->ctx_id); @@ -1759,40 +1763,41 @@ static int __cam_isp_ctx_handle_buf_done_for_request( ctx->img_iommu_hdl, req_isp->fence_map_out[j].resource_handle); if (rc) { CAM_ERR(CAM_ISP, - "Failed to retrieve image buffers req_id:%d ctx_id:%d bubble detected:%d rc:%d", - req->request_id, ctx->ctx_id, req_isp->bubble_detected, rc); + "Failed to retrieve image buffers req_id:%d ctx_id:%u link: 0x%x bubble detected:%d rc:%d", + req->request_id, ctx->ctx_id, ctx->link_hdl, + req_isp->bubble_detected, rc); return rc; } } if (!req_isp->bubble_detected) { CAM_DBG(CAM_ISP, - "Sync with success: req %lld res 0x%x fd 0x%x, ctx %u", + "Sync with success: req %lld res 0x%x fd 0x%x, ctx %u link: 0x%x", req->request_id, req_isp->fence_map_out[j].resource_handle, req_isp->fence_map_out[j].sync_id, - ctx->ctx_id); + ctx->ctx_id, ctx->link_hdl); rc = cam_sync_signal(req_isp->fence_map_out[j].sync_id, CAM_SYNC_STATE_SIGNALED_SUCCESS, CAM_SYNC_COMMON_EVENT_SUCCESS); if (rc) - CAM_DBG(CAM_ISP, "Sync failed with rc = %d", - rc); + CAM_DBG(CAM_ISP, "Sync failed with rc = %d, ctx %u link: 0x%x", + rc, ctx->ctx_id, ctx->link_hdl); } else if (!req_isp->bubble_report) { CAM_DBG(CAM_ISP, - "Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u", + "Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u link: 0x%x", req->request_id, req_isp->fence_map_out[j].resource_handle, req_isp->fence_map_out[j].sync_id, - ctx->ctx_id); + ctx->ctx_id, ctx->link_hdl); rc = cam_sync_signal(req_isp->fence_map_out[j].sync_id, CAM_SYNC_STATE_SIGNALED_ERROR, CAM_SYNC_ISP_EVENT_BUBBLE); if (rc) - CAM_ERR(CAM_ISP, "Sync failed with rc = %d", - rc); + CAM_ERR(CAM_ISP, "Sync failed with rc = %d, ctx %u link: 0x%x", + rc, ctx->ctx_id, ctx->link_hdl); } else { /* * Ignore the buffer done if bubble detect is on @@ -1802,17 +1807,17 @@ static int __cam_isp_ctx_handle_buf_done_for_request( */ req_isp->num_acked++; CAM_DBG(CAM_ISP, - "buf done with bubble state %d recovery %d for req %lld, ctx %u", + "buf done with bubble state %d recovery %d for req %lld, ctx %u link: 0x%x", bubble_state, req_isp->bubble_report, req->request_id, - ctx->ctx_id); + ctx->ctx_id, ctx->link_hdl); continue; } - CAM_DBG(CAM_ISP, "req %lld, reset sync id 0x%x ctx %u", + CAM_DBG(CAM_ISP, "req %lld, reset sync id 0x%x ctx %u link: 0x%x", req->request_id, - req_isp->fence_map_out[j].sync_id, ctx->ctx_id); + req_isp->fence_map_out[j].sync_id, ctx->ctx_id, ctx->link_hdl); if (!rc) { req_isp->num_acked++; req_isp->fence_map_out[j].sync_id = -1; @@ -1831,9 +1836,9 @@ check_deferred: if (req_isp->num_acked > req_isp->num_fence_map_out) { /* Should not happen */ CAM_ERR(CAM_ISP, - "WARNING: req_id %lld num_acked %d > map_out %d, ctx %u", + "WARNING: req_id %lld num_acked %d > map_out %d, ctx %u link: 0x%x", req->request_id, req_isp->num_acked, - req_isp->num_fence_map_out, ctx->ctx_id); + req_isp->num_fence_map_out, ctx->ctx_id, ctx->link_hdl); WARN_ON(req_isp->num_acked > req_isp->num_fence_map_out); } @@ -1857,40 +1862,40 @@ static int __cam_isp_handle_deferred_buf_done( struct cam_context *ctx = ctx_isp->base; CAM_DBG(CAM_ISP, - "ctx[%d] : Req %llu : Handling %d deferred buf_dones num_acked=%d, bubble_handling=%d", - ctx->ctx_id, req->request_id, req_isp->num_deferred_acks, + "ctx[%u] link[0x%x] : Req %llu : Handling %d deferred buf_dones num_acked=%d, bubble_handling=%d", + ctx->ctx_id, ctx->link_hdl, req->request_id, req_isp->num_deferred_acks, req_isp->num_acked, bubble_handling); for (i = 0; i < req_isp->num_deferred_acks; i++) { j = req_isp->deferred_fence_map_index[i]; CAM_DBG(CAM_ISP, - "ctx[%d] : Sync with status=%d, event_cause=%d: req %lld res 0x%x sync_id 0x%x", - ctx->ctx_id, status, event_cause, + "ctx[%u] link[0x%x] : Sync with status=%d, event_cause=%d: req %lld res 0x%x sync_id 0x%x", + ctx->ctx_id, ctx->link_hdl, status, event_cause, req->request_id, req_isp->fence_map_out[j].resource_handle, req_isp->fence_map_out[j].sync_id); if (req_isp->fence_map_out[j].sync_id == -1) { CAM_WARN(CAM_ISP, - "ctx[%d Deferred buf_done already signalled, req_id=%llu, j=%d, res=0x%x", - ctx->ctx_id, req->request_id, j, + "ctx[%u] link[0x%x] : Deferred buf_done already signalled, req_id=%llu, j=%d, res=0x%x", + ctx->ctx_id, ctx->link_hdl, req->request_id, j, req_isp->fence_map_out[j].resource_handle); continue; } if (!bubble_handling) { CAM_WARN(CAM_ISP, - "Unexpected Buf done for res=0x%x on ctx[%d] for Req %llu, status=%d, possible bh delays", + "Unexpected Buf done for res=0x%x on ctx[%u] link[0x%x] for Req %llu, status=%d, possible bh delays", req_isp->fence_map_out[j].resource_handle, ctx->ctx_id, - req->request_id, status); + ctx->link_hdl, req->request_id, status); rc = cam_sync_signal(req_isp->fence_map_out[j].sync_id, status, event_cause); if (rc) { CAM_ERR(CAM_ISP, - "ctx[%d] : Sync signal for Req %llu, sync_id %d status=%d failed with rc = %d", - ctx->ctx_id, req->request_id, + "ctx[%u] link[0x%x] : Sync signal for Req %llu, sync_id %d status=%d failed with rc = %d", + ctx->ctx_id, ctx->link_hdl, req->request_id, req_isp->fence_map_out[j].sync_id, status, rc); } else { @@ -1903,8 +1908,8 @@ static int __cam_isp_handle_deferred_buf_done( } CAM_DBG(CAM_ISP, - "ctx[%d] : Req %llu : Handled %d deferred buf_dones num_acked=%d, num_fence_map_out=%d", - ctx->ctx_id, req->request_id, req_isp->num_deferred_acks, + "ctx[%u] link[0x%x] : Req %llu : Handled %d deferred buf_dones num_acked=%d, num_fence_map_out=%d", + ctx->ctx_id, ctx->link_hdl, req->request_id, req_isp->num_deferred_acks, req_isp->num_acked, req_isp->num_fence_map_out); req_isp->num_deferred_acks = 0; @@ -1931,9 +1936,9 @@ static int __cam_isp_ctx_handle_deferred_buf_done_in_bubble( if (req_isp->num_acked > req_isp->num_fence_map_out) { /* Should not happen */ CAM_ERR(CAM_ISP, - "WARNING: req_id %lld num_acked %d > map_out %d, ctx %u", + "WARNING: req_id %lld num_acked %d > map_out %d, ctx %u, link[0x%x]", req->request_id, req_isp->num_acked, - req_isp->num_fence_map_out, ctx->ctx_id); + req_isp->num_fence_map_out, ctx->ctx_id, ctx->link_hdl); WARN_ON(req_isp->num_acked > req_isp->num_fence_map_out); } @@ -1964,8 +1969,8 @@ static int __cam_isp_ctx_handle_buf_done_for_request_verify_addr( req_isp = (struct cam_isp_ctx_req *) req->req_priv; - CAM_DBG(CAM_ISP, "Enter with bubble_state %d, req_bubble_detected %d", - bubble_state, req_isp->bubble_detected); + CAM_DBG(CAM_ISP, "Enter with bubble_state %d, req_bubble_detected %d, ctx %u, link[0x%x]", + bubble_state, req_isp->bubble_detected, ctx->ctx_id, ctx->link_hdl); unhandled_done.timestamp = done->timestamp; @@ -2027,10 +2032,10 @@ static int __cam_isp_ctx_handle_buf_done_for_request_verify_addr( * bound to it, we needn't process it. */ CAM_DBG(CAM_ISP, - "BUF_DONE for res %s not active in Req %lld ", + "BUF_DONE for res %s not active in Req %lld ctx %u, link[0x%x]", __cam_isp_resource_handle_id_to_type( ctx_isp->isp_device_type, comp_grp->res_id[i]), - req->request_id); + req->request_id, ctx->ctx_id, ctx->link_hdl); continue; } @@ -2040,8 +2045,8 @@ static int __cam_isp_ctx_handle_buf_done_for_request_verify_addr( req_isp->fence_map_out[j].resource_handle); CAM_WARN(CAM_ISP, - "Duplicate BUF_DONE for req %lld : i=%d, j=%d, res=%s", - req->request_id, i, j, handle_type); + "Duplicate BUF_DONE for req %lld : i=%d, j=%d, res=%s, ctx %u, link[0x%x]", + req->request_id, i, j, handle_type, ctx->ctx_id, ctx->link_hdl); trace_cam_log_event("Duplicate BufDone", handle_type, req->request_id, ctx->ctx_id); @@ -2054,8 +2059,9 @@ static int __cam_isp_ctx_handle_buf_done_for_request_verify_addr( ctx->img_iommu_hdl, req_isp->fence_map_out[j].resource_handle); if (rc) { CAM_ERR(CAM_ISP, - "Failed to retrieve image buffers req_id:%d ctx_id:%d bubble detected:%d rc:%d", - req->request_id, ctx->ctx_id, req_isp->bubble_detected, rc); + "Failed to retrieve image buffers req_id:%d ctx_id:%u link[0x%x] bubble detected:%d rc:%d", + req->request_id, ctx->ctx_id, ctx->link_hdl, + req_isp->bubble_detected, rc); return rc; } } @@ -2076,29 +2082,31 @@ static int __cam_isp_ctx_handle_buf_done_for_request_verify_addr( req_isp->deferred_fence_map_index[deferred_indx] = j; req_isp->num_deferred_acks++; CAM_DBG(CAM_ISP, - "ctx[%d] : Deferred buf done for %llu with bubble state %d recovery %d", - ctx->ctx_id, req->request_id, bubble_state, + "ctx[%u] link[0x%x]:Deferred buf done for %llu with bubble state %d recovery %d", + ctx->ctx_id, ctx->link_hdl, req->request_id, bubble_state, req_isp->bubble_report); CAM_DBG(CAM_ISP, - "ctx[%d] : Deferred info : num_acks=%d, fence_map_index=%d, resource_handle=0x%x, sync_id=%d", - ctx->ctx_id, req_isp->num_deferred_acks, j, + "ctx[%u] link[0x%x]:Deferred info:num_acks=%d,fence_map_index=%d,resource_handle=0x%x,sync_id=%d", + ctx->ctx_id, ctx->link_hdl, req_isp->num_deferred_acks, j, req_isp->fence_map_out[j].resource_handle, req_isp->fence_map_out[j].sync_id); continue; } else if (!req_isp->bubble_detected) { CAM_DBG(CAM_ISP, - "Sync with success: req %lld res 0x%x fd 0x%x, ctx %u", + "Sync with success: req %lld res 0x%x fd 0x%x, ctx:%u link[0x%x]", req->request_id, req_isp->fence_map_out[j].resource_handle, req_isp->fence_map_out[j].sync_id, - ctx->ctx_id); + ctx->ctx_id, ctx->link_hdl); rc = cam_sync_signal(req_isp->fence_map_out[j].sync_id, CAM_SYNC_STATE_SIGNALED_SUCCESS, CAM_SYNC_COMMON_EVENT_SUCCESS); if (rc) { - CAM_ERR(CAM_ISP, "Sync = %u for req = %llu failed with rc = %d", - req_isp->fence_map_out[j].sync_id, req->request_id, rc); + CAM_ERR(CAM_ISP, + "Sync=%u for req=%llu failed with rc=%d ctx:%u link[0x%x]", + req_isp->fence_map_out[j].sync_id, req->request_id, + rc, ctx->ctx_id, ctx->link_hdl); } else if (req_isp->num_deferred_acks) { /* Process deferred buf_done acks */ __cam_isp_handle_deferred_buf_done(ctx_isp, @@ -2110,18 +2118,20 @@ static int __cam_isp_ctx_handle_buf_done_for_request_verify_addr( req_isp->fence_map_out[j].sync_id = -1; } else if (!req_isp->bubble_report) { CAM_DBG(CAM_ISP, - "Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u", + "Sync with failure: req %lld res 0x%x fd 0x%x, ctx:%u link[0x%x]", req->request_id, req_isp->fence_map_out[j].resource_handle, req_isp->fence_map_out[j].sync_id, - ctx->ctx_id); + ctx->ctx_id, ctx->link_hdl); rc = cam_sync_signal(req_isp->fence_map_out[j].sync_id, CAM_SYNC_STATE_SIGNALED_ERROR, CAM_SYNC_ISP_EVENT_BUBBLE); if (rc) { - CAM_ERR(CAM_ISP, "Sync = %u for req = %llu failed with rc = %d", - req_isp->fence_map_out[j].sync_id, req->request_id, rc); + CAM_ERR(CAM_ISP, + "Sync:%u for req:%llu failed with rc:%d,ctx:%u,link[0x%x]", + req_isp->fence_map_out[j].sync_id, req->request_id, + rc, ctx->ctx_id, ctx->link_hdl); } else if (req_isp->num_deferred_acks) { /* Process deferred buf_done acks */ __cam_isp_handle_deferred_buf_done(ctx_isp, req, @@ -2140,11 +2150,11 @@ static int __cam_isp_ctx_handle_buf_done_for_request_verify_addr( */ req_isp->num_acked++; CAM_DBG(CAM_ISP, - "buf done with bubble state %d recovery %d for req %lld, ctx %u", + "buf done with bubble state %d recovery %d for req %lld, ctx_idx:%u link[0x%x]", bubble_state, req_isp->bubble_report, req->request_id, - ctx->ctx_id); + ctx->ctx_id, ctx->link_hdl); /* Process deferred buf_done acks */ if (req_isp->num_deferred_acks) @@ -2157,16 +2167,16 @@ static int __cam_isp_ctx_handle_buf_done_for_request_verify_addr( rc = __cam_isp_ctx_handle_buf_done_for_req_list(ctx_isp, req); if (rc) CAM_ERR(CAM_ISP, - "Error in buf done for req = %llu with rc = %d", - req->request_id, rc); + "Error in buf done for req = %llu with rc = %d, ctx_idx:%u link[0x%x]", + req->request_id, rc, ctx->ctx_id, ctx->link_hdl); return rc; } continue; } - CAM_DBG(CAM_ISP, "req %lld, reset sync id 0x%x ctx %u", + CAM_DBG(CAM_ISP, "req %lld, reset sync id 0x%x ctx_idx:%u link[0x%x]", req->request_id, - req_isp->fence_map_out[j].sync_id, ctx->ctx_id); + req_isp->fence_map_out[j].sync_id, ctx->ctx_id, ctx->link_hdl); if (!rc) { req_isp->num_acked++; } @@ -2188,9 +2198,9 @@ check_deferred: if (req_isp->num_acked > req_isp->num_fence_map_out) { /* Should not happen */ CAM_ERR(CAM_ISP, - "WARNING: req_id %lld num_acked %d > map_out %d, ctx %u", + "WARNING: req_id %lld num_acked %d > map_out %d, ctx_idx:%u link[0x%x]", req->request_id, req_isp->num_acked, - req_isp->num_fence_map_out, ctx->ctx_id); + req_isp->num_fence_map_out, ctx->ctx_id, ctx->link_hdl); } if (req_isp->num_acked != req_isp->num_fence_map_out) @@ -2211,7 +2221,8 @@ static int __cam_isp_ctx_handle_buf_done( struct cam_isp_hw_done_event_data done_next_req = {0}; if (list_empty(&ctx->active_req_list)) { - CAM_WARN(CAM_ISP, "Buf done with no active request"); + CAM_WARN(CAM_ISP, "Buf done with no active request, ctx_idx:%u link[0x%x]", + ctx->ctx_id, ctx->link_hdl); return 0; } @@ -2239,8 +2250,8 @@ static int __cam_isp_ctx_handle_buf_done( */ CAM_WARN(CAM_ISP, - "Unhandled buf done resources for req %lld, trying next request %lld in active_list", - req->request_id, next_req->request_id); + "Unhandled bufdone resources for req %lld,trying next request %lld,ctx:%u link[0x%x]", + req->request_id, next_req->request_id, ctx->ctx_id, ctx->link_hdl); __cam_isp_ctx_handle_buf_done_for_request(ctx_isp, next_req, &done_next_req, @@ -2248,16 +2259,16 @@ static int __cam_isp_ctx_handle_buf_done( if (unhandled_res.resource_handle == 0) CAM_INFO(CAM_ISP, - "BUF Done event handed for next request %lld", - next_req->request_id); + "BUF Done event handed for next request %lld, ctx_idx:%u link[0x%x]", + next_req->request_id, ctx->ctx_id, ctx->link_hdl); else CAM_ERR(CAM_ISP, - "BUF Done not handled for next request %lld", - next_req->request_id); + "BUF Done not handled for next request %lld, ctx_idx:%u link[0x%x]", + next_req->request_id, ctx->ctx_id, ctx->link_hdl); } else { CAM_WARN(CAM_ISP, - "Req %lld only active request, spurious buf_done rxd", - req->request_id); + "Req %lld only active request, spurious buf_done rxd, ctx_idx:%u link[0x%x]", + req->request_id, ctx->ctx_id, ctx->link_hdl); } } @@ -2333,11 +2344,12 @@ static void __cam_isp_ctx_try_buf_done_process_for_active_request( break; CAM_WARN(CAM_ISP, - "Processing delayed buf done req: %llu bubble_detected: %s res: 0x%x fd: 0x%x, ctx: %u [deferred req: %llu last applied: %llu]", + "Processing delayed buf done req: %llu bubble_detected: %s res: 0x%x fd: 0x%x, ctx: %u link: 0x%x [deferred req: %llu last applied: %llu]", curr_active_req->request_id, CAM_BOOL_TO_YESNO(curr_active_isp_req->bubble_detected), curr_active_isp_req->fence_map_out[j].resource_handle, - curr_active_isp_req->fence_map_out[j].sync_id, ctx->ctx_id, + curr_active_isp_req->fence_map_out[j].sync_id, + ctx->ctx_id, ctx->link_hdl, deferred_req->request_id, ctx_isp->last_applied_req_id); /* Signal only if bubble is not detected for this request */ @@ -2347,9 +2359,10 @@ static void __cam_isp_ctx_try_buf_done_process_for_active_request( CAM_SYNC_COMMON_EVENT_SUCCESS); if (rc) CAM_ERR(CAM_ISP, - "Sync: %d for req: %llu failed with rc: %d", + "Sync: %d for req: %llu failed with rc: %d, ctx: %u link: 0x%x", curr_active_isp_req->fence_map_out[j].sync_id, - curr_active_req->request_id, rc); + curr_active_req->request_id, rc, + ctx->ctx_id, ctx->link_hdl); curr_active_isp_req->fence_map_out[j].sync_id = -1; } @@ -2383,9 +2396,10 @@ static int __cam_isp_ctx_check_deferred_buf_done( if (ctx_isp->last_applied_req_id != ctx_isp->last_bufdone_err_apply_req_id) { CAM_DBG(CAM_ISP, - "Trying to find buf done with req in wait list, req %llu last apply id:%lld last err id:%lld curr_num_deferred: %u", + "Trying to find buf done with req in wait list, req %llu last apply id:%lld last err id:%lld curr_num_deferred: %u, ctx: %u link: 0x%x", req->request_id, ctx_isp->last_applied_req_id, - ctx_isp->last_bufdone_err_apply_req_id, curr_num_deferred); + ctx_isp->last_bufdone_err_apply_req_id, curr_num_deferred, + ctx->ctx_id, ctx->link_hdl); ctx_isp->last_bufdone_err_apply_req_id = ctx_isp->last_applied_req_id; } @@ -2419,9 +2433,10 @@ static int __cam_isp_ctx_check_deferred_buf_done( if (ctx_isp->last_applied_req_id != ctx_isp->last_bufdone_err_apply_req_id) { CAM_DBG(CAM_ISP, - "Trying to find buf done with req in pending list, req %llu last apply id:%lld last err id:%lld curr_num_deferred: %u", + "Trying to find buf done with req in pending list, req %llu last apply id:%lld last err id:%lld curr_num_deferred: %u, ctx: %u link: 0x%x", req->request_id, ctx_isp->last_applied_req_id, - ctx_isp->last_bufdone_err_apply_req_id, curr_num_deferred); + ctx_isp->last_bufdone_err_apply_req_id, curr_num_deferred, + ctx->ctx_id, ctx->link_hdl); ctx_isp->last_bufdone_err_apply_req_id = ctx_isp->last_applied_req_id; } @@ -2445,8 +2460,8 @@ static int __cam_isp_ctx_check_deferred_buf_done( if (!req_in_pending_wait_list && (ctx_isp->last_applied_req_id != ctx_isp->last_bufdone_err_apply_req_id)) { CAM_DBG(CAM_ISP, - "Buf done with no active request bubble_state=%d last_applied_req_id:%lld", - bubble_state, ctx_isp->last_applied_req_id); + "Bufdone without active request bubble_state=%d last_applied_req_id:%lld,ctx:%u link:0x%x", + bubble_state, ctx_isp->last_applied_req_id, ctx->ctx_id, ctx->link_hdl); ctx_isp->last_bufdone_err_apply_req_id = ctx_isp->last_applied_req_id; } @@ -2483,8 +2498,8 @@ static int __cam_isp_ctx_handle_buf_done_verify_addr( &irq_delay_detected); else CAM_WARN(CAM_ISP, - "Req %lld only active request, spurious buf_done rxd", - req->request_id); + "Req %lld only active request, spurious buf_done rxd, ctx: %u link: 0x%x", + req->request_id, ctx->ctx_id, ctx->link_hdl); } /* @@ -2545,7 +2560,9 @@ static int __cam_isp_ctx_apply_pending_req( ctx = ctx_isp->base; if (list_empty(&ctx->pending_req_list)) { - CAM_DBG(CAM_ISP, "No pending requests to apply"); + CAM_DBG(CAM_ISP, + "No pending requests to apply, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); rc = -EFAULT; goto end; } @@ -2572,8 +2589,8 @@ static int __cam_isp_ctx_apply_pending_req( list); spin_unlock_bh(&ctx->lock); - CAM_DBG(CAM_REQ, "Apply request %lld in substate %d ctx %u", - req->request_id, ctx_isp->substate_activated, ctx->ctx_id); + CAM_DBG(CAM_REQ, "Apply request %lld in substate %d ctx_idx: %u, link: 0x%x", + req->request_id, ctx_isp->substate_activated, ctx->ctx_id, ctx->link_hdl); req_isp = (struct cam_isp_ctx_req *) req->req_priv; cfg.ctxt_to_hw_map = ctx_isp->hw_ctx; @@ -2602,7 +2619,9 @@ static int __cam_isp_ctx_apply_pending_req( rc = ctx->hw_mgr_intf->hw_config(ctx->hw_mgr_intf->hw_mgr_priv, &cfg); if (rc) { - CAM_ERR_RATE_LIMIT(CAM_ISP, "Can not apply the configuration"); + CAM_ERR_RATE_LIMIT(CAM_ISP, + "Can not apply the configuration,ctx: %u,link: 0x%x", + ctx->ctx_id, ctx->link_hdl); spin_lock_bh(&ctx->lock); ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_SOF; @@ -2615,9 +2634,9 @@ static int __cam_isp_ctx_apply_pending_req( spin_unlock_bh(&ctx->lock); } else { atomic_set(&ctx_isp->apply_in_progress, 0); - CAM_DBG(CAM_ISP, "New substate state %d, applied req %lld", + CAM_DBG(CAM_ISP, "New substate state %d, applied req %lld, ctx: %u, link: 0x%x", CAM_ISP_CTX_ACTIVATED_APPLIED, - ctx_isp->last_applied_req_id); + ctx_isp->last_applied_req_id, ctx->ctx_id, ctx->link_hdl); __cam_isp_ctx_update_state_monitor_array(ctx_isp, CAM_ISP_STATE_CHANGE_TRIGGER_APPLIED, @@ -2657,16 +2676,17 @@ static int __cam_isp_ctx_offline_epoch_in_activated_state( atomic_set(&ctx_isp->rxd_epoch, 1); - CAM_DBG(CAM_ISP, "SOF frame %lld ctx %u", ctx_isp->frame_id, - ctx->ctx_id); + CAM_DBG(CAM_ISP, "SOF frame %lld ctx %u link: 0x%x", ctx_isp->frame_id, + ctx->ctx_id, ctx->link_hdl); /* * For offline it is not possible for epoch to be generated without * RUP done. IRQ scheduling delays can possibly cause this. */ if (list_empty(&ctx->active_req_list)) { - CAM_WARN(CAM_ISP, "Active list empty on ctx: %u - EPOCH serviced before RUP", - ctx->ctx_id); + CAM_WARN(CAM_ISP, + "Active list empty on ctx:%u link:0x%x - EPOCH serviced before RUP", + ctx->ctx_id, ctx->link_hdl); } else { list_for_each_entry_safe(req, req_temp, &ctx->active_req_list, list) { if (req->request_id > ctx_isp->reported_req_id) { @@ -2702,7 +2722,7 @@ static int __cam_isp_ctx_reg_upd_in_epoch_bubble_state( ctx_isp->substate_activated)); else CAM_WARN_RATE_LIMIT(CAM_ISP, - "ctx_id:%d Unexpected reg update in activated Substate[%s] for frame_id:%lld", + "ctx:%u Unexpected regupdate in activated Substate[%s] for frame_id:%lld", ctx_isp->base->ctx_id, __cam_isp_ctx_substate_val_to_type( ctx_isp->substate_activated), @@ -2720,7 +2740,8 @@ static int __cam_isp_ctx_reg_upd_in_applied_state( uint64_t request_id = 0; if (list_empty(&ctx->wait_req_list)) { - CAM_ERR(CAM_ISP, "Reg upd ack with no waiting request"); + CAM_ERR(CAM_ISP, "Reg upd ack with no waiting request, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); goto end; } req = list_first_entry(&ctx->wait_req_list, @@ -2733,16 +2754,16 @@ static int __cam_isp_ctx_reg_upd_in_applied_state( ctx_isp->active_req_cnt++; request_id = req->request_id; CAM_DBG(CAM_REQ, - "move request %lld to active list(cnt = %d), ctx %u", - req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id); + "move request %lld to active list(cnt = %d), ctx %u, link: 0x%x", + req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id, ctx->link_hdl); __cam_isp_ctx_update_event_record(ctx_isp, CAM_ISP_CTX_EVENT_RUP, req); } else { /* no io config, so the request is completed. */ list_add_tail(&req->list, &ctx->free_req_list); CAM_DBG(CAM_ISP, - "move active request %lld to free list(cnt = %d), ctx %u", - req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id); + "move active request %lld to free list(cnt = %d), ctx %u, link: 0x%x", + req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id, ctx->link_hdl); } /* @@ -2750,9 +2771,9 @@ static int __cam_isp_ctx_reg_upd_in_applied_state( * state so change substate here. */ ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_EPOCH; - CAM_DBG(CAM_ISP, "next Substate[%s]", + CAM_DBG(CAM_ISP, "next Substate[%s], ctx %u, link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated)); + ctx_isp->substate_activated), ctx->ctx_id, ctx->link_hdl); __cam_isp_ctx_update_state_monitor_array(ctx_isp, CAM_ISP_STATE_CHANGE_TRIGGER_REG_UPDATE, request_id); @@ -2785,7 +2806,8 @@ static int __cam_isp_ctx_notify_sof_in_activated_state( if (atomic_read(&ctx_isp->process_bubble)) { if (list_empty(&ctx->active_req_list)) { CAM_ERR(CAM_ISP, - "No available active req in bubble"); + "No available active req in bubble, ctx %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); atomic_set(&ctx_isp->process_bubble, 0); ctx_isp->bubble_frame_cnt = 0; rc = -EINVAL; @@ -2795,8 +2817,8 @@ static int __cam_isp_ctx_notify_sof_in_activated_state( if (ctx_isp->last_sof_timestamp == ctx_isp->sof_timestamp_val) { CAM_DBG(CAM_ISP, - "Tasklet delay detected! Bubble frame check skipped, sof_timestamp: %lld", - ctx_isp->sof_timestamp_val); + "Tasklet delay detected! Bubble frame check skipped, sof_timestamp: %lld, ctx %u, link: 0x%x", + ctx_isp->sof_timestamp_val, ctx->ctx_id, ctx->link_hdl); goto notify_only; } @@ -2815,23 +2837,24 @@ static int __cam_isp_ctx_notify_sof_in_activated_state( ctx->hw_mgr_intf->hw_mgr_priv, &hw_cmd_args); if (rc) { - CAM_ERR(CAM_ISP, "HW command failed"); + CAM_ERR(CAM_ISP, "HW command failed, ctx %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); return rc; } last_cdm_done_req = isp_hw_cmd_args.u.last_cdm_done; - CAM_DBG(CAM_ISP, "last_cdm_done req: %d", - last_cdm_done_req); + CAM_DBG(CAM_ISP, "last_cdm_done req: %d, ctx %u, link: 0x%x", + last_cdm_done_req, ctx->ctx_id, ctx->link_hdl); if (last_cdm_done_req >= req->request_id) { CAM_DBG(CAM_ISP, - "CDM callback detected for req: %lld, possible buf_done delay, waiting for buf_done", - req->request_id); + "invalid sof event data CDM cb detected for req: %lld, possible buf_done delay, waiting for buf_done, ctx %u, link: 0x%x", + req->request_id, ctx->ctx_id, ctx->link_hdl); ctx_isp->bubble_frame_cnt = 0; } else { CAM_DBG(CAM_ISP, - "CDM callback not happened for req: %lld, possible CDM stuck or workqueue delay", - req->request_id); + "CDM callback not happened for req: %lld, possible CDM stuck or workqueue delay, ctx %u, link: 0x%x", + req->request_id, ctx->ctx_id, ctx->link_hdl); req_isp->num_acked = 0; req_isp->num_deferred_acks = 0; ctx_isp->bubble_frame_cnt = 0; @@ -2842,19 +2865,19 @@ static int __cam_isp_ctx_notify_sof_in_activated_state( atomic_set(&ctx_isp->process_bubble, 0); ctx_isp->active_req_cnt--; CAM_DBG(CAM_REQ, - "Move active req: %lld to pending list(cnt = %d) [bubble re-apply],ctx %u", + "Move active req: %lld to pending list(cnt = %d) [bubble re-apply], ctx %u link: 0x%x", req->request_id, - ctx_isp->active_req_cnt, ctx->ctx_id); + ctx_isp->active_req_cnt, ctx->ctx_id, ctx->link_hdl); } } else if (req_isp->bubble_detected) { ctx_isp->bubble_frame_cnt++; CAM_DBG(CAM_ISP, - "Waiting on bufdone for bubble req: %lld, since frame_cnt = %lld", + "Waiting on bufdone for bubble req: %lld, since frame_cnt = %lld, ctx %u link: 0x%x", req->request_id, - ctx_isp->bubble_frame_cnt); + ctx_isp->bubble_frame_cnt, ctx->ctx_id, ctx->link_hdl); } else { - CAM_DBG(CAM_ISP, "Delayed bufdone for req: %lld", - req->request_id); + CAM_DBG(CAM_ISP, "Delayed bufdone for req: %lld, ctx %u link: 0x%x", + req->request_id, ctx->ctx_id, ctx->link_hdl); } } @@ -2949,7 +2972,8 @@ static int __cam_isp_ctx_sof_in_activated_state( } if (!evt_data) { - CAM_ERR(CAM_ISP, "in valid sof event data"); + CAM_ERR(CAM_ISP, "in valid sof event data, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); return -EINVAL; } @@ -2958,8 +2982,9 @@ static int __cam_isp_ctx_sof_in_activated_state( __cam_isp_ctx_update_state_monitor_array(ctx_isp, CAM_ISP_STATE_CHANGE_TRIGGER_SOF, request_id); - CAM_DBG(CAM_ISP, "frame id: %lld time stamp:0x%llx, ctx %u request %llu", - ctx_isp->frame_id, ctx_isp->sof_timestamp_val, ctx->ctx_id, request_id); + CAM_DBG(CAM_ISP, "frame id: %lld time stamp:0x%llx, ctx %u request %llu, link: 0x%x", + ctx_isp->frame_id, ctx_isp->sof_timestamp_val, ctx->ctx_id, request_id, + ctx->link_hdl); return rc; } @@ -2990,7 +3015,8 @@ static int __cam_isp_ctx_reg_upd_in_sof(struct cam_isp_context *ctx_isp, list_add_tail(&req->list, &ctx->free_req_list); else CAM_ERR(CAM_ISP, - "receive rup in unexpected state"); + "receive rup in unexpected state, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); } if (req != NULL) { __cam_isp_ctx_update_state_monitor_array(ctx_isp, @@ -3024,7 +3050,7 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp, * If no wait req in epoch, this is an error case. * The recovery is to go back to sof state */ - CAM_ERR(CAM_ISP, "Ctx:%d No wait request", ctx->ctx_id); + CAM_ERR(CAM_ISP, "Ctx:%u link: 0x%x No wait request", ctx->ctx_id, ctx->link_hdl); ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_SOF; /* Send SOF event as empty frame*/ @@ -3066,8 +3092,8 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp, req_isp->cdm_reset_before_apply = false; atomic_set(&ctx_isp->process_bubble, 1); - CAM_INFO_RATE_LIMIT(CAM_ISP, "ctx:%d Report Bubble flag %d req id:%lld", - ctx->ctx_id, req_isp->bubble_report, req->request_id); + CAM_INFO_RATE_LIMIT(CAM_ISP, "ctx:%u link: 0x%x Report Bubble flag %d req id:%lld", + ctx->ctx_id, ctx->link_hdl, req_isp->bubble_report, req->request_id); if (req_isp->bubble_report) { __cam_isp_ctx_notify_error_util(CAM_TRIGGER_POINT_SOF, CRM_KMD_ERR_BUBBLE, @@ -3076,8 +3102,8 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp, req->request_id, ctx->ctx_id); } else { req_isp->bubble_report = 0; - CAM_DBG(CAM_ISP, "Skip bubble recovery for req %lld ctx %u", - req->request_id, ctx->ctx_id); + CAM_DBG(CAM_ISP, "Skip bubble recovery for req %lld ctx %u, link: 0x%x", + req->request_id, ctx->ctx_id, ctx->link_hdl); if (ctx_isp->active_req_cnt <= 1) __cam_isp_ctx_notify_trigger_util(CAM_TRIGGER_POINT_SOF, ctx_isp); @@ -3090,8 +3116,8 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp, list_del_init(&req->list); list_add_tail(&req->list, &ctx->active_req_list); ctx_isp->active_req_cnt++; - CAM_DBG(CAM_REQ, "move request %lld to active list(cnt = %d), ctx %u", - req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id); + CAM_DBG(CAM_REQ, "move request %lld to active list(cnt = %d), ctx %u, link: 0x%x", + req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id, ctx->link_hdl); /* * Handle the deferred buf done after moving @@ -3118,8 +3144,8 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp, request_id = req->request_id; ctx_isp->reported_req_id = request_id; CAM_DBG(CAM_ISP, - "ctx %d reported_req_id update to %lld", - ctx->ctx_id, ctx_isp->reported_req_id); + "ctx %u link: 0x%x reported_req_id update to %lld", + ctx->ctx_id, ctx->link_hdl, ctx_isp->reported_req_id); break; } } @@ -3146,9 +3172,9 @@ end: CAM_ISP_STATE_CHANGE_TRIGGER_EPOCH, request_id); } - CAM_DBG(CAM_ISP, "next Substate[%s]", + CAM_DBG(CAM_ISP, "next Substate[%s], ctx_idx: %u link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated)); + ctx_isp->substate_activated), ctx->ctx_id, ctx->link_hdl); return 0; } @@ -3191,14 +3217,16 @@ static int __cam_isp_ctx_sof_in_epoch(struct cam_isp_context *ctx_isp, ctx_isp->last_sof_jiffies = jiffies; if (atomic_read(&ctx_isp->apply_in_progress)) - CAM_INFO(CAM_ISP, "Apply is in progress at the time of SOF"); + CAM_INFO(CAM_ISP, "Apply is in progress at the time of SOF, ctx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); __cam_isp_ctx_update_sof_ts_util(sof_event_data, ctx_isp); if (list_empty(&ctx->active_req_list)) ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_SOF; else - CAM_DBG(CAM_ISP, "Still need to wait for the buf done"); + CAM_DBG(CAM_ISP, "Still need to wait for the buf done, ctx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); req = list_last_entry(&ctx->active_req_list, struct cam_ctx_request, list); @@ -3209,13 +3237,13 @@ static int __cam_isp_ctx_sof_in_epoch(struct cam_isp_context *ctx_isp, if (ctx_isp->frame_id == 1) CAM_INFO(CAM_ISP, - "First SOF in EPCR ctx:%d frame_id:%lld next substate %s", - ctx->ctx_id, ctx_isp->frame_id, + "First SOF in EPCR ctx:%u link: 0x%x frame_id:%lld next substate %s", + ctx->ctx_id, ctx->link_hdl, ctx_isp->frame_id, __cam_isp_ctx_substate_val_to_type( ctx_isp->substate_activated)); - CAM_DBG(CAM_ISP, "SOF in epoch ctx:%d frame_id:%lld next substate:%s", - ctx->ctx_id, ctx_isp->frame_id, + CAM_DBG(CAM_ISP, "SOF in epoch ctx:%u link: 0x%x frame_id:%lld next substate:%s", + ctx->ctx_id, ctx->link_hdl, ctx_isp->frame_id, __cam_isp_ctx_substate_val_to_type( ctx_isp->substate_activated)); @@ -3255,7 +3283,8 @@ static int __cam_isp_ctx_epoch_in_bubble_applied( (struct cam_isp_hw_epoch_event_data *)evt_data; if (!evt_data) { - CAM_ERR(CAM_ISP, "invalid event data"); + CAM_ERR(CAM_ISP, "invalid event data, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); return -EINVAL; } @@ -3271,7 +3300,8 @@ static int __cam_isp_ctx_epoch_in_bubble_applied( * If no pending req in epoch, this is an error case. * Just go back to the bubble state. */ - CAM_ERR(CAM_ISP, "ctx:%d No pending request.", ctx->ctx_id); + CAM_ERR(CAM_ISP, "ctx:%u link: 0x%x No pending request.", + ctx->ctx_id, ctx->link_hdl); __cam_isp_ctx_send_sof_timestamp(ctx_isp, request_id, CAM_REQ_MGR_SOF_EVENT_SUCCESS); __cam_isp_ctx_update_event_record(ctx_isp, @@ -3285,8 +3315,8 @@ static int __cam_isp_ctx_epoch_in_bubble_applied( list); req_isp = (struct cam_isp_ctx_req *)req->req_priv; req_isp->bubble_detected = true; - CAM_INFO_RATE_LIMIT(CAM_ISP, "Ctx:%d Report Bubble flag %d req id:%lld", - ctx->ctx_id, req_isp->bubble_report, req->request_id); + CAM_INFO_RATE_LIMIT(CAM_ISP, "Ctx:%u link: 0x%x Report Bubble flag %d req id:%lld", + ctx->ctx_id, ctx->link_hdl, req_isp->bubble_report, req->request_id); req_isp->reapply_type = CAM_CONFIG_REAPPLY_IO; req_isp->cdm_reset_before_apply = false; @@ -3296,8 +3326,8 @@ static int __cam_isp_ctx_epoch_in_bubble_applied( atomic_set(&ctx_isp->process_bubble, 1); } else { req_isp->bubble_report = 0; - CAM_DBG(CAM_ISP, "Skip bubble recovery for req %lld ctx %u", - req->request_id, ctx->ctx_id); + CAM_DBG(CAM_ISP, "Skip bubble recovery for req %lld ctx %u link: 0x%x", + req->request_id, ctx->ctx_id, ctx->link_hdl); if (ctx_isp->active_req_cnt <= 1) __cam_isp_ctx_notify_trigger_util(CAM_TRIGGER_POINT_SOF, ctx_isp); @@ -3311,8 +3341,8 @@ static int __cam_isp_ctx_epoch_in_bubble_applied( list_del_init(&req->list); list_add_tail(&req->list, &ctx->active_req_list); ctx_isp->active_req_cnt++; - CAM_DBG(CAM_ISP, "move request %lld to active list(cnt = %d) ctx %u", - req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id); + CAM_DBG(CAM_ISP, "move request %lld to active list(cnt = %d) ctx %u, link: 0x%x", + req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id, ctx->link_hdl); /* * Handle the deferred buf done after moving @@ -3355,15 +3385,15 @@ static int __cam_isp_ctx_epoch_in_bubble_applied( CAM_ISP_CTX_EVENT_EPOCH, NULL); } ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_BUBBLE; - CAM_DBG(CAM_ISP, "next Substate[%s]", + CAM_DBG(CAM_ISP, "next Substate[%s], ctx_idx: %u, link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated)); + ctx_isp->substate_activated), ctx->ctx_id, ctx->link_hdl); cam_req_mgr_debug_delay_detect(); trace_cam_delay_detect("ISP", "bubble epoch_in_bubble_applied", - req->request_id, ctx->ctx_id, - ctx->link_hdl, ctx->session_hdl, + req->request_id, ctx->ctx_id, ctx->link_hdl, + ctx->session_hdl, CAM_DEFAULT_VALUE); end: req = list_last_entry(&ctx->active_req_list, struct cam_ctx_request, @@ -3590,8 +3620,8 @@ static int __cam_isp_ctx_handle_recovery_req_util( if (rc) { /* Unable to notify CRM to do reapply back to normal */ CAM_WARN(CAM_ISP, - "ctx:%u unable to notify CRM for req %llu", - ctx->ctx_id, ctx_isp->recovery_req_id); + "ctx:%u link:0x%x unable to notify CRM for req %llu", + ctx->ctx_id, ctx->link_hdl, ctx_isp->recovery_req_id); ctx_isp->recovery_req_id = 0; atomic_set(&ctx_isp->internal_recovery_set, 0); } @@ -3653,7 +3683,8 @@ static int __cam_isp_ctx_handle_error(struct cam_isp_context *ctx_isp, struct cam_isp_hw_error_event_data *error_event_data = (struct cam_isp_hw_error_event_data *)evt_data; - CAM_DBG(CAM_ISP, "Enter HW error_type = %d", error_event_data->error_type); + CAM_DBG(CAM_ISP, "Enter HW error_type = %d, ctx:%u on link 0x%x", + error_event_data->error_type, ctx->ctx_id, ctx->link_hdl); if (error_event_data->try_internal_recovery) { rc = __cam_isp_ctx_trigger_error_req_reapply(error_event_data->error_type, ctx_isp); @@ -3675,10 +3706,12 @@ static int __cam_isp_ctx_handle_error(struct cam_isp_context *ctx_isp, */ if (list_empty(&ctx->active_req_list)) { CAM_DBG(CAM_ISP, - "handling error with no active request"); + "handling error with no active request, ctx:%u on link 0x%x", + ctx->ctx_id, ctx->link_hdl); if (list_empty(&ctx->wait_req_list)) { CAM_ERR_RATE_LIMIT(CAM_ISP, - "Error with no active/wait request"); + "Error with no active/wait request, ctx:%u on link 0x%x", + ctx->ctx_id, ctx->link_hdl); goto end; } else { req_to_dump = list_first_entry(&ctx->wait_req_list, @@ -3701,17 +3734,17 @@ static int __cam_isp_ctx_handle_error(struct cam_isp_context *ctx_isp, &ctx->active_req_list, list) { req_isp = (struct cam_isp_ctx_req *) req->req_priv; if (!req_isp->bubble_report) { - CAM_ERR(CAM_ISP, "signalled error for req %llu", - req->request_id); + CAM_ERR(CAM_ISP, "signalled error for req %llu, ctx:%u on link 0x%x", + req->request_id, ctx->ctx_id, ctx->link_hdl); for (i = 0; i < req_isp->num_fence_map_out; i++) { fence_map_out = &req_isp->fence_map_out[i]; if (req_isp->fence_map_out[i].sync_id != -1) { CAM_DBG(CAM_ISP, - "req %llu, Sync fd 0x%x ctx %u", + "req %llu, Sync fd 0x%x ctx %u, link 0x%x", req->request_id, req_isp->fence_map_out[i].sync_id, - ctx->ctx_id); + ctx->ctx_id, ctx->link_hdl); rc = cam_sync_signal( fence_map_out->sync_id, CAM_SYNC_STATE_SIGNALED_ERROR, @@ -3735,17 +3768,17 @@ static int __cam_isp_ctx_handle_error(struct cam_isp_context *ctx_isp, &ctx->wait_req_list, list) { req_isp = (struct cam_isp_ctx_req *) req->req_priv; if (!req_isp->bubble_report) { - CAM_ERR(CAM_ISP, "signalled error for req %llu", - req->request_id); + CAM_ERR(CAM_ISP, "signalled error for req %llu, ctx %u, link 0x%x", + req->request_id, ctx->ctx_id, ctx->link_hdl); for (i = 0; i < req_isp->num_fence_map_out; i++) { fence_map_out = &req_isp->fence_map_out[i]; if (req_isp->fence_map_out[i].sync_id != -1) { CAM_DBG(CAM_ISP, - "req %llu, Sync fd 0x%x ctx %u", + "req %llu, Sync fd 0x%x ctx %u link 0x%x", req->request_id, req_isp->fence_map_out[i].sync_id, - ctx->ctx_id); + ctx->ctx_id, ctx->link_hdl); rc = cam_sync_signal( fence_map_out->sync_id, CAM_SYNC_STATE_SIGNALED_ERROR, @@ -3840,7 +3873,7 @@ end: req_mgr_err_code, error_request_id, ctx); ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_HW_ERROR; - CAM_DBG(CAM_ISP, "Handling error done on ctx: %u", ctx->ctx_id); + CAM_DBG(CAM_ISP, "Handling error done on ctx: %u, link: 0x%x", ctx->ctx_id, ctx->link_hdl); exit: return rc; @@ -3856,14 +3889,15 @@ static int __cam_isp_ctx_fs2_sof_in_sof_state( uint64_t request_id = 0; if (!evt_data) { - CAM_ERR(CAM_ISP, "in valid sof event data"); + CAM_ERR(CAM_ISP, "in valid sof event data, ctx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); return -EINVAL; } __cam_isp_ctx_update_sof_ts_util(sof_event_data, ctx_isp); - CAM_DBG(CAM_ISP, "frame id: %lld time stamp:0x%llx", - ctx_isp->frame_id, ctx_isp->sof_timestamp_val); + CAM_DBG(CAM_ISP, "frame id: %lld time stamp:0x%llx, ctx: %u, link: 0x%x", + ctx_isp->frame_id, ctx_isp->sof_timestamp_val, ctx->ctx_id, ctx->link_hdl); if (!(list_empty(&ctx->wait_req_list))) goto end; @@ -3911,7 +3945,8 @@ static int __cam_isp_ctx_fs2_buf_done(struct cam_isp_context *ctx_isp, if (prev_active_req_cnt == ctx_isp->active_req_cnt + 1) { if (list_empty(&ctx->wait_req_list) && list_empty(&ctx->active_req_list)) { - CAM_DBG(CAM_ISP, "No request, move to SOF"); + CAM_DBG(CAM_ISP, "No request, move to SOF, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_SOF; if (ctx_isp->reported_req_id < curr_req_id) { @@ -3971,7 +4006,8 @@ static int __cam_isp_ctx_fs2_reg_upd_in_sof(struct cam_isp_context *ctx_isp, list_add_tail(&req->list, &ctx->free_req_list); else CAM_ERR(CAM_ISP, - "receive rup in unexpected state"); + "receive rup in unexpected state, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); } if (req != NULL) { __cam_isp_ctx_update_state_monitor_array(ctx_isp, @@ -3992,7 +4028,8 @@ static int __cam_isp_ctx_fs2_reg_upd_in_applied_state( uint64_t request_id = 0; if (list_empty(&ctx->wait_req_list)) { - CAM_ERR(CAM_ISP, "Reg upd ack with no waiting request"); + CAM_ERR(CAM_ISP, "Reg upd ack with no waiting request, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); goto end; } req = list_first_entry(&ctx->wait_req_list, @@ -4003,8 +4040,8 @@ static int __cam_isp_ctx_fs2_reg_upd_in_applied_state( if (req_isp->num_fence_map_out != 0) { list_add_tail(&req->list, &ctx->active_req_list); ctx_isp->active_req_cnt++; - CAM_DBG(CAM_REQ, "move request %lld to active list(cnt = %d)", - req->request_id, ctx_isp->active_req_cnt); + CAM_DBG(CAM_REQ, "move request %lld to active list(cnt = %d), ctx:%u,link:0x%x", + req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id, ctx->link_hdl); } else { /* no io config, so the request is completed. */ list_add_tail(&req->list, &ctx->free_req_list); @@ -4033,8 +4070,9 @@ static int __cam_isp_ctx_fs2_reg_upd_in_applied_state( __cam_isp_ctx_notify_trigger_util(CAM_TRIGGER_POINT_SOF, ctx_isp); } - CAM_DBG(CAM_ISP, "next Substate[%s]", - __cam_isp_ctx_substate_val_to_type(ctx_isp->substate_activated)); + CAM_DBG(CAM_ISP, "next Substate[%s], ctx_idx: %u, link: 0x%x", + __cam_isp_ctx_substate_val_to_type(ctx_isp->substate_activated), + ctx->ctx_id, ctx->link_hdl); end: if (req != NULL && !rc) { @@ -4489,8 +4527,8 @@ static inline int cam_isp_context_apply_evt_injection(struct cam_context *ctx) inject_evt.evt_params = evt_inject_params; rc = cam_context_apply_evt_injection(ctx, &inject_evt); if (rc) - CAM_ERR(CAM_ISP, "Fail to apply event injection ctx_id: %u req_id: %u", - ctx->ctx_id, evt_inject_params->req_id); + CAM_ERR(CAM_ISP, "Fail to apply event injection ctx_id: %u link: 0x%x req_id: %u", + ctx->ctx_id, ctx->link_hdl, evt_inject_params->req_id); evt_inject_params->is_valid = false; @@ -4518,16 +4556,16 @@ static int __cam_isp_ctx_apply_req_in_activated_state( if (apply->re_apply) if (apply->request_id <= ctx_isp->last_applied_req_id) { CAM_INFO_RATE_LIMIT(CAM_ISP, - "ctx_id:%d Trying to reapply the same request %llu again", - ctx->ctx_id, + "ctx_id:%u link: 0x%x Trying to reapply the same request %llu again", + ctx->ctx_id, ctx->link_hdl, apply->request_id); return 0; } if (list_empty(&ctx->pending_req_list)) { CAM_ERR_RATE_LIMIT(CAM_ISP, - "ctx_id:%d No available request for Apply id %lld", - ctx->ctx_id, + "ctx_id:%u link: 0x%x No available request for Apply id %lld", + ctx->ctx_id, ctx->link_hdl, apply->request_id); rc = -EFAULT; goto end; @@ -4541,8 +4579,8 @@ static int __cam_isp_ctx_apply_req_in_activated_state( */ if (atomic_read(&ctx_isp->process_bubble)) { CAM_INFO_RATE_LIMIT(CAM_ISP, - "ctx_id:%d Processing bubble cannot apply Request Id %llu", - ctx->ctx_id, + "ctx_id:%u link: 0x%x Processing bubble cannot apply Request Id %llu", + ctx->ctx_id, ctx->link_hdl, apply->request_id); rc = -EFAULT; goto end; @@ -4554,8 +4592,8 @@ static int __cam_isp_ctx_apply_req_in_activated_state( */ if (atomic_read(&ctx_isp->internal_recovery_set)) { CAM_INFO_RATE_LIMIT(CAM_ISP, - "ctx_id:%d Processing recovery cannot apply Request Id %lld", - ctx->ctx_id, + "ctx_id:%u link: 0x%x Processing recovery cannot apply Request Id %lld", + ctx->ctx_id, ctx->link_hdl, apply->request_id); rc = -EAGAIN; goto end; @@ -4572,25 +4610,25 @@ static int __cam_isp_ctx_apply_req_in_activated_state( */ if (req->request_id != apply->request_id) { CAM_ERR_RATE_LIMIT(CAM_ISP, - "ctx_id:%d Invalid Request Id asking %llu existing %llu", - ctx->ctx_id, + "ctx_id:%u link: 0x%x Invalid Request Id asking %llu existing %llu", + ctx->ctx_id, ctx->link_hdl, apply->request_id, req->request_id); rc = -EFAULT; goto end; } - CAM_DBG(CAM_REQ, "Apply request %lld in Substate[%s] ctx %u", + CAM_DBG(CAM_REQ, "Apply request %lld in Substate[%s] ctx %u, link: 0x%x", req->request_id, __cam_isp_ctx_substate_val_to_type(ctx_isp->substate_activated), - ctx->ctx_id); + ctx->ctx_id, ctx->link_hdl); req_isp = (struct cam_isp_ctx_req *) req->req_priv; if (ctx_isp->active_req_cnt >= 2) { CAM_WARN_RATE_LIMIT(CAM_ISP, - "Reject apply request (id %lld) due to congestion(cnt = %d) ctx %u", + "Reject apply request (id %lld) due to congestion(cnt = %d) ctx %u, link: 0x%x", req->request_id, ctx_isp->active_req_cnt, - ctx->ctx_id); + ctx->ctx_id, ctx->link_hdl); spin_lock_bh(&ctx->lock); if (!list_empty(&ctx->active_req_list)) @@ -4598,8 +4636,8 @@ static int __cam_isp_ctx_apply_req_in_activated_state( struct cam_ctx_request, list); else CAM_ERR_RATE_LIMIT(CAM_ISP, - "WARNING: should not happen (cnt = %d) but active_list empty", - ctx_isp->active_req_cnt); + "WARNING: should not happen (cnt = %d) but active_list empty, ctx %u, link: 0x%x", + ctx_isp->active_req_cnt, ctx->ctx_id, ctx->link_hdl); spin_unlock_bh(&ctx->lock); if (active_req) { @@ -4653,9 +4691,9 @@ static int __cam_isp_ctx_apply_req_in_activated_state( __cam_isp_ctx_enqueue_request_in_order(ctx, req, false); else list_add_tail(&req->list, &ctx->wait_req_list); - CAM_DBG(CAM_ISP, "new substate Substate[%s], applied req %lld", + CAM_DBG(CAM_ISP, "new Substate[%s], applied req %lld, ctx_idx: %u, link: 0x%x", __cam_isp_ctx_substate_val_to_type(next_state), - ctx_isp->last_applied_req_id); + ctx_isp->last_applied_req_id, ctx->ctx_id, ctx->link_hdl); spin_unlock_bh(&ctx->lock); __cam_isp_ctx_update_state_monitor_array(ctx_isp, @@ -4673,12 +4711,12 @@ static int __cam_isp_ctx_apply_req_in_activated_state( ctx_isp->active_req_cnt++; spin_unlock_bh(&ctx->lock); CAM_DBG(CAM_REQ, - "move request %lld to active list(cnt = %d), ctx %u", - req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id); + "move request %lld to active list(cnt = %d), ctx %u, link: 0x%x", + req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id, ctx->link_hdl); } else { CAM_ERR_RATE_LIMIT(CAM_ISP, - "ctx_id:%d ,Can not apply (req %lld) the configuration, rc %d", - ctx->ctx_id, apply->request_id, rc); + "ctx_id:%u link: 0x%x,Can not apply (req %lld) the configuration, rc %d", + ctx->ctx_id, ctx->link_hdl, apply->request_id, rc); } atomic_set(&ctx_isp->apply_in_progress, 0); @@ -4693,19 +4731,19 @@ static int __cam_isp_ctx_apply_req_in_sof( struct cam_isp_context *ctx_isp = (struct cam_isp_context *) ctx->ctx_priv; - CAM_DBG(CAM_ISP, "current Substate[%s]", + CAM_DBG(CAM_ISP, "current Substate[%s], ctx %u, link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated)); + ctx_isp->substate_activated), ctx->ctx_id, ctx->link_hdl); rc = __cam_isp_ctx_apply_req_in_activated_state(ctx, apply, CAM_ISP_CTX_ACTIVATED_APPLIED); - CAM_DBG(CAM_ISP, "new Substate[%s]", + CAM_DBG(CAM_ISP, "new Substate[%s], ctx %u, link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated)); + ctx_isp->substate_activated), ctx->ctx_id, ctx->link_hdl); if (rc) - CAM_DBG(CAM_ISP, "Apply failed in Substate[%s], rc %d", + CAM_DBG(CAM_ISP, "Apply failed in Substate[%s], rc %d, ctx %u, link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated), rc); + ctx_isp->substate_activated), rc, ctx->ctx_id, ctx->link_hdl); return rc; } @@ -4717,19 +4755,19 @@ static int __cam_isp_ctx_apply_req_in_epoch( struct cam_isp_context *ctx_isp = (struct cam_isp_context *) ctx->ctx_priv; - CAM_DBG(CAM_ISP, "current Substate[%s]", + CAM_DBG(CAM_ISP, "current Substate[%s], ctx %u, link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated)); + ctx_isp->substate_activated), ctx->ctx_id, ctx->link_hdl); rc = __cam_isp_ctx_apply_req_in_activated_state(ctx, apply, CAM_ISP_CTX_ACTIVATED_APPLIED); - CAM_DBG(CAM_ISP, "new Substate[%s]", + CAM_DBG(CAM_ISP, "new Substate[%s], ctx %u, link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated)); + ctx_isp->substate_activated), ctx->ctx_id, ctx->link_hdl); if (rc) - CAM_DBG(CAM_ISP, "Apply failed in Substate[%s], rc %d", + CAM_DBG(CAM_ISP, "Apply failed in Substate[%s], rc %d, ctx %u, link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated), rc); + ctx_isp->substate_activated), rc, ctx->ctx_id, ctx->link_hdl); return rc; } @@ -4741,19 +4779,19 @@ static int __cam_isp_ctx_apply_req_in_bubble( struct cam_isp_context *ctx_isp = (struct cam_isp_context *) ctx->ctx_priv; - CAM_DBG(CAM_ISP, "current Substate[%s]", + CAM_DBG(CAM_ISP, "current Substate[%s], ctx %u, link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated)); + ctx_isp->substate_activated), ctx->ctx_id, ctx->link_hdl); rc = __cam_isp_ctx_apply_req_in_activated_state(ctx, apply, CAM_ISP_CTX_ACTIVATED_BUBBLE_APPLIED); - CAM_DBG(CAM_ISP, "new Substate[%s]", + CAM_DBG(CAM_ISP, "new Substate[%s], ctx %u, link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated)); + ctx_isp->substate_activated), ctx->ctx_id, ctx->link_hdl); if (rc) - CAM_DBG(CAM_ISP, "Apply failed in Substate[%s], rc %d", + CAM_DBG(CAM_ISP, "Apply failed in Substate[%s], rc %d, ctx %u, link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated), rc); + ctx_isp->substate_activated), rc, ctx->ctx_id, ctx->link_hdl); return rc; } @@ -4845,10 +4883,11 @@ static int __cam_isp_ctx_apply_default_req_settings( &hw_cmd_args); if (rc) CAM_ERR(CAM_ISP, - "Failed to apply default settings rc %d", rc); + "Failed to apply default settings rc %d ctx %u, link: 0x%x", + rc, ctx->ctx_id, ctx->link_hdl); else - CAM_DBG(CAM_ISP, "Applied default settings rc %d ctx: %u", - rc, ctx->ctx_id); + CAM_DBG(CAM_ISP, "Applied default settings rc %d ctx: %u link: 0x%x", + rc, ctx->ctx_id, ctx->link_hdl); } end: @@ -4909,8 +4948,9 @@ static int __cam_isp_ctx_dump_req_info( ctx_isp = (struct cam_isp_context *)ctx->ctx_priv; if (dump_args->buf_len <= dump_args->offset) { - CAM_WARN(CAM_ISP, "Dump buffer overshoot len %zu offset %zu", - dump_args->buf_len, dump_args->offset); + CAM_WARN(CAM_ISP, + "Dump buffer overshoot len %zu offset %zu, ctx_idx: %u, link: 0x%x", + dump_args->buf_len, dump_args->offset, ctx->ctx_id, ctx->link_hdl); return -ENOSPC; } @@ -4921,8 +4961,8 @@ static int __cam_isp_ctx_dump_req_info( sizeof(uint64_t)); if (remain_len < min_len) { - CAM_WARN(CAM_ISP, "Dump buffer exhaust remain %zu min %u", - remain_len, min_len); + CAM_WARN(CAM_ISP, "Dump buffer exhaust remain %zu min %u, ctx_idx: %u, link: 0x%x", + remain_len, min_len, ctx->ctx_id, ctx->link_hdl); return -ENOSPC; } @@ -4930,8 +4970,9 @@ static int __cam_isp_ctx_dump_req_info( rc = cam_common_user_dump_helper(dump_args, cam_isp_ctx_user_dump_req_list, &ctx->pending_req_list, sizeof(uint64_t), "ISP_OUT_FENCE_PENDING_REQUESTS:"); if (rc) { - CAM_ERR(CAM_ISP, "CAM_ISP_CONTEXT: Pending request dump failed, rc: %d", - rc); + CAM_ERR(CAM_ISP, + "CAM_ISP_CONTEXT:Pending request dump failed, rc:%d, ctx:%u, link:0x%x", + rc, ctx->ctx_id, ctx->link_hdl); return rc; } @@ -4939,8 +4980,9 @@ static int __cam_isp_ctx_dump_req_info( rc = cam_common_user_dump_helper(dump_args, cam_isp_ctx_user_dump_req_list, &ctx->wait_req_list, sizeof(uint64_t), "ISP_OUT_FENCE_APPLIED_REQUESTS:"); if (rc) { - CAM_ERR(CAM_ISP, "CAM_ISP_CONTEXT: Applied request dump failed, rc: %d", - rc); + CAM_ERR(CAM_ISP, + "CAM_ISP_CONTEXT: Applied request dump failed, rc:%d, ctx:%u, link:0x%x", + rc, ctx->ctx_id, ctx->link_hdl); return rc; } @@ -4948,8 +4990,9 @@ static int __cam_isp_ctx_dump_req_info( rc = cam_common_user_dump_helper(dump_args, cam_isp_ctx_user_dump_req_list, &ctx->active_req_list, sizeof(uint64_t), "ISP_OUT_FENCE_ACTIVE_REQUESTS:"); if (rc) { - CAM_ERR(CAM_ISP, "CAM_ISP_CONTEXT: Active request dump failed, rc: %d", - rc); + CAM_ERR(CAM_ISP, + "CAM_ISP_CONTEXT: Active request dump failed, rc:%d, ctx:%u, link:0x%x", + rc, ctx->ctx_id, ctx->link_hdl); return rc; } @@ -4969,8 +5012,8 @@ static int __cam_isp_ctx_dump_req_info( if (rc) { CAM_ERR(CAM_ISP, - "CAM_ISP_CONTEXT DUMP_REQ_INFO: Dump failed, rc: %d", - rc); + "CAM_ISP_CONTEXT DUMP_REQ_INFO: Dump failed, rc: %d, ctx_idx: %u, link: 0x%x", + rc, ctx->ctx_id, ctx->link_hdl); return rc; } } @@ -5047,8 +5090,8 @@ static int __cam_isp_ctx_dump_in_top_state( list_for_each_entry_safe(req, req_temp, &ctx->active_req_list, list) { if (req->request_id == dump_info->req_id) { - CAM_INFO(CAM_ISP, "isp dump active list req: %lld", - dump_info->req_id); + CAM_INFO(CAM_ISP, "isp dump active list req: %lld, ctx_idx: %u, link: 0x%x", + dump_info->req_id, ctx->ctx_id, ctx->link_hdl); req_type = 'a'; goto hw_dump; } @@ -5056,8 +5099,8 @@ static int __cam_isp_ctx_dump_in_top_state( list_for_each_entry_safe(req, req_temp, &ctx->wait_req_list, list) { if (req->request_id == dump_info->req_id) { - CAM_INFO(CAM_ISP, "isp dump wait list req: %lld", - dump_info->req_id); + CAM_INFO(CAM_ISP, "isp dump wait list req: %lld, ctx_idx: %u, link: 0x%x", + dump_info->req_id, ctx->ctx_id, ctx->link_hdl); req_type = 'w'; goto hw_dump; } @@ -5065,8 +5108,9 @@ static int __cam_isp_ctx_dump_in_top_state( list_for_each_entry_safe(req, req_temp, &ctx->pending_req_list, list) { if (req->request_id == dump_info->req_id) { - CAM_INFO(CAM_ISP, "isp dump pending list req: %lld", - dump_info->req_id); + CAM_INFO(CAM_ISP, + "isp dump pending list req: %lld, ctx_idx: %u, link: 0x%x", + dump_info->req_id, ctx->ctx_id, ctx->link_hdl); req_type = 'p'; goto hw_dump; } @@ -5076,14 +5120,15 @@ hw_dump: rc = cam_mem_get_cpu_buf(dump_info->buf_handle, &cpu_addr, &buf_len); if (rc) { - CAM_ERR(CAM_ISP, "Invalid handle %u rc %d", - dump_info->buf_handle, rc); + CAM_ERR(CAM_ISP, "Invalid handle %u rc %d, ctx_idx: %u, link: 0x%x", + dump_info->buf_handle, rc, ctx->ctx_id, ctx->link_hdl); goto end; } if (buf_len <= dump_info->offset) { spin_unlock_bh(&ctx->lock); - CAM_WARN(CAM_ISP, "Dump buffer overshoot len %zu offset %zu", - buf_len, dump_info->offset); + CAM_WARN(CAM_ISP, + "Dump buffer overshoot len %zu offset %zu, ctx_idx: %u, link: 0x%x", + buf_len, dump_info->offset, ctx->ctx_id, ctx->link_hdl); return -ENOSPC; } @@ -5093,8 +5138,9 @@ hw_dump: if (remain_len < min_len) { spin_unlock_bh(&ctx->lock); - CAM_WARN(CAM_ISP, "Dump buffer exhaust remain %zu min %u", - remain_len, min_len); + CAM_WARN(CAM_ISP, + "Dump buffer exhaust remain %zu min %u, ctx_idx: %u, link: 0x%x", + remain_len, min_len, ctx->ctx_id, ctx->link_hdl); return -ENOSPC; } @@ -5106,8 +5152,8 @@ hw_dump: cur_time); __cam_isp_ctx_print_event_record(ctx_isp); if (diff < CAM_ISP_CTX_RESPONSE_TIME_THRESHOLD) { - CAM_INFO(CAM_ISP, "req %lld found no error", - req->request_id); + CAM_INFO(CAM_ISP, "req %lld found no error, ctx_idx: %u, link: 0x%x", + req->request_id, ctx->ctx_id, ctx->link_hdl); dump_only_event_record = true; } @@ -5121,8 +5167,8 @@ hw_dump: rc = cam_common_user_dump_helper(&dump_args, cam_isp_ctx_user_dump_timer, req, sizeof(uint64_t), "ISP_CTX_DUMP:.%c", req_type); if (rc) { - CAM_ERR(CAM_ISP, "Time dump fail %lld, rc: %d", - req->request_id, rc); + CAM_ERR(CAM_ISP, "Time dump fail %lld, rc: %d, ctx_idx: %u, link: 0x%x", + req->request_id, rc, ctx->ctx_id, ctx->link_hdl); goto end; } dump_info->offset = dump_args.offset; @@ -5135,8 +5181,9 @@ hw_dump: cam_isp_ctx_user_dump_stream_info, ctx, sizeof(int32_t), "ISP_STREAM_INFO_FROM_CTX:"); if (rc) { - CAM_ERR(CAM_ISP, "ISP CTX stream info dump fail %lld, rc: %d", - req->request_id, rc); + CAM_ERR(CAM_ISP, + "ISP CTX stream info dump fail %lld, rc: %d, ctx: %u, link: 0x%x", + req->request_id, rc, ctx->ctx_id, ctx->link_hdl); goto end; } @@ -5149,8 +5196,9 @@ hw_dump: rc = ctx->hw_mgr_intf->hw_cmd(ctx->hw_mgr_intf->hw_mgr_priv, &hw_cmd_args); if (rc) { - CAM_ERR(CAM_ISP, "IFE HW MGR stream info dump fail %lld, rc: %d", - req->request_id, rc); + CAM_ERR(CAM_ISP, + "IFE HW MGR stream info dump fail %lld, rc: %d, ctx: %u, link: 0x%x", + req->request_id, rc, ctx->ctx_id, ctx->link_hdl); goto end; } @@ -5160,8 +5208,8 @@ hw_dump: /* Dump event record */ rc = __cam_isp_ctx_dump_event_record(ctx_isp, &dump_args); if (rc) { - CAM_ERR(CAM_ISP, "Event record dump fail %lld, rc: %d", - req->request_id, rc); + CAM_ERR(CAM_ISP, "Event record dump fail %lld, rc: %d, ctx_idx: %u, link: 0x%x", + req->request_id, rc, ctx->ctx_id, ctx->link_hdl); goto end; } dump_info->offset = dump_args.offset; @@ -5172,16 +5220,16 @@ hw_dump: /* Dump state monitor array */ rc = __cam_isp_ctx_user_dump_state_monitor_array(ctx_isp, &dump_args); if (rc) { - CAM_ERR(CAM_ISP, "Dump event fail %lld, rc: %d", - req->request_id, rc); + CAM_ERR(CAM_ISP, "Dump event fail %lld, rc: %d, ctx_idx: %u, link: 0x%x", + req->request_id, rc, ctx->ctx_id, ctx->link_hdl); goto end; } /* Dump request info */ rc = __cam_isp_ctx_dump_req_info(ctx, req, &dump_args); if (rc) { - CAM_ERR(CAM_ISP, "Dump Req info fail %lld, rc: %d", - req->request_id, rc); + CAM_ERR(CAM_ISP, "Dump Req info fail %lld, rc: %d, ctx_idx: %u, link: 0x%x", + req->request_id, rc, ctx->ctx_id, ctx->link_hdl); goto end; } spin_unlock_bh(&ctx->lock); @@ -5209,8 +5257,8 @@ static int __cam_isp_ctx_flush_req_in_flushed_state( struct cam_context *ctx, struct cam_req_mgr_flush_request *flush_req) { - CAM_INFO(CAM_ISP, "Flush (type %d) in flushed state req id %lld ctx_id:%d", - flush_req->type, flush_req->req_id, ctx->ctx_id); + CAM_INFO(CAM_ISP, "Flush (type %d) in flushed state req id %lld ctx_id:%u link: 0x%x", + flush_req->type, flush_req->req_id, ctx->ctx_id, ctx->link_hdl); if (flush_req->req_id > ctx->last_flush_req) ctx->last_flush_req = flush_req->req_id; @@ -5232,17 +5280,20 @@ static int __cam_isp_ctx_flush_req(struct cam_context *ctx, INIT_LIST_HEAD(&flush_list); if (list_empty(req_list)) { - CAM_DBG(CAM_ISP, "request list is empty"); + CAM_DBG(CAM_ISP, "request list is empty, ctx_id:%u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); if (flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_CANCEL_REQ) { - CAM_INFO(CAM_ISP, "no request to cancel (last applied:%lld cancel:%lld)", - ctx_isp->last_applied_req_id, flush_req->req_id); + CAM_INFO(CAM_ISP, + "no request to cancel(lastapplied:%lld cancel:%lld),ctx:%u link:0x%x", + ctx_isp->last_applied_req_id, flush_req->req_id, + ctx->ctx_id, ctx->link_hdl); return -EINVAL; } else return 0; } - CAM_DBG(CAM_REQ, "Flush [%u] in progress for req_id %llu", - flush_req->type, flush_req->req_id); + CAM_DBG(CAM_REQ, "Flush [%u] in progress for req_id %llu, ctx_id:%u link: 0x%x", + flush_req->type, flush_req->req_id, ctx->ctx_id, ctx->link_hdl); list_for_each_entry_safe(req, req_temp, req_list, list) { if (flush_req->type == CAM_REQ_MGR_FLUSH_TYPE_CANCEL_REQ) { if (req->request_id != flush_req->req_id) { @@ -5270,8 +5321,8 @@ static int __cam_isp_ctx_flush_req(struct cam_context *ctx, * req in CSL layer. */ CAM_INFO(CAM_ISP, - "flush list is empty, flush type %d for req %llu", - flush_req->type, flush_req->req_id); + "flush list is empty, flush type %d for req %llu, ctx_id:%u link: 0x%x", + flush_req->type, flush_req->req_id, ctx->ctx_id, ctx->link_hdl); return 0; } @@ -5279,9 +5330,11 @@ 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_DBG(CAM_ISP, "Flush req 0x%llx, fence %d", + CAM_DBG(CAM_ISP, + "Flush req 0x%llx, fence %d, ctx_id:%u link: 0x%x", req->request_id, - req_isp->fence_map_out[i].sync_id); + req_isp->fence_map_out[i].sync_id, + ctx->ctx_id, ctx->link_hdl); rc = cam_sync_signal( req_isp->fence_map_out[i].sync_id, CAM_SYNC_STATE_SIGNALED_CANCEL, @@ -5289,7 +5342,8 @@ static int __cam_isp_ctx_flush_req(struct cam_context *ctx, if (rc) { tmp = req_isp->fence_map_out[i].sync_id; CAM_ERR_RATE_LIMIT(CAM_ISP, - "signal fence %d failed", tmp); + "signal fence %d failed, ctx_id:%u link: 0x%x", + tmp, ctx->ctx_id, ctx->link_hdl); } req_isp->fence_map_out[i].sync_id = -1; } @@ -5316,7 +5370,7 @@ static int __cam_isp_ctx_flush_req_in_top_state( ctx_isp = (struct cam_isp_context *) ctx->ctx_priv; - CAM_DBG(CAM_ISP, "Flush pending list"); + CAM_DBG(CAM_ISP, "Flush pending list, ctx_idx: %u, link: 0x%x", ctx->ctx_id, ctx->link_hdl); spin_lock_bh(&ctx->lock); __cam_isp_ctx_flush_req(ctx, &ctx->pending_req_list, flush_req); spin_unlock_bh(&ctx->lock); @@ -5332,8 +5386,8 @@ static int __cam_isp_ctx_flush_req_in_top_state( ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_HALT; spin_unlock_bh(&ctx->lock); - CAM_INFO(CAM_ISP, "Last request id to flush is %lld, ctx_id:%d", - flush_req->req_id, ctx->ctx_id); + CAM_INFO(CAM_ISP, "Last request id to flush is %lld, ctx_id:%u link: 0x%x", + flush_req->req_id, ctx->ctx_id, ctx->link_hdl); ctx->last_flush_req = flush_req->req_id; __cam_isp_ctx_trigger_reg_dump(CAM_HW_MGR_CMD_REG_DUMP_ON_FLUSH, ctx); @@ -5346,11 +5400,13 @@ static int __cam_isp_ctx_flush_req_in_top_state( rc = ctx->hw_mgr_intf->hw_stop(ctx->hw_mgr_intf->hw_mgr_priv, &stop_args); if (rc) - CAM_ERR(CAM_ISP, "Failed to stop HW in Flush rc: %d", - rc); + CAM_ERR(CAM_ISP, "Failed to stop HW in Flush rc: %d, ctx_id:%u link: 0x%x", + rc, ctx->ctx_id, ctx->link_hdl); - CAM_INFO(CAM_ISP, "Stop HW complete. Reset HW next."); - CAM_DBG(CAM_ISP, "Flush wait and active lists"); + CAM_INFO(CAM_ISP, "Stop HW complete. Reset HW next.Ctx_id:%u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); + CAM_DBG(CAM_ISP, "Flush wait and active lists, ctx_id:%u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); if (ctx->ctx_crm_intf && ctx->ctx_crm_intf->notify_timer) { timer.link_hdl = ctx->link_hdl; @@ -5375,7 +5431,8 @@ static int __cam_isp_ctx_flush_req_in_top_state( rc = ctx->hw_mgr_intf->hw_reset(ctx->hw_mgr_intf->hw_mgr_priv, &reset_args); if (rc) - CAM_ERR(CAM_ISP, "Failed to reset HW rc: %d", rc); + CAM_ERR(CAM_ISP, "Failed to reset HW rc: %d, ctx_id:%u link: 0x%x", + rc, ctx->ctx_id, ctx->link_hdl); ctx_isp->init_received = false; } @@ -5395,7 +5452,8 @@ static int __cam_isp_ctx_flush_req_in_ready( { int rc = 0; - CAM_DBG(CAM_ISP, "try to flush pending list"); + CAM_DBG(CAM_ISP, "try to flush pending list, ctx_id:%u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); spin_lock_bh(&ctx->lock); rc = __cam_isp_ctx_flush_req(ctx, &ctx->pending_req_list, flush_req); @@ -5406,8 +5464,8 @@ static int __cam_isp_ctx_flush_req_in_ready( trace_cam_context_state("ISP", ctx); - CAM_DBG(CAM_ISP, "Flush request in ready state. next state %d", - ctx->state); + CAM_DBG(CAM_ISP, "Flush request in ready state. next state %d, ctx_id:%u link: 0x%x", + ctx->state, ctx->ctx_id, ctx->link_hdl); return rc; } @@ -5530,14 +5588,15 @@ static int __cam_isp_ctx_rdi_only_sof_in_top_state( uint64_t request_id = 0; if (!evt_data) { - CAM_ERR(CAM_ISP, "in valid sof event data"); + CAM_ERR(CAM_ISP, "in valid sof event data, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); return -EINVAL; } __cam_isp_ctx_update_sof_ts_util(sof_event_data, ctx_isp); - CAM_DBG(CAM_ISP, "frame id: %lld time stamp:0x%llx", - ctx_isp->frame_id, ctx_isp->sof_timestamp_val); + CAM_DBG(CAM_ISP, "frame id: %lld time stamp:0x%llx, ctx_idx: %u, link: 0x%x", + ctx_isp->frame_id, ctx_isp->sof_timestamp_val, ctx->ctx_id, ctx->link_hdl); /* * notify reqmgr with sof signal. Note, due to scheduling delay @@ -5566,17 +5625,19 @@ static int __cam_isp_ctx_rdi_only_sof_in_top_state( __cam_isp_ctx_send_sof_timestamp(ctx_isp, request_id, CAM_REQ_MGR_SOF_EVENT_SUCCESS); } else { - CAM_ERR_RATE_LIMIT(CAM_ISP, "Can not notify SOF to CRM"); + CAM_ERR_RATE_LIMIT(CAM_ISP, "Can not notify SOF to CRM, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); } if (list_empty(&ctx->active_req_list)) ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_SOF; else - CAM_DBG(CAM_ISP, "Still need to wait for the buf done"); + CAM_DBG(CAM_ISP, "Still need to wait for the buf done, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); - CAM_DBG(CAM_ISP, "next Substate[%s]", + CAM_DBG(CAM_ISP, "next Substate[%s], ctx_idx: %u, link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated)); + ctx_isp->substate_activated), ctx->ctx_id, ctx->link_hdl); return rc; } @@ -5618,22 +5679,23 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_applied( * the previous sof time stamp that got captured in the * sof in applied state. */ - CAM_DBG(CAM_ISP, "frame id: %lld time stamp:0x%llx", - ctx_isp->frame_id, ctx_isp->sof_timestamp_val); + CAM_DBG(CAM_ISP, "frame id: %lld time stamp:0x%llx, ctx_idx: %u, link: 0x%x", + ctx_isp->frame_id, ctx_isp->sof_timestamp_val, ctx->ctx_id, ctx->link_hdl); __cam_isp_ctx_send_sof_timestamp(ctx_isp, request_id, CAM_REQ_MGR_SOF_EVENT_SUCCESS); __cam_isp_ctx_update_sof_ts_util(sof_event_data, ctx_isp); - CAM_DBG(CAM_ISP, "frame id: %lld time stamp:0x%llx", - ctx_isp->frame_id, ctx_isp->sof_timestamp_val); + CAM_DBG(CAM_ISP, "frame id: %lld time stamp:0x%llx, ctx_idx: %u, link: 0x%x", + ctx_isp->frame_id, ctx_isp->sof_timestamp_val, ctx->ctx_id, ctx->link_hdl); if (list_empty(&ctx->wait_req_list)) { /* * If no pending req in epoch, this is an error case. * The recovery is to go back to sof state */ - CAM_ERR(CAM_ISP, "No wait request"); + CAM_ERR(CAM_ISP, "No wait request, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_SOF; /* Send SOF event as empty frame*/ @@ -5647,8 +5709,8 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_applied( list); req_isp = (struct cam_isp_ctx_req *)req->req_priv; req_isp->bubble_detected = true; - CAM_INFO_RATE_LIMIT(CAM_ISP, "Ctx:%d Report Bubble flag %d req id:%lld", - ctx->ctx_id, req_isp->bubble_report, req->request_id); + CAM_INFO_RATE_LIMIT(CAM_ISP, "Ctx:%u link: 0x%x Report Bubble flag %d req id:%lld", + ctx->ctx_id, ctx->link_hdl, req_isp->bubble_report, req->request_id); req_isp->reapply_type = CAM_CONFIG_REAPPLY_IO; req_isp->cdm_reset_before_apply = false; @@ -5667,8 +5729,8 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_applied( list_del_init(&req->list); list_add_tail(&req->list, &ctx->active_req_list); ctx_isp->active_req_cnt++; - CAM_DBG(CAM_ISP, "move request %lld to active list(cnt = %d)", - req->request_id, ctx_isp->active_req_cnt); + CAM_DBG(CAM_ISP, "move request %lld to active list(cnt = %d), ctx_idx: %u, link: 0x%x", + req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id, ctx->link_hdl); if (!req_isp->bubble_report) { if (req->request_id > ctx_isp->reported_req_id) { @@ -5685,9 +5747,9 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_applied( /* change the state to bubble, as reg update has not come */ ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_BUBBLE; - CAM_DBG(CAM_ISP, "next Substate[%s]", + CAM_DBG(CAM_ISP, "next Substate[%s], ctx_idx: %u, link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated)); + ctx_isp->substate_activated), ctx->ctx_id, ctx->link_hdl); end: return 0; } @@ -5707,18 +5769,20 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state( int rc = 0; if (!evt_data) { - CAM_ERR(CAM_ISP, "in valid sof event data"); + CAM_ERR(CAM_ISP, "in valid sof event data, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); return -EINVAL; } __cam_isp_ctx_update_sof_ts_util(sof_event_data, ctx_isp); - CAM_DBG(CAM_ISP, "frame id: %lld time stamp:0x%llx", - ctx_isp->frame_id, ctx_isp->sof_timestamp_val); + CAM_DBG(CAM_ISP, "frame id: %lld time stamp:0x%llx, ctx_idx: %u, link: 0x%x", + ctx_isp->frame_id, ctx_isp->sof_timestamp_val, ctx->ctx_id, ctx->link_hdl); if (atomic_read(&ctx_isp->process_bubble)) { if (list_empty(&ctx->active_req_list)) { - CAM_ERR(CAM_ISP, "No available active req in bubble"); + CAM_ERR(CAM_ISP, "No available active req in bubble, ctx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); atomic_set(&ctx_isp->process_bubble, 0); return -EINVAL; } @@ -5726,10 +5790,10 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state( if (ctx_isp->last_sof_timestamp == ctx_isp->sof_timestamp_val) { CAM_DBG(CAM_ISP, - "Tasklet delay detected! Bubble frame: %lld check skipped, sof_timestamp: %lld, ctx_id: %d", + "Tasklet delay detected! Bubble frame: %lld check skipped, sof_timestamp: %lld, ctx_id: %u, link: 0x%x", ctx_isp->frame_id, ctx_isp->sof_timestamp_val, - ctx->ctx_id); + ctx->ctx_id, ctx->link_hdl); goto end; } @@ -5747,18 +5811,19 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state( ctx->hw_mgr_intf->hw_mgr_priv, &hw_cmd_args); if (rc) { - CAM_ERR(CAM_ISP, "HW command failed"); + CAM_ERR(CAM_ISP, "HW command failed, ctx_id: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); return rc; } last_cdm_done_req = isp_hw_cmd_args.u.last_cdm_done; - CAM_DBG(CAM_ISP, "last_cdm_done req: %d ctx_id: %d", - last_cdm_done_req, ctx->ctx_id); + CAM_DBG(CAM_ISP, "last_cdm_done req: %d ctx_id: %u, link: 0x%x", + last_cdm_done_req, ctx->ctx_id, ctx->link_hdl); if (last_cdm_done_req >= req->request_id) { CAM_DBG(CAM_ISP, - "CDM callback detected for req: %lld, possible buf_done delay, waiting for buf_done", - req->request_id); + "CDM callback detected for req: %lld, possible buf_done delay, waiting for buf_done, ctx_id: %u, link: 0x%x", + req->request_id, ctx->ctx_id, ctx->link_hdl); if (req_isp->num_fence_map_out == req_isp->num_deferred_acks) { __cam_isp_handle_deferred_buf_done(ctx_isp, req, @@ -5772,8 +5837,8 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state( goto end; } else { CAM_WARN(CAM_ISP, - "CDM callback not happened for req: %lld, possible CDM stuck or workqueue delay", - req->request_id); + "CDM callback not happened for req: %lld, possible CDM stuck or workqueue delay, ctx_id: %u, link: 0x%x", + req->request_id, ctx->ctx_id, ctx->link_hdl); req_isp->num_acked = 0; req_isp->num_deferred_acks = 0; req_isp->bubble_detected = false; @@ -5783,9 +5848,9 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state( atomic_set(&ctx_isp->process_bubble, 0); ctx_isp->active_req_cnt--; CAM_DBG(CAM_REQ, - "Move active req: %lld to pending list(cnt = %d) [bubble re-apply],ctx %u", + "Move active req: %lld to pending list(cnt = %d) [bubble re-apply],ctx %u link: 0x%x", req->request_id, - ctx_isp->active_req_cnt, ctx->ctx_id); + ctx_isp->active_req_cnt, ctx->ctx_id, ctx->link_hdl); } goto end; } @@ -5800,8 +5865,8 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state( struct cam_ctx_request, list); list_del_init(&req->list); req_isp = (struct cam_isp_ctx_req *) req->req_priv; - CAM_DBG(CAM_ISP, "signal fence in active list. fence num %d", - req_isp->num_fence_map_out); + CAM_DBG(CAM_ISP, "signal fence in active list. fence num %d, ctx %u link: 0x%x", + req_isp->num_fence_map_out, ctx->ctx_id, ctx->link_hdl); for (i = 0; i < req_isp->num_fence_map_out; i++) if (req_isp->fence_map_out[i].sync_id != -1) { cam_sync_signal( @@ -5832,9 +5897,9 @@ end: if (!atomic_read(&ctx_isp->process_bubble)) ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_SOF; - CAM_DBG(CAM_ISP, "next Substate[%s]", + CAM_DBG(CAM_ISP, "next Substate[%s], ctx %u link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated)); + ctx_isp->substate_activated), ctx->ctx_id, ctx->link_hdl); ctx_isp->last_sof_timestamp = ctx_isp->sof_timestamp_val; return 0; @@ -5850,7 +5915,8 @@ static int __cam_isp_ctx_rdi_only_reg_upd_in_bubble_state( req = list_first_entry(&ctx->active_req_list, struct cam_ctx_request, list); - CAM_INFO(CAM_ISP, "Received RUP for Bubble Request", req->request_id); + CAM_INFO(CAM_ISP, "Received RUP for Bubble Request, ctx %u link: 0x%x", + req->request_id, ctx->ctx_id, ctx->link_hdl); return 0; } @@ -5866,7 +5932,8 @@ static int __cam_isp_ctx_rdi_only_reg_upd_in_bubble_applied_state( ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_EPOCH; /* notify reqmgr with sof signal*/ if (list_empty(&ctx->wait_req_list)) { - CAM_ERR(CAM_ISP, "Reg upd ack with no waiting request"); + CAM_ERR(CAM_ISP, "Reg upd ack with no waiting request, ctx %u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); goto error; } @@ -5883,16 +5950,16 @@ static int __cam_isp_ctx_rdi_only_reg_upd_in_bubble_applied_state( list_add_tail(&req->list, &ctx->active_req_list); ctx_isp->active_req_cnt++; CAM_DBG(CAM_ISP, - "move request %lld to active list(cnt = %d)", - req->request_id, ctx_isp->active_req_cnt); + "move request %lld to active list(cnt = %d), ctx %u link: 0x%x", + req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id, ctx->link_hdl); /* if packet has buffers, set correct request id */ request_id = req->request_id; } else { /* no io config, so the request is completed. */ list_add_tail(&req->list, &ctx->free_req_list); CAM_DBG(CAM_ISP, - "move active req %lld to free list(cnt=%d)", - req->request_id, ctx_isp->active_req_cnt); + "move active req %lld to free list(cnt=%d), ctx %u link: 0x%x", + req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id, ctx->link_hdl); } __cam_isp_ctx_notify_trigger_util(CAM_TRIGGER_POINT_SOF, ctx_isp); @@ -5902,9 +5969,9 @@ static int __cam_isp_ctx_rdi_only_reg_upd_in_bubble_applied_state( __cam_isp_ctx_send_sof_timestamp(ctx_isp, request_id, CAM_REQ_MGR_SOF_EVENT_SUCCESS); - CAM_DBG(CAM_ISP, "next Substate[%s]", + CAM_DBG(CAM_ISP, "next Substate[%s], ctx %u link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated)); + ctx_isp->substate_activated), ctx->ctx_id, ctx->link_hdl); __cam_isp_ctx_update_event_record(ctx_isp, CAM_ISP_CTX_EVENT_RUP, req); return 0; @@ -5997,19 +6064,19 @@ static int __cam_isp_ctx_rdi_only_apply_req_top_state( struct cam_isp_context *ctx_isp = (struct cam_isp_context *) ctx->ctx_priv; - CAM_DBG(CAM_ISP, "current Substate[%s]", + CAM_DBG(CAM_ISP, "current Substate[%s], ctx_idx: %u, link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated)); + ctx_isp->substate_activated), ctx->ctx_id, ctx->link_hdl); rc = __cam_isp_ctx_apply_req_in_activated_state(ctx, apply, CAM_ISP_CTX_ACTIVATED_APPLIED); - CAM_DBG(CAM_ISP, "new Substate[%s]", + CAM_DBG(CAM_ISP, "new Substate[%s], ctx_idx: %u, link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated)); + ctx_isp->substate_activated), ctx->ctx_id, ctx->link_hdl); if (rc) CAM_ERR_RATE_LIMIT(CAM_ISP, - "ctx_id:%d Apply failed in Substate[%s], rc %d", - ctx->ctx_id, + "ctx_id:%u link: 0x%x Apply failed in Substate[%s], rc %d", + ctx->ctx_id, ctx->link_hdl, __cam_isp_ctx_substate_val_to_type( ctx_isp->substate_activated), rc); @@ -6074,7 +6141,8 @@ static int __cam_isp_ctx_flush_dev_in_top_state(struct cam_context *ctx, struct cam_req_mgr_flush_request flush_req; if (!ctx_isp->offline_context) { - CAM_ERR(CAM_ISP, "flush dev only supported in offline context"); + CAM_ERR(CAM_ISP, "flush dev only supported in offline context,ctx: %u, link:0x%x", + ctx->ctx_id, ctx->link_hdl); return -EINVAL; } @@ -6082,7 +6150,8 @@ static int __cam_isp_ctx_flush_dev_in_top_state(struct cam_context *ctx, CAM_REQ_MGR_FLUSH_TYPE_CANCEL_REQ; flush_req.req_id = cmd->req_id; - CAM_DBG(CAM_ISP, "offline flush (type:%u, req:%lu)", flush_req.type, flush_req.req_id); + CAM_DBG(CAM_ISP, "offline flush (type:%u, req:%lu), ctx_idx: %u, link: 0x%x", + flush_req.type, flush_req.req_id, ctx->ctx_id, ctx->link_hdl); switch (ctx->state) { case CAM_CTX_ACQUIRED: @@ -6091,7 +6160,8 @@ static int __cam_isp_ctx_flush_dev_in_top_state(struct cam_context *ctx, case CAM_CTX_READY: return __cam_isp_ctx_flush_req_in_ready(ctx, &flush_req); default: - CAM_ERR(CAM_ISP, "flush dev in wrong state: %d", ctx->state); + CAM_ERR(CAM_ISP, "flush dev in wrong state: %d, ctx_idx: %u, link: 0x%x", + ctx->state, ctx->ctx_id, ctx->link_hdl); return -EINVAL; } @@ -6154,7 +6224,8 @@ static int __cam_isp_ctx_release_hw_in_top_state(struct cam_context *ctx, &rel_arg); ctx_isp->hw_ctx = NULL; } else { - CAM_ERR(CAM_ISP, "No hw resources acquired for ctx[%u]", ctx->ctx_id); + CAM_ERR(CAM_ISP, "No hw resources acquired for ctx[%u], link: 0x%x", + ctx->ctx_id, ctx->link_hdl); } ctx->last_flush_req = 0; @@ -6184,7 +6255,8 @@ static int __cam_isp_ctx_release_hw_in_top_state(struct cam_context *ctx, * But we still add some sanity check code here to help the debug */ if (!list_empty(&ctx->active_req_list)) - CAM_WARN(CAM_ISP, "Active list is not empty"); + CAM_WARN(CAM_ISP, "Active list is not empty, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); /* Flush all the pending request list */ flush_req.type = CAM_REQ_MGR_FLUSH_TYPE_ALL; @@ -6192,7 +6264,8 @@ static int __cam_isp_ctx_release_hw_in_top_state(struct cam_context *ctx, flush_req.dev_hdl = ctx->dev_hdl; flush_req.req_id = 0; - CAM_DBG(CAM_ISP, "try to flush pending list"); + CAM_DBG(CAM_ISP, "try to flush pending list, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); spin_lock_bh(&ctx->lock); rc = __cam_isp_ctx_flush_req(ctx, &ctx->pending_req_list, &flush_req); spin_unlock_bh(&ctx->lock); @@ -6201,8 +6274,8 @@ static int __cam_isp_ctx_release_hw_in_top_state(struct cam_context *ctx, ctx->state = CAM_CTX_ACQUIRED; trace_cam_context_state("ISP", ctx); - CAM_DBG(CAM_ISP, "Release device success[%u] next state %d", - ctx->ctx_id, ctx->state); + CAM_DBG(CAM_ISP, "Release device success[%u] link: 0x%x next state %d", + ctx->ctx_id, ctx->link_hdl, ctx->state); return rc; } @@ -6218,7 +6291,8 @@ static int __cam_isp_ctx_release_dev_in_top_state(struct cam_context *ctx, struct cam_req_mgr_flush_request flush_req; if (cmd && ctx_isp->hw_ctx) { - CAM_ERR(CAM_ISP, "releasing hw"); + CAM_ERR(CAM_ISP, "releasing hw, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); __cam_isp_ctx_release_hw_in_top_state(ctx, NULL); } @@ -6258,7 +6332,8 @@ static int __cam_isp_ctx_release_dev_in_top_state(struct cam_context *ctx, * But we still add some sanity check code here to help the debug */ if (!list_empty(&ctx->active_req_list)) - CAM_ERR(CAM_ISP, "Active list is not empty"); + CAM_ERR(CAM_ISP, "Active list is not empty, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); /* Flush all the pending request list */ flush_req.type = CAM_REQ_MGR_FLUSH_TYPE_ALL; @@ -6266,7 +6341,8 @@ static int __cam_isp_ctx_release_dev_in_top_state(struct cam_context *ctx, flush_req.dev_hdl = ctx->dev_hdl; flush_req.req_id = 0; - CAM_DBG(CAM_ISP, "try to flush pending list"); + CAM_DBG(CAM_ISP, "try to flush pending list, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); spin_lock_bh(&ctx->lock); rc = __cam_isp_ctx_flush_req(ctx, &ctx->pending_req_list, &flush_req); spin_unlock_bh(&ctx->lock); @@ -6275,8 +6351,8 @@ static int __cam_isp_ctx_release_dev_in_top_state(struct cam_context *ctx, ctx->state = CAM_CTX_AVAILABLE; trace_cam_context_state("ISP", ctx); - CAM_DBG(CAM_ISP, "Release device success[%u] next state %d", - ctx->ctx_id, ctx->state); + CAM_DBG(CAM_ISP, "Release device success[%u] link: 0x%x next state %d", + ctx->ctx_id, ctx->link_hdl, ctx->state); return rc; } @@ -6296,7 +6372,8 @@ static int __cam_isp_ctx_config_dev_in_top_state( struct cam_isp_hw_cmd_args isp_hw_cmd_args; uint32_t packet_opcode = 0; - CAM_DBG(CAM_ISP, "get free request object......"); + CAM_DBG(CAM_ISP, "get free request object......ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); /* get free request */ spin_lock_bh(&ctx->lock); @@ -6308,7 +6385,8 @@ static int __cam_isp_ctx_config_dev_in_top_state( spin_unlock_bh(&ctx->lock); if (!req) { - CAM_ERR(CAM_ISP, "No more request obj free"); + CAM_ERR(CAM_ISP, "No more request obj free, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); return -ENOMEM; } @@ -6329,7 +6407,8 @@ static int __cam_isp_ctx_config_dev_in_top_state( rc = ctx->hw_mgr_intf->hw_cmd(ctx->hw_mgr_intf->hw_mgr_priv, &hw_cmd_args); if (rc) { - CAM_ERR(CAM_ISP, "HW command failed"); + CAM_ERR(CAM_ISP, "HW command failed, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); goto free_req; } @@ -6337,16 +6416,16 @@ static int __cam_isp_ctx_config_dev_in_top_state( if ((packet_opcode == CAM_ISP_PACKET_UPDATE_DEV) && (packet->header.request_id <= ctx->last_flush_req)) { CAM_INFO(CAM_ISP, - "request %lld has been flushed, reject packet", - packet->header.request_id); + "request %lld has been flushed, reject packet, ctx_idx: %u, link: 0x%x", + packet->header.request_id, ctx->ctx_id, ctx->link_hdl); rc = -EBADR; goto free_req; } else if ((packet_opcode == CAM_ISP_PACKET_INIT_DEV) && (packet->header.request_id <= ctx->last_flush_req) && ctx->last_flush_req && packet->header.request_id) { CAM_WARN(CAM_ISP, - "last flushed req is %lld, config dev(init) for req %lld", - ctx->last_flush_req, packet->header.request_id); + "last flushed req is %lld, config dev(init) for req %lld, ctx_idx: %u, link: 0x%x", + ctx->last_flush_req, packet->header.request_id, ctx->ctx_id, ctx->link_hdl); rc = -EBADR; goto free_req; } @@ -6369,7 +6448,8 @@ static int __cam_isp_ctx_config_dev_in_top_state( rc = ctx->hw_mgr_intf->hw_prepare_update( ctx->hw_mgr_intf->hw_mgr_priv, &cfg); if (rc != 0) { - CAM_ERR(CAM_ISP, "Prepare config packet failed in HW layer"); + CAM_ERR(CAM_ISP, "Prepare config packet failed in HW layer, ctx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); rc = -EFAULT; goto free_req; } @@ -6389,16 +6469,17 @@ static int __cam_isp_ctx_config_dev_in_top_state( for (i = 0; i < req_isp->num_fence_map_out; i++) { rc = cam_sync_get_obj_ref(req_isp->fence_map_out[i].sync_id); if (rc) { - CAM_ERR(CAM_ISP, "Can't get ref for fence %d", - req_isp->fence_map_out[i].sync_id); + CAM_ERR(CAM_ISP, "Can't get ref for fence %d, ctx_idx: %u, link: 0x%x", + req_isp->fence_map_out[i].sync_id, ctx->ctx_id, ctx->link_hdl); goto put_ref; } } CAM_DBG(CAM_ISP, - "packet req-id:%lld, opcode:%d, num_entry:%d, num_fence_out: %d, num_fence_in: %d", + "packet req-id:%lld, opcode:%d, num_entry:%d, num_fence_out: %d, num_fence_in: %d, ctx_idx: %u, link: 0x%x", packet->header.request_id, req_isp->hw_update_data.packet_opcode_type, - req_isp->num_cfg, req_isp->num_fence_map_out, req_isp->num_fence_map_in); + req_isp->num_cfg, req_isp->num_fence_map_out, req_isp->num_fence_map_in, + ctx->ctx_id, ctx->link_hdl); req->request_id = packet->header.request_id; req->status = 1; @@ -6408,7 +6489,8 @@ static int __cam_isp_ctx_config_dev_in_top_state( if (ctx->state < CAM_CTX_ACTIVATED) { rc = __cam_isp_ctx_enqueue_init_request(ctx, req); if (rc) - CAM_ERR(CAM_ISP, "Enqueue INIT pkt failed"); + CAM_ERR(CAM_ISP, "Enqueue INIT pkt failed, ctx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); ctx_isp->init_received = true; if ((ctx_isp->vfps_aux_context) && (req->request_id > 0)) @@ -6417,14 +6499,15 @@ static int __cam_isp_ctx_config_dev_in_top_state( ctx_isp->resume_hw_in_flushed = false; } else { rc = -EINVAL; - CAM_ERR(CAM_ISP, "Recevied INIT pkt in wrong state:%d", - ctx->state); + CAM_ERR(CAM_ISP, "Received INIT pkt in wrong state:%d, ctx:%u, link:0x%x", + ctx->state, ctx->ctx_id, ctx->link_hdl); } } else { if ((ctx->state == CAM_CTX_FLUSHED) || (ctx->state < CAM_CTX_READY)) { rc = -EINVAL; - CAM_ERR(CAM_ISP, "Received update req %lld in wrong state:%d", - req->request_id, ctx->state); + CAM_ERR(CAM_ISP, + "Received update req %lld in wrong state:%d, ctx_idx: %u, link: 0x%x", + req->request_id, ctx->state, ctx->ctx_id, ctx->link_hdl); goto put_ref; } @@ -6439,17 +6522,19 @@ static int __cam_isp_ctx_config_dev_in_top_state( if (rc) { if (rc == -EBADR) CAM_INFO(CAM_ISP, - "Add req failed: req id=%llu, it has been flushed", - req->request_id); + "Add req failed:req id=%llu flushed,ctx:%u,link:0x%x", + req->request_id, ctx->ctx_id, ctx->link_hdl); else - CAM_ERR(CAM_ISP, "Add req failed: req id=%llu", - req->request_id); + CAM_ERR(CAM_ISP, + "Add req failed: req id=%llu, ctx_idx: %u, link: 0x%x", + req->request_id, ctx->ctx_id, ctx->link_hdl); } else { __cam_isp_ctx_enqueue_request_in_order( ctx, req, true); } } else { - CAM_ERR(CAM_ISP, "Unable to add request: req id=%llu", req->request_id); + CAM_ERR(CAM_ISP, "Unable to add request: req id=%llu,ctx: %u,link: 0x%x", + req->request_id, ctx->ctx_id, ctx->link_hdl); rc = -ENODEV; } } @@ -6457,8 +6542,8 @@ static int __cam_isp_ctx_config_dev_in_top_state( goto put_ref; CAM_DBG(CAM_REQ, - "Preprocessing Config req_id %lld successful on ctx %u", - req->request_id, ctx->ctx_id); + "Preprocessing Config req_id %lld successful on ctx %u, link: 0x%x", + req->request_id, ctx->ctx_id, ctx->link_hdl); if (ctx_isp->offline_context && atomic_read(&ctx_isp->rxd_epoch)) __cam_isp_ctx_schedule_apply_req(ctx_isp); @@ -6471,8 +6556,8 @@ static int __cam_isp_ctx_config_dev_in_top_state( put_ref: for (--i; i >= 0; i--) { if (cam_sync_put_obj_ref(req_isp->fence_map_out[i].sync_id)) - CAM_ERR(CAM_CTXT, "Failed to put ref of fence %d", - req_isp->fence_map_out[i].sync_id); + CAM_ERR(CAM_CTXT, "Failed to put ref of fence %d, ctx_idx: %u, link: 0x%x", + req_isp->fence_map_out[i].sync_id, ctx->ctx_id, ctx->link_hdl); } free_req: spin_lock_bh(&ctx->lock); @@ -6508,15 +6593,16 @@ static int __cam_isp_ctx_allocate_mem_hw_entries( ctx->max_hw_update_entries = max_hw_upd_entries; CAM_DBG(CAM_ISP, - "Allocate max_entries: 0x%x max_res: 0x%x is_sfe_en: %d", - max_hw_upd_entries, max_res, (param->op_flags & CAM_IFE_CTX_SFE_EN)); + "Allocate max_entries: 0x%x max_res: 0x%x is_sfe_en: %d, ctx: %u, link: 0x%x", + max_hw_upd_entries, max_res, (param->op_flags & CAM_IFE_CTX_SFE_EN), + ctx->ctx_id, ctx->link_hdl); ctx->hw_update_entry = kcalloc(CAM_ISP_CTX_REQ_MAX, sizeof(struct cam_hw_update_entry *), GFP_KERNEL); if (!ctx->hw_update_entry) { - CAM_ERR(CAM_CTXT, "%s[%d] no memory ", - ctx->dev_name, ctx->ctx_id); + CAM_ERR(CAM_CTXT, "%s[%u] no memory, link: 0x%x", + ctx->dev_name, ctx->ctx_id, ctx->link_hdl); return -ENOMEM; } @@ -6524,8 +6610,8 @@ static int __cam_isp_ctx_allocate_mem_hw_entries( ctx->hw_update_entry[i] = kcalloc(ctx->max_hw_update_entries, sizeof(struct cam_hw_update_entry), GFP_KERNEL); if (!ctx->hw_update_entry[i]) { - CAM_ERR(CAM_CTXT, "%s[%d] no memory for hw_update_entry: %u", - ctx->dev_name, ctx->ctx_id, i); + CAM_ERR(CAM_CTXT, "%s[%u] no memory for hw_update_entry: %u, link: 0x%x", + ctx->dev_name, ctx->ctx_id, i, ctx->link_hdl); return -ENOMEM; } } @@ -6534,8 +6620,8 @@ static int __cam_isp_ctx_allocate_mem_hw_entries( GFP_KERNEL); if (!ctx->in_map_entries) { - CAM_ERR(CAM_CTXT, "%s[%d] no memory for in_map_entries", - ctx->dev_name, ctx->ctx_id); + CAM_ERR(CAM_CTXT, "%s[%u] no memory for in_map_entries, link: 0x%x", + ctx->dev_name, ctx->ctx_id, ctx->link_hdl); rc = -ENOMEM; goto end; } @@ -6546,8 +6632,8 @@ static int __cam_isp_ctx_allocate_mem_hw_entries( GFP_KERNEL); if (!ctx->in_map_entries[i]) { - CAM_ERR(CAM_CTXT, "%s[%d] no memory for in_map_entries: %u", - ctx->dev_name, ctx->ctx_id, i); + CAM_ERR(CAM_CTXT, "%s[%u] no memory for in_map_entries: %u, link: 0x%x", + ctx->dev_name, ctx->ctx_id, i, ctx->link_hdl); rc = -ENOMEM; goto end; } @@ -6557,8 +6643,8 @@ static int __cam_isp_ctx_allocate_mem_hw_entries( GFP_KERNEL); if (!ctx->out_map_entries) { - CAM_ERR(CAM_CTXT, "%s[%d] no memory for out_map_entries", - ctx->dev_name, ctx->ctx_id); + CAM_ERR(CAM_CTXT, "%s[%u] no memory for out_map_entries, link: 0x%x", + ctx->dev_name, ctx->ctx_id, ctx->link_hdl); rc = -ENOMEM; goto end; } @@ -6569,8 +6655,8 @@ static int __cam_isp_ctx_allocate_mem_hw_entries( GFP_KERNEL); if (!ctx->out_map_entries[i]) { - CAM_ERR(CAM_CTXT, "%s[%d] no memory for out_map_entries: %u", - ctx->dev_name, ctx->ctx_id, i); + CAM_ERR(CAM_CTXT, "%s[%u] no memory for out_map_entries: %u, link: 0x%x", + ctx->dev_name, ctx->ctx_id, i, ctx->link_hdl); rc = -ENOMEM; goto end; } @@ -6608,33 +6694,37 @@ static int __cam_isp_ctx_acquire_dev_in_available(struct cam_context *ctx, struct cam_isp_hw_cmd_args isp_hw_cmd_args; if (!ctx->hw_mgr_intf) { - CAM_ERR(CAM_ISP, "HW interface is not ready"); + CAM_ERR(CAM_ISP, "HW interface is not ready, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); rc = -EFAULT; goto end; } CAM_DBG(CAM_ISP, - "session_hdl 0x%x, num_resources %d, hdl type %d, res %lld", + "session_hdl 0x%x, num_resources %d, hdl type %d, res %lld, ctx_idx: %u, link: 0x%x", cmd->session_handle, cmd->num_resources, - cmd->handle_type, cmd->resource_hdl); + cmd->handle_type, cmd->resource_hdl, ctx->ctx_id, ctx->link_hdl); ctx_isp->v4l2_event_sub_ids = cam_req_mgr_get_id_subscribed(); if (cmd->num_resources == CAM_API_COMPAT_CONSTANT) { ctx_isp->split_acquire = true; - CAM_DBG(CAM_ISP, "Acquire dev handle"); + CAM_DBG(CAM_ISP, "Acquire dev handle, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); goto get_dev_handle; } if (cmd->num_resources > CAM_ISP_CTX_RES_MAX) { - CAM_ERR(CAM_ISP, "Too much resources in the acquire"); + CAM_ERR(CAM_ISP, "Too much resources in the acquire, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); rc = -ENOMEM; goto end; } /* for now we only support user pointer */ if (cmd->handle_type != 1) { - CAM_ERR(CAM_ISP, "Only user pointer is supported"); + CAM_ERR(CAM_ISP, "Only user pointer is supported, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); rc = -EINVAL; goto end; } @@ -6646,8 +6736,8 @@ static int __cam_isp_ctx_acquire_dev_in_available(struct cam_context *ctx, goto end; } - CAM_DBG(CAM_ISP, "start copy %d resources from user", - cmd->num_resources); + CAM_DBG(CAM_ISP, "start copy %d resources from user, ctx_idx: %u, link: 0x%x", + cmd->num_resources, ctx->ctx_id, ctx->link_hdl); if (copy_from_user(isp_res, u64_to_user_ptr(cmd->resource_hdl), sizeof(*isp_res)*cmd->num_resources)) { @@ -6664,8 +6754,8 @@ static int __cam_isp_ctx_acquire_dev_in_available(struct cam_context *ctx, rc = __cam_isp_ctx_allocate_mem_hw_entries(ctx, ¶m); if (rc) { - CAM_ERR(CAM_ISP, "Ctx[%d] allocate hw entry fail", - ctx->ctx_id); + CAM_ERR(CAM_ISP, "Ctx[%u] link: 0x%x allocate hw entry fail", + ctx->ctx_id, ctx->link_hdl); goto free_res; } @@ -6673,7 +6763,8 @@ static int __cam_isp_ctx_acquire_dev_in_available(struct cam_context *ctx, rc = ctx->hw_mgr_intf->hw_acquire(ctx->hw_mgr_intf->hw_mgr_priv, ¶m); if (rc != 0) { - CAM_ERR(CAM_ISP, "Acquire device failed"); + CAM_ERR(CAM_ISP, "Acquire device failed, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); goto free_res; } @@ -6685,7 +6776,8 @@ static int __cam_isp_ctx_acquire_dev_in_available(struct cam_context *ctx, rc = ctx->hw_mgr_intf->hw_cmd(ctx->hw_mgr_intf->hw_mgr_priv, &hw_cmd_args); if (rc) { - CAM_ERR(CAM_ISP, "HW command failed"); + CAM_ERR(CAM_ISP, "HW command failed, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); goto free_hw; } @@ -6694,7 +6786,8 @@ static int __cam_isp_ctx_acquire_dev_in_available(struct cam_context *ctx, * this context has rdi only resource assign rdi only * state machine */ - CAM_DBG(CAM_ISP, "RDI only session Context"); + CAM_DBG(CAM_ISP, "RDI only session Context, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); ctx_isp->substate_machine_irq = cam_isp_ctx_rdi_only_activated_state_machine_irq; @@ -6702,17 +6795,22 @@ static int __cam_isp_ctx_acquire_dev_in_available(struct cam_context *ctx, cam_isp_ctx_rdi_only_activated_state_machine; ctx_isp->rdi_only_context = true; } else if (isp_hw_cmd_args.u.ctx_type == CAM_ISP_CTX_FS2) { - CAM_DBG(CAM_ISP, "FS2 Session has PIX, RD and RDI"); + CAM_DBG(CAM_ISP, "FS2 Session has PIX, RD and RDI, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); ctx_isp->substate_machine_irq = cam_isp_ctx_fs2_state_machine_irq; ctx_isp->substate_machine = cam_isp_ctx_fs2_state_machine; } else if (isp_hw_cmd_args.u.ctx_type == CAM_ISP_CTX_OFFLINE) { - CAM_DBG(CAM_ISP, "offline Session has PIX and RD resources"); + CAM_DBG(CAM_ISP, + "offline Session has PIX and RD resources, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); ctx_isp->substate_machine_irq = cam_isp_ctx_offline_state_machine_irq; } else { - CAM_DBG(CAM_ISP, "Session has PIX or PIX and RDI resources"); + CAM_DBG(CAM_ISP, + "Session has PIX or PIX and RDI resources, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); ctx_isp->substate_machine_irq = cam_isp_ctx_activated_state_machine_irq; ctx_isp->substate_machine = @@ -6727,6 +6825,8 @@ static int __cam_isp_ctx_acquire_dev_in_available(struct cam_context *ctx, for (i = 0; i < CAM_ISP_CTX_EVENT_MAX; i++) atomic64_set(&ctx_isp->event_record_head[i], -1); + CAM_INFO(CAM_ISP, "Ctx_type: %u, ctx_id: %u, hw_mgr_ctx: %u", isp_hw_cmd_args.u.ctx_type, + ctx->ctx_id, param.hw_mgr_ctx_id); kfree(isp_res); isp_res = NULL; @@ -6739,11 +6839,13 @@ get_dev_handle: req_hdl_param.ops = ctx->crm_ctx_intf; req_hdl_param.priv = ctx; req_hdl_param.dev_id = CAM_ISP; - CAM_DBG(CAM_ISP, "get device handle form bridge"); + CAM_DBG(CAM_ISP, "get device handle form bridge, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); ctx->dev_hdl = cam_create_device_hdl(&req_hdl_param); if (ctx->dev_hdl <= 0) { rc = -EFAULT; - CAM_ERR(CAM_ISP, "Can not create device handle"); + CAM_ERR(CAM_ISP, "Can not create device handle, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); goto free_hw; } cmd->dev_handle = ctx->dev_hdl; @@ -6753,9 +6855,9 @@ get_dev_handle: ctx->state = CAM_CTX_ACQUIRED; trace_cam_context_state("ISP", ctx); - CAM_DBG(CAM_ISP, - "Acquire success on session_hdl 0x%x num_rsrces %d ctx %u", - cmd->session_handle, cmd->num_resources, ctx->ctx_id); + CAM_INFO(CAM_ISP, + "Acquire success: session_hdl 0x%x num_rsrces %d ctx %u link: 0x%x", + cmd->session_handle, cmd->num_resources, ctx->ctx_id, ctx->link_hdl); return rc; @@ -6788,24 +6890,28 @@ static int __cam_isp_ctx_acquire_hw_v1(struct cam_context *ctx, struct cam_isp_acquire_hw_info *acquire_hw_info = NULL; if (!ctx->hw_mgr_intf) { - CAM_ERR(CAM_ISP, "HW interface is not ready"); + CAM_ERR(CAM_ISP, "HW interface is not ready, ctx %u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); rc = -EFAULT; goto end; } CAM_DBG(CAM_ISP, - "session_hdl 0x%x, hdl type %d, res %lld", - cmd->session_handle, cmd->handle_type, cmd->resource_hdl); + "session_hdl 0x%x, hdl type %d, res %lld ctx %u link: 0x%x", + cmd->session_handle, cmd->handle_type, cmd->resource_hdl, + ctx->ctx_id, ctx->link_hdl); /* for now we only support user pointer */ if (cmd->handle_type != 1) { - CAM_ERR(CAM_ISP, "Only user pointer is supported"); + CAM_ERR(CAM_ISP, "Only user pointer is supported, ctx %u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); rc = -EINVAL; goto end; } if (cmd->data_size < sizeof(*acquire_hw_info)) { - CAM_ERR(CAM_ISP, "data_size is not a valid value"); + CAM_ERR(CAM_ISP, "data_size is not a valid value, ctx %u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); goto end; } @@ -6815,7 +6921,8 @@ static int __cam_isp_ctx_acquire_hw_v1(struct cam_context *ctx, goto end; } - CAM_DBG(CAM_ISP, "start copy resources from user"); + CAM_DBG(CAM_ISP, "start copy resources from user, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); if (copy_from_user(acquire_hw_info, (void __user *)cmd->resource_hdl, cmd->data_size)) { @@ -6835,8 +6942,8 @@ static int __cam_isp_ctx_acquire_hw_v1(struct cam_context *ctx, rc = __cam_isp_ctx_allocate_mem_hw_entries(ctx, ¶m); if (rc) { - CAM_ERR(CAM_ISP, "Ctx[%d] allocate hw entry fail", - ctx->ctx_id); + CAM_ERR(CAM_ISP, "Ctx[%u] link: 0x%x allocate hw entry fail", + ctx->ctx_id, ctx->link_hdl); goto free_res; } @@ -6844,7 +6951,8 @@ static int __cam_isp_ctx_acquire_hw_v1(struct cam_context *ctx, rc = ctx->hw_mgr_intf->hw_acquire(ctx->hw_mgr_intf->hw_mgr_priv, ¶m); if (rc != 0) { - CAM_ERR(CAM_ISP, "Acquire device failed"); + CAM_ERR(CAM_ISP, "Acquire device failed, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); goto free_res; } @@ -6859,7 +6967,8 @@ static int __cam_isp_ctx_acquire_hw_v1(struct cam_context *ctx, rc = ctx->hw_mgr_intf->hw_cmd(ctx->hw_mgr_intf->hw_mgr_priv, &hw_cmd_args); if (rc) { - CAM_ERR(CAM_ISP, "HW command failed"); + CAM_ERR(CAM_ISP, "HW command failed, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); goto free_hw; } @@ -6868,7 +6977,8 @@ static int __cam_isp_ctx_acquire_hw_v1(struct cam_context *ctx, * this context has rdi only resource assign rdi only * state machine */ - CAM_DBG(CAM_ISP, "RDI only session Context"); + CAM_DBG(CAM_ISP, "RDI only session Context, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); ctx_isp->substate_machine_irq = cam_isp_ctx_rdi_only_activated_state_machine_irq; @@ -6876,18 +6986,21 @@ static int __cam_isp_ctx_acquire_hw_v1(struct cam_context *ctx, cam_isp_ctx_rdi_only_activated_state_machine; ctx_isp->rdi_only_context = true; } else if (isp_hw_cmd_args.u.ctx_type == CAM_ISP_CTX_FS2) { - CAM_DBG(CAM_ISP, "FS2 Session has PIX, RD and RDI"); + CAM_DBG(CAM_ISP, "FS2 Session has PIX, RD and RDI, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); ctx_isp->substate_machine_irq = cam_isp_ctx_fs2_state_machine_irq; ctx_isp->substate_machine = cam_isp_ctx_fs2_state_machine; } else if (isp_hw_cmd_args.u.ctx_type == CAM_ISP_CTX_OFFLINE) { - CAM_DBG(CAM_ISP, "Offline session has PIX and RD resources"); + CAM_DBG(CAM_ISP, "Offline session has PIX and RD resources, ctx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); ctx_isp->substate_machine_irq = cam_isp_ctx_offline_state_machine_irq; ctx_isp->substate_machine = NULL; } else { - CAM_DBG(CAM_ISP, "Session has PIX or PIX and RDI resources"); + CAM_DBG(CAM_ISP, "Session has PIX or PIX and RDI resources, ctx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); ctx_isp->substate_machine_irq = cam_isp_ctx_activated_state_machine_irq; ctx_isp->substate_machine = @@ -6904,9 +7017,10 @@ static int __cam_isp_ctx_acquire_hw_v1(struct cam_context *ctx, atomic64_set(&ctx_isp->event_record_head[i], -1); trace_cam_context_state("ISP", ctx); - CAM_DBG(CAM_ISP, - "Acquire success on session_hdl 0x%xs ctx_type %d ctx_id %u", - ctx->session_hdl, isp_hw_cmd_args.u.ctx_type, ctx->ctx_id); + CAM_INFO(CAM_ISP, + "Acquire success:session_hdl 0x%xs ctx_type %d ctx %u link: 0x%x hw_mgr_ctx: %u", + ctx->session_hdl, isp_hw_cmd_args.u.ctx_type, ctx->ctx_id, ctx->link_hdl, + param.hw_mgr_ctx_id); kfree(acquire_hw_info); return rc; @@ -6942,24 +7056,28 @@ static int __cam_isp_ctx_acquire_hw_v2(struct cam_context *ctx, struct cam_isp_comp_record_query query_cmd; if (!ctx->hw_mgr_intf) { - CAM_ERR(CAM_ISP, "HW interface is not ready"); + CAM_ERR(CAM_ISP, "HW interface is not ready, ctx_id %u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); rc = -EFAULT; goto end; } CAM_DBG(CAM_ISP, - "session_hdl 0x%x, hdl type %d, res %lld", - cmd->session_handle, cmd->handle_type, cmd->resource_hdl); + "session_hdl 0x%x, hdl type %d, res %lld, ctx_id %u link: 0x%x", + cmd->session_handle, cmd->handle_type, cmd->resource_hdl, + ctx->ctx_id, ctx->link_hdl); /* for now we only support user pointer */ if (cmd->handle_type != 1) { - CAM_ERR(CAM_ISP, "Only user pointer is supported"); + CAM_ERR(CAM_ISP, "Only user pointer is supported, ctx_id %u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); rc = -EINVAL; goto end; } if (cmd->data_size < sizeof(*acquire_hw_info)) { - CAM_ERR(CAM_ISP, "data_size is not a valid value"); + CAM_ERR(CAM_ISP, "data_size is not a valid value, ctx_id %u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); goto end; } @@ -6969,7 +7087,8 @@ static int __cam_isp_ctx_acquire_hw_v2(struct cam_context *ctx, goto end; } - CAM_DBG(CAM_ISP, "start copy resources from user"); + CAM_DBG(CAM_ISP, "start copy resources from user, ctx_id %u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); if (copy_from_user(acquire_hw_info, (void __user *)cmd->resource_hdl, cmd->data_size)) { @@ -6990,14 +7109,15 @@ static int __cam_isp_ctx_acquire_hw_v2(struct cam_context *ctx, rc = ctx->hw_mgr_intf->hw_acquire(ctx->hw_mgr_intf->hw_mgr_priv, ¶m); if (rc != 0) { - CAM_ERR(CAM_ISP, "Acquire device failed"); + CAM_ERR(CAM_ISP, "Acquire device failed, ctx_id %u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); goto free_res; } rc = __cam_isp_ctx_allocate_mem_hw_entries(ctx, ¶m); if (rc) { - CAM_ERR(CAM_ISP, "Ctx[%d] allocate hw entry fail", - ctx->ctx_id); + CAM_ERR(CAM_ISP, "Ctx[%u] link: 0x%x allocate hw entry fail", + ctx->ctx_id, ctx->link_hdl); goto free_hw; } @@ -7062,7 +7182,8 @@ static int __cam_isp_ctx_acquire_hw_v2(struct cam_context *ctx, rc = ctx->hw_mgr_intf->hw_cmd(ctx->hw_mgr_intf->hw_mgr_priv, &hw_cmd_args); if (rc) { - CAM_ERR(CAM_ISP, "HW command failed"); + CAM_ERR(CAM_ISP, "HW command failed, ctx_id %u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); goto free_hw; } @@ -7086,7 +7207,8 @@ static int __cam_isp_ctx_acquire_hw_v2(struct cam_context *ctx, * this context has rdi only resource assign rdi only * state machine */ - CAM_DBG(CAM_ISP, "RDI only session Context"); + CAM_DBG(CAM_ISP, "RDI only session Context, ctx_id %u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); ctx_isp->substate_machine_irq = cam_isp_ctx_rdi_only_activated_state_machine_irq; @@ -7094,19 +7216,22 @@ static int __cam_isp_ctx_acquire_hw_v2(struct cam_context *ctx, cam_isp_ctx_rdi_only_activated_state_machine; ctx_isp->rdi_only_context = true; } else if (isp_hw_cmd_args.u.ctx_type == CAM_ISP_CTX_FS2) { - CAM_DBG(CAM_ISP, "FS2 Session has PIX, RD and RDI"); + CAM_DBG(CAM_ISP, "FS2 Session has PIX, RD and RDI, ctx_id %u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); ctx_isp->substate_machine_irq = cam_isp_ctx_fs2_state_machine_irq; ctx_isp->substate_machine = cam_isp_ctx_fs2_state_machine; } else if (isp_hw_cmd_args.u.ctx_type == CAM_ISP_CTX_OFFLINE) { - CAM_DBG(CAM_ISP, "Offline Session has PIX and RD resources"); + CAM_DBG(CAM_ISP, "Offline Session has PIX and RD resources, ctx_id %u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); ctx_isp->substate_machine_irq = cam_isp_ctx_offline_state_machine_irq; ctx_isp->substate_machine = NULL; ctx_isp->offline_context = true; } else { - CAM_DBG(CAM_ISP, "Session has PIX or PIX and RDI resources"); + CAM_DBG(CAM_ISP, "Session has PIX or PIX and RDI resources, ctx_id %u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); ctx_isp->substate_machine_irq = cam_isp_ctx_activated_state_machine_irq; ctx_isp->substate_machine = @@ -7119,9 +7244,10 @@ static int __cam_isp_ctx_acquire_hw_v2(struct cam_context *ctx, cam_req_mgr_process_workq_apply_req_worker); if (rc) CAM_ERR(CAM_ISP, - "Failed to create workq for IFE rc:%d offline: %s vfps: %s", + "Failed to create workq for IFE rc:%d offline: %s vfps: %s ctx_id %u link: 0x%x", rc, CAM_BOOL_TO_YESNO(ctx_isp->offline_context), - CAM_BOOL_TO_YESNO(ctx_isp->vfps_aux_context)); + CAM_BOOL_TO_YESNO(ctx_isp->vfps_aux_context), + ctx->ctx_id, ctx->link_hdl); } ctx_isp->hw_ctx = param.ctxt_to_hw_map; @@ -7129,9 +7255,10 @@ static int __cam_isp_ctx_acquire_hw_v2(struct cam_context *ctx, ctx->ctxt_to_hw_map = param.ctxt_to_hw_map; trace_cam_context_state("ISP", ctx); - CAM_DBG(CAM_ISP, - "Acquire success on session_hdl 0x%xs ctx_type %d ctx_id %u", - ctx->session_hdl, isp_hw_cmd_args.u.ctx_type, ctx->ctx_id); + CAM_INFO(CAM_ISP, + "Acquire success: session_hdl 0x%xs ctx_type %d ctx %u link: 0x%x hw_mgr_ctx: %u", + ctx->session_hdl, isp_hw_cmd_args.u.ctx_type, ctx->ctx_id, ctx->link_hdl, + param.hw_mgr_ctx_id); kfree(acquire_hw_info); return rc; @@ -7163,7 +7290,8 @@ static int __cam_isp_ctx_acquire_hw_in_acquired(struct cam_context *ctx, else if (api_version == 2) rc = __cam_isp_ctx_acquire_hw_v2(ctx, args); else - CAM_ERR(CAM_ISP, "Unsupported api version %d", api_version); + CAM_ERR(CAM_ISP, "Unsupported api version %d, ctx_id %u link: 0x%x", + api_version, ctx->ctx_id, ctx->link_hdl); return rc; } @@ -7176,7 +7304,8 @@ static int __cam_isp_ctx_config_dev_in_acquired(struct cam_context *ctx, (struct cam_isp_context *) ctx->ctx_priv; if (!ctx_isp->hw_acquired) { - CAM_ERR(CAM_ISP, "HW is not acquired, reject packet"); + CAM_ERR(CAM_ISP, "HW is not acquired, reject packet, ctx_id %u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); return -EINVAL; } @@ -7187,7 +7316,8 @@ static int __cam_isp_ctx_config_dev_in_acquired(struct cam_context *ctx, trace_cam_context_state("ISP", ctx); } - CAM_DBG(CAM_ISP, "next state %d", ctx->state); + CAM_DBG(CAM_ISP, "next state %d, ctx %u link: 0x%x", + ctx->state, ctx->ctx_id, ctx->link_hdl); return rc; } @@ -7202,7 +7332,8 @@ static int __cam_isp_ctx_config_dev_in_flushed(struct cam_context *ctx, (struct cam_isp_context *) ctx->ctx_priv; if (!ctx_isp->hw_acquired) { - CAM_ERR(CAM_ISP, "HW is not acquired, reject packet"); + CAM_ERR(CAM_ISP, "HW is not acquired, reject packet, ctx_id %u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); rc = -EINVAL; goto end; } @@ -7213,14 +7344,15 @@ static int __cam_isp_ctx_config_dev_in_flushed(struct cam_context *ctx, if (!ctx_isp->init_received) { CAM_WARN(CAM_ISP, - "Received update packet in flushed state, skip start"); + "Received update pckt in flushed state, skip start, ctx %u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); goto end; } - CAM_DBG(CAM_ISP, "vfps_ctx:%s resume_hw_in_flushed:%d ctx:%d", + CAM_DBG(CAM_ISP, "vfps_ctx:%s resume_hw_in_flushed:%d ctx:%u link: 0x%x", CAM_BOOL_TO_YESNO(ctx_isp->vfps_aux_context), ctx_isp->resume_hw_in_flushed, - ctx->ctx_id); + ctx->ctx_id, ctx->link_hdl); if (ctx_isp->vfps_aux_context) { /* Resume the HW only when we get first valid req */ @@ -7237,7 +7369,8 @@ static int __cam_isp_ctx_config_dev_in_flushed(struct cam_context *ctx, rc = ctx->hw_mgr_intf->hw_cmd(ctx->hw_mgr_intf->hw_mgr_priv, &hw_cmd_args); if (rc) { - CAM_ERR(CAM_ISP, "Failed to resume HW rc: %d", rc); + CAM_ERR(CAM_ISP, "Failed to resume HW rc: %d, ctx_id %u link: 0x%x", + rc, ctx->ctx_id, ctx->link_hdl); goto end; } @@ -7246,15 +7379,16 @@ static int __cam_isp_ctx_config_dev_in_flushed(struct cam_context *ctx, rc = __cam_isp_ctx_start_dev_in_ready(ctx, &start_cmd); if (rc) CAM_ERR(CAM_ISP, - "Failed to re-start HW after flush rc: %d", rc); + "Failed to re-start HW after flush rc: %d, ctx_id %u link: 0x%x", + rc, ctx->ctx_id, ctx->link_hdl); else CAM_INFO(CAM_ISP, - "Received init after flush. Re-start HW complete in ctx:%d", - ctx->ctx_id); + "Received init after flush. Re-start HW complete in ctx:%d, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); end: - CAM_DBG(CAM_ISP, "next state %d sub_state:%d", ctx->state, - ctx_isp->substate_activated); + CAM_DBG(CAM_ISP, "next state %d sub_state:%d ctx_id %u link: 0x%x", ctx->state, + ctx_isp->substate_activated, ctx->ctx_id, ctx->link_hdl); return rc; } @@ -7266,18 +7400,18 @@ static int __cam_isp_ctx_link_in_acquired(struct cam_context *ctx, (struct cam_isp_context *) ctx->ctx_priv; if (!link) { - CAM_ERR(CAM_ISP, "setup link info is null: %pK ctx: %u", - link, ctx->ctx_id); + CAM_ERR(CAM_ISP, "setup link info is null: %pK ctx: %u link: 0x%x", + link, ctx->ctx_id, ctx->link_hdl); return -EINVAL; } if (!link->crm_cb) { - CAM_ERR(CAM_ISP, "crm cb is null: %pK ctx: %u", - link->crm_cb, ctx->ctx_id); + CAM_ERR(CAM_ISP, "crm cb is null: %pK ctx: %u, link: 0x%x", + link->crm_cb, ctx->ctx_id, ctx->link_hdl); return -EINVAL; } - CAM_DBG(CAM_ISP, "Enter........."); + CAM_DBG(CAM_ISP, "Enter.........ctx: %u, link: 0x%x", ctx->ctx_id, ctx->link_hdl); ctx->link_hdl = link->link_hdl; ctx->ctx_crm_intf = link->crm_cb; @@ -7304,7 +7438,8 @@ static int __cam_isp_ctx_link_in_acquired(struct cam_context *ctx, trace_cam_context_state("ISP", ctx); } - CAM_DBG(CAM_ISP, "next state %d", ctx->state); + CAM_DBG(CAM_ISP, "next state %d, ctx: %u, link: 0x%x", + ctx->state, ctx->ctx_id, ctx->link_hdl); return rc; } @@ -7381,7 +7516,8 @@ static int __cam_isp_ctx_start_dev_in_ready(struct cam_context *ctx, if (list_empty(&ctx->pending_req_list)) { /* should never happen */ - CAM_ERR(CAM_ISP, "Start device with empty configuration"); + CAM_ERR(CAM_ISP, "Start device with empty configuration, ctx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); rc = -EFAULT; goto end; } else { @@ -7391,7 +7527,8 @@ static int __cam_isp_ctx_start_dev_in_ready(struct cam_context *ctx, req_isp = (struct cam_isp_ctx_req *) req->req_priv; if (!ctx_isp->hw_ctx) { - CAM_ERR(CAM_ISP, "Wrong hw context pointer."); + CAM_ERR(CAM_ISP, "Wrong hw context pointer.ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); rc = -EFAULT; goto end; } @@ -7437,19 +7574,19 @@ static int __cam_isp_ctx_start_dev_in_ready(struct cam_context *ctx, list_add_tail(&req->list, &ctx->free_req_list); atomic_set(&ctx_isp->rxd_epoch, 1); CAM_DBG(CAM_REQ, - "Move pending req: %lld to free list(cnt: %d) offline ctx %u", - req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id); + "Move pending req: %lld to free list(cnt: %d) offline ctx %u link: 0x%x", + req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id, ctx->link_hdl); } else if (ctx_isp->rdi_only_context || !req_isp->num_fence_map_out) { list_add_tail(&req->list, &ctx->wait_req_list); CAM_DBG(CAM_REQ, - "Move pending req: %lld to wait list(cnt: %d) ctx %u", - req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id); + "Move pending req: %lld to wait list(cnt: %d) ctx %u link: 0x%x", + req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id, ctx->link_hdl); } else { list_add_tail(&req->list, &ctx->active_req_list); ctx_isp->active_req_cnt++; CAM_DBG(CAM_REQ, - "Move pending req: %lld to active list(cnt: %d) ctx %u offline %d", - req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id, + "Move pending req: %lld to active list(cnt: %d) ctx %u link: 0x%x offline %d", + req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id, ctx->link_hdl, ctx_isp->offline_context); } @@ -7464,7 +7601,7 @@ static int __cam_isp_ctx_start_dev_in_ready(struct cam_context *ctx, &start_isp); if (rc) { /* HW failure. user need to clean up the resource */ - CAM_ERR(CAM_ISP, "Start HW failed"); + CAM_ERR(CAM_ISP, "Start HW failed, ctx %u link: 0x%x", ctx->ctx_id, ctx->link_hdl); ctx->state = CAM_CTX_READY; if ((rc == -ETIMEDOUT) && (isp_ctx_debug.enable_cdm_cmd_buff_dump)) @@ -7475,7 +7612,7 @@ static int __cam_isp_ctx_start_dev_in_ready(struct cam_context *ctx, list_add(&req->list, &ctx->pending_req_list); goto end; } - CAM_DBG(CAM_ISP, "start device success ctx %u", ctx->ctx_id); + CAM_DBG(CAM_ISP, "start device success ctx %u link: 0x%x", ctx->ctx_id, ctx->link_hdl); end: return rc; @@ -7524,9 +7661,9 @@ static int __cam_isp_ctx_stop_dev_in_activated_unlock( &stop); } - CAM_DBG(CAM_ISP, "next Substate[%s]", + CAM_DBG(CAM_ISP, "next Substate[%s], ctx_idx: %u, link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated)); + ctx_isp->substate_activated), ctx->ctx_id, ctx->link_hdl); if (ctx->ctx_crm_intf && ctx->ctx_crm_intf->notify_stop) { @@ -7538,15 +7675,16 @@ static int __cam_isp_ctx_stop_dev_in_activated_unlock( ctx->ctx_id, ctx->link_hdl); ctx->ctx_crm_intf->notify_stop(¬ify); } else if (!ctx_isp->offline_context) - CAM_ERR(CAM_ISP, "cb not present"); + CAM_ERR(CAM_ISP, "cb not present, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); while (!list_empty(&ctx->pending_req_list)) { req = list_first_entry(&ctx->pending_req_list, struct cam_ctx_request, list); list_del_init(&req->list); req_isp = (struct cam_isp_ctx_req *) req->req_priv; - CAM_DBG(CAM_ISP, "signal fence in pending list. fence num %d", - req_isp->num_fence_map_out); + CAM_DBG(CAM_ISP, "signal fence in pending list. fence num %d ctx:%u, link: 0x%x", + req_isp->num_fence_map_out, ctx->ctx_id, ctx->link_hdl); for (i = 0; i < req_isp->num_fence_map_out; i++) if (req_isp->fence_map_out[i].sync_id != -1) { cam_sync_signal( @@ -7562,8 +7700,8 @@ static int __cam_isp_ctx_stop_dev_in_activated_unlock( struct cam_ctx_request, list); list_del_init(&req->list); req_isp = (struct cam_isp_ctx_req *) req->req_priv; - CAM_DBG(CAM_ISP, "signal fence in wait list. fence num %d", - req_isp->num_fence_map_out); + CAM_DBG(CAM_ISP, "signal fence in wait list. fence num %d ctx: %u, link: 0x%x", + req_isp->num_fence_map_out, ctx->ctx_id, ctx->link_hdl); for (i = 0; i < req_isp->num_fence_map_out; i++) if (req_isp->fence_map_out[i].sync_id != -1) { cam_sync_signal( @@ -7579,8 +7717,8 @@ static int __cam_isp_ctx_stop_dev_in_activated_unlock( struct cam_ctx_request, list); list_del_init(&req->list); req_isp = (struct cam_isp_ctx_req *) req->req_priv; - CAM_DBG(CAM_ISP, "signal fence in active list. fence num %d", - req_isp->num_fence_map_out); + CAM_DBG(CAM_ISP, "signal fence in active list. fence num %d ctx: %u, link: 0x%x", + req_isp->num_fence_map_out, ctx->ctx_id, ctx->link_hdl); for (i = 0; i < req_isp->num_fence_map_out; i++) if (req_isp->fence_map_out[i].sync_id != -1) { cam_sync_signal( @@ -7607,13 +7745,14 @@ static int __cam_isp_ctx_stop_dev_in_activated_unlock( for (i = 0; i < CAM_ISP_CTX_EVENT_MAX; i++) atomic64_set(&ctx_isp->event_record_head[i], -1); - CAM_DBG(CAM_ISP, "Stop device success next state %d on ctx %u", - ctx->state, ctx->ctx_id); + CAM_DBG(CAM_ISP, "Stop device success next state %d on ctx %u link: 0x%x", + ctx->state, ctx->ctx_id, ctx->link_hdl); if (!stop_cmd) { rc = __cam_isp_ctx_unlink_in_ready(ctx, NULL); if (rc) - CAM_ERR(CAM_ISP, "Unlink failed rc=%d", rc); + CAM_ERR(CAM_ISP, "Unlink failed rc=%d, ctx %u link: 0x%x", + rc, ctx->ctx_id, ctx->link_hdl); } return rc; } @@ -7639,11 +7778,13 @@ static int __cam_isp_ctx_release_dev_in_activated(struct cam_context *ctx, rc = __cam_isp_ctx_stop_dev_in_activated_unlock(ctx, NULL); if (rc) - CAM_ERR(CAM_ISP, "Stop device failed rc=%d", rc); + CAM_ERR(CAM_ISP, "Stop device failed rc=%d, ctx %u link: 0x%x", + rc, ctx->ctx_id, ctx->link_hdl); rc = __cam_isp_ctx_release_dev_in_top_state(ctx, cmd); if (rc) - CAM_ERR(CAM_ISP, "Release device failed rc=%d", rc); + CAM_ERR(CAM_ISP, "Release device failed rc=%d ctx %u link: 0x%x", + rc, ctx->ctx_id, ctx->link_hdl); return rc; } @@ -7655,11 +7796,13 @@ static int __cam_isp_ctx_release_hw_in_activated(struct cam_context *ctx, rc = __cam_isp_ctx_stop_dev_in_activated_unlock(ctx, NULL); if (rc) - CAM_ERR(CAM_ISP, "Stop device failed rc=%d", rc); + CAM_ERR(CAM_ISP, "Stop device failed rc=%d, ctx %u link: 0x%x", + rc, ctx->ctx_id, ctx->link_hdl); rc = __cam_isp_ctx_release_hw_in_top_state(ctx, cmd); if (rc) - CAM_ERR(CAM_ISP, "Release hw failed rc=%d", rc); + CAM_ERR(CAM_ISP, "Release hw failed rc=%d, ctx %u link: 0x%x", + rc, ctx->ctx_id, ctx->link_hdl); return rc; } @@ -7770,8 +7913,8 @@ static int __cam_isp_ctx_reset_and_recover( rc = ctx->hw_mgr_intf->hw_stop(ctx->hw_mgr_intf->hw_mgr_priv, &stop_args); if (rc) { - CAM_ERR(CAM_ISP, "Failed to stop HW rc: %d ctx: %u", - rc, ctx->ctx_id); + CAM_ERR(CAM_ISP, "Failed to stop HW rc: %d ctx: %u link: 0x%x", + rc, ctx->ctx_id, ctx->link_hdl); goto end; } CAM_DBG(CAM_ISP, "Stop HW success ctx: %u link: 0x%x", @@ -7794,7 +7937,8 @@ static int __cam_isp_ctx_reset_and_recover( rc = ctx->hw_mgr_intf->hw_cmd(ctx->hw_mgr_intf->hw_mgr_priv, &hw_cmd_args); if (rc) { - CAM_ERR(CAM_ISP, "Failed to resume HW rc: %d ctx: %u", rc, ctx->ctx_id); + CAM_ERR(CAM_ISP, "Failed to resume HW rc: %d ctx: %u link: 0x%x", + rc, ctx->ctx_id, ctx->link_hdl); goto end; } CAM_DBG(CAM_ISP, "Resume call success ctx: %u on link: 0x%x", @@ -7819,7 +7963,7 @@ static int __cam_isp_ctx_reset_and_recover( rc = ctx->hw_mgr_intf->hw_start(ctx->hw_mgr_intf->hw_mgr_priv, &start_isp); if (rc) { - CAM_ERR(CAM_ISP, "Start HW failed"); + CAM_ERR(CAM_ISP, "Start HW failed, ctx: %u link: 0x%x", ctx->ctx_id, ctx->link_hdl); ctx->state = CAM_CTX_READY; goto end; } @@ -7900,8 +8044,8 @@ static int __cam_isp_ctx_process_evt(struct cam_context *ctx, if ((ctx->state == CAM_CTX_ACQUIRED) && (link_evt_data->evt_type != CAM_REQ_MGR_LINK_EVT_UPDATE_PROPERTIES)) { CAM_WARN(CAM_ISP, - "Get unexpect evt:%d in acquired state", - link_evt_data->evt_type); + "Get unexpect evt:%d in acquired state, ctx: %u on link: 0x%x", + link_evt_data->evt_type, ctx->ctx_id, ctx->link_hdl); return -EINVAL; } @@ -7941,13 +8085,13 @@ static int __cam_isp_ctx_process_evt(struct cam_context *ctx, ctx_isp->vfps_aux_context = true; else ctx_isp->vfps_aux_context = false; - CAM_DBG(CAM_ISP, "vfps_aux_context:%s on ctx: %u", - CAM_BOOL_TO_YESNO(ctx_isp->vfps_aux_context), ctx->ctx_id); + CAM_DBG(CAM_ISP, "vfps_aux_context:%s on ctx: %u link: 0x%x", + CAM_BOOL_TO_YESNO(ctx_isp->vfps_aux_context), ctx->ctx_id, ctx->link_hdl); break; default: CAM_WARN(CAM_ISP, - "Unsupported event type: 0x%x on ctx: %u", - link_evt_data->evt_type, ctx->ctx_id); + "Unsupported event type: 0x%x on ctx: %u link: 0x%x", + link_evt_data->evt_type, ctx->ctx_id, ctx->link_hdl); rc = -EINVAL; break; } @@ -7961,15 +8105,18 @@ static int __cam_isp_ctx_unlink_in_activated(struct cam_context *ctx, int rc = 0; CAM_WARN(CAM_ISP, - "Received unlink in activated state. It's unexpected"); + "Received unlink in activated state. It's unexpected, ctx: %u link: 0x%x", + ctx->ctx_id, ctx->link_hdl); rc = __cam_isp_ctx_stop_dev_in_activated_unlock(ctx, NULL); if (rc) - CAM_WARN(CAM_ISP, "Stop device failed rc=%d", rc); + CAM_WARN(CAM_ISP, "Stop device failed rc=%d, ctx: %u link: 0x%x", + rc, ctx->ctx_id, ctx->link_hdl); rc = __cam_isp_ctx_unlink_in_ready(ctx, unlink); if (rc) - CAM_ERR(CAM_ISP, "Unlink failed rc=%d", rc); + CAM_ERR(CAM_ISP, "Unlink failed rc=%d, ctx: %u link: 0x%x", + rc, ctx->ctx_id, ctx->link_hdl); return rc; } @@ -7983,25 +8130,25 @@ static int __cam_isp_ctx_apply_req(struct cam_context *ctx, (struct cam_isp_context *) ctx->ctx_priv; trace_cam_apply_req("ISP", ctx->ctx_id, apply->request_id, apply->link_hdl); - CAM_DBG(CAM_ISP, "Enter: apply req in Substate[%s] request_id:%lld", + CAM_DBG(CAM_ISP, "Enter: apply req in Substate[%s] request_id:%lld, ctx: %u link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated), apply->request_id); + ctx_isp->substate_activated), apply->request_id, ctx->ctx_id, ctx->link_hdl); ctx_ops = &ctx_isp->substate_machine[ctx_isp->substate_activated]; if (ctx_ops->crm_ops.apply_req) { rc = ctx_ops->crm_ops.apply_req(ctx, apply); } else { CAM_WARN_RATE_LIMIT(CAM_ISP, - "No handle function in activated Substate[%s]", + "No handle function in activated Substate[%s], ctx: %u link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated)); + ctx_isp->substate_activated), ctx->ctx_id, ctx->link_hdl); rc = -EFAULT; } if (rc) CAM_WARN_RATE_LIMIT(CAM_ISP, - "Apply failed in active Substate[%s] rc %d", + "Apply failed in active Substate[%s] rc %d, ctx: %u link: 0x%x", __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated), rc); + ctx_isp->substate_activated), rc, ctx->ctx_id, ctx->link_hdl); return rc; } @@ -8016,8 +8163,9 @@ static int __cam_isp_ctx_apply_default_settings( if (!(apply->trigger_point & ctx_isp->subscribe_event)) { CAM_WARN(CAM_ISP, - "Trigger: %u not subscribed for: %u", - apply->trigger_point, ctx_isp->subscribe_event); + "Trigger: %u not subscribed for: %u, ctx: %u link: 0x%x", + apply->trigger_point, ctx_isp->subscribe_event, ctx->ctx_id, + ctx->link_hdl); return 0; } @@ -8046,15 +8194,15 @@ static int __cam_isp_ctx_apply_default_settings( rc = ctx_ops->crm_ops.notify_frame_skip(ctx, apply); } else { CAM_WARN_RATE_LIMIT(CAM_ISP, - "No handle function in activated substate %d", - ctx_isp->substate_activated); + "No handle function in activated substate %d, ctx:%u on link:0x%x", + ctx_isp->substate_activated, ctx->ctx_id, ctx->link_hdl); rc = -EFAULT; } if (rc) CAM_WARN_RATE_LIMIT(CAM_ISP, - "Apply default failed in active substate %d rc %d", - ctx_isp->substate_activated, rc); + "Apply default failed in active substate %d rc %d ctx: %u link: 0x%x", + ctx_isp->substate_activated, rc, ctx->ctx_id, ctx->link_hdl); } return rc; @@ -8073,26 +8221,26 @@ static int __cam_isp_ctx_handle_irq_in_activated(void *context, trace_cam_isp_activated_irq(ctx, ctx_isp->substate_activated, evt_id, __cam_isp_ctx_get_event_ts(evt_id, evt_data)); - CAM_DBG(CAM_ISP, "Enter: State %d, Substate[%s], evt id %d, ctx:%d", + CAM_DBG(CAM_ISP, "Enter: State %d, Substate[%s], evt id %d, ctx:%u link: 0x%x", ctx->state, __cam_isp_ctx_substate_val_to_type( ctx_isp->substate_activated), evt_id, - ctx->ctx_id); + ctx->ctx_id, ctx->link_hdl); irq_ops = &ctx_isp->substate_machine_irq[ctx_isp->substate_activated]; if (irq_ops->irq_ops[evt_id]) { rc = irq_ops->irq_ops[evt_id](ctx_isp, evt_data); } else { CAM_DBG(CAM_ISP, - "No handle function for Substate[%s], evt id %d, ctx:%d", + "No handle function for Substate[%s], evt id %d, ctx:%u link: 0x%x", __cam_isp_ctx_substate_val_to_type( ctx_isp->substate_activated), evt_id, - ctx->ctx_id); + ctx->ctx_id, ctx->link_hdl); if (isp_ctx_debug.enable_state_monitor_dump) __cam_isp_ctx_dump_state_monitor_array(ctx_isp); } - CAM_DBG(CAM_ISP, "Exit: State %d Substate[%s], ctx:%d", + CAM_DBG(CAM_ISP, "Exit: State %d Substate[%s], ctx:%u link: 0x%x", ctx->state, __cam_isp_ctx_substate_val_to_type( - ctx_isp->substate_activated), ctx->ctx_id); + ctx_isp->substate_activated), ctx->ctx_id, ctx->link_hdl); spin_unlock(&ctx->lock); return rc; @@ -8121,16 +8269,16 @@ static int cam_isp_context_validate_event_notify_injection(struct cam_context *c break; default: CAM_ERR(CAM_ISP, - "Invalid error type: %u for error event injection err type: %u req id: %llu ctx id: %u dev hdl: %d", + "Invalid error type: %u for error event injection err type: %u req id: %llu ctx id: %u link: 0x%x dev hdl: %d", err_evt_params->err_type, err_evt_params->err_code, - req_id, ctx->ctx_id, ctx->dev_hdl); + req_id, ctx->ctx_id, ctx->link_hdl, ctx->dev_hdl); return -EINVAL; } CAM_INFO(CAM_ISP, - "Inject ERR evt: err code: %u err type: %u req id: %llu ctx id: %u dev hdl: %d", + "Inject ERR evt: err code: %u err type: %u req id: %llu ctx id: %u link: 0x%x dev hdl: %d", err_evt_params->err_code, err_evt_params->err_type, - req_id, ctx->ctx_id, ctx->dev_hdl); + req_id, ctx->ctx_id, ctx->link_hdl, ctx->dev_hdl); break; } case V4L_EVENT_CAM_REQ_MGR_PF_ERROR: { @@ -8141,24 +8289,27 @@ static int cam_isp_context_validate_event_notify_injection(struct cam_context *c rc = cam_smmu_is_cb_non_fatal_fault_en(ctx->img_iommu_hdl, &non_fatal_en); if (rc) { CAM_ERR(CAM_ISP, - "Fail to query whether device's cb has non-fatal enabled rc:%d", - rc); + "Fail to query whether device's cb has non-fatal enabled rc:%d, ctx id: %u link: 0x%x", + rc, ctx->ctx_id, ctx->link_hdl); return rc; } if (!non_fatal_en) { CAM_ERR(CAM_ISP, - "Fail to inject page fault event notification. Page fault is fatal for ISP"); + "Fail to inject pagefault event notif. Pagefault fatal for ISP,ctx:%u link:0x%x", + ctx->ctx_id, ctx->link_hdl); return -EINVAL; } CAM_INFO(CAM_ISP, - "Inject PF evt: req_id: %llu ctx id: %u dev hdl: %d ctx found: %hhu", - req_id, ctx->ctx_id, ctx->dev_hdl, pf_evt_params->ctx_found); + "Inject PF evt: req_id:%llu ctx:%u link:0x%x dev hdl:%d ctx found:%hhu", + req_id, ctx->ctx_id, ctx->link_hdl, ctx->dev_hdl, + pf_evt_params->ctx_found); break; } default: - CAM_ERR(CAM_ISP, "Event notification type not supported: %u", evt_type); + CAM_ERR(CAM_ISP, "Event notification type not supported: %u, ctx: %u link: 0x%x", + evt_type, ctx->ctx_id, ctx->link_hdl); rc = -EINVAL; } @@ -8184,12 +8335,13 @@ static int cam_isp_context_inject_evt(void *context, void *evt_args) rc = cam_isp_context_validate_event_notify_injection(ctx, evt_params); if (rc) { CAM_ERR(CAM_ISP, - "Event notification injection failed validation rc: %d", rc); + "Event notif injection failed validation rc:%d, ctx:%u link:0x%x", + rc, ctx->ctx_id, ctx->link_hdl); return rc; } } else { - CAM_ERR(CAM_ISP, "Buffer done err injection %u not supported by ISP", - evt_params->inject_id); + CAM_ERR(CAM_ISP, "Bufdone err injection %u not supported by ISP,ctx:%u link:0x%x", + evt_params->inject_id, ctx->ctx_id, ctx->link_hdl); return -EINVAL; } @@ -8312,7 +8464,8 @@ static int cam_isp_context_hw_recovery(void *priv, void *data) if (ctx->hw_mgr_intf->hw_recovery) rc = ctx->hw_mgr_intf->hw_recovery(ctx->hw_mgr_intf->hw_mgr_priv, data); else - CAM_ERR(CAM_ISP, "hw mgr doesn't support recovery"); + CAM_ERR(CAM_ISP, "hw mgr doesn't support recovery, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); return rc; } @@ -8326,12 +8479,13 @@ static void cam_isp_context_find_faulted_context(struct cam_context *ctx, *found = false; list_for_each_entry_safe(req, req_temp, req_list, list) { - CAM_INFO(CAM_ISP, "List req_id: %llu ctx id: %u", - req->request_id, ctx->ctx_id); + CAM_INFO(CAM_ISP, "List req_id: %llu ctx id: %u link: 0x%x", + req->request_id, ctx->ctx_id, ctx->link_hdl); rc = cam_context_dump_pf_info_to_hw(ctx, pf_args, &req->pf_data); if (rc) - CAM_ERR(CAM_ISP, "Failed to dump pf info"); + CAM_ERR(CAM_ISP, "Failed to dump pf info, ctx_idx: %u, link: 0x%x", + ctx->ctx_id, ctx->link_hdl); /* * Found faulted buffer. Even if faulted ctx is found, but * continue to search for faulted buffer @@ -8367,16 +8521,16 @@ static int cam_isp_context_dump_requests(void *data, void *args) goto end; CAM_INFO(CAM_ISP, - "Iterating over active list for isp ctx %d state %d", - ctx->ctx_id, ctx->state); + "Iterating over active list for isp ctx %u link: 0x%x state %d", + ctx->ctx_id, ctx->link_hdl, ctx->state); cam_isp_context_find_faulted_context(ctx, &ctx->active_req_list, pf_args, &found); if (found) goto end; CAM_INFO(CAM_ISP, - "Iterating over waiting list of isp ctx %d state %d", - ctx->ctx_id, ctx->state); + "Iterating over waiting list of isp ctx %u link: 0x%x state %d", + ctx->ctx_id, ctx->link_hdl, ctx->state); cam_isp_context_find_faulted_context(ctx, &ctx->wait_req_list, pf_args, &found); if (found) @@ -8391,8 +8545,8 @@ static int cam_isp_context_dump_requests(void *data, void *args) * overflow error. */ CAM_INFO(CAM_ISP, - "Iterating over pending req list of isp ctx %d state %d", - ctx->ctx_id, ctx->state); + "Iterating over pending req list of isp ctx %u link: 0x%x state %d", + ctx->ctx_id, ctx->link_hdl, ctx->state); cam_isp_context_find_faulted_context(ctx, &ctx->pending_req_list, pf_args, &found); if (found) @@ -8402,10 +8556,11 @@ end: if (pf_args->pf_context_info.resource_type) { ctx_isp = (struct cam_isp_context *)ctx->ctx_priv; CAM_INFO(CAM_ISP, - "Page fault on resource:%s (0x%x) ctx id:%d frame id:%d reported id:%lld applied id:%lld", + "Page fault on resource:%s (0x%x) ctx id:%u link: 0x%x frame id:%d reported id:%lld applied id:%lld", __cam_isp_resource_handle_id_to_type(ctx_isp->isp_device_type, - pf_args->pf_context_info.resource_type), - pf_args->pf_context_info.resource_type, ctx->ctx_id, ctx_isp->frame_id, + pf_args->pf_context_info.resource_type), + pf_args->pf_context_info.resource_type, + ctx->ctx_id, ctx->link_hdl, ctx_isp->frame_id, ctx_isp->reported_req_id, ctx_isp->last_applied_req_id); } @@ -8419,7 +8574,8 @@ end: rc = cam_context_send_pf_evt(ctx, pf_args); if (rc) CAM_ERR(CAM_ISP, - "Failed to notify PF event to userspace rc: %d", rc); + "Failed to notify PF event to userspace rc: %d, ctx id:%u link: 0x%x", + rc, ctx->ctx_id, ctx->link_hdl); return rc; } @@ -8497,7 +8653,8 @@ int cam_isp_context_init(struct cam_isp_context *ctx, rc = cam_context_init(ctx_base, isp_dev_name, CAM_ISP, ctx_id, crm_node_intf, hw_intf, ctx->req_base, CAM_ISP_CTX_REQ_MAX, img_iommu_hdl); if (rc) { - CAM_ERR(CAM_ISP, "Camera Context Base init failed"); + CAM_ERR(CAM_ISP, "Camera Context Base init failed, ctx_idx: %u, link: 0x%x", + ctx_base->ctx_id, ctx_base->link_hdl); goto err; } diff --git a/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c b/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c index bdcbb7e0dc..113bbf825b 100644 --- a/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c +++ b/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c @@ -134,8 +134,9 @@ static int cam_ife_mgr_update_core_info_to_cpas(struct cam_ife_hw_mgr_ctx rc = cam_cpas_csid_input_core_info_update(csid_core_idx, sfe_core_idx, set_port); if (rc) { - CAM_ERR(CAM_PERF, "Failed in updating core info to cpas rc: %d", - rc); + CAM_ERR(CAM_PERF, + "Failed to update core info to cpas rc:%d,ctx:%u", + rc, ctx->ctx_index); return rc; } } @@ -195,8 +196,8 @@ static int cam_isp_blob_drv_config(struct cam_ife_hw_mgr_ctx *ctx, sizeof(struct cam_ife_csid_drv_config_args)); if (rc) { CAM_ERR(CAM_PERF, - "DRV config failed req_id:%d i:%d hw_idx=%d rc:%d", - request_id, i, ctx->base[i].idx, rc); + "DRV config failed req_id:%d i:%d hw_idx=%d rc:%d ctx_idx: %u", + request_id, i, ctx->base[i].idx, rc, ctx->ctx_index); break; } } @@ -234,8 +235,8 @@ static int cam_ife_mgr_finish_clk_bw_update( clk_bw_args.hw_intf = NULL; clk_bw_args.clock_updated = false; CAM_DBG(CAM_PERF, - "Clock/BW Update for req_id:%d i:%d num_vfe_out:%d num_sfe_out:%d in_rd:%d", - request_id, i, ctx->num_acq_vfe_out, ctx->num_acq_sfe_out, + "Clock/BW Update for ctx:%u req:%d i:%d num_vfe_out:%d num_sfe_out:%d in_rd:%d", + ctx->ctx_index, request_id, i, ctx->num_acq_vfe_out, ctx->num_acq_sfe_out, !list_empty(&ctx->res_list_ife_in_rd)); if ((ctx->base[i].hw_type == CAM_ISP_HW_TYPE_VFE) && (ctx->num_acq_vfe_out || (!list_empty(&ctx->res_list_ife_in_rd)))) @@ -247,8 +248,9 @@ static int cam_ife_mgr_finish_clk_bw_update( continue; CAM_DBG(CAM_PERF, - "Apply Clock/BW for req_id:%d i:%d hw_idx=%d hw_type:%d inline:%s num_vfe_out:%d num_sfe_out:%d in_rd:%d", - request_id, i, clk_bw_args.hw_intf->hw_idx, clk_bw_args.hw_intf->hw_type, + "Apply Clock/BW for ctx:%u req:%d i:%d hw_idx=%d hw_type:%d inline:%s num_vfe_out:%d num_sfe_out:%d in_rd:%d", + ctx->ctx_index, request_id, i, clk_bw_args.hw_intf->hw_idx, + clk_bw_args.hw_intf->hw_type, CAM_BOOL_TO_YESNO(clk_bw_args.is_drv_config_en), ctx->num_acq_vfe_out, ctx->num_acq_sfe_out, !list_empty(&ctx->res_list_ife_in_rd)); @@ -257,8 +259,9 @@ static int cam_ife_mgr_finish_clk_bw_update( sizeof(struct cam_isp_apply_clk_bw_args)); if (rc) { CAM_ERR(CAM_PERF, - "Finish Clock/BW Update failed req_id:%d i:%d hw_idx=%d hw_type:%d rc:%d", - request_id, i, ctx->base[i].idx, ctx->base[i].hw_type, rc); + "Finish Clock/BW Update failed ctx:%u req:%d i:%d hw_id=%d hw_type:%d rc:%d", + ctx->ctx_index, request_id, i, ctx->base[i].idx, + ctx->base[i].hw_type, rc); break; } @@ -419,8 +422,8 @@ static int cam_ife_mgr_regspace_data_cb(uint32_t reg_base_type, break; default: CAM_ERR(CAM_ISP, - "Unrecognized reg base type: %u", - reg_base_type); + "Unrecognized reg base type: %u, ctx_idx: %u", + reg_base_type, ctx->ctx_index); return rc; } @@ -437,9 +440,11 @@ static int cam_ife_mgr_handle_reg_dump(struct cam_ife_hw_mgr_ctx *ctx, if (cam_presil_mode_enabled()) { if (g_ife_hw_mgr.debug_cfg.enable_presil_reg_dump) { - CAM_WARN(CAM_ISP, "regdump enabled for presil mode"); + CAM_WARN(CAM_ISP, "regdump enabled for presil mode, ctx_idx: %u", + ctx->ctx_index); } else { - CAM_ERR(CAM_ISP, "regdump disabled by default for presil mode"); + CAM_ERR(CAM_ISP, "regdump disabled by default for presil mode, ctx: %u", + ctx->ctx_index); return 0; } } @@ -454,11 +459,12 @@ static int cam_ife_mgr_handle_reg_dump(struct cam_ife_hw_mgr_ctx *ctx, if (!atomic_read(&ctx->cdm_done)) CAM_WARN_RATE_LIMIT(CAM_ISP, - "Reg dump values might be from more than one request"); + "Reg dump values might be from more than one request, ctx_idx: %u", + ctx->ctx_index); for (i = 0; i < num_reg_dump_buf; i++) { - CAM_DBG(CAM_ISP, "Reg dump cmd meta data: %u req_type: %u", - reg_dump_buf_desc[i].meta_data, meta_type); + CAM_DBG(CAM_ISP, "Reg dump cmd meta data: %u req_type: %u ctx_idx: %u", + reg_dump_buf_desc[i].meta_data, meta_type, ctx->ctx_index); if (reg_dump_buf_desc[i].meta_data == meta_type) { rc = cam_soc_util_reg_dump_to_cmd_buf(ctx, ®_dump_buf_desc[i], @@ -468,8 +474,8 @@ static int cam_ife_mgr_handle_reg_dump(struct cam_ife_hw_mgr_ctx *ctx, user_triggered_dump); if (rc) { CAM_ERR(CAM_ISP, - "Reg dump failed at idx: %d, rc: %d req_id: %llu meta type: %u", - i, rc, ctx->applied_req_id, meta_type); + "Reg dump failed at idx: %d, rc: %d req_id: %llu meta type: %u ctx_idx: %u", + i, rc, ctx->applied_req_id, meta_type, ctx->ctx_index); return rc; } } @@ -821,7 +827,8 @@ static int cam_ife_hw_mgr_check_and_notify_overflow( } if (!hw_if) { - CAM_ERR_RATE_LIMIT(CAM_ISP, "hw_intf is null"); + CAM_ERR_RATE_LIMIT(CAM_ISP, "hw_intf is null, ctx_idx: %u", + hw_mgr_ctx->ctx_index); return -EINVAL; } @@ -833,10 +840,10 @@ static int cam_ife_hw_mgr_check_and_notify_overflow( sizeof(struct cam_isp_hw_overflow_info)); CAM_DBG(CAM_ISP, - "check and notify hw idx %d type %d bus overflow happened %d", + "check and notify hw idx %d type %d bus overflow happened %d ctx_idx: %u", hw_mgr_ctx->base[i].idx, hw_mgr_ctx->base[i].hw_type, - overflow_info.is_bus_overflow); + overflow_info.is_bus_overflow, hw_mgr_ctx->ctx_index); if (overflow_info.is_bus_overflow) *is_bus_overflow = true; @@ -922,8 +929,8 @@ static int cam_ife_hw_mgr_reset_csid( return rc; err: - CAM_ERR(CAM_ISP, "RESET HW res failed: (type:%d, id:%d)", - hw_mgr_res->res_type, hw_mgr_res->res_id); + CAM_ERR(CAM_ISP, "RESET HW res failed: (ctx_idx: %u type:%d, id:%d)", + ctx->ctx_index, hw_mgr_res->res_type, hw_mgr_res->res_id); return rc; } @@ -938,7 +945,7 @@ static int cam_ife_hw_mgr_init_hw_res( if (!isp_hw_res->hw_res[i]) continue; hw_intf = isp_hw_res->hw_res[i]->hw_intf; - CAM_DBG(CAM_ISP, "enabled vfe hardware %d", + CAM_DBG(CAM_ISP, "enabled vfe hardware %u", hw_intf->hw_idx); if (hw_intf->hw_ops.init) { rc = hw_intf->hw_ops.init(hw_intf->hw_priv, @@ -996,8 +1003,9 @@ static int cam_ife_mgr_csid_start_hw( if (hw_mgr_res->is_secure) is_secure = true; - CAM_DBG(CAM_ISP, "csid[%u] res:%s res_id %d cnt %u, is_secure: %s", - isp_res->hw_intf->hw_idx, + CAM_DBG(CAM_ISP, + "csid[%u] ctx_idx: %u res:%s res_id %d cnt %u, is_secure: %s", + isp_res->hw_intf->hw_idx, ctx->ctx_index, isp_res->res_name, isp_res->res_id, cnt, CAM_BOOL_TO_YESNO(is_secure)); res[cnt] = isp_res; @@ -1051,20 +1059,20 @@ static int cam_ife_hw_mgr_start_hw_res( sizeof(struct cam_isp_resource_node)); if (rc) { CAM_ERR(CAM_ISP, - "Can not start HW:%d resources", - hw_intf->hw_idx); + "Can not start HW:%d resources, ctx_idx: %u", + hw_intf->hw_idx, ctx->ctx_index); goto err; } } else { - CAM_ERR(CAM_ISP, "function null"); + CAM_ERR(CAM_ISP, "function null, ctx_idx: %u", ctx->ctx_index); goto err; } } return 0; err: - CAM_ERR(CAM_ISP, "Start hw res failed (type:%d, id:%d)", - isp_hw_res->res_type, isp_hw_res->res_id); + CAM_ERR(CAM_ISP, "Start hw res failed (ctx_idx: %u type:%d, id:%d)", + ctx->ctx_index, isp_hw_res->res_type, isp_hw_res->res_id); return rc; } @@ -1126,7 +1134,7 @@ static void cam_ife_hw_mgr_deinit_hw( int i = 0, j; if (!ctx->flags.init_done) { - CAM_WARN(CAM_ISP, "ctx is not in init state"); + CAM_WARN(CAM_ISP, "ctx is not in init state, ctx_idx: %u", ctx->ctx_index); return; } @@ -1137,15 +1145,16 @@ static void cam_ife_hw_mgr_deinit_hw( /* Deinit IFE CSID */ list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_csid, list) { - CAM_DBG(CAM_ISP, "%s: Going to DeInit IFE CSID\n", __func__); + CAM_DBG(CAM_ISP, "%s: Going to DeInit IFE CSID\n ctx_idx: %u", __func__, + ctx->ctx_index); cam_ife_hw_mgr_deinit_hw_res(hw_mgr_res); } if (ctx->ctx_type == CAM_IFE_CTX_TYPE_SFE) { /* Deint SFE RSRC */ list_for_each_entry(hw_mgr_res, &ctx->res_list_sfe_src, list) { - CAM_DBG(CAM_ISP, "Going to DeInit SFE SRC %u", - hw_mgr_res->res_id); + CAM_DBG(CAM_ISP, "Going to DeInit SFE SRC %u, ctx_idx: %u", + hw_mgr_res->res_id, ctx->ctx_index); cam_ife_hw_mgr_deinit_hw_res(hw_mgr_res); } @@ -1156,15 +1165,15 @@ static void cam_ife_hw_mgr_deinit_hw( /* Deint BUS RD */ list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_in_rd, list) { - CAM_DBG(CAM_ISP, "Going to DeInit BUS RD %u", - hw_mgr_res->res_id); + CAM_DBG(CAM_ISP, "Going to DeInit BUS RD %u, ctx_idx: %u", + hw_mgr_res->res_id, ctx->ctx_index); cam_ife_hw_mgr_deinit_hw_res(hw_mgr_res); } /* Deint IFE MUX(SRC) */ list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_src, list) { - CAM_DBG(CAM_ISP, "Going to DeInit IFE SRC %u", - hw_mgr_res->res_id); + CAM_DBG(CAM_ISP, "Going to DeInit IFE SRC %u, ctx_idx: %u", + hw_mgr_res->res_id, ctx->ctx_index); cam_ife_hw_mgr_deinit_hw_res(hw_mgr_res); } @@ -1199,13 +1208,13 @@ static int cam_ife_hw_mgr_init_hw( int rc = 0, i; /* INIT IFE SRC */ - CAM_DBG(CAM_ISP, "INIT IFE SRC in ctx id:%d", + CAM_DBG(CAM_ISP, "INIT IFE SRC in ctx id:%u", ctx->ctx_index); list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_src, list) { rc = cam_ife_hw_mgr_init_hw_res(hw_mgr_res); if (rc) { - CAM_ERR(CAM_ISP, "Can not INIT IFE SRC (%d)", - hw_mgr_res->res_id); + CAM_ERR(CAM_ISP, "Can not INIT IFE SRC (%d), ctx_idx:%u", + hw_mgr_res->res_id, ctx->ctx_index); goto deinit; } } @@ -1218,49 +1227,49 @@ static int cam_ife_hw_mgr_init_hw( rc = cam_ife_hw_mgr_init_hw_res(hw_mgr_res); if (rc) { CAM_ERR(CAM_ISP, - "Can not INIT SFE SRC res (%d)", - hw_mgr_res->res_id); + "Can not INIT SFE SRC res (%d), ctx_idx:%u", + hw_mgr_res->res_id, ctx->ctx_index); goto deinit; } } - CAM_DBG(CAM_ISP, "INIT SFE OUT RESOURCES in ctx id:%d", + CAM_DBG(CAM_ISP, "INIT SFE OUT RESOURCES in ctx id:%u", ctx->ctx_index); for (i = 0; i < max_sfe_out_res; i++) { rc = cam_ife_hw_mgr_init_hw_res( &ctx->res_list_sfe_out[i]); if (rc) { - CAM_ERR(CAM_ISP, "Can not INIT SFE OUT (%d)", - ctx->res_list_sfe_out[i].res_id); + CAM_ERR(CAM_ISP, "Can not INIT SFE OUT (%d), ctx_idx:%u", + ctx->res_list_sfe_out[i].res_id, ctx->ctx_index); goto deinit; } } } - CAM_DBG(CAM_ISP, "INIT IFE csid ... in ctx id:%d", + CAM_DBG(CAM_ISP, "INIT IFE csid ... in ctx id:%u", ctx->ctx_index); /* INIT IFE BUS RD */ - CAM_DBG(CAM_ISP, "INIT IFE BUS RD in ctx id:%d", + CAM_DBG(CAM_ISP, "INIT IFE BUS RD in ctx id:%u", ctx->ctx_index); list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_in_rd, list) { rc = cam_ife_hw_mgr_init_hw_res(hw_mgr_res); if (rc) { - CAM_ERR(CAM_ISP, "Can not IFE BUS RD (%d)", - hw_mgr_res->res_id); + CAM_ERR(CAM_ISP, "Can not IFE BUS RD (%d), ctx_idx:%u", + hw_mgr_res->res_id, ctx->ctx_index); return rc; } } /* INIT IFE OUT */ - CAM_DBG(CAM_ISP, "INIT IFE OUT RESOURCES in ctx id:%d", + CAM_DBG(CAM_ISP, "INIT IFE OUT RESOURCES in ctx id:%u", ctx->ctx_index); for (i = 0; i < max_ife_out_res; i++) { rc = cam_ife_hw_mgr_init_hw_res(&ctx->res_list_ife_out[i]); if (rc) { - CAM_ERR(CAM_ISP, "Can not INIT IFE OUT (%d)", - ctx->res_list_ife_out[i].res_id); + CAM_ERR(CAM_ISP, "Can not INIT IFE OUT (%d), ctx_idx:%u", + ctx->res_list_ife_out[i].res_id, ctx->ctx_index); goto deinit; } } @@ -1269,8 +1278,8 @@ static int cam_ife_hw_mgr_init_hw( list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_csid, list) { rc = cam_ife_hw_mgr_init_hw_res(hw_mgr_res); if (rc) { - CAM_ERR(CAM_ISP, "Can not INIT IFE CSID(id :%d)", - hw_mgr_res->res_id); + CAM_ERR(CAM_ISP, "Can not INIT IFE CSID(id :%d), ctx_idx:%u", + hw_mgr_res->res_id, ctx->ctx_index); goto deinit; } } @@ -1281,7 +1290,7 @@ static int cam_ife_hw_mgr_init_hw( rc = cam_ife_hw_mgr_reset_csid(ctx, CAM_IFE_CSID_RESET_GLOBAL); if (rc) { - CAM_ERR(CAM_ISP, "CSID reset failed"); + CAM_ERR(CAM_ISP, "CSID reset failed, ctx_idx:%u", ctx->ctx_index); goto deinit; } } @@ -1292,7 +1301,7 @@ static int cam_ife_hw_mgr_init_hw( rc = cam_cpas_activate_llcc(i); if (rc) { CAM_ERR(CAM_ISP, - "Failed to activate cache: %d", i); + "Failed to activate cache: %d, ctx_idx:%u", i, ctx->ctx_index); goto deinit; } } @@ -1423,7 +1432,7 @@ static void cam_ife_hw_mgr_dump_all_ctx(void) list_for_each_entry_safe(ctx, ctx_temp, &g_ife_hw_mgr.used_ctx_list, list) { CAM_INFO_RATE_LIMIT(CAM_ISP, - "ctx id:%d is_dual:%d num_base:%d rdi only:%d", + "ctx id:%u is_dual:%d num_base:%d rdi only:%d", ctx->ctx_index, ctx->flags.is_dual, ctx->num_base, ctx->flags.is_rdi_only_context); @@ -1434,8 +1443,8 @@ static void cam_ife_hw_mgr_dump_all_ctx(void) continue; CAM_INFO_RATE_LIMIT(CAM_ISP, - "csid:%d res_type:%d res: %s res_id:%d res_state:%d", - hw_mgr_res->hw_res[i]->hw_intf->hw_idx, + "csid:%d ctx id:%u res_type:%d res: %s res_id:%d res_state:%d", + hw_mgr_res->hw_res[i]->hw_intf->hw_idx, ctx->ctx_index, hw_mgr_res->hw_res[i]->res_type, hw_mgr_res->hw_res[i]->res_name, hw_mgr_res->hw_res[i]->res_id, @@ -1450,8 +1459,8 @@ static void cam_ife_hw_mgr_dump_all_ctx(void) continue; CAM_INFO_RATE_LIMIT(CAM_ISP, - "ife IN:%d res_type:%d res_id:%d res_state:%d", - hw_mgr_res->hw_res[i]->hw_intf->hw_idx, + "ife IN:%d ctx id:%u res_type:%d res_id:%d res_state:%d", + hw_mgr_res->hw_res[i]->hw_intf->hw_idx, ctx->ctx_index, hw_mgr_res->hw_res[i]->res_type, hw_mgr_res->hw_res[i]->res_id, hw_mgr_res->hw_res[i]->res_state); @@ -1465,8 +1474,8 @@ static void cam_ife_hw_mgr_dump_all_ctx(void) continue; CAM_INFO_RATE_LIMIT(CAM_ISP, - "sfe IN:%d res_type:%d res_id:%d res_state:%d", - hw_mgr_res->hw_res[i]->hw_intf->hw_idx, + "sfe IN:%d ctx id:%u res_type:%d res_id:%d res_state:%d", + hw_mgr_res->hw_res[i]->hw_intf->hw_idx, ctx->ctx_index, hw_mgr_res->hw_res[i]->res_type, hw_mgr_res->hw_res[i]->res_id, hw_mgr_res->hw_res[i]->res_state); @@ -1557,12 +1566,13 @@ static void cam_ife_hw_mgr_print_acquire_info( fail: CAM_ERR(CAM_ISP, - "Failed to acquire %s-IFE/SFE with [%u pix] [%u pd] [%u rdi] ports for ctx:%u", + "Failed to acquire %s-IFE/SFE with [%u pix] [%u pd] [%u rdi] ports for ctx_idx:%u", (hw_mgr_ctx->flags.is_dual) ? "dual" : "single", num_pix_port, num_pd_port, num_rdi_port, hw_mgr_ctx->ctx_index); - CAM_INFO(CAM_ISP, "Previously acquired IFEs[%d %d] SFEs[%d %d]", + CAM_INFO(CAM_ISP, "Previously acquired IFEs[%d %d] SFEs[%d %d], ctx_idx: %u", hw_idx[CAM_ISP_HW_SPLIT_LEFT], hw_idx[CAM_ISP_HW_SPLIT_RIGHT], - sfe_hw_idx[CAM_ISP_HW_SPLIT_LEFT], sfe_hw_idx[CAM_ISP_HW_SPLIT_RIGHT]); + sfe_hw_idx[CAM_ISP_HW_SPLIT_LEFT], sfe_hw_idx[CAM_ISP_HW_SPLIT_RIGHT], + hw_mgr_ctx->ctx_index); list_for_each_entry_safe(hw_mgr_res, hw_mgr_res_temp, &hw_mgr_ctx->res_list_ife_src, list) { @@ -1570,12 +1580,12 @@ fail: hw_res = hw_mgr_res->hw_res[i]; if (hw_res && hw_res->hw_intf) CAM_INFO(CAM_ISP, - "IFE src split_id:%d res:%s hw_idx:%u state:%s", + "IFE src split_id:%d res:%s hw_idx:%u state:%s ctx_idx: %u", i, hw_res->res_name, hw_res->hw_intf->hw_idx, cam_ife_hw_mgr_get_res_state - (hw_res->res_state)); + (hw_res->res_state), hw_mgr_ctx->ctx_index); } } @@ -1585,12 +1595,12 @@ fail: hw_res = hw_mgr_res->hw_res[i]; if (hw_res && hw_res->hw_intf) CAM_INFO(CAM_ISP, - "SFE src split_id:%d res:%s hw_idx:%u state:%s", + "SFE src split_id:%d res:%s hw_idx:%u state:%s ctx_idx: %u", i, hw_res->res_name, hw_res->hw_intf->hw_idx, cam_ife_hw_mgr_get_res_state - (hw_res->res_state)); + (hw_res->res_state), hw_mgr_ctx->ctx_index); } } cam_ife_hw_mgr_dump_all_ctx(); @@ -1621,8 +1631,8 @@ static void cam_ife_hw_mgr_dump_acq_data( hw_res = hw_mgr_res->hw_res[i]; if (hw_res && hw_res->hw_intf) CAM_INFO(CAM_ISP, - "CSID split_id: %d res: %s hw_idx: %u state: %s", - i, + "CSID split_id: %d ctx_idx: %u res: %s hw_idx: %u state: %s", + i, hwr_mgr_ctx->ctx_index, hw_res->res_name, hw_res->hw_intf->hw_idx, cam_ife_hw_mgr_get_res_state @@ -1637,8 +1647,8 @@ static void cam_ife_hw_mgr_dump_acq_data( hw_res = hw_mgr_res->hw_res[i]; if (hw_res && hw_res->hw_intf) CAM_INFO(CAM_ISP, - "IFE src split_id: %d res: %s hw_idx: %u state: %s", - i, + "IFE src split_id: %d ctx_idx: %u res: %s hw_idx: %u state: %s", + i, hwr_mgr_ctx->ctx_index, hw_res->res_name, hw_res->hw_intf->hw_idx, cam_ife_hw_mgr_get_res_state @@ -1653,8 +1663,8 @@ static void cam_ife_hw_mgr_dump_acq_data( hw_res = hw_mgr_res->hw_res[i]; if (hw_res && hw_res->hw_intf) CAM_INFO(CAM_ISP, - "IFE src_rd split_id: %d res: %s hw_idx: %u state: %s", - i, + "IFE src_rd split_id: %d ctx_idx: %u res: %s hw_idx: %u state: %s", + i, hwr_mgr_ctx->ctx_index, hw_res->res_name, hw_res->hw_intf->hw_idx, cam_ife_hw_mgr_get_res_state @@ -1669,8 +1679,8 @@ static void cam_ife_hw_mgr_dump_acq_data( hw_res = hw_mgr_res->hw_res[j]; if (hw_res && hw_res->hw_intf) CAM_INFO(CAM_ISP, - "IFE out split_id: %d res: %s res_id: 0x%x hw_idx: %u state: %s", - j, hw_res->res_name, hw_res->res_id, + "IFE out split_id: %d ctx_idx: %u res: %s res_id: 0x%x hw_idx: %u state: %s", + j, hwr_mgr_ctx->ctx_index, hw_res->res_name, hw_res->res_id, hw_res->hw_intf->hw_idx, cam_ife_hw_mgr_get_res_state (hw_res->res_state)); @@ -1715,7 +1725,8 @@ static int cam_ife_mgr_csid_change_halt_mode(struct cam_ife_hw_mgr_ctx *ctx, sizeof( struct cam_ife_csid_hw_halt_args)); if (rc) - CAM_ERR(CAM_ISP, "Halt update failed"); + CAM_ERR(CAM_ISP, "Halt update failed, ctx_idx: %u", + ctx->ctx_index); break; } } @@ -1746,8 +1757,8 @@ static int cam_ife_mgr_csid_stop_hw( isp_res = hw_mgr_res->hw_res[i]; if (isp_res->hw_intf->hw_idx != base_idx) continue; - CAM_DBG(CAM_ISP, "base_idx %d res:%s res_id %d cnt %u", - base_idx, isp_res->res_name, + CAM_DBG(CAM_ISP, "base_idx %d ctx_idx: %u res:%s res_id %d cnt %u", + base_idx, ctx->ctx_index, isp_res->res_name, isp_res->res_id, cnt); stop_res[cnt] = isp_res; cnt++; @@ -1828,7 +1839,7 @@ static int cam_ife_hw_mgr_release_hw_for_ctx( ife_ctx->flags.need_csid_top_cfg = false; - CAM_DBG(CAM_ISP, "release context completed ctx id:%d", + CAM_DBG(CAM_ISP, "release context completed ctx id:%u", ife_ctx->ctx_index); return 0; @@ -1887,8 +1898,8 @@ static void cam_ife_mgr_add_base_info( ctx->base[0].hw_type = hw_type; ctx->num_base++; CAM_DBG(CAM_ISP, - "Add split id = %d for base idx = %d num_base=%d hw_type=%d", - split_id, base_idx, ctx->num_base, hw_type); + "Add split id = %d ctx_idx: %u for base idx = %d num_base=%d hw_type=%d", + split_id, ctx->ctx_index, base_idx, ctx->num_base, hw_type); } else { /*Check if base index already exists in the list */ for (i = 0; i < ctx->num_base; i++) { @@ -1909,8 +1920,8 @@ static void cam_ife_mgr_add_base_info( ctx->base[ctx->num_base].hw_type = hw_type; ctx->num_base++; CAM_DBG(CAM_ISP, - "Add split_id=%d for base idx=%d num_base=%d hw_type=%d", - split_id, base_idx, ctx->num_base, hw_type); + "Add split_id=%d ctx_idx: %u for base idx=%d num_base=%d hw_type=%d", + split_id, ctx->ctx_index, base_idx, ctx->num_base, hw_type); } } } @@ -1947,8 +1958,8 @@ static int cam_ife_mgr_process_base_info( cam_ife_mgr_add_base_info(ctx, i, res->hw_intf->hw_idx, CAM_ISP_HW_TYPE_VFE); - CAM_DBG(CAM_ISP, "add IFE base info for hw %d", - res->hw_intf->hw_idx); + CAM_DBG(CAM_ISP, "add IFE base info for hw %d ctx_idx: %u", + res->hw_intf->hw_idx, ctx->ctx_index); } } @@ -1973,8 +1984,8 @@ static int cam_ife_mgr_process_base_info( res->hw_intf->hw_idx, CAM_ISP_HW_TYPE_CSID); hw_idx_map[res->hw_intf->hw_idx] = true; - CAM_DBG(CAM_ISP, "add CSID base info for hw %d", - res->hw_intf->hw_idx); + CAM_DBG(CAM_ISP, "add CSID base info for hw %d, ctx_idx: %u", + res->hw_intf->hw_idx, ctx->ctx_index); } } @@ -1991,12 +2002,12 @@ static int cam_ife_mgr_process_base_info( cam_ife_mgr_add_base_info(ctx, i, res->hw_intf->hw_idx, CAM_ISP_HW_TYPE_SFE); - CAM_DBG(CAM_ISP, "add SFE base info for hw %d", - res->hw_intf->hw_idx); + CAM_DBG(CAM_ISP, "add SFE base info for hw %d, ctx_idx: %u", + res->hw_intf->hw_idx, ctx->ctx_index); } } - CAM_DBG(CAM_ISP, "ctx base num = %d", ctx->num_base); + CAM_DBG(CAM_ISP, "ctx base num = %d, ctx_idx: %u", ctx->num_base, ctx->ctx_index); return 0; } @@ -2032,11 +2043,11 @@ static int cam_ife_hw_mgr_acquire_res_ife_out_rdi( vfe_out_res_id = CAM_ISP_IFE_OUT_RES_RDI_3; break; default: - CAM_ERR(CAM_ISP, "invalid resource type"); + CAM_ERR(CAM_ISP, "invalid resource type, ctx_idx: %u", ife_ctx->ctx_index); goto err; } - CAM_DBG(CAM_ISP, "vfe_in_res_id = %d, vfe_out_red_id = %d", - vfe_in_res_id, vfe_out_res_id); + CAM_DBG(CAM_ISP, "ctx_idx: %u vfe_in_res_id = %d, vfe_out_red_id = %d", + ife_ctx->ctx_index, vfe_in_res_id, vfe_out_res_id); vfe_acquire.rsrc_type = CAM_ISP_RESOURCE_VFE_OUT; vfe_acquire.tasklet = ife_ctx->common.tasklet_info; @@ -2045,8 +2056,8 @@ static int cam_ife_hw_mgr_acquire_res_ife_out_rdi( for (i = 0; i < in_port->num_out_res; i++) { out_port = &in_port->data[i]; - CAM_DBG(CAM_ISP, "i = %d, vfe_out_res_id = %d, out_port: %d", - i, vfe_out_res_id, out_port->res_type); + CAM_DBG(CAM_ISP, "i = %d, ctx_idx: %u vfe_out_res_id = %d, out_port: %d", + i, ife_ctx->ctx_index, vfe_out_res_id, out_port->res_type); if (vfe_out_res_id != out_port->res_type) continue; @@ -2067,8 +2078,8 @@ static int cam_ife_hw_mgr_acquire_res_ife_out_rdi( &vfe_acquire, sizeof(struct cam_vfe_acquire_args)); if (rc) { - CAM_ERR(CAM_ISP, "Can not acquire out resource 0x%x", - out_port->res_type); + CAM_ERR(CAM_ISP, "Can not acquire out resource 0x%x, ctx_idx: %u", + out_port->res_type, ife_ctx->ctx_index); goto err; } @@ -2081,8 +2092,8 @@ static int cam_ife_hw_mgr_acquire_res_ife_out_rdi( if (i == in_port->num_out_res) { CAM_ERR(CAM_ISP, - "Cannot acquire out resource, i=%d, num_out_res=%d", - i, in_port->num_out_res); + "Cannot acquire out resource, i=%d, num_out_res=%d, ctx_idx: %u", + i, in_port->num_out_res, ife_ctx->ctx_index); goto err; } @@ -2126,7 +2137,8 @@ static int cam_ife_hw_mgr_acquire_res_ife_out_pixel( out_port->res_type)) continue; - CAM_DBG(CAM_ISP, "res_type 0x%x", out_port->res_type); + CAM_DBG(CAM_ISP, "res_type 0x%x, ctx_idx: %u", + out_port->res_type, ife_ctx->ctx_index); k = out_port->res_type & 0xFF; ife_out_res = &ife_ctx->res_list_ife_out[k]; @@ -2175,8 +2187,8 @@ static int cam_ife_hw_mgr_acquire_res_ife_out_pixel( sizeof(struct cam_vfe_acquire_args)); if (rc) { CAM_ERR(CAM_ISP, - "Can not acquire out resource 0x%x", - out_port->res_type); + "Can not acquire out resource 0x%x, ctx_idx: %u", + out_port->res_type, ife_ctx->ctx_index); goto err; } @@ -2188,10 +2200,10 @@ static int cam_ife_hw_mgr_acquire_res_ife_out_pixel( ife_out_res->hw_res[j]->res_id; comp_grp->num_res++; - CAM_DBG(CAM_ISP, "resource type:0x%x res id:0x%x comp grp id:%d", + CAM_DBG(CAM_ISP, "resource type:0x%x res id:0x%x comp grp id:%d ctx:%u", ife_out_res->hw_res[j]->res_type, ife_out_res->hw_res[j]->res_id, - vfe_acquire.vfe_out.comp_grp_id); + vfe_acquire.vfe_out.comp_grp_id, ife_ctx->ctx_index); } ife_out_res->res_type = CAM_ISP_RESOURCE_VFE_OUT; ife_out_res->res_id = out_port->res_type; @@ -2240,14 +2252,14 @@ static int cam_ife_hw_mgr_acquire_res_sfe_out_rdi( break; default: CAM_ERR(CAM_ISP, - "invalid SFE RDI resource type 0x%x", - sfe_in_res_id); + "invalid SFE RDI resource type 0x%x, ctx_idx: %u", + sfe_in_res_id, ife_ctx->ctx_index); goto err; } CAM_DBG(CAM_ISP, - "sfe_in_res_id: 0x%x sfe_out_res_id: 0x%x", - sfe_in_res_id, sfe_out_res_id); + "sfe_in_res_id: 0x%x sfe_out_res_id: 0x%x ctx_idx: %u", + sfe_in_res_id, sfe_out_res_id, ife_ctx->ctx_index); sfe_acquire.rsrc_type = CAM_ISP_RESOURCE_SFE_OUT; sfe_acquire.tasklet = ife_ctx->common.tasklet_info; @@ -2256,8 +2268,8 @@ static int cam_ife_hw_mgr_acquire_res_sfe_out_rdi( for (i = 0; i < in_port->num_out_res; i++) { out_port = &in_port->data[i]; CAM_DBG(CAM_ISP, - "i: %d sfe_out_res_id: 0x%x out_port: 0x%x", - i, sfe_out_res_id, out_port->res_type); + "i: %d sfe_out_res_id: 0x%x out_port: 0x%x ctx_idx: %u", + i, sfe_out_res_id, out_port->res_type, ife_ctx->ctx_index); if (sfe_out_res_id != out_port->res_type) continue; @@ -2277,8 +2289,8 @@ static int cam_ife_hw_mgr_acquire_res_sfe_out_rdi( sizeof(struct cam_sfe_acquire_args)); if (rc) { CAM_ERR(CAM_ISP, - "Can not acquire out resource: 0x%x", - out_port->res_type); + "Can not acquire out resource: 0x%x ctx_idx: %u", + out_port->res_type, ife_ctx->ctx_index); goto err; } @@ -2291,8 +2303,8 @@ static int cam_ife_hw_mgr_acquire_res_sfe_out_rdi( if (i == in_port->num_out_res) { CAM_ERR(CAM_ISP, - "Cannot acquire out resource i: %d, num_out_res: %u", - i, in_port->num_out_res); + "Cannot acquire out resource i: %d, num_out_res: %u ctx_idx: %u", + i, in_port->num_out_res, ife_ctx->ctx_index); goto err; } @@ -2334,7 +2346,8 @@ static int cam_ife_hw_mgr_acquire_res_sfe_out_pix( continue; k = out_port->res_type & 0xFF; - CAM_DBG(CAM_ISP, "res_type: 0x%x", out_port->res_type); + CAM_DBG(CAM_ISP, "ctx_idx: %u res_type: 0x%x", + ife_ctx->ctx_index, out_port->res_type); sfe_out_res = &ife_ctx->res_list_sfe_out[k]; sfe_out_res->is_dual_isp = in_port->usage_type; @@ -2372,8 +2385,8 @@ static int cam_ife_hw_mgr_acquire_res_sfe_out_pix( sizeof(struct cam_sfe_acquire_args)); if (rc) { CAM_ERR(CAM_ISP, - "Can not acquire out resource 0x%x", - out_port->res_type); + "Can not acquire out resource 0x%x ctx_idx: %u", + out_port->res_type, ife_ctx->ctx_index); goto err; } @@ -2385,8 +2398,9 @@ static int cam_ife_hw_mgr_acquire_res_sfe_out_pix( sfe_out_res->hw_res[j]->res_id; comp_grp->num_res++; - CAM_DBG(CAM_ISP, "resource type:0x%x res: %s res id: 0x%x comp grp id:%d", - sfe_out_res->hw_res[j]->res_type, + CAM_DBG(CAM_ISP, + "ctx:%u res_type:0x%x res: %s res id:0x%x comp grp id:%d", + ife_ctx->ctx_index, sfe_out_res->hw_res[j]->res_type, sfe_out_res->hw_res[j]->res_name, sfe_out_res->hw_res[j]->res_id, sfe_acquire.sfe_out.comp_grp_id); @@ -2443,8 +2457,8 @@ static int cam_ife_hw_mgr_acquire_res_sfe_out( sfe_res_iterator, in_port); break; default: - CAM_ERR(CAM_ISP, "Unknown SFE IN resource: %d", - sfe_res_iterator->res_id); + CAM_ERR(CAM_ISP, "Unknown SFE IN resource: %d, ctx_idx: %u", + sfe_res_iterator->res_id, ife_ctx->ctx_index); rc = -EINVAL; break; } @@ -2465,7 +2479,7 @@ static int cam_ife_hw_mgr_acquire_res_ife_out( struct cam_isp_hw_mgr_res *ife_src_res; if (list_empty(&ife_ctx->res_list_ife_src)) { - CAM_WARN(CAM_ISP, "IFE src list empty"); + CAM_WARN(CAM_ISP, "IFE src list empty, ctx_idx: %u", ife_ctx->ctx_index); return 0; } @@ -2489,8 +2503,8 @@ static int cam_ife_hw_mgr_acquire_res_ife_out( ife_src_res, in_port); break; default: - CAM_ERR(CAM_ISP, "Unknown IFE SRC resource: %d", - ife_src_res->res_id); + CAM_ERR(CAM_ISP, "Unknown IFE SRC resource: %d, ctx_idx: %u", + ife_src_res->res_id, ife_ctx->ctx_index); break; } if (rc) @@ -2673,8 +2687,8 @@ static int cam_ife_hw_mgr_acquire_sfe_hw( sizeof(struct cam_sfe_acquire_args)); if (rc) { CAM_DBG(CAM_ISP, - "Can not acquire SFE HW: %d for res: %d", - i, sfe_acquire->sfe_in.res_id); + "Can not acquire SFE HW: %d for res: %d ctx_idx: %u", + i, sfe_acquire->sfe_in.res_id, ife_ctx->ctx_index); continue; } else { break; @@ -2691,8 +2705,8 @@ static int cam_ife_hw_mgr_acquire_sfe_hw( sizeof(struct cam_sfe_acquire_args)); if (rc) { CAM_DBG(CAM_ISP, - "Can not acquire SFE HW: %d for res: %d", - i, sfe_acquire->sfe_in.res_id); + "Can not acquire SFE HW: %d for res: %d ctx_idx: %u", + i, sfe_acquire->sfe_in.res_id, ife_ctx->ctx_index); continue; } else { break; @@ -2718,7 +2732,7 @@ static int cam_ife_hw_mgr_acquire_res_sfe_src_util( rc = cam_ife_hw_mgr_get_res(&ife_ctx->free_res_list, &sfe_src_res); if (rc) { - CAM_ERR(CAM_ISP, "Ctx : %d failed to get res", ife_ctx->ctx_index); + CAM_ERR(CAM_ISP, "Ctx : %u failed to get res", ife_ctx->ctx_index); return rc; } @@ -2747,8 +2761,8 @@ static int cam_ife_hw_mgr_acquire_res_sfe_src_util( if (rc || !sfe_acquire->sfe_in.rsrc_node) { CAM_ERR(CAM_ISP, - "Failed to acquire split_id: %d SFE for res_type: %u id: %u", - i, sfe_src_res->res_type, sfe_src_res->res_id); + "Failed to acquire split_id: %d SFE for res_type: %u id: %u ctx_idx: %u", + i, sfe_src_res->res_type, sfe_src_res->res_id, ife_ctx->ctx_index); goto err; } @@ -2762,12 +2776,12 @@ static int cam_ife_hw_mgr_acquire_res_sfe_src_util( sfe_src_res->hw_res[i]->res_id); CAM_DBG(CAM_ISP, - "acquire success %s SFE: %u res_name: %s res_type: %u res_id: %u", + "acquire success %s SFE: %u res_name: %s res_type: %u res_id: %u ctx_idx: %u", ((i == CAM_ISP_HW_SPLIT_LEFT) ? "LEFT" : "RIGHT"), sfe_src_res->hw_res[i]->hw_intf->hw_idx, sfe_src_res->hw_res[i]->res_name, sfe_src_res->hw_res[i]->res_type, - sfe_src_res->hw_res[i]->res_id); + sfe_src_res->hw_res[i]->res_id, ife_ctx->ctx_index); } csid_res->num_children++; err: @@ -2877,7 +2891,8 @@ static int cam_ife_hw_mgr_acquire_res_sfe_src( is_rdi = true; break; default: - CAM_ERR(CAM_ISP, "Wrong CSID Path Resource ID: %u", sfe_res_id); + CAM_ERR(CAM_ISP, "Wrong CSID Path Resource ID: %u ctx_idx: %u", + sfe_res_id, ife_ctx->ctx_index); goto err; } @@ -2895,8 +2910,8 @@ static int cam_ife_hw_mgr_acquire_res_sfe_src( return 0; err: - CAM_ERR(CAM_ISP, "Acquire SFE failed ctx: %u acquired_res 0x%x sfe_res %u", - ife_ctx->ctx_index, sfe_acquired_res, sfe_res_id); + CAM_ERR(CAM_ISP, "Acquire SFE failed ctx: %u acquired_res 0x%x sfe_res %u ctx_idx: %u", + ife_ctx->ctx_index, sfe_acquired_res, sfe_res_id, ife_ctx->ctx_index); return rc; } @@ -2927,10 +2942,10 @@ static bool cam_ife_mgr_check_can_use_lite( } CAM_DBG(CAM_ISP, - "in_port lite hint %d, rdi_only: %d can_use_lite: %d res_id: %u", + "in_port lite hint %d, rdi_only: %d can_use_lite: %d res_id: %u ctx_idx: %u", csid_acquire->in_port->can_use_lite, ife_ctx->flags.is_rdi_only_context, - can_use_lite, csid_acquire->res_id); + can_use_lite, csid_acquire->res_id, ife_ctx->ctx_index); end: return can_use_lite; @@ -2951,7 +2966,7 @@ static int cam_ife_hw_mgr_acquire_res_ife_bus_rd( rc = cam_ife_hw_mgr_get_res(&ife_ctx->free_res_list, &ife_bus_rd_res); if (rc) { - CAM_ERR(CAM_ISP, "No more free hw mgr resource"); + CAM_ERR(CAM_ISP, "No more free hw mgr resource, ctx_idx: %u", ife_ctx->ctx_index); goto end; } @@ -2978,13 +2993,15 @@ static int cam_ife_hw_mgr_acquire_res_ife_bus_rd( ife_bus_rd_res->hw_res[i] = vfe_acquire.vfe_bus_rd.rsrc_node; - CAM_DBG(CAM_ISP, "Acquired VFE:%d BUS RD for LEFT", j); + CAM_DBG(CAM_ISP, "Acquired VFE:%d BUS RD for LEFT, ctx_idx: %u", + j, ife_ctx->ctx_index); break; } } if (j == CAM_IFE_HW_NUM_MAX || !vfe_acquire.vfe_bus_rd.rsrc_node) { - CAM_ERR(CAM_ISP, "Failed to acquire BUS RD for LEFT", i); + CAM_ERR(CAM_ISP, "Failed to acquire VFE:%d BUS RD for LEFT, ctx_idx: %u", + j, ife_ctx->ctx_index); goto put_res; } @@ -3011,14 +3028,16 @@ static int cam_ife_hw_mgr_acquire_res_ife_bus_rd( vfe_acquire.vfe_bus_rd.rsrc_node; CAM_DBG(CAM_ISP, - "Acquired VFE:%d BUS RD for RIGHT", j); + "Acquired VFE:%d BUS RD for RIGHT, ctx: %u", + j, ife_ctx->ctx_index); break; } } if (j == CAM_IFE_HW_NUM_MAX || !vfe_acquire.vfe_bus_rd.rsrc_node) { - CAM_ERR(CAM_ISP, "Failed to acquire BUS RD for RIGHT"); + CAM_ERR(CAM_ISP, "Failed to acquire VFE:%d BUS RD for RIGHT, ctx: %u", + j, ife_ctx->ctx_index); goto end; } } @@ -3046,19 +3065,20 @@ static int cam_ife_hw_mgr_acquire_sfe_bus_rd( rc = cam_ife_hw_mgr_get_res(&ife_ctx->free_res_list, &sfe_rd_res); if (rc) { - CAM_ERR(CAM_ISP, "No more free hw mgr resource"); + CAM_ERR(CAM_ISP, "No more free hw mgr resource, ctx_idx: %u", ife_ctx->ctx_index); goto err; } if (!cam_ife_hw_mgr_is_sfe_rd_res(in_port->sfe_in_path_type)) { - CAM_ERR(CAM_ISP, "Invalid sfe rd type: 0x%x", - in_port->sfe_in_path_type); + CAM_ERR(CAM_ISP, "Invalid sfe rd type: 0x%x ctx_idx: %u", + in_port->sfe_in_path_type, ife_ctx->ctx_index); rc = -EINVAL; goto put_res; } if (in_port->usage_type) - CAM_WARN(CAM_ISP, "DUAL mode not supported for BUS RD [RDIs]"); + CAM_WARN(CAM_ISP, "DUAL mode not supported for BUS RD [RDIs], ctx_idx: %u", + ife_ctx->ctx_index); sfe_acquire.rsrc_type = CAM_ISP_RESOURCE_SFE_RD; sfe_acquire.tasklet = ife_ctx->common.tasklet_info; @@ -3085,9 +3105,9 @@ static int cam_ife_hw_mgr_acquire_sfe_bus_rd( &sfe_acquire, sizeof(sfe_acquire)); if (rc) { CAM_DBG(CAM_ISP, - "No SFE RD rsrc: 0x%x from hw: %u", + "No SFE RD rsrc: 0x%x from hw: %u ctx_idx: %u", in_port->sfe_in_path_type, - hw_intf->hw_idx); + hw_intf->hw_idx, ife_ctx->ctx_index); continue; } @@ -3095,8 +3115,8 @@ static int cam_ife_hw_mgr_acquire_sfe_bus_rd( sfe_acquire.sfe_rd.rsrc_node; CAM_DBG(CAM_ISP, - "acquired from old SFE(%s): %u path: 0x%x successfully", - (i == 0) ? "left" : "right", + "ctx_idx: %u acquired from old SFE(%s): %u path: 0x%x successfully", + ife_ctx->ctx_index, (i == 0) ? "left" : "right", hw_intf->hw_idx, in_port->sfe_in_path_type); /* With SFE the below condition should never be met */ @@ -3129,8 +3149,8 @@ static int cam_ife_hw_mgr_acquire_sfe_bus_rd( if (!sfe_acquire.sfe_rd.rsrc_node || rc) { CAM_ERR(CAM_ISP, - "Failed to acquire SFE RD: 0x%x", - in_port->sfe_in_path_type); + "Failed to acquire SFE RD: 0x%x, ctx_idx: %u", + in_port->sfe_in_path_type, ife_ctx->ctx_index); goto put_res; } @@ -3138,10 +3158,10 @@ static int cam_ife_hw_mgr_acquire_sfe_bus_rd( acquire_successful: CAM_DBG(CAM_ISP, - "SFE RD left [%u] acquired success for path: %u is_dual: %d res: %s res_id: 0x%x", + "SFE RD left [%u] acquired success for path: %u is_dual: %d res: %s res_id: 0x%x ctx_idx: %u", sfe_rd_res->hw_res[0]->hw_intf->hw_idx, in_port->sfe_in_path_type, in_port->usage_type, sfe_rd_res->hw_res[0]->res_name, - sfe_rd_res->hw_res[0]->res_id); + sfe_rd_res->hw_res[0]->res_id, ife_ctx->ctx_index); sfe_rd_res->res_id = in_port->sfe_in_path_type; sfe_rd_res->res_type = sfe_acquire.rsrc_type; @@ -3170,14 +3190,16 @@ acquire_successful: if (!sfe_acquire.sfe_rd.rsrc_node || rc) { CAM_ERR(CAM_ISP, - "Can not acquire SFE RD right resource"); + "Can not acquire SFE RD right resource, ctx_idx: %u", + ife_ctx->ctx_index); goto err; } sfe_rd_res->hw_res[1] = sfe_acquire.sfe_rd.rsrc_node; CAM_DBG(CAM_ISP, - "SFE right [%u] acquire success for res: 0x%x", - sfe_rd_res->hw_res[1]->hw_intf->hw_idx, in_port->sfe_in_path_type); + "SFE right [%u] acquire success for res: 0x%x ctx_idx: %u", + sfe_rd_res->hw_res[1]->hw_intf->hw_idx, in_port->sfe_in_path_type, + ife_ctx->ctx_index); } return 0; @@ -3203,7 +3225,8 @@ static int cam_ife_hw_mgr_acquire_ife_src_for_sfe( rc = cam_ife_hw_mgr_get_res(&ife_ctx->free_res_list, &ife_src_res); if (rc) { - CAM_ERR(CAM_ISP, "No more free hw mgr resource"); + CAM_ERR(CAM_ISP, "No more free hw mgr resource, ctx_idx: %u", + ife_ctx->ctx_index); goto end; } @@ -3262,8 +3285,8 @@ static int cam_ife_hw_mgr_acquire_ife_src_for_sfe( if (i == CAM_IFE_HW_NUM_MAX || rc || !vfe_acquire.vfe_in.rsrc_node) { - CAM_ERR(CAM_ISP, "Unable to acquire LEFT IFE res: %d", - vfe_acquire.vfe_in.res_id); + CAM_ERR(CAM_ISP, "Unable to acquire LEFT IFE res: %d ctx_idx: %u", + vfe_acquire.vfe_in.res_id, ife_ctx->ctx_index); return -EAGAIN; } @@ -3277,11 +3300,11 @@ static int cam_ife_hw_mgr_acquire_ife_src_for_sfe( ife_src_res->hw_res[0]->res_id); CAM_DBG(CAM_ISP, - "acquire success LEFT IFE: %d res type: 0x%x res: %s res id: 0x%x", + "acquire success LEFT IFE: %d res type: 0x%x res: %s res id: 0x%x ctx_idx: %u", hw_intf->hw_idx, ife_src_res->hw_res[0]->res_type, ife_src_res->hw_res[0]->res_name, - ife_src_res->hw_res[0]->res_id); + ife_src_res->hw_res[0]->res_id, ife_ctx->ctx_index); if (ife_ctx->flags.is_dual) { vfe_acquire.vfe_in.rsrc_node = NULL; @@ -3311,8 +3334,8 @@ static int cam_ife_hw_mgr_acquire_ife_src_for_sfe( if (i == CAM_IFE_HW_NUM_MAX || rc || !vfe_acquire.vfe_in.rsrc_node) { - CAM_ERR(CAM_ISP, "Unable to acquire right IFE res: %u", - vfe_acquire.vfe_in.res_id); + CAM_ERR(CAM_ISP, "Unable to acquire right IFE res: %u, ctx_idx: %u", + vfe_acquire.vfe_in.res_id, ife_ctx->ctx_index); rc = -EAGAIN; goto end; } @@ -3323,11 +3346,11 @@ static int cam_ife_hw_mgr_acquire_ife_src_for_sfe( acquired_hw_path[1] |= cam_convert_res_id_to_hw_path( ife_src_res->hw_res[0]->res_id); CAM_DBG(CAM_ISP, - "acquire success RIGHT IFE: %u res type: 0x%x res: %s res id: 0x%x", + "acquire success RIGHT IFE: %u res type: 0x%x res: %s res id: 0x%x ctx_idx: %u", hw_intf->hw_idx, ife_src_res->hw_res[1]->res_type, ife_src_res->hw_res[1]->res_name, - ife_src_res->hw_res[1]->res_id); + ife_src_res->hw_res[1]->res_id, ife_ctx->ctx_index); } return 0; @@ -3367,7 +3390,8 @@ static int cam_ife_hw_mgr_acquire_res_ife_src( rc = cam_ife_hw_mgr_get_res(&ife_ctx->free_res_list, &ife_src_res); if (rc) { - CAM_ERR(CAM_ISP, "No more free hw mgr resource"); + CAM_ERR(CAM_ISP, "No more free hw mgr resource, ctx_idx: %u", + ife_ctx->ctx_index); goto err; } cam_ife_hw_mgr_put_res(&ife_ctx->res_list_ife_src, @@ -3427,8 +3451,8 @@ static int cam_ife_hw_mgr_acquire_res_ife_src( vfe_acquire.vfe_in.sync_mode = CAM_ISP_HW_SYNC_NONE; break; default: - CAM_ERR(CAM_ISP, "Wrong IFE CSID Path Resource ID : %d", - csid_res->res_id); + CAM_ERR(CAM_ISP, "Wrong IFE CSID Path Resource ID : %d, ctx_idx: %u", + csid_res->res_id, ife_ctx->ctx_index); goto err; } ife_src_res->res_type = vfe_acquire.rsrc_type; @@ -3464,8 +3488,8 @@ static int cam_ife_hw_mgr_acquire_res_ife_src( sizeof(struct cam_vfe_acquire_args)); if (rc) { CAM_ERR(CAM_ISP, - "Can not acquire IFE HW res %d", - csid_res->res_id); + "Can not acquire IFE HW res %d, ctx_idx: %u", + csid_res->res_id, ife_ctx->ctx_index); goto err; } ife_src_res->hw_res[i] = vfe_acquire.vfe_in.rsrc_node; @@ -3475,7 +3499,8 @@ static int cam_ife_hw_mgr_acquire_res_ife_src( hw_intf->hw_idx); if (i >= CAM_MAX_HW_SPLIT) { - CAM_ERR(CAM_ISP, "HW split is invalid: %d", i); + CAM_ERR(CAM_ISP, "HW split is invalid: %d, ctx_idx: %u", + i, ife_ctx->ctx_index); return -EINVAL; } @@ -3483,8 +3508,8 @@ static int cam_ife_hw_mgr_acquire_res_ife_src( ife_src_res->hw_res[i]->res_id); CAM_DBG(CAM_ISP, - "acquire success IFE:%d res type :0x%x res: %s res id:0x%x", - hw_intf->hw_idx, + "acquire success IFE:%d ctx_idx: %u res type :0x%x res: %s res id:0x%x", + hw_intf->hw_idx, ife_ctx->ctx_index, ife_src_res->hw_res[i]->res_type, ife_src_res->hw_res[i]->res_name, ife_src_res->hw_res[i]->res_id); @@ -3560,8 +3585,8 @@ static int cam_ife_hw_mgr_acquire_csid_hw( &ife_hw_mgr->csid_hw_caps[hw_intf->hw_idx]; if (csid_caps->is_lite && !can_use_lite) { - CAM_DBG(CAM_ISP, "CSID[%u] cannot use lite", - hw_intf->hw_idx); + CAM_DBG(CAM_ISP, "CSID[%u] cannot use lite, ctx_idx: %u", + hw_intf->hw_idx, ife_ctx->ctx_index); continue; } @@ -3569,15 +3594,16 @@ static int cam_ife_hw_mgr_acquire_csid_hw( csid_acquire, sizeof(*csid_acquire)); if (rc) { CAM_DBG(CAM_ISP, - "No ife resource from hw %d", - hw_intf->hw_idx); + "No ife resource from hw %d, ctx_idx: %u", + hw_intf->hw_idx, ife_ctx->ctx_index); continue; } CAM_DBG(CAM_ISP, - "acquired from old csid(%s)=%d successfully, is_secure: %s", + "acquired from old csid(%s)=%d successfully, is_secure: %s, ctx_idx: %u", (i == 0) ? "left" : "right", hw_intf->hw_idx, - CAM_BOOL_TO_YESNO(csid_res_iterator->is_secure)); + CAM_BOOL_TO_YESNO(csid_res_iterator->is_secure), + ife_ctx->ctx_index); goto acquire_successful; } } @@ -3591,8 +3617,8 @@ static int cam_ife_hw_mgr_acquire_csid_hw( if (ife_hw_mgr->csid_hw_caps[hw_intf->hw_idx].is_lite && !can_use_lite) { - CAM_DBG(CAM_ISP, "CSID[%u] cannot use lite", - hw_intf->hw_idx); + CAM_DBG(CAM_ISP, "CSID[%u] cannot use lite, ctx_idx: %u", + hw_intf->hw_idx, ife_ctx->ctx_index); continue; } @@ -3608,11 +3634,12 @@ static int cam_ife_hw_mgr_acquire_csid_hw( if (rc == -EBUSY) busy_count++; else - CAM_ERR(CAM_ISP, "CSID[%d] acquire failed (rc=%d)", i, rc); + CAM_ERR(CAM_ISP, "CSID[%d] acquire failed (rc=%d), ctx_idx: %u", + i, rc, ife_ctx->ctx_index); } if (compat_count == busy_count) - CAM_ERR(CAM_ISP, "all compatible CSIDs are busy"); + CAM_ERR(CAM_ISP, "all compatible CSIDs are busy, ctx_idx: %u", ife_ctx->ctx_index); acquire_successful: return rc; @@ -3634,7 +3661,8 @@ static bool cam_ife_hw_mgr_is_need_csid_ipp( in_port->ife_rd_count)) need = false; - CAM_DBG(CAM_ISP, "Need CSID PIX %u, Ctx_type: %u", need, ife_ctx->ctx_type); + CAM_DBG(CAM_ISP, "Need CSID PIX %u, Ctx_type: %u, ctx_idx: %u", + need, ife_ctx->ctx_type, ife_ctx->ctx_index); return need; } @@ -3662,7 +3690,7 @@ static int cam_ife_hw_mgr_acquire_res_ife_csid_pxl( rc = cam_ife_hw_mgr_get_res(&ife_ctx->free_res_list, &csid_res); if (rc) { - CAM_ERR(CAM_ISP, "No more free hw mgr resource"); + CAM_ERR(CAM_ISP, "No more free hw mgr resource, ctx_idx: %u", ife_ctx->ctx_index); goto end; } @@ -3683,12 +3711,13 @@ static int cam_ife_hw_mgr_acquire_res_ife_csid_pxl( csid_res->is_secure = out_port->secure_mode; } - CAM_DBG(CAM_ISP, "CSID Acq: E"); + CAM_DBG(CAM_ISP, "CSID Acq: Enter, ctx_idx: %u", ife_ctx->ctx_index); cam_ife_hw_mgr_put_res(&ife_ctx->res_list_ife_csid, &csid_res); /* for dual ife, acquire the right ife first */ for (i = csid_res->is_dual_isp; i >= 0 ; i--) { - CAM_DBG(CAM_ISP, "i %d is_dual %d", i, csid_res->is_dual_isp); + CAM_DBG(CAM_ISP, "ctx_idx: %u i %d is_dual %d", + ife_ctx->ctx_index, i, csid_res->is_dual_isp); csid_acquire.res_type = CAM_ISP_RESOURCE_PIX_PATH; csid_acquire.res_id = path_res_id; @@ -3715,8 +3744,8 @@ static int cam_ife_hw_mgr_acquire_res_ife_csid_pxl( if (rc) { CAM_ERR(CAM_ISP, - "Cannot acquire ife csid pxl path rsrc %s", - (is_ipp) ? "IPP" : "PPP"); + "Cannot acquire ife csid pxl path rsrc %s, ctx_idx: %u", + (is_ipp) ? "IPP" : "PPP", ife_ctx->ctx_index); goto end; } @@ -3734,8 +3763,8 @@ static int cam_ife_hw_mgr_acquire_res_ife_csid_pxl( ife_ctx->flags.need_csid_top_cfg = csid_acquire.need_top_cfg; CAM_DBG(CAM_ISP, - "acquired csid(%s)=%d pxl path rsrc %s successfully, is_secure: %s", - (i == 0) ? "left" : "right", hw_intf->hw_idx, + "acquired csid(%s)=%d ctx_idx: %u pxl path rsrc %s successfully, is_secure: %s", + (i == 0) ? "left" : "right", hw_intf->hw_idx, ife_ctx->ctx_index, (is_ipp) ? "IPP" : "PPP", CAM_BOOL_TO_YESNO(csid_res->is_secure)); } @@ -3830,7 +3859,7 @@ static int cam_ife_hw_mgr_acquire_csid_rdi_util( rc = cam_ife_hw_mgr_get_res(&ife_ctx->free_res_list, &csid_res); if (rc) { - CAM_ERR(CAM_ISP, "No more free hw mgr resource"); + CAM_ERR(CAM_ISP, "No more free hw mgr resource, ctx_idx: %u", ife_ctx->ctx_index); goto end; } @@ -3850,8 +3879,8 @@ static int cam_ife_hw_mgr_acquire_csid_rdi_util( if (out_port) { if (cam_ife_hw_mgr_is_shdr_fs_rdi_res(out_port->res_type, ife_ctx->flags.is_sfe_shdr, ife_ctx->flags.is_sfe_fs)) { - CAM_DBG(CAM_ISP, "setting inline shdr mode for res: 0x%x", - out_port->res_type); + CAM_DBG(CAM_ISP, "setting inline shdr mode for res: 0x%x, ctx_idx: %u", + out_port->res_type, ife_ctx->ctx_index); csid_acquire.sfe_inline_shdr = true; /* * Merged output will only be from the first n RDIs @@ -3865,8 +3894,8 @@ static int cam_ife_hw_mgr_acquire_csid_rdi_util( csid_acquire.sec_evt_config.en_secondary_evt = true; csid_acquire.sec_evt_config.evt_type = CAM_IFE_CSID_EVT_SOF; CAM_DBG(CAM_ISP, - "Secondary SOF evt enabled for path: 0x%x", - out_port->res_type); + "Secondary SOF evt enabled for path: 0x%x, ctx_idx: %u", + out_port->res_type, ife_ctx->ctx_index); } /* Enable EPOCH/SYNC frame drop for error monitoring on master */ @@ -3876,8 +3905,8 @@ static int cam_ife_hw_mgr_acquire_csid_rdi_util( CAM_IFE_CSID_EVT_EPOCH | CAM_IFE_CSID_EVT_SENSOR_SYNC_FRAME_DROP; CAM_DBG(CAM_ISP, - "Secondary EPOCH & frame drop evt enabled for path: 0x%x", - out_port->res_type); + "Secondary EPOCH & frame drop evt enabled for path: 0x%x, ctx_idx: %u", + out_port->res_type, ife_ctx->ctx_index); } } } @@ -3900,21 +3929,22 @@ static int cam_ife_hw_mgr_acquire_csid_rdi_util( if (rc) { CAM_ERR(CAM_ISP, - "CSID Path reserve failed rc=%d res_id=%d", rc, path_res_id); + "CSID Path reserve failed rc=%d res_id=%d ctx_idx: %u", + rc, path_res_id, ife_ctx->ctx_index); goto put_res; } if (csid_acquire.node_res == NULL) { - CAM_ERR(CAM_ISP, "Acquire CSID RDI rsrc failed"); + CAM_ERR(CAM_ISP, "Acquire CSID RDI rsrc failed, ctx_idx: %u", ife_ctx->ctx_index); goto put_res; } CAM_DBG(CAM_ISP, - "acquired csid[%u] rdi path rsrc %u successfully, is_secure: %s", + "acquired csid[%u] rdi path rsrc %u successfully, is_secure: %s, ctx_idx: %u", csid_acquire.node_res->hw_intf->hw_idx, csid_acquire.node_res->res_id, - CAM_BOOL_TO_YESNO(csid_res->is_secure)); + CAM_BOOL_TO_YESNO(csid_res->is_secure), ife_ctx->ctx_index); ife_ctx->flags.need_csid_top_cfg = csid_acquire.need_top_cfg; csid_res->res_type = CAM_ISP_RESOURCE_PIX_PATH; @@ -3958,14 +3988,14 @@ static int cam_ife_hw_mgr_get_csid_rdi_for_sfe_ipp_input( rc = cam_ife_hw_mgr_acquire_csid_rdi_util(ife_ctx, in_port, res_id, NULL); if (rc) { - CAM_ERR(CAM_ISP, "Acquire RDI Ctx: %d rdi:%d rc %d", + CAM_ERR(CAM_ISP, "Acquire RDI Ctx: %u rdi:%d rc %d", ife_ctx->ctx_index, res_id, rc); goto end; } *acquired_rdi_res |= BIT(res_id); } - CAM_DBG(CAM_ISP, "Ctx: %d rdi_res:%d ctx_type %d rc %d", ife_ctx->ctx_index, + CAM_DBG(CAM_ISP, "Ctx: %u rdi_res:%d ctx_type %d rc %d", ife_ctx->ctx_index, res_id, ife_ctx->ctx_type, rc); end: return rc; @@ -3990,14 +4020,14 @@ static int cam_ife_hw_mgr_acquire_res_ife_csid_rdi( rc = cam_ife_hw_mgr_acquire_csid_rdi_util(ife_ctx, in_port, res_id, out_port); if (rc) { - CAM_ERR(CAM_ISP, "Ctx: %d Res %d acquire failed rc %d", + CAM_ERR(CAM_ISP, "Ctx: %u Res %d acquire failed rc %d", ife_ctx->ctx_index, res_id, rc); break; } *acquired_rdi_res |= BIT(res_id); } - CAM_DBG(CAM_ISP, "Ctx: %d rdi: %d", ife_ctx->ctx_index, res_id); + CAM_DBG(CAM_ISP, "Ctx: %u rdi: %d", ife_ctx->ctx_index, res_id); return rc; } @@ -4014,7 +4044,8 @@ static int cam_ife_hw_mgr_acquire_res_root( ife_ctx->res_list_ife_in.is_dual_isp = in_port->usage_type; } else if ((ife_ctx->res_list_ife_in.res_id != in_port->res_type) && (!ife_ctx->flags.is_fe_enabled)) { - CAM_ERR(CAM_ISP, "No Free resource for this context"); + CAM_ERR(CAM_ISP, "No Free resource for this context, ctx_idx: %u", + ife_ctx->ctx_index); goto err; } else { /* else do nothing */ @@ -4038,9 +4069,9 @@ static int cam_ife_mgr_check_and_update_fe_v0( if (acquire_hw_info->input_info_offset >= acquire_hw_info->input_info_size) { CAM_ERR(CAM_ISP, - "Invalid size offset 0x%x is greater then size 0x%x", + "Invalid size offset 0x%x is greater then size 0x%x, ctx_idx: %u", acquire_hw_info->input_info_offset, - acquire_hw_info->input_info_size); + acquire_hw_info->input_info_size, ife_ctx->ctx_index); return -EINVAL; } @@ -4053,14 +4084,14 @@ static int cam_ife_mgr_check_and_update_fe_v0( sizeof(struct cam_isp_in_port_info)) > ((uint8_t *)acquire_hw_info + acquire_info_size)) { - CAM_ERR(CAM_ISP, "Invalid size"); + CAM_ERR(CAM_ISP, "Invalid size, ctx_idx: %u", ife_ctx->ctx_index); return -EINVAL; } if ((in_port->num_out_res > max_ife_out_res) || (in_port->num_out_res <= 0)) { - CAM_ERR(CAM_ISP, "Invalid num output res %u", - in_port->num_out_res); + CAM_ERR(CAM_ISP, "Invalid num output res %u ctx_idx: %u", + in_port->num_out_res, ife_ctx->ctx_index); return -EINVAL; } @@ -4070,11 +4101,12 @@ static int cam_ife_mgr_check_and_update_fe_v0( total_in_port_length += in_port_length; if (total_in_port_length > acquire_hw_info->input_info_size) { - CAM_ERR(CAM_ISP, "buffer size is not enough"); + CAM_ERR(CAM_ISP, "buffer size is not enough, ctx_idx: %u", + ife_ctx->ctx_index); return -EINVAL; } - CAM_DBG(CAM_ISP, "in_port%d res_type %d", i, - in_port->res_type); + CAM_DBG(CAM_ISP, "in_port%d res_type %d ctx_idx: %u", i, + in_port->res_type, ife_ctx->ctx_index); if (in_port->res_type == CAM_ISP_IFE_IN_RES_RD) { ife_ctx->flags.is_fe_enabled = true; break; @@ -4083,7 +4115,8 @@ static int cam_ife_mgr_check_and_update_fe_v0( in_port = (struct cam_isp_in_port_info *)((uint8_t *)in_port + in_port_length); } - CAM_DBG(CAM_ISP, "is_fe_enabled %d", ife_ctx->flags.is_fe_enabled); + CAM_DBG(CAM_ISP, "is_fe_enabled %d, ctx_idx: %u", + ife_ctx->flags.is_fe_enabled, ife_ctx->ctx_index); return 0; } @@ -4113,9 +4146,9 @@ static int cam_ife_mgr_check_and_update_fe_v2( if (acquire_hw_info->input_info_offset >= acquire_hw_info->input_info_size) { CAM_ERR(CAM_ISP, - "Invalid size offset 0x%x is greater then size 0x%x", + "Invalid size offset 0x%x is greater then size 0x%x ctx_idx: %u", acquire_hw_info->input_info_offset, - acquire_hw_info->input_info_size); + acquire_hw_info->input_info_size, ife_ctx->ctx_index); return -EINVAL; } @@ -4128,15 +4161,15 @@ static int cam_ife_mgr_check_and_update_fe_v2( sizeof(struct cam_isp_in_port_info)) > ((uint8_t *)acquire_hw_info + acquire_info_size)) { - CAM_ERR(CAM_ISP, "Invalid size"); + CAM_ERR(CAM_ISP, "Invalid size, ctx_idx: %u", ife_ctx->ctx_index); return -EINVAL; } if ((in_port->num_out_res > (max_ife_out_res + max_sfe_out_res)) || (in_port->num_out_res <= 0)) { - CAM_ERR(CAM_ISP, "Invalid num output res %u", - in_port->num_out_res); + CAM_ERR(CAM_ISP, "Invalid num output res %u, ctx_idx: %u", + in_port->num_out_res, ife_ctx->ctx_index); return -EINVAL; } @@ -4146,11 +4179,12 @@ static int cam_ife_mgr_check_and_update_fe_v2( total_in_port_length += in_port_length; if (total_in_port_length > acquire_hw_info->input_info_size) { - CAM_ERR(CAM_ISP, "buffer size is not enough"); + CAM_ERR(CAM_ISP, "buffer size is not enough, ctx_idx: %u", + ife_ctx->ctx_index); return -EINVAL; } - CAM_DBG(CAM_ISP, "in_port%d res_type %d", i, - in_port->res_type); + CAM_DBG(CAM_ISP, "in_port%d res_type 0x%x ctx_idx: %u", i, + in_port->res_type, ife_ctx->ctx_index); is_sfe_rd = cam_ife_mgr_check_for_sfe_rd(in_port->sfe_in_path_type); if (is_sfe_rd) ife_ctx->scratch_buf_info.num_fetches++; @@ -4180,12 +4214,12 @@ static int cam_ife_mgr_check_and_update_fe_v2( ((uint8_t *)in_port + in_port_length); } CAM_DBG(CAM_ISP, - "is_fe_enabled %d is_offline %d sfe_fs %d sfe_shdr: %d num_sfe_fetches: %u", + "is_fe_enabled %d is_offline %d sfe_fs %d sfe_shdr: %d num_sfe_fetches: %u ctx_idx: %u", ife_ctx->flags.is_fe_enabled, ife_ctx->flags.is_offline, ife_ctx->flags.is_sfe_fs, ife_ctx->flags.is_sfe_shdr, - ife_ctx->scratch_buf_info.num_fetches); + ife_ctx->scratch_buf_info.num_fetches, ife_ctx->ctx_index); return 0; } @@ -4212,7 +4246,8 @@ static int cam_ife_mgr_check_and_update_fe( ife_ctx, acquire_hw_info, acquire_info_size); break; default: - CAM_ERR(CAM_ISP, "Invalid ver of common info from user"); + CAM_ERR(CAM_ISP, "Invalid ver of common info from user, ctx_idx: %u", + ife_ctx->ctx_index); return -EINVAL; } @@ -4247,8 +4282,8 @@ static int cam_ife_hw_mgr_preprocess_port( out_port->res_type)) in_port->lcr_count++; else { - CAM_DBG(CAM_ISP, "out_res_type %d", - out_port->res_type); + CAM_DBG(CAM_ISP, "out_res_type 0x%x, ctx_idx: %u", + out_port->res_type, ife_ctx->ctx_index); in_port->ipp_count++; if (in_port->can_use_lite) { switch(out_port->res_type) { @@ -4257,15 +4292,16 @@ static int cam_ife_hw_mgr_preprocess_port( in_port->lite_path_count++; break; default: - CAM_WARN(CAM_ISP, "Output port 0x%x cannot use lite", - out_port->res_type); + CAM_WARN(CAM_ISP, + "Output port 0x%x cannot use lite, ctx: %u", + out_port->res_type, ife_ctx->ctx_index); } } } } - CAM_DBG(CAM_ISP, "rdi: %d ipp: %d ppp: %d ife_rd: %d lcr: %d", - in_port->rdi_count, in_port->ipp_count, + CAM_DBG(CAM_ISP, "ctx_idx: %u rdi: %d ipp: %d ppp: %d ife_rd: %d lcr: %d", + ife_ctx->ctx_index, in_port->rdi_count, in_port->ipp_count, in_port->ppp_count, in_port->ife_rd_count, in_port->lcr_count); @@ -4292,14 +4328,15 @@ static int cam_ife_hw_mgr_acquire_offline_res_ife_camif( isp_bus_rd_res = list_first_entry(&ife_ctx->res_list_ife_in_rd, struct cam_isp_hw_mgr_res, list); if (!isp_bus_rd_res) { - CAM_ERR(CAM_ISP, "BUS RD resource has not been acquired"); + CAM_ERR(CAM_ISP, "BUS RD resource has not been acquired, ctx_idx: %u", + ife_ctx->ctx_index); rc = -EINVAL; goto end; } rc = cam_ife_hw_mgr_get_res(&ife_ctx->free_res_list, &ife_src_res); if (rc) { - CAM_ERR(CAM_ISP, "No free resource"); + CAM_ERR(CAM_ISP, "No free resource, ctx_idx: %u", ife_ctx->ctx_index); goto end; } @@ -4343,8 +4380,8 @@ static int cam_ife_hw_mgr_acquire_offline_res_ife_camif( if (i == CAM_IFE_HW_NUM_MAX || rc || !vfe_acquire.vfe_in.rsrc_node) { - CAM_ERR(CAM_ISP, "Failed to acquire IFE LEFT rc: %d", - rc); + CAM_ERR(CAM_ISP, "Failed to acquire IFE LEFT rc: %d, ctx_idx: %u", + rc, ife_ctx->ctx_index); goto put_res; } @@ -4354,8 +4391,8 @@ static int cam_ife_hw_mgr_acquire_offline_res_ife_camif( acquired_hw_path[i] |= cam_convert_res_id_to_hw_path( ife_src_res->hw_res[0]->res_id); - CAM_DBG(CAM_ISP, "Acquired VFE:%d CAMIF for LEFT", - ife_src_res->hw_res[0]->hw_intf->hw_idx); + CAM_DBG(CAM_ISP, "Acquired VFE:%d CAMIF for LEFT, ctx_idx: %u", + ife_src_res->hw_res[0]->hw_intf->hw_idx, ife_ctx->ctx_index); ife_src_res->res_type = vfe_acquire.rsrc_type; ife_src_res->res_id = vfe_acquire.vfe_in.res_id; @@ -4384,8 +4421,8 @@ static int cam_ife_hw_mgr_acquire_offline_res_ife_camif( } if (rc || !vfe_acquire.vfe_in.rsrc_node) { - CAM_ERR(CAM_ISP, "Failed to acquire IFE RIGHT rc: %d", - rc); + CAM_ERR(CAM_ISP, "Failed to acquire IFE RIGHT rc: %d, ctx_idx: %u", + rc, ife_ctx->ctx_index); goto end; } @@ -4397,8 +4434,8 @@ static int cam_ife_hw_mgr_acquire_offline_res_ife_camif( acquired_hw_path[i] |= cam_convert_res_id_to_hw_path( ife_src_res->hw_res[1]->res_id); - CAM_DBG(CAM_ISP, "Acquired VFE:%d CAMIF for RIGHT", - ife_src_res->hw_res[1]->hw_intf->hw_idx); + CAM_DBG(CAM_ISP, "Acquired VFE:%d CAMIF for RIGHT, ctx_idx: %u", + ife_src_res->hw_res[1]->hw_intf->hw_idx, ife_ctx->ctx_index); } return rc; @@ -4428,14 +4465,15 @@ static int cam_ife_hw_mgr_acquire_offline_res_sfe( struct cam_isp_hw_mgr_res, list); if (!sfe_bus_rd_res) { - CAM_ERR(CAM_ISP, "BUS RD resource has not been acquired"); + CAM_ERR(CAM_ISP, "BUS RD resource has not been acquired, ctx_idx: %u", + ife_ctx->ctx_index); rc = -EINVAL; goto end; } rc = cam_ife_hw_mgr_get_res(&ife_ctx->free_res_list, &sfe_src_res); if (rc) { - CAM_ERR(CAM_ISP, "No free resource"); + CAM_ERR(CAM_ISP, "No free resource, ctx_idx: %u", ife_ctx->ctx_index); goto end; } @@ -4455,13 +4493,13 @@ static int cam_ife_hw_mgr_acquire_offline_res_sfe( sizeof(struct cam_sfe_acquire_args)); if (rc) { CAM_ERR(CAM_ISP, - "Failed to acquire SFE PIX for offline"); + "Failed to acquire SFE PIX for offline, ctx_idx: %u", ife_ctx->ctx_index); goto put_res; } sfe_src_res->hw_res[i] = sfe_acquire.sfe_in.rsrc_node; - CAM_DBG(CAM_ISP, "Acquired SFE: %u PIX LEFT for offline", - sfe_src_res->hw_res[i]->hw_intf->hw_idx); + CAM_DBG(CAM_ISP, "Acquired SFE: %u PIX LEFT for offline, ctx_idx: %u", + sfe_src_res->hw_res[i]->hw_intf->hw_idx, ife_ctx->ctx_index); sfe_src_res->res_type = sfe_acquire.rsrc_type; sfe_src_res->res_id = sfe_acquire.sfe_in.res_id; @@ -4470,7 +4508,7 @@ static int cam_ife_hw_mgr_acquire_offline_res_sfe( if (ife_ctx->flags.is_dual) { CAM_WARN(CAM_ISP, - "DUAL not supported for offline use-case"); + "DUAL not supported for offline use-case, ctx_idx: %u", ife_ctx->ctx_index); sfe_acquire.sfe_in.rsrc_node = NULL; hw_intf = ife_hw_mgr->sfe_devices[ @@ -4481,13 +4519,14 @@ static int cam_ife_hw_mgr_acquire_offline_res_sfe( if (rc) { CAM_ERR(CAM_ISP, - "Failed to acquire SFE PIX for RIGHT"); + "Failed to acquire SFE PIX for RIGHT, ctx_idx: %u", + ife_ctx->ctx_index); goto end; } sfe_src_res->hw_res[i] = sfe_acquire.sfe_in.rsrc_node; - CAM_DBG(CAM_ISP, "Acquired SFE:%d PIX RIGHT for offline", - sfe_src_res->hw_res[i]->hw_intf->hw_idx); + CAM_DBG(CAM_ISP, "Acquired SFE:%d PIX RIGHT for offline, ctx_idx: %u", + sfe_src_res->hw_res[i]->hw_intf->hw_idx, ife_ctx->ctx_index); } sfe_bus_rd_res->num_children++; @@ -4518,7 +4557,8 @@ static int cam_ife_hw_mgr_acquire_offline_res_csid( struct cam_isp_hw_mgr_res, list); if (!sfe_bus_rd_res) { - CAM_ERR(CAM_ISP, "BUS RD resource has not been acquired"); + CAM_ERR(CAM_ISP, "BUS RD resource has not been acquired, ctx_idx: %u", + ife_ctx->ctx_index); rc = -EINVAL; goto end; } @@ -4532,7 +4572,7 @@ static int cam_ife_hw_mgr_acquire_offline_res_csid( rc = cam_ife_hw_mgr_get_res(&ife_ctx->free_res_list, &csid_res); if (rc) { - CAM_ERR(CAM_ISP, "No more free hw mgr resource"); + CAM_ERR(CAM_ISP, "No more free hw mgr resource, ctx_idx: %u", ife_ctx->ctx_index); goto end; } @@ -4554,8 +4594,8 @@ static int cam_ife_hw_mgr_acquire_offline_res_csid( if (rc || (csid_acquire.node_res == NULL)) { CAM_ERR(CAM_ISP, - "CSID Path reserve failed rc=%d res_id=%d", - rc, path_res_id); + "CSID Path reserve failed rc=%d res_id=%d ctx_idx: %u", + rc, path_res_id, ife_ctx->ctx_index); goto put_res; } @@ -4591,7 +4631,8 @@ static int cam_ife_mgr_acquire_hw_sfe_offline( rc = cam_ife_hw_mgr_acquire_sfe_bus_rd( ife_ctx, in_port); if (rc) { - CAM_ERR(CAM_ISP, "Acquire SFE BUS RD resource Failed"); + CAM_ERR(CAM_ISP, "Acquire SFE BUS RD resource Failed, ctx_idx: %u", + ife_ctx->ctx_index); goto err; } @@ -4599,7 +4640,7 @@ static int cam_ife_mgr_acquire_hw_sfe_offline( in_port); if (rc) { CAM_ERR(CAM_ISP, - "Acquire IFE CSID RDI0 resource Failed"); + "Acquire IFE CSID RDI0 resource Failed, ctx_idx: %u", ife_ctx->ctx_index); goto err; } @@ -4607,7 +4648,7 @@ static int cam_ife_mgr_acquire_hw_sfe_offline( ife_ctx, in_port); if (rc) { CAM_ERR(CAM_ISP, - "Acquire SFE PIX SRC resource Failed"); + "Acquire SFE PIX SRC resource Failed, ctx_idx: %u", ife_ctx->ctx_index); goto err; } @@ -4618,7 +4659,8 @@ static int cam_ife_mgr_acquire_hw_sfe_offline( acquired_hw_id, acquired_hw_path); if (rc) { CAM_ERR(CAM_ISP, - "Acquire IFE IPP SRC resource Failed"); + "Acquire IFE IPP SRC resource Failed, ctx_idx: %u", + ife_ctx->ctx_index); goto err; } } @@ -4629,7 +4671,8 @@ static int cam_ife_mgr_acquire_hw_sfe_offline( acquired_hw_id, acquired_hw_path); if (rc) { CAM_ERR(CAM_ISP, - "Acquire IFE LCR SRC resource Failed"); + "Acquire IFE LCR SRC resource Failed, ctx_idx: %u", + ife_ctx->ctx_index); goto err; } } @@ -4638,7 +4681,8 @@ static int cam_ife_mgr_acquire_hw_sfe_offline( ife_ctx, in_port); if (rc) { CAM_ERR(CAM_ISP, - "Acquire IFE OUT resource Failed"); + "Acquire IFE OUT resource Failed, ctx_idx: %u", + ife_ctx->ctx_index); goto err; } } @@ -4646,7 +4690,7 @@ static int cam_ife_mgr_acquire_hw_sfe_offline( rc = cam_ife_hw_mgr_acquire_res_sfe_out(ife_ctx, in_port); if (rc) { CAM_ERR(CAM_ISP, - "Acquire SFE OUT resource Failed"); + "Acquire SFE OUT resource Failed, ctx_idx: %u", ife_ctx->ctx_index); goto err; } @@ -4666,7 +4710,8 @@ static int cam_ife_mgr_acquire_hw_ife_offline( rc = cam_ife_hw_mgr_acquire_res_ife_bus_rd(ife_ctx, in_port); if (rc) { - CAM_ERR(CAM_ISP, "Acquire IFE BUS RD resource Failed"); + CAM_ERR(CAM_ISP, "Acquire IFE BUS RD resource Failed, ctx_idx: %u", + ife_ctx->ctx_index); goto err; } @@ -4675,7 +4720,8 @@ static int cam_ife_mgr_acquire_hw_ife_offline( in_port, false, acquired_hw_id, acquired_hw_path); if (rc) { - CAM_ERR(CAM_ISP, "Acquire IFE IPP SRC resource Failed"); + CAM_ERR(CAM_ISP, "Acquire IFE IPP SRC resource Failed, ctx_idx: %u", + ife_ctx->ctx_index); goto err; } @@ -4684,13 +4730,15 @@ static int cam_ife_mgr_acquire_hw_ife_offline( in_port, true, acquired_hw_id, acquired_hw_path); if (rc) { - CAM_ERR(CAM_ISP, "Acquire IFE LCR SRC resource Failed"); + CAM_ERR(CAM_ISP, "Acquire IFE LCR SRC resource Failed, ctx_idx: %u", + ife_ctx->ctx_index); goto err; } rc = cam_ife_hw_mgr_acquire_res_ife_out(ife_ctx, in_port); if (rc) { - CAM_ERR(CAM_ISP, "Acquire IFE OUT resource Failed"); + CAM_ERR(CAM_ISP, "Acquire IFE OUT resource Failed, ctx_idx: %u", + ife_ctx->ctx_index); goto err; } @@ -4712,15 +4760,16 @@ static int cam_ife_mgr_acquire_hw_for_offline_ctx( if ((!in_port->ipp_count && !in_port->lcr_count) || !in_port->ife_rd_count) { CAM_ERR(CAM_ISP, - "Invalid %d BUS RD %d PIX %d LCR ports for FE ctx", - in_port->ife_rd_count, in_port->ipp_count, in_port->lcr_count); + "Invalid %d BUS RD %d PIX %d LCR ports for FE ctx: %u", + in_port->ife_rd_count, in_port->ipp_count, in_port->lcr_count, + ife_ctx->ctx_index); return -EINVAL; } if (in_port->rdi_count || in_port->ppp_count) { CAM_ERR(CAM_ISP, - "%d RDI %d PPP ports invalid for FE ctx", - in_port->rdi_count, in_port->ppp_count); + "%d RDI %d PPP ports invalid for FE ctx_idx: %u", + in_port->rdi_count, in_port->ppp_count, ife_ctx->ctx_index); return -EINVAL; } @@ -4757,7 +4806,7 @@ static int cam_ife_mgr_acquire_hw_for_ctx( /* get root node resource */ rc = cam_ife_hw_mgr_acquire_res_root(ife_ctx, in_port); if (rc) { - CAM_ERR(CAM_ISP, "Can not acquire root resource"); + CAM_ERR(CAM_ISP, "Can not acquire root resource, ctx_idx: %u", ife_ctx->ctx_index); goto err; } @@ -4765,7 +4814,7 @@ static int cam_ife_mgr_acquire_hw_for_ctx( !in_port->ppp_count && !in_port->lcr_count) { CAM_ERR(CAM_ISP, - "No PIX or RDI or PPP or LCR resource"); + "No PIX or RDI or PPP or LCR resource, ctx_idx: %u", ife_ctx->ctx_index); return -EINVAL; } @@ -4777,9 +4826,9 @@ static int cam_ife_mgr_acquire_hw_for_ctx( rc = cam_ife_hw_mgr_acquire_res_ife_bus_rd( ife_ctx, in_port); if (rc) { - CAM_ERR(CAM_ISP, "Acquire %s BUS RD resource Failed", + CAM_ERR(CAM_ISP, "Acquire %s BUS RD resource Failed, ctx_idx: %u", (ife_ctx->ctx_type == - CAM_IFE_CTX_TYPE_SFE) ? "SFE" : "IFE"); + CAM_IFE_CTX_TYPE_SFE) ? "SFE" : "IFE", ife_ctx->ctx_index); goto err; } } @@ -4790,7 +4839,8 @@ static int cam_ife_mgr_acquire_hw_for_ctx( in_port, true, crop_enable); if (rc) { - CAM_ERR(CAM_ISP, "Acquire IFE CSID IPP/LCR resource Failed"); + CAM_ERR(CAM_ISP, "Acquire IFE CSID IPP/LCR resource Failed, ctx_idx: %u", + ife_ctx->ctx_index); goto err; } } @@ -4810,7 +4860,8 @@ static int cam_ife_mgr_acquire_hw_for_ctx( if (rc) { CAM_ERR(CAM_ISP, - "Acquire IFE CSID PPP resource Failed"); + "Acquire IFE CSID PPP resource Failed, ctx_idx: %u", + ife_ctx->ctx_index); goto err; } } @@ -4821,7 +4872,8 @@ static int cam_ife_mgr_acquire_hw_for_ctx( acquired_rdi_res); if (rc) { CAM_ERR(CAM_ISP, - "Acquire IFE CSID RDI resource Failed"); + "Acquire IFE CSID RDI resource Failed, ctx_idx: %u", + ife_ctx->ctx_index); goto err; } } @@ -4834,7 +4886,7 @@ static int cam_ife_mgr_acquire_hw_for_ctx( rc = cam_ife_hw_mgr_get_csid_rdi_for_sfe_ipp_input(ife_ctx, in_port, acquired_rdi_res); if (rc) { - CAM_ERR(CAM_ISP, "Acquire RDI for SFE IPP failed Ctx: %d rc %d", + CAM_ERR(CAM_ISP, "Acquire RDI for SFE IPP failed Ctx: %u rc %d", ife_ctx->ctx_index, rc); goto err; } @@ -4846,7 +4898,8 @@ static int cam_ife_mgr_acquire_hw_for_ctx( rc = cam_ife_hw_mgr_acquire_res_sfe_src(ife_ctx, in_port, acquired_hw_id, acquired_hw_path); if (rc) { - CAM_ERR(CAM_ISP, "Acquire SFE SRC resource failed"); + CAM_ERR(CAM_ISP, "Acquire SFE SRC resource failed, ctx_idx: %u", + ife_ctx->ctx_index); goto err; } } @@ -4866,7 +4919,8 @@ static int cam_ife_mgr_acquire_hw_for_ctx( if (rc) { CAM_ERR(CAM_ISP, - "Acquire IFE IPP SRC resource Failed"); + "Acquire IFE IPP SRC resource Failed, ctx_idx: %u", + ife_ctx->ctx_index); goto err; } } @@ -4880,7 +4934,8 @@ static int cam_ife_mgr_acquire_hw_for_ctx( if (rc) { CAM_ERR(CAM_ISP, - "Acquire IFE RDI SRC resource Failed"); + "Acquire IFE RDI SRC resource Failed, ctx_idx: %u", + ife_ctx->ctx_index); goto err; } } @@ -4891,7 +4946,8 @@ static int cam_ife_mgr_acquire_hw_for_ctx( ife_ctx, in_port, true, false, acquired_hw_id, acquired_hw_path); if (rc) { - CAM_ERR(CAM_ISP, "Acquire IFE LCR SRC resource Failed"); + CAM_ERR(CAM_ISP, "Acquire IFE LCR SRC resource Failed, ctx_idx: %u", + ife_ctx->ctx_index); goto err; } } @@ -4901,21 +4957,24 @@ static int cam_ife_mgr_acquire_hw_for_ctx( rc = cam_ife_hw_mgr_acquire_res_ife_src(ife_ctx, in_port, false, true, acquired_hw_id, acquired_hw_path); if (rc) { - CAM_ERR(CAM_ISP, "Acquire IFE PPP SRC resource Failed"); + CAM_ERR(CAM_ISP, "Acquire IFE PPP SRC resource Failed, ctx_idx: %u", + ife_ctx->ctx_index); goto err; } } rc = cam_ife_hw_mgr_acquire_res_ife_out(ife_ctx, in_port); if (rc) { - CAM_ERR(CAM_ISP, "Acquire IFE OUT resource Failed"); + CAM_ERR(CAM_ISP, "Acquire IFE OUT resource Failed, ctx_idx: %u", + ife_ctx->ctx_index); goto err; } if (ife_ctx->ctx_type == CAM_IFE_CTX_TYPE_SFE) { rc = cam_ife_hw_mgr_acquire_res_sfe_out(ife_ctx, in_port); if (rc) { - CAM_ERR(CAM_ISP, "Acquire SFE OUT resource Failed"); + CAM_ERR(CAM_ISP, "Acquire SFE OUT resource Failed, ctx_idx: %u", + ife_ctx->ctx_index); goto err; } } @@ -4958,12 +5017,13 @@ void cam_ife_cam_cdm_callback(uint32_t handle, void *userdata, CAM_ISP_PACKET_META_REG_DUMP_PER_REQUEST, NULL, false); } else { - CAM_INFO(CAM_ISP, "CDM delay, Skip dump req: %llu, cdm_req: %llu", - req_id, ctx->cdm_userdata.request_id); + CAM_INFO(CAM_ISP, + "CDM delay, Skip dump req: %llu, cdm_req: %llu ctx_idx: %u", + req_id, ctx->cdm_userdata.request_id, ctx->ctx_index); } } CAM_DBG(CAM_ISP, - "CDM hdl=0x%x, udata=%pK, status=%d, cookie=%u ctx_index=%d cdm_req=%llu", + "CDM hdl=0x%x, udata=%pK, status=%d, cookie=%u ctx_index=%u cdm_req=%llu", handle, userdata, status, req_id, ctx->ctx_index, ctx->cdm_userdata.request_id); } else if (status == CAM_CDM_CB_STATUS_PAGEFAULT) { @@ -4972,8 +5032,8 @@ void cam_ife_cam_cdm_callback(uint32_t handle, void *userdata, ctx->common.sec_pf_evt_cb(ctx->common.cb_priv, cookie); } else { CAM_WARN(CAM_ISP, - "Called by CDM hdl=0x%x, udata=%pK, status=%d, cdm_req=%llu", - handle, userdata, status, ctx->cdm_userdata.request_id); + "Called by CDM hdl=0x%x, udata=%pK, status=%d, cdm_req=%llu ctx_idx: %u", + handle, userdata, status, ctx->cdm_userdata.request_id, ctx->ctx_index); } } @@ -5296,7 +5356,7 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args) rc = cam_ife_mgr_check_and_update_fe(ife_ctx, acquire_hw_info, acquire_args->acquire_info_size); if (rc) { - CAM_ERR(CAM_ISP, "buffer size is not enough"); + CAM_ERR(CAM_ISP, "buffer size is not enough, ctx_idx: %u", ife_ctx->ctx_index); goto free_ctx; } @@ -5305,7 +5365,7 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args) GFP_KERNEL); if (!in_port) { - CAM_ERR(CAM_ISP, "No memory available"); + CAM_ERR(CAM_ISP, "No memory available, ctx_idx: %u", ife_ctx->ctx_index); rc = -ENOMEM; goto free_ctx; } @@ -5332,7 +5392,8 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args) i, &input_size, &in_port[i]); if (rc < 0) { - CAM_ERR(CAM_ISP, "Failed in parsing: %d", rc); + CAM_ERR(CAM_ISP, "Failed in parsing: %d, ctx_idx: %u", + rc, ife_ctx->ctx_index); goto free_mem; } @@ -5342,8 +5403,9 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args) for (j = 1; j < in_port[i].num_valid_vc_dt; j++) { if (in_port[i].format[j] != input_format_checker) { CAM_ERR(CAM_ISP, - "Different input formats for FE use-cases not supported - formats vc0: %u vc%d: %u", - input_format_checker, j, in_port[i].format[j]); + "Different input formats for FE use-cases not supported - formats vc0: %u vc%d: %u ctx_idx: %u", + input_format_checker, j, in_port[i].format[j], + ife_ctx->ctx_index); rc = -EINVAL; goto free_mem; } @@ -5369,15 +5431,15 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args) /* Check whether context has only RDI resource */ if (!total_pix_port && !total_pd_port) { ife_ctx->flags.is_rdi_only_context = true; - CAM_DBG(CAM_ISP, "RDI only context"); + CAM_DBG(CAM_ISP, "RDI only context, ctx_idx: %u", ife_ctx->ctx_index); } /* Check whether context has only RDI and PD resource */ if (!total_pix_port && (total_pd_port && total_rdi_port)) { ife_ctx->flags.rdi_pd_context = true; - CAM_DBG(CAM_ISP, "RDI and PD context with [%u pd] [%u rdi]", - total_pd_port, total_rdi_port); + CAM_DBG(CAM_ISP, "RDI and PD context with [%u pd] [%u rdi], ctx_idx: %u", + total_pd_port, total_rdi_port, ife_ctx->ctx_index); } /* Check if all output ports are of lite */ @@ -5386,7 +5448,8 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args) /* acquire HW resources */ for (i = 0; i < acquire_hw_info->num_inputs; i++) { - CAM_DBG(CAM_ISP, "in_res_type %x", in_port[i].res_type); + CAM_DBG(CAM_ISP, "ctx_idx: %u in_res_type %x", + ife_ctx->ctx_index, in_port[i].res_type); if (!ife_ctx->ctx_type) { if (in_port[i].cust_node) { ife_ctx->ctx_type = CAM_IFE_CTX_TYPE_CUSTOM; @@ -5401,8 +5464,8 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args) } CAM_DBG(CAM_ISP, - "in_res_type: 0x%x sfe_in_path_type: 0x%x sfe_ife_enable: 0x%x", - in_port[i].res_type, in_port[i].sfe_in_path_type, + "in_res_type: 0x%x ctx_idx: %u sfe_in_path_type: 0x%x sfe_ife_enable: 0x%x", + in_port[i].res_type, ife_ctx->ctx_index, in_port[i].sfe_in_path_type, in_port[i].sfe_ife_enable); if (ife_ctx->flags.is_offline) @@ -5437,7 +5500,7 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args) /* Process base info */ rc = cam_ife_mgr_process_base_info(ife_ctx); if (rc) { - CAM_ERR(CAM_ISP, "Process base info failed"); + CAM_ERR(CAM_ISP, "Process base info failed, ctx_idx: %u", ife_ctx->ctx_index); goto free_res; } @@ -5476,13 +5539,13 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args) cdm_acquire.cam_cdm_callback = cam_ife_cam_cdm_callback; rc = cam_cdm_acquire(&cdm_acquire); if (rc) { - CAM_ERR(CAM_ISP, "Failed to acquire the CDM HW"); + CAM_ERR(CAM_ISP, "Failed to acquire the CDM HW, ctx_idx: %u", ife_ctx->ctx_index); goto free_cdm_cmd; } CAM_DBG(CAM_ISP, - "Successfully acquired CDM Id: %d, CDM HW hdl=%x, is_dual=%d", - cdm_acquire.id, cdm_acquire.handle, ife_ctx->flags.is_dual); + "Successfully acquired ctx_idx: %u CDM Id: %d, CDM HW hdl=%x, is_dual=%d", + ife_ctx->ctx_index, cdm_acquire.id, cdm_acquire.handle, ife_ctx->flags.is_dual); ife_ctx->cdm_handle = cdm_acquire.handle; ife_ctx->cdm_id = cdm_acquire.id; ife_ctx->cdm_hw_idx = cdm_acquire.hw_idx; @@ -5502,7 +5565,8 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args) ife_ctx->scratch_buf_info.sfe_scratch_config = kzalloc(sizeof(struct cam_sfe_scratch_buf_cfg), GFP_KERNEL); if (!ife_ctx->scratch_buf_info.sfe_scratch_config) { - CAM_ERR(CAM_ISP, "Failed to allocate SFE scratch config"); + CAM_ERR(CAM_ISP, "Failed to allocate SFE scratch config, ctx_idx: %u", + ife_ctx->ctx_index); rc = -ENOMEM; goto free_cdm_cmd; } @@ -5510,7 +5574,8 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args) ife_ctx->scratch_buf_info.ife_scratch_config = kzalloc(sizeof(struct cam_ife_scratch_buf_cfg), GFP_KERNEL); if (!ife_ctx->scratch_buf_info.ife_scratch_config) { - CAM_ERR(CAM_ISP, "Failed to allocate IFE scratch config"); + CAM_ERR(CAM_ISP, "Failed to allocate IFE scratch config, ctx_idx: %u", + ife_ctx->ctx_index); rc = -ENOMEM; kfree(ife_ctx->scratch_buf_info.sfe_scratch_config); goto free_cdm_cmd; @@ -5547,6 +5612,7 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args) acquire_args->op_params.num_valid_params = 2; acquire_args->op_params.param_list[0] = max_ife_out_res; acquire_args->op_params.param_list[1] = max_sfe_out_res; + acquire_args->hw_mgr_ctx_id = ife_ctx->ctx_index; cam_ife_hw_mgr_print_acquire_info(ife_ctx, total_pix_port, total_pd_port, total_rdi_port, rc); @@ -5671,7 +5737,7 @@ static int cam_ife_mgr_acquire_dev(void *hw_mgr_priv, void *acquire_hw_args) GFP_KERNEL); if (!gen_port_info) { - CAM_ERR(CAM_ISP, "No memory available"); + CAM_ERR(CAM_ISP, "No memory available, ctx_idx: %u", ife_ctx->ctx_index); rc = -ENOMEM; goto err; } @@ -5680,17 +5746,18 @@ static int cam_ife_mgr_acquire_dev(void *hw_mgr_priv, void *acquire_hw_args) if (isp_resource[i].resource_id != CAM_ISP_RES_ID_PORT) continue; - CAM_DBG(CAM_ISP, "acquire no = %d total = %d", i, + CAM_DBG(CAM_ISP, "ctx_idx: %u acquire no = %d total = %d", ife_ctx->ctx_index, i, acquire_args->num_acq); CAM_DBG(CAM_ISP, - "start copy from user handle %lld with len = %d", - isp_resource[i].res_hdl, + "ctx_idx: %u start copy from user handle %lld with len = %d", + ife_ctx->ctx_index, isp_resource[i].res_hdl, isp_resource[i].length); in_port_length = sizeof(struct cam_isp_in_port_info); if (in_port_length > isp_resource[i].length) { - CAM_ERR(CAM_ISP, "buffer size is not enough"); + CAM_ERR(CAM_ISP, "buffer size is not enough, ctx_idx: %u", + ife_ctx->ctx_index); rc = -EINVAL; goto free_res; } @@ -5700,8 +5767,8 @@ static int cam_ife_mgr_acquire_dev(void *hw_mgr_priv, void *acquire_hw_args) isp_resource[i].length); if (!IS_ERR(in_port)) { if (in_port->num_out_res > max_ife_out_res) { - CAM_ERR(CAM_ISP, "too many output res %d", - in_port->num_out_res); + CAM_ERR(CAM_ISP, "too many output res %d, ctx_idx: %u", + in_port->num_out_res, ife_ctx->ctx_index); rc = -EINVAL; kfree(in_port); goto free_res; @@ -5711,7 +5778,8 @@ static int cam_ife_mgr_acquire_dev(void *hw_mgr_priv, void *acquire_hw_args) (in_port->num_out_res - 1) * sizeof(struct cam_isp_out_port_info); if (in_port_length > isp_resource[i].length) { - CAM_ERR(CAM_ISP, "buffer size is not enough"); + CAM_ERR(CAM_ISP, "buffer size is not enough, ctx_idx: %u", + ife_ctx->ctx_index); rc = -EINVAL; kfree(in_port); goto free_res; @@ -5740,8 +5808,8 @@ static int cam_ife_mgr_acquire_dev(void *hw_mgr_priv, void *acquire_hw_args) kfree(in_port); } else { CAM_ERR(CAM_ISP, - "Copy from user failed with in_port = %pK", - in_port); + "Copy from user failed with in_port = %pK, ctx_idx: %u", + in_port, ife_ctx->ctx_index); rc = -EFAULT; goto free_mem; } @@ -5750,15 +5818,15 @@ static int cam_ife_mgr_acquire_dev(void *hw_mgr_priv, void *acquire_hw_args) /* Check whether context has only RDI resource */ if (!total_pix_port || !total_pd_port) { ife_ctx->flags.is_rdi_only_context = true; - CAM_DBG(CAM_ISP, "RDI only context"); + CAM_DBG(CAM_ISP, "RDI only context, ctx_idx: %u", ife_ctx->ctx_index); } /* Check whether context has only RDI and PD resource */ if (!total_pix_port && (total_pd_port && total_rdi_port)) { ife_ctx->flags.rdi_pd_context = true; - CAM_DBG(CAM_ISP, "RDI and PD context with [%u pd] [%u rdi]", - total_pd_port, total_rdi_port); + CAM_DBG(CAM_ISP, "RDI and PD context with [%u pd] [%u rdi] ctx_idx: %u", + total_pd_port, total_rdi_port, ife_ctx->ctx_index); } /* acquire HW resources */ @@ -5789,7 +5857,7 @@ static int cam_ife_mgr_acquire_dev(void *hw_mgr_priv, void *acquire_hw_args) /* Process base info */ rc = cam_ife_mgr_process_base_info(ife_ctx); if (rc) { - CAM_ERR(CAM_ISP, "Process base info failed"); + CAM_ERR(CAM_ISP, "Process base info failed, ctx_idx: %u", ife_ctx->ctx_index); goto free_res; } @@ -5826,12 +5894,12 @@ static int cam_ife_mgr_acquire_dev(void *hw_mgr_priv, void *acquire_hw_args) cdm_acquire.cam_cdm_callback = cam_ife_cam_cdm_callback; rc = cam_cdm_acquire(&cdm_acquire); if (rc) { - CAM_ERR(CAM_ISP, "Failed to acquire the CDM HW"); + CAM_ERR(CAM_ISP, "Failed to acquire the CDM HW, ctx_idx: %u", ife_ctx->ctx_index); goto free_cdm_cmd; } - CAM_DBG(CAM_ISP, "Successfully acquired CDM ID:%d, CDM HW hdl=%x", - cdm_acquire.id, cdm_acquire.handle); + CAM_DBG(CAM_ISP, "Successfully acquired CDM ID:%d, CDM HW hdl=%x ctx_idx: %u", + cdm_acquire.id, cdm_acquire.handle, ife_ctx->ctx_index); if (cdm_acquire.id == CAM_CDM_IFE) ife_ctx->flags.internal_cdm = true; @@ -5927,7 +5995,7 @@ static void cam_ife_mgr_print_blob_info(struct cam_ife_hw_mgr_ctx *ctx, uint64_t struct cam_isp_clock_config *sfe_clock_config = (struct cam_isp_clock_config *) &hw_update_data->bw_clk_config.sfe_clock_config; - CAM_INFO(CAM_ISP, "ctx: %d req_id:%llu config_valid[BW VFE_CLK SFE_CLK]:[%d %d %d]", + CAM_INFO(CAM_ISP, "ctx: %u req_id:%llu config_valid[BW VFE_CLK SFE_CLK]:[%d %d %d]", ctx->ctx_index, request_id, hw_update_data->bw_clk_config.bw_config_valid, hw_update_data->bw_clk_config.ife_clock_config_valid, hw_update_data->bw_clk_config.sfe_clock_config_valid); @@ -5937,8 +6005,8 @@ static void cam_ife_mgr_print_blob_info(struct cam_ife_hw_mgr_ctx *ctx, uint64_t for (i = 0; i < bw_config->num_paths; i++) { CAM_INFO(CAM_PERF, - "ISP_BLOB usage_type=%u [%s] [%s] [%s] [%llu] [%llu] [%llu]", - bw_config->usage_type, + "ctx_idx: %u ISP_BLOB usage_type=%u [%s] [%s] [%s] [%llu] [%llu] [%llu]", + ctx->ctx_index, bw_config->usage_type, cam_isp_util_usage_data_to_string( bw_config->axi_path[i].usage_data), cam_cpas_axi_util_path_type_to_string( @@ -5954,16 +6022,16 @@ ife_clk: if (!hw_update_data->bw_clk_config.ife_clock_config_valid) goto sfe_clk; - CAM_INFO(CAM_PERF, "IFE clk update usage=%u left_clk= %lu right_clk=%lu", - ife_clock_config->usage_type, ife_clock_config->left_pix_hz, + CAM_INFO(CAM_PERF, "IFE ctx_idx: %u clk update usage=%u left_clk= %lu right_clk=%lu", + ctx->ctx_index, ife_clock_config->usage_type, ife_clock_config->left_pix_hz, ife_clock_config->right_pix_hz); sfe_clk: if (!hw_update_data->bw_clk_config.sfe_clock_config_valid) goto end; - CAM_INFO(CAM_PERF, "SFE clk update usage: %u left_clk: %lu right_clk: %lu", - sfe_clock_config->usage_type, sfe_clock_config->left_pix_hz, + CAM_INFO(CAM_PERF, "SFE ctx_idx: %u clk update usage: %u left_clk: %lu right_clk: %lu", + ctx->ctx_index, sfe_clock_config->usage_type, sfe_clock_config->left_pix_hz, sfe_clock_config->right_pix_hz); end: @@ -6140,8 +6208,8 @@ static int cam_isp_blob_bw_update_v2( for (i = 0; i < bw_config->num_paths; i++) { CAM_DBG(CAM_PERF, - "ISP_BLOB usage_type=%u [%s] [%s] [%s] [%s] [%llu] [%llu] [%llu]", - bw_config->usage_type, + "ctx_idx: %u ISP_BLOB usage_type=%u [%s] [%s] [%s] [%s] [%llu] [%llu] [%llu]", + ctx->ctx_index, bw_config->usage_type, cam_isp_util_usage_data_to_string( bw_config->axi_path[i].usage_data), cam_cpas_axi_util_path_type_to_string( @@ -6190,9 +6258,10 @@ static int cam_isp_blob_bw_update_v2( struct cam_vfe_bw_update_args_v2)); if (rc) CAM_ERR(CAM_PERF, - "BW Update failed rc: %d", rc); + "BW Update failed rc: %d, ctx_idx: %u", + rc, ctx->ctx_index); } else { - CAM_WARN(CAM_ISP, "NULL hw_intf!"); + CAM_WARN(CAM_ISP, "NULL hw_intf!, ctx_idx: %u", ctx->ctx_index); } } } @@ -6237,9 +6306,10 @@ static int cam_isp_blob_bw_update_v2( struct cam_sfe_bw_update_args)); if (rc) CAM_ERR(CAM_PERF, - "BW Update failed rc: %d", rc); + "BW Update failed rc: %d, ctx_idx: %u", + rc, ctx->ctx_index); } else { - CAM_WARN(CAM_ISP, "NULL hw_intf!"); + CAM_WARN(CAM_ISP, "NULL hw_intf!, ctx_idx: %u", ctx->ctx_index); } } } @@ -6262,8 +6332,8 @@ static int cam_isp_blob_bw_update( bool camif_r_bw_updated = false; CAM_DBG(CAM_PERF, - "ISP_BLOB usage=%u left cam_bw_bps=%llu ext_bw_bps=%llu, right cam_bw_bps=%llu ext_bw_bps=%llu", - bw_config->usage_type, + "ctx_idx: %u ISP_BLOB usage=%u left cam_bw_bps=%llu ext_bw_bps=%llu, right cam_bw_bps=%llu ext_bw_bps=%llu", + ctx->ctx_index, bw_config->usage_type, bw_config->left_pix_vote.cam_bw_bps, bw_config->left_pix_vote.ext_bw_bps, bw_config->right_pix_vote.cam_bw_bps, @@ -6314,8 +6384,8 @@ static int cam_isp_blob_bw_update( bw_config->rdi_vote[idx].ext_bw_bps; } else { if (hw_mgr_res->hw_res[i]) { - CAM_ERR(CAM_ISP, "Invalid res_id %u", - hw_mgr_res->res_id); + CAM_ERR(CAM_ISP, "Invalid ctx_idx: %u res_id %u", + ctx->ctx_index, hw_mgr_res->res_id); rc = -EINVAL; return rc; } @@ -6334,9 +6404,10 @@ static int cam_isp_blob_bw_update( &bw_upd_args, sizeof(struct cam_vfe_bw_update_args)); if (rc) - CAM_ERR(CAM_PERF, "BW Update failed"); + CAM_ERR(CAM_PERF, "BW Update failed, ctx_idx: %u", + ctx->ctx_index); } else - CAM_WARN(CAM_ISP, "NULL hw_intf!"); + CAM_WARN(CAM_ISP, "NULL hw_intf!ctx_idx: %u", ctx->ctx_index); } } @@ -6346,7 +6417,7 @@ static int cam_isp_blob_bw_update( static void cam_ife_mgr_send_frame_event(uint64_t request_id, uint32_t ctx_index) { if (cam_presil_mode_enabled()) { - CAM_DBG(CAM_PRESIL, "PRESIL FRAME req_id=%llu ctx_index %d", + CAM_DBG(CAM_PRESIL, "PRESIL FRAME req_id=%llu ctx_index %u", request_id, ctx_index); cam_presil_send_event(CAM_PRESIL_EVENT_IFE_FRAME_RUN, request_id); } @@ -6381,14 +6452,14 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv, if (!ctx->flags.ctx_in_use || !ctx->cdm_cmd) { CAM_ERR(CAM_ISP, - "Invalid context parameters : ctx_in_use=%d, cdm_cmd=%pK", - ctx->flags.ctx_in_use, ctx->cdm_cmd); + "Invalid context parameters : ctx_index %u, ctx_in_use=%d, cdm_cmd=%pK", + ctx->ctx_index, ctx->flags.ctx_in_use, ctx->cdm_cmd); return -EPERM; } if (atomic_read(&ctx->overflow_pending)) { CAM_DBG(CAM_ISP, - "Ctx[%pK][%d] Overflow pending, cannot apply req %llu", + "Ctx[%pK][%u] Overflow pending, cannot apply req %llu", ctx, ctx->ctx_index, cfg->request_id); return -EPERM; } @@ -6403,7 +6474,7 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv, ctx->try_recovery_cnt = 0; ctx->recovery_req_id = 0; CAM_DBG(CAM_ISP, - "Ctx[%pK][%d] Reset overflow recovery count for req %llu", + "Ctx[%pK][%u] Reset overflow recovery count for req %llu", ctx, ctx->ctx_index, cfg->request_id); } @@ -6412,15 +6483,15 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv, ctx->cdm_userdata.request_id = cfg->request_id; ctx->cdm_userdata.hw_update_data = hw_update_data; - CAM_DBG(CAM_ISP, "Ctx[%pK][%d] : Applying Req %lld, init_packet=%d", + CAM_DBG(CAM_ISP, "Ctx[%pK][%u] : Applying Req %lld, init_packet=%d", ctx, ctx->ctx_index, cfg->request_id, cfg->init_packet); if (cfg->reapply_type && cfg->cdm_reset_before_apply) { if (ctx->last_cdm_done_req < cfg->request_id) { is_cdm_hung = !cam_cdm_detect_hang_error(ctx->cdm_handle); CAM_ERR_RATE_LIMIT(CAM_ISP, - "CDM callback not received for req: %lld, last_cdm_done_req: %lld, is_cdm_hung: %d", - cfg->request_id, ctx->last_cdm_done_req, + "ctx_idx: %u CDM callback not received for req: %lld, last_cdm_done_req: %lld, is_cdm_hung: %d", + ctx->ctx_index, cfg->request_id, ctx->last_cdm_done_req, is_cdm_hung); if (!is_cdm_hung) @@ -6429,22 +6500,22 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv, rc = cam_cdm_reset_hw(ctx->cdm_handle); if (rc) { CAM_ERR_RATE_LIMIT(CAM_ISP, - "CDM reset unsuccessful for req: %lld. ctx: %d, rc: %d", + "CDM reset unsuccessful for req: %lld. ctx: %u, rc: %d", cfg->request_id, ctx->ctx_index, rc); ctx->last_cdm_done_req = 0; return rc; } } else { CAM_ERR_RATE_LIMIT(CAM_ISP, - "CDM callback received, should wait for buf done for req: %lld", - cfg->request_id); + "CDM callback received, should wait for buf done for req: %lld, ctx_idx: %u", + cfg->request_id, ctx->ctx_index); return -EALREADY; } ctx->last_cdm_done_req = 0; } CAM_DBG(CAM_PERF, - "ctx_idx=%d, bw_config_version=%d config_valid[BW VFE_CLK SFE_CLK]:[%d %d %d]", + "ctx_idx=%u, bw_config_version=%d config_valid[BW VFE_CLK SFE_CLK]:[%d %d %d]", ctx->ctx_index, ctx->bw_config_version, hw_update_data->bw_clk_config.bw_config_valid, hw_update_data->bw_clk_config.ife_clock_config_valid, @@ -6453,8 +6524,9 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv, if (hw_update_data->drv_config_valid) { rc = cam_isp_blob_drv_config(ctx, cfg->request_id, hw_update_data); if (rc) { - CAM_ERR(CAM_ISP, "DRV config failed for req: %llu rc:%d", cfg->request_id, - rc); + CAM_ERR(CAM_ISP, "DRV config failed for req: %llu rc:%d ctx_idx=%u", + cfg->request_id, + rc, ctx->ctx_index); } } @@ -6467,7 +6539,8 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv, rc = cam_isp_blob_ife_clock_update((struct cam_isp_clock_config *) &hw_update_data->bw_clk_config.ife_clock_config, ctx); if (rc) { - CAM_ERR(CAM_PERF, "Clock Update Failed, rc=%d", rc); + CAM_ERR(CAM_PERF, "Clock Update Failed, rc=%d, ctx_idx=%u", + rc, ctx->ctx_index); return rc; } } @@ -6476,7 +6549,8 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv, rc = cam_isp_blob_sfe_clock_update((struct cam_isp_clock_config *) &hw_update_data->bw_clk_config.sfe_clock_config, ctx); if (rc) { - CAM_ERR(CAM_PERF, "Clock Update Failed, rc=%d", rc); + CAM_ERR(CAM_PERF, "Clock Update Failed, rc=%d, ctx_idx=%u", + rc, ctx->ctx_index); return rc; } } @@ -6487,7 +6561,8 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv, (struct cam_isp_bw_config *) &hw_update_data->bw_clk_config.bw_config, ctx); if (rc) { - CAM_ERR(CAM_PERF, "Bandwidth Update Failed rc: %d", rc); + CAM_ERR(CAM_PERF, "Bandwidth Update Failed rc: %d, ctx_idx=%u", + rc, ctx->ctx_index); return rc; } } else if ((ctx->bw_config_version == CAM_ISP_BW_CONFIG_V2) || @@ -6495,24 +6570,27 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv, rc = cam_isp_blob_bw_update_v2(&hw_update_data->bw_clk_config.bw_config_v2, ctx); if (rc) { - CAM_ERR(CAM_PERF, "Bandwidth Update Failed rc: %d", rc); + CAM_ERR(CAM_PERF, "Bandwidth Update Failed rc: %d, ctx_idx=%u", + rc, ctx->ctx_index); return rc; } } else { - CAM_ERR(CAM_PERF, "Invalid bw config version: %d", ctx->bw_config_version); + CAM_ERR(CAM_PERF, "Invalid bw config version: %d, ctx_idx=%u", + ctx->bw_config_version, ctx->ctx_index); } } /* Apply the updated values in top layer to the HW*/ rc = cam_ife_mgr_finish_clk_bw_update(ctx, cfg->request_id, false); if (rc) { - CAM_ERR(CAM_ISP, "Failed in finishing clk/bw update rc: %d", rc); + CAM_ERR(CAM_ISP, "Failed in finishing clk/bw update rc: %d, ctx_idx=%u", + rc, ctx->ctx_index); cam_ife_mgr_print_blob_info(ctx, cfg->request_id, hw_update_data); return rc; } CAM_DBG(CAM_ISP, - "Enter ctx id:%d num_hw_upd_entries %d request id: %llu", + "Enter ctx id:%u num_hw_upd_entries %d request id: %llu", ctx->ctx_index, cfg->num_hw_update_entries, cfg->request_id); if (cfg->num_hw_update_entries > 0) { @@ -6541,8 +6619,8 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv, if (cmd->flags == CAM_ISP_UNUSED_BL || cmd->flags >= CAM_ISP_BL_MAX) - CAM_ERR(CAM_ISP, "Unexpected BL type %d", - cmd->flags); + CAM_ERR(CAM_ISP, "Unexpected BL type %d, ctx_idx=%u", + cmd->flags, ctx->ctx_index); cdm_cmd->cmd[i - skip].bl_addr.mem_handle = cmd->handle; cdm_cmd->cmd[i - skip].offset = cmd->offset; @@ -6552,14 +6630,16 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv, cdm_cmd->cmd_arrary_count = cfg->num_hw_update_entries - skip; if (cam_presil_mode_enabled()) { - CAM_INFO(CAM_ISP, "Sending relevant buffers for request:%llu to presil", - cfg->request_id); + CAM_INFO(CAM_ISP, + "Sending relevant buffers for request:%llu to presil, ctx_idx=%u", + cfg->request_id, ctx->ctx_index); rc = cam_presil_send_buffers_from_packet(hw_update_data->packet, g_ife_hw_mgr.mgr_common.img_iommu_hdl, g_ife_hw_mgr.mgr_common.cmd_iommu_hdl); if (rc) { - CAM_ERR(CAM_ISP, "Error sending buffers for request:%llu to presil", - cfg->request_id); + CAM_ERR(CAM_ISP, + "Error sending buffers for request:%llu to presil, ctx=%u", + cfg->request_id, ctx->ctx_index); return rc; } } @@ -6567,13 +6647,13 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv, reinit_completion(&ctx->config_done_complete); ctx->applied_req_id = cfg->request_id; - CAM_DBG(CAM_ISP, "Submit to CDM"); + CAM_DBG(CAM_ISP, "Submit to CDM, ctx_idx=%u", ctx->ctx_index); atomic_set(&ctx->cdm_done, 0); rc = cam_cdm_submit_bls(ctx->cdm_handle, cdm_cmd); if (rc) { CAM_ERR(CAM_ISP, - "Failed to apply the configs for req %llu, rc %d", - cfg->request_id, rc); + "Failed to apply the configs for req %llu, rc %d ctx_idx=%u", + cfg->request_id, rc, ctx->ctx_index); return rc; } @@ -6584,7 +6664,7 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv, msecs_to_jiffies(60)); if (rem_jiffies == 0) { CAM_ERR(CAM_ISP, - "config done completion timeout for req_id=%llu ctx_index %d", + "config done completion timeout for req_id=%llu ctx_index %u", cfg->request_id, ctx->ctx_index); rc = cam_cdm_detect_hang_error(ctx->cdm_handle); if (rc < 0) { @@ -6593,11 +6673,12 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv, rc = -ETIMEDOUT; } else { CAM_DBG(CAM_ISP, - "Wq delayed but IRQ CDM done"); + "Wq delayed but IRQ CDM done, ctx_index %u", + ctx->ctx_index); } } else { CAM_DBG(CAM_ISP, - "config done Success for req_id=%llu ctx_index %d", + "config done Success for req_id=%llu ctx_index %u", cfg->request_id, ctx->ctx_index); /* Update last applied MUP */ if (hw_update_data->mup_en) { @@ -6618,10 +6699,10 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv, cam_ife_mgr_send_frame_event(cfg->request_id, ctx->ctx_index); } else { - CAM_ERR(CAM_ISP, "No commands to config"); + CAM_ERR(CAM_ISP, "No commands to config, ctx_index %u", ctx->ctx_index); } - CAM_DBG(CAM_ISP, "Exit: Config Done: %llu", cfg->request_id); + CAM_DBG(CAM_ISP, "Exit: Config Done: %llu, ctx_index %u", cfg->request_id, ctx->ctx_index); return rc; } @@ -6643,11 +6724,11 @@ static int cam_ife_mgr_stop_hw_in_overflow(void *stop_hw_args) return -EPERM; } - CAM_DBG(CAM_ISP, "Enter...ctx id:%d", + CAM_DBG(CAM_ISP, "Enter...ctx id:%u", ctx->ctx_index); if (!ctx->num_base) { - CAM_ERR(CAM_ISP, "Number of bases are zero"); + CAM_ERR(CAM_ISP, "Number of bases are zero, ctx_index %u", ctx->ctx_index); return -EINVAL; } @@ -6692,7 +6773,7 @@ static int cam_ife_mgr_stop_hw_in_overflow(void *stop_hw_args) /* Stop tasklet for context */ cam_tasklet_stop(ctx->common.tasklet_info); - CAM_DBG(CAM_ISP, "Exit...ctx id:%d rc :%d", + CAM_DBG(CAM_ISP, "Exit...ctx id:%u rc :%d", ctx->ctx_index, rc); return rc; @@ -6707,7 +6788,7 @@ static int cam_ife_mgr_bw_control(struct cam_ife_hw_mgr_ctx *ctx, int rc = -EINVAL; uint32_t i; - CAM_DBG(CAM_ISP, "Enter...ctx id:%d", ctx->ctx_index); + CAM_DBG(CAM_ISP, "Enter...ctx id:%u", ctx->ctx_index); list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_src, list) { for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) { @@ -6726,9 +6807,10 @@ static int cam_ife_mgr_bw_control(struct cam_ife_hw_mgr_ctx *ctx, &bw_ctrl_args, sizeof(struct cam_isp_bw_control_args)); if (rc) - CAM_ERR(CAM_ISP, "BW Update failed"); + CAM_ERR(CAM_ISP, "BW Update failed, ctx id:%u", + ctx->ctx_index); } else - CAM_WARN(CAM_ISP, "NULL hw_intf!"); + CAM_WARN(CAM_ISP, "NULL hw_intf!, ctx id:%u", ctx->ctx_index); } } @@ -6749,9 +6831,10 @@ static int cam_ife_mgr_bw_control(struct cam_ife_hw_mgr_ctx *ctx, &bw_ctrl_args, sizeof(struct cam_isp_bw_control_args)); if (rc) - CAM_ERR(CAM_ISP, "BW Update failed"); + CAM_ERR(CAM_ISP, "BW Update failed, ctx id:%u", + ctx->ctx_index); } else - CAM_WARN(CAM_ISP, "NULL hw_intf!"); + CAM_WARN(CAM_ISP, "NULL hw_intf! ctx id:%u", ctx->ctx_index); } } @@ -6787,14 +6870,14 @@ static int cam_ife_mgr_stop_hw(void *hw_mgr_priv, void *stop_hw_args) } if (!ctx->num_base) { - CAM_ERR(CAM_ISP, "number of bases are zero"); + CAM_ERR(CAM_ISP, "number of bases are zero, ctx id:%u", ctx->ctx_index); return -EINVAL; } /* Cancel all scheduled recoveries without affecting future recoveries */ atomic_inc(&ctx->recovery_id); - CAM_DBG(CAM_ISP, " Enter...ctx id:%d", ctx->ctx_index); + CAM_DBG(CAM_ISP, " Enter...ctx id:%u", ctx->ctx_index); stop_isp = (struct cam_isp_stop_args *)stop_args->args; /* Set the csid halt command */ @@ -6806,7 +6889,7 @@ static int cam_ife_mgr_stop_hw(void *hw_mgr_priv, void *stop_hw_args) /* Note:stop resource will remove the irq mask from the hardware */ - CAM_DBG(CAM_ISP, "Halting CSIDs"); + CAM_DBG(CAM_ISP, "Halting CSIDs, ctx id:%u", ctx->ctx_index); /* get master base index first */ for (i = 0; i < ctx->num_base; i++) { @@ -6829,7 +6912,7 @@ static int cam_ife_mgr_stop_hw(void *hw_mgr_priv, void *stop_hw_args) CAM_CSID_HALT_MODE_INTERNAL); - CAM_DBG(CAM_ISP, "Stopping master CSID idx %d", master_base_idx); + CAM_DBG(CAM_ISP, "Stopping master CSID idx %d, ctx id:%u", master_base_idx, ctx->ctx_index); /* Stop the master CSID path first */ @@ -6840,8 +6923,8 @@ static int cam_ife_mgr_stop_hw(void *hw_mgr_priv, void *stop_hw_args) for (i = 0; i < ctx->num_base; i++) { if (ctx->base[i].idx == master_base_idx) continue; - CAM_DBG(CAM_ISP, "Stopping CSID idx %d i %d master %d", - ctx->base[i].idx, i, master_base_idx); + CAM_DBG(CAM_ISP, "Stopping CSID idx %d i %d master %d ctx id:%u", + ctx->base[i].idx, i, master_base_idx, ctx->ctx_index); cam_ife_mgr_csid_stop_hw(ctx, &ctx->res_list_ife_csid, ctx->base[i].idx, csid_halt_type); @@ -6855,26 +6938,26 @@ static int cam_ife_mgr_stop_hw(void *hw_mgr_priv, void *stop_hw_args) /* check to avoid iterating loop */ if (ctx->ctx_type == CAM_IFE_CTX_TYPE_SFE) { - CAM_DBG(CAM_ISP, "Going to stop SFE Out"); + CAM_DBG(CAM_ISP, "Going to stop SFE Out, ctx id:%u", ctx->ctx_index); /* SFE out resources */ for (i = 0; i < max_sfe_out_res; i++) cam_ife_hw_mgr_stop_hw_res(&ctx->res_list_sfe_out[i]); - CAM_DBG(CAM_ISP, "Going to stop SFE SRC resources"); + CAM_DBG(CAM_ISP, "Going to stop SFE SRC resources, ctx id:%u", ctx->ctx_index); /* SFE in resources */ list_for_each_entry(hw_mgr_res, &ctx->res_list_sfe_src, list) cam_ife_hw_mgr_stop_hw_res(hw_mgr_res); } - CAM_DBG(CAM_ISP, "Going to stop IFE out resources"); + CAM_DBG(CAM_ISP, "Going to stop IFE out resources, ctx id:%u", ctx->ctx_index); /* IFE out resources */ for (i = 0; i < max_ife_out_res; i++) cam_ife_hw_mgr_stop_hw_res(&ctx->res_list_ife_out[i]); - CAM_DBG(CAM_ISP, "Going to stop IFE Mux"); + CAM_DBG(CAM_ISP, "Going to stop IFE Mux, ctx id:%u", ctx->ctx_index); /* IFE mux in resources */ list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_src, list) { @@ -6907,7 +6990,7 @@ static int cam_ife_mgr_stop_hw(void *hw_mgr_priv, void *stop_hw_args) msecs_to_jiffies(10)); if (rem_jiffies == 0) CAM_WARN(CAM_ISP, - "config done completion timeout for last applied req_id=%llu ctx_index %", + "config done completion timeout for last applied req_id=%llu ctx_index %u", ctx->applied_req_id, ctx->ctx_index); /* Reset CDM for KMD internal stop */ @@ -6924,19 +7007,21 @@ static int cam_ife_mgr_stop_hw(void *hw_mgr_priv, void *stop_hw_args) goto end; if (cam_cdm_stream_off(ctx->cdm_handle)) - CAM_ERR(CAM_ISP, "CDM stream off failed %d", ctx->cdm_handle); + CAM_ERR(CAM_ISP, "CDM stream off failed %d, ctx_id: %u", + ctx->cdm_handle, ctx->ctx_index); cam_ife_hw_mgr_deinit_hw(ctx); CAM_DBG(CAM_ISP, - "Stop success for ctx id:%d rc :%d", ctx->ctx_index, rc); + "Stop success for ctx id:%u rc :%d", ctx->ctx_index, rc); mutex_lock(&g_ife_hw_mgr.ctx_mutex); if (!atomic_dec_return(&g_ife_hw_mgr.active_ctx_cnt)) { rc = cam_ife_notify_safe_lut_scm(CAM_IFE_SAFE_DISABLE); if (rc) { CAM_ERR(CAM_ISP, - "SAFE SCM call failed:Check TZ/HYP dependency"); + "SAFE SCM call failed:Check TZ/HYP dependency, ctx_id: %u", + ctx->ctx_index); rc = 0; } } @@ -7031,7 +7116,7 @@ static int cam_ife_mgr_restart_hw(void *start_hw_args) return -EPERM; } - CAM_DBG(CAM_ISP, "START IFE OUT ... in ctx id:%d", ctx->ctx_index); + CAM_DBG(CAM_ISP, "START IFE OUT ... in ctx id:%u", ctx->ctx_index); cam_tasklet_start(ctx->common.tasklet_info); @@ -7040,19 +7125,20 @@ static int cam_ife_mgr_restart_hw(void *start_hw_args) rc = cam_ife_hw_mgr_start_hw_res( &ctx->res_list_ife_out[i], ctx); if (rc) { - CAM_ERR(CAM_ISP, "Can not start IFE OUT (%d)", i); + CAM_ERR(CAM_ISP, "Can not start IFE OUT (%d), ctx_idx: %u", + i, ctx->ctx_index); goto err; } } - CAM_DBG(CAM_ISP, "START IFE SRC ... in ctx id:%d", ctx->ctx_index); + CAM_DBG(CAM_ISP, "START IFE SRC ... in ctx id:%u", ctx->ctx_index); /* Start IFE BUS RD device */ list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_in_rd, list) { rc = cam_ife_hw_mgr_start_hw_res(hw_mgr_res, ctx); if (rc) { - CAM_ERR(CAM_ISP, "Can not start IFE BUS RD (%d)", - hw_mgr_res->res_id); + CAM_ERR(CAM_ISP, "Can not start IFE BUS RD (%d), ctx_idx: %u", + hw_mgr_res->res_id, ctx->ctx_index); goto err; } } @@ -7061,27 +7147,27 @@ static int cam_ife_mgr_restart_hw(void *start_hw_args) list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_src, list) { rc = cam_ife_hw_mgr_start_hw_res(hw_mgr_res, ctx); if (rc) { - CAM_ERR(CAM_ISP, "Can not start IFE MUX (%d)", - hw_mgr_res->res_id); + CAM_ERR(CAM_ISP, "Can not start IFE MUX (%d), ctx_idx: %u", + hw_mgr_res->res_id, ctx->ctx_index); goto err; } } - CAM_DBG(CAM_ISP, "START CSID HW ... in ctx id:%d", ctx->ctx_index); + CAM_DBG(CAM_ISP, "START CSID HW ... in ctx id:%u", ctx->ctx_index); /* Start the IFE CSID HW devices */ rc = cam_ife_mgr_csid_start_hw(ctx, CAM_IFE_PIX_PATH_RES_MAX, false, false); if (rc) { - CAM_ERR(CAM_ISP, "Error in starting CSID HW in ctx id:%d", ctx->ctx_index); + CAM_ERR(CAM_ISP, "Error in starting CSID HW in ctx id:%u", ctx->ctx_index); goto err; } /* Start IFE root node: do nothing */ - CAM_DBG(CAM_ISP, "Exit...(success)"); + CAM_DBG(CAM_ISP, "Exit...(success), ctx_idx: %u", ctx->ctx_index); return 0; err: cam_ife_mgr_stop_hw_in_overflow(start_hw_args); - CAM_DBG(CAM_ISP, "Exit...(rc=%d)", rc); + CAM_DBG(CAM_ISP, "Exit...(rc=%d), ctx_idx: %u", rc, ctx->ctx_index); return rc; } @@ -7098,14 +7184,15 @@ static int cam_ife_mgr_find_core_idx( continue; if (ctx->base[i].split_id == split_id) { - CAM_DBG(CAM_ISP, "Found core: %u for split_id: %d hw_type: %d", - ctx->base[i].idx, split_id, hw_type); + CAM_DBG(CAM_ISP, "Found core: %u for split_id: %d hw_type: %d ctx_idx: %u", + ctx->base[i].idx, split_id, hw_type, ctx->ctx_index); *core_idx = ctx->base[i].idx; goto end; } } - CAM_ERR(CAM_ISP, "Failed to find core idx for hw_type: %d split_id %d", hw_type, split_id); + CAM_ERR(CAM_ISP, "Failed to find core idx for hw_type: %d split_id %d ctx_idx: %u", + hw_type, split_id, ctx->ctx_index); return -EINVAL; end: @@ -7157,8 +7244,8 @@ static void cam_ife_hw_mgr_set_hw_debug_config( &vfe_debug_args, sizeof(vfe_debug_args)); if (rc) CAM_DBG(CAM_ISP, - "Failed to set IFE_%u bus wr debug cfg rc: %d", - hw_idx, rc); + "Failed to set IFE_%u bus wr debug cfg rc: %d, ctx_idx: %u", + hw_idx, rc, ctx->ctx_index); } break; case CAM_ISP_HW_TYPE_SFE: @@ -7169,8 +7256,8 @@ static void cam_ife_hw_mgr_set_hw_debug_config( &sfe_debug_args, sizeof(sfe_debug_args)); if (rc) CAM_DBG(CAM_ISP, - "Failed to set SFE_%u debug cfg rc: %d", - hw_idx, rc); + "Failed to set SFE_%u debug cfg rc: %d, ctx_idx: %u", + hw_idx, rc, ctx->ctx_index); } break; case CAM_ISP_HW_TYPE_CSID: @@ -7181,8 +7268,8 @@ static void cam_ife_hw_mgr_set_hw_debug_config( &csid_debug_args, sizeof(csid_debug_args)); if (rc) CAM_DBG(CAM_ISP, - "Failed to set CSID_%u debug cfg rc: %d", - hw_idx, rc); + "Failed to set CSID_%u debug cfg rc: %d, ctx_idx: %u", + hw_idx, rc, ctx->ctx_index); } break; default: @@ -7226,12 +7313,12 @@ static int cam_ife_mgr_start_hw(void *hw_mgr_priv, void *start_hw_args) } if ((!ctx->flags.init_done) && start_isp->start_only) { - CAM_ERR(CAM_ISP, "Invalid args init_done %d start_only %d", - ctx->flags.init_done, start_isp->start_only); + CAM_ERR(CAM_ISP, "Invalid args init_done %d start_only %d, ctx_idx: %u", + ctx->flags.init_done, start_isp->start_only, ctx->ctx_index); return -EINVAL; } - CAM_DBG(CAM_ISP, "Enter... ctx id:%d", + CAM_DBG(CAM_ISP, "Enter... ctx id:%u", ctx->ctx_index); rc = cam_cpas_query_drv_enable(&g_ife_hw_mgr.cam_ddr_drv_support, @@ -7252,8 +7339,8 @@ static int cam_ife_mgr_start_hw(void *hw_mgr_priv, void *start_hw_args) ctx->base[i].idx); if (rc) CAM_ERR(CAM_ISP, - "Failed to unmask VFE:%d BUS_WR IRQ rc:%d", - ctx->base[i].idx, rc); + "Failed to unmask VFE:%d BUS_WR IRQ rc:%d ctx_idx: %u", + ctx->base[i].idx, rc, ctx->ctx_index); } goto start_only; } @@ -7300,10 +7387,10 @@ static int cam_ife_mgr_start_hw(void *hw_mgr_priv, void *start_hw_args) goto tasklet_stop; } CAM_DBG(CAM_ISP, - "CSID: %u split_id: %d core_idx: %u core_type: %u is_sfe_offline: %d", + "CSID: %u split_id: %d core_idx: %u core_type: %u is_sfe_offline: %d ctx_idx: %u", hw_intf->hw_idx, i, csid_top_args.core_idx, csid_top_args.input_core_type, - csid_top_args.is_sfe_offline); + csid_top_args.is_sfe_offline, ctx->ctx_index); } } } @@ -7333,7 +7420,7 @@ static int cam_ife_mgr_start_hw(void *hw_mgr_priv, void *start_hw_args) rc = cam_ife_hw_mgr_init_hw(ctx); if (rc) { - CAM_ERR(CAM_ISP, "Init failed"); + CAM_ERR(CAM_ISP, "Init failed, ctx_idx: %u", ctx->ctx_index); goto tasklet_stop; } @@ -7344,7 +7431,8 @@ static int cam_ife_mgr_start_hw(void *hw_mgr_priv, void *start_hw_args) rc = cam_ife_notify_safe_lut_scm(CAM_IFE_SAFE_ENABLE); if (rc) { CAM_ERR(CAM_ISP, - "SAFE SCM call failed:Check TZ/HYP dependency"); + "SAFE SCM call failed:Check TZ/HYP dependency, ctx_idx: %u", + ctx->ctx_index); rc = -EFAULT; goto deinit_hw; } @@ -7353,7 +7441,8 @@ static int cam_ife_mgr_start_hw(void *hw_mgr_priv, void *start_hw_args) rc = cam_cdm_stream_on(ctx->cdm_handle); if (rc) { - CAM_ERR(CAM_ISP, "Can not start cdm (%d)", ctx->cdm_handle); + CAM_ERR(CAM_ISP, "Can not start cdm (%d), ctx_idx: %u", + ctx->cdm_handle, ctx->ctx_index); goto safe_disable; } @@ -7362,16 +7451,16 @@ start_only: atomic_set(&ctx->overflow_pending, 0); /* Apply initial configuration */ - CAM_DBG(CAM_ISP, "Config HW"); + CAM_DBG(CAM_ISP, "Config HW, ctx_idx: %u", ctx->ctx_index); rc = cam_ife_mgr_config_hw(hw_mgr_priv, &start_isp->hw_config); if (rc) { CAM_ERR(CAM_ISP, - "Config HW failed, start_only=%d, rc=%d", - start_isp->start_only, rc); + "Config HW failed, start_only=%d, rc=%d ctx_idx: %u", + start_isp->start_only, rc, ctx->ctx_index); goto cdm_streamoff; } - CAM_DBG(CAM_ISP, "START IFE OUT ... in ctx id:%d", + CAM_DBG(CAM_ISP, "START IFE OUT ... in ctx id:%u", ctx->ctx_index); /* start the IFE out devices */ for (i = 0; i < max_ife_out_res; i++) { @@ -7394,8 +7483,8 @@ start_only: rc = cam_ife_hw_mgr_start_hw_res( &ctx->res_list_ife_out[i], ctx); if (rc) { - CAM_ERR(CAM_ISP, "Can not start IFE OUT (%d)", - i); + CAM_ERR(CAM_ISP, "Can not start IFE OUT (%d), ctx_idx: %u", + i, ctx->ctx_index); goto err; } } @@ -7408,7 +7497,7 @@ start_only: primary_rdi_out_res); } - CAM_DBG(CAM_ISP, "START IFE SRC ... in ctx id:%d", + CAM_DBG(CAM_ISP, "START IFE SRC ... in ctx id:%u", ctx->ctx_index); /* Start the IFE mux in devices */ list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_src, list) { @@ -7419,45 +7508,45 @@ start_only: rc = cam_ife_hw_mgr_start_hw_res(hw_mgr_res, ctx); if (rc) { - CAM_ERR(CAM_ISP, "Can not start IFE Mux (%d)", - hw_mgr_res->res_id); + CAM_ERR(CAM_ISP, "Can not start IFE Mux (%d), ctx_idx: %u", + hw_mgr_res->res_id, ctx->ctx_index); goto err; } } if (ctx->ctx_type == CAM_IFE_CTX_TYPE_SFE) { - CAM_DBG(CAM_ISP, "START SFE OUT ... in ctx id:%d", + CAM_DBG(CAM_ISP, "START SFE OUT ... in ctx id:%u", ctx->ctx_index); for (i = 0; i < max_sfe_out_res; i++) { hw_mgr_res = &ctx->res_list_sfe_out[i]; rc = cam_ife_hw_mgr_start_hw_res( &ctx->res_list_sfe_out[i], ctx); if (rc) { - CAM_ERR(CAM_ISP, "Can not start SFE OUT (%d)", - i); + CAM_ERR(CAM_ISP, "Can not start SFE OUT (%d), ctx_idx: %u", + i, ctx->ctx_index); goto err; } } - CAM_DBG(CAM_ISP, "START SFE SRC RSRC ... in ctx id:%d", + CAM_DBG(CAM_ISP, "START SFE SRC RSRC ... in ctx id:%u", ctx->ctx_index); list_for_each_entry(hw_mgr_res, &ctx->res_list_sfe_src, list) { rc = cam_ife_hw_mgr_start_hw_res(hw_mgr_res, ctx); if (rc) { - CAM_ERR(CAM_ISP, "Can not start SFE SRC (%d)", - hw_mgr_res->res_id); + CAM_ERR(CAM_ISP, "Can not start SFE SRC (%d), ctx_idx: %u", + hw_mgr_res->res_id, ctx->ctx_index); goto err; } } } - CAM_DBG(CAM_ISP, "START BUS RD ... in ctx id:%d", + CAM_DBG(CAM_ISP, "START BUS RD ... in ctx id:%u", ctx->ctx_index); list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_in_rd, list) { rc = cam_ife_hw_mgr_start_hw_res(hw_mgr_res, ctx); if (rc) { - CAM_ERR(CAM_ISP, "Can not start BUS RD (%d)", - hw_mgr_res->res_id); + CAM_ERR(CAM_ISP, "Can not start BUS RD (%d), ctx_idx: %u", + hw_mgr_res->res_id, ctx->ctx_index); goto err; } } @@ -7471,7 +7560,7 @@ start_only: cam_ife_mgr_reset_streamon_scratch_cfg(ctx); } - CAM_DBG(CAM_ISP, "START CSID HW ... in ctx id:%d", + CAM_DBG(CAM_ISP, "START CSID HW ... in ctx id:%u", ctx->ctx_index); /* Start the IFE CSID HW devices */ rc = cam_ife_mgr_csid_start_hw(ctx, primary_rdi_csid_res, @@ -7480,7 +7569,7 @@ start_only: goto err; /* Start IFE root node: do nothing */ - CAM_DBG(CAM_ISP, "Start success for ctx id:%d", ctx->ctx_index); + CAM_DBG(CAM_ISP, "Start success for ctx id:%u", ctx->ctx_index); return 0; @@ -7491,7 +7580,7 @@ err: stop_args.args = (void *)(&stop_isp); cam_ife_mgr_stop_hw(hw_mgr_priv, &stop_args); - CAM_DBG(CAM_ISP, "Exit...(rc=%d)", rc); + CAM_DBG(CAM_ISP, "Exit...(rc=%d), ctx_idx: %u", rc, ctx->ctx_index); return rc; cdm_streamoff: @@ -7537,25 +7626,25 @@ static int cam_ife_mgr_reset(void *hw_mgr_priv, void *hw_reset_args) } if (hw_mgr->csid_global_reset_en) { - CAM_DBG(CAM_ISP, "Path reset not supported"); + CAM_DBG(CAM_ISP, "Path reset not supported, ctx_idx: %u", ctx->ctx_index); return 0; } - CAM_DBG(CAM_ISP, "Reset CSID and VFE"); + CAM_DBG(CAM_ISP, "Reset CSID and VFE, ctx_idx: %u", ctx->ctx_index); rc = cam_ife_hw_mgr_reset_csid(ctx, CAM_IFE_CSID_RESET_PATH); if (rc) { - CAM_ERR(CAM_ISP, "Failed to reset CSID:%d rc: %d", - rc); + CAM_ERR(CAM_ISP, "Failed to reset CSID:%d rc: %d ctx_idx: %u", + rc, ctx->ctx_index); goto end; } for (i = 0; i < ctx->num_base; i++) { rc = cam_ife_mgr_reset_vfe_hw(hw_mgr, ctx->base[i].idx); if (rc) { - CAM_ERR(CAM_ISP, "Failed to reset VFE:%d rc: %d", - ctx->base[i].idx, rc); + CAM_ERR(CAM_ISP, "Failed to reset VFE:%d rc: %d ctx_idx: %u", + ctx->base[i].idx, rc, ctx->ctx_index); goto end; } } @@ -7585,7 +7674,7 @@ static int cam_ife_mgr_release_hw(void *hw_mgr_priv, return -EPERM; } - CAM_DBG(CAM_ISP, "Enter...ctx id:%d", + CAM_DBG(CAM_ISP, "Enter...ctx id:%u", ctx->ctx_index); if (ctx->flags.init_done) @@ -7597,7 +7686,8 @@ static int cam_ife_mgr_release_hw(void *hw_mgr_priv, if (ctx->ctx_type == CAM_IFE_CTX_TYPE_SFE) { rc = cam_ife_mgr_update_core_info_to_cpas(ctx, false); if (rc) - CAM_ERR(CAM_ISP, "Failed to update core info to cpas rc:%d", rc); + CAM_ERR(CAM_ISP, "Failed to update core info to cpas rc:%d, ctx_idx: %u", + rc, ctx->ctx_index); } /* reset base info */ @@ -7692,9 +7782,10 @@ static int cam_isp_blob_fe_update( sizeof( struct cam_fe_config)); if (rc) - CAM_ERR(CAM_ISP, "fs Update failed"); + CAM_ERR(CAM_ISP, "fs Update failed, ctx_idx: %u", + ctx->ctx_index); } else - CAM_WARN(CAM_ISP, "NULL hw_intf!"); + CAM_WARN(CAM_ISP, "NULL hw_intf! ctx_idx: %u", ctx->ctx_index); } } @@ -7721,9 +7812,10 @@ static int cam_isp_blob_fe_update( sizeof( struct cam_vfe_fe_update_args)); if (rc) - CAM_ERR(CAM_ISP, "fe Update failed"); + CAM_ERR(CAM_ISP, "fe Update failed, ctx_idx: %u", + ctx->ctx_index); } else - CAM_WARN(CAM_ISP, "NULL hw_intf!"); + CAM_WARN(CAM_ISP, "NULL hw_intf! ctx_idx: %u", ctx->ctx_index); } } return rc; @@ -7756,28 +7848,29 @@ static int cam_isp_blob_ubwc_update( if ((prepare->num_hw_update_entries + 1) >= prepare->max_hw_update_entries) { - CAM_ERR(CAM_ISP, "Insufficient HW entries :%d max:%d", + CAM_ERR(CAM_ISP, "Insufficient HW entries :%d max:%d ctx_idx: %u", prepare->num_hw_update_entries, - prepare->max_hw_update_entries); + prepare->max_hw_update_entries, ctx->ctx_index); rc = -EINVAL; goto end; } switch (ubwc_config->api_version) { case CAM_UBWC_CFG_VERSION_1: - CAM_DBG(CAM_ISP, "num_ports= %d", ubwc_config->num_ports); + CAM_DBG(CAM_ISP, "ctx_idx: %u num_ports= %d", + ctx->ctx_index, ubwc_config->num_ports); kmd_buf_info = blob_info->kmd_buf_info; for (i = 0; i < ubwc_config->num_ports; i++) { ubwc_plane_cfg = &ubwc_config->ubwc_plane_cfg[i][0]; res_id_out = ubwc_plane_cfg->port_type & 0xFF; - CAM_DBG(CAM_ISP, "UBWC config idx %d, port_type=%d", i, - ubwc_plane_cfg->port_type); + CAM_DBG(CAM_ISP, "UBWC config idx %d, port_type=%d ctx_idx: %u", i, + ubwc_plane_cfg->port_type, ctx->ctx_index); if (res_id_out >= max_ife_out_res) { - CAM_ERR(CAM_ISP, "Invalid port type:%x", - ubwc_plane_cfg->port_type); + CAM_ERR(CAM_ISP, "Invalid port type:%x, ctx_idx: %u", + ubwc_plane_cfg->port_type, ctx->ctx_index); rc = -EINVAL; goto end; } @@ -7789,9 +7882,9 @@ static int cam_isp_blob_ubwc_update( + total_used_bytes); } else { CAM_ERR(CAM_ISP, - "no free kmd memory for base=%d bytes_used=%u buf_size=%u", + "no free kmd memory for base=%d bytes_used=%u buf_size=%u ctx_idx: %u", blob_info->base_info->idx, bytes_used, - kmd_buf_info->size); + kmd_buf_info->size, ctx->ctx_index); rc = -ENOMEM; goto end; } @@ -7802,7 +7895,7 @@ static int cam_isp_blob_ubwc_update( hw_mgr_res = &ctx->res_list_ife_out[res_id_out]; if (!hw_mgr_res) { - CAM_ERR(CAM_ISP, "Invalid hw_mgr_res"); + CAM_ERR(CAM_ISP, "Invalid hw_mgr_res, ctx_idx: %u", ctx->ctx_index); rc = -EINVAL; goto end; } @@ -7828,10 +7921,10 @@ static int cam_isp_blob_ubwc_update( &bytes_used); if (rc < 0) { CAM_ERR(CAM_ISP, - "Failed cmd_update, base_idx=%d, bytes_used=%u, res_id_out=0x%X", + "Failed cmd_update, base_idx=%d, bytes_used=%u, res_id_out=0x%X ctx_idx: %u", blob_info->base_info->idx, bytes_used, - ubwc_plane_cfg->port_type); + ubwc_plane_cfg->port_type, ctx->ctx_index); goto end; } @@ -7843,8 +7936,8 @@ static int cam_isp_blob_ubwc_update( CAM_ISP_UNUSED_BL, total_used_bytes, kmd_buf_info, prepare); break; default: - CAM_ERR(CAM_ISP, "Invalid UBWC API Version %d", - ubwc_config->api_version); + CAM_ERR(CAM_ISP, "Invalid UBWC API Version %d ctx_idx: %u", + ubwc_config->api_version, ctx->ctx_index); rc = -EINVAL; break; } @@ -7928,26 +8021,26 @@ static int cam_isp_blob_ubwc_update_v2( if (prepare->num_hw_update_entries + 1 >= prepare->max_hw_update_entries) { - CAM_ERR(CAM_ISP, "Insufficient HW entries :%d max:%d", + CAM_ERR(CAM_ISP, "Insufficient HW entries :%d max:%d, ctx_idx: %u", prepare->num_hw_update_entries, - prepare->max_hw_update_entries); + prepare->max_hw_update_entries, ctx->ctx_index); rc = -EINVAL; goto end; } - CAM_DBG(CAM_ISP, "num_ports= %d", ubwc_config->num_ports); + CAM_DBG(CAM_ISP, "ctx_idx: %u num_ports= %d", ctx->ctx_index, ubwc_config->num_ports); kmd_buf_info = blob_info->kmd_buf_info; for (i = 0; i < ubwc_config->num_ports; i++) { ubwc_plane_cfg = &ubwc_config->ubwc_plane_cfg[i][0]; res_id_out = ubwc_plane_cfg->port_type & 0xFF; - CAM_DBG(CAM_ISP, "UBWC config idx %d, port_type=%d", i, - ubwc_plane_cfg->port_type); + CAM_DBG(CAM_ISP, "UBWC config idx %d, port_type=%d ctx_idx: %u", i, + ubwc_plane_cfg->port_type, ctx->ctx_index); if (res_id_out >= max_ife_out_res) { - CAM_ERR(CAM_ISP, "Invalid port type:%x", - ubwc_plane_cfg->port_type); + CAM_ERR(CAM_ISP, "Invalid port type:%x ctx_idx: %u", + ubwc_plane_cfg->port_type, ctx->ctx_index); rc = -EINVAL; goto end; } @@ -7979,9 +8072,9 @@ static int cam_isp_blob_ubwc_update_v2( + total_used_bytes); } else { CAM_ERR(CAM_ISP, - "no free kmd memory for base=%d bytes_used=%u buf_size=%u", + "no free kmd memory for base=%d bytes_used=%u buf_size=%u ctx_idx: %u", blob_info->base_info->idx, bytes_used, - kmd_buf_info->size); + kmd_buf_info->size, ctx->ctx_index); rc = -ENOMEM; goto end; } @@ -8004,10 +8097,10 @@ static int cam_isp_blob_ubwc_update_v2( &bytes_used); if (rc < 0) { CAM_ERR(CAM_ISP, - "Failed cmd_update, base_idx=%d, bytes_used=%u, res_id_out=0x%X", + "Failed cmd_update, base_idx=%d, bytes_used=%u, res_id_out=0x%X, ctx_idx: %u", blob_info->base_info->idx, bytes_used, - ubwc_plane_cfg->port_type); + ubwc_plane_cfg->port_type, ctx->ctx_index); goto end; } @@ -8093,21 +8186,22 @@ static int cam_isp_blob_ife_scratch_buf_update( res_id_out = buffer_info->resource_type & 0xFF; - CAM_DBG(CAM_ISP, "scratch config idx: %d res: 0x%x", - i, buffer_info->resource_type); + CAM_DBG(CAM_ISP, "scratch config idx: %d res: 0x%x ctx_idx: %u", + i, buffer_info->resource_type, ctx->ctx_index); ife_out_res = &ctx->res_list_ife_out[res_id_out]; if (!ife_out_res->hw_res[0]) { CAM_ERR(CAM_ISP, - "IFE rsrc_type: 0x%x not acquired, failing scratch config", - buffer_info->resource_type); + "IFE rsrc_type: 0x%x not acquired, failing scratch config, ctx_idx: %u", + buffer_info->resource_type, ctx->ctx_index); return -EINVAL; } if (ife_scratch_config->num_config >= CAM_IFE_SCRATCH_NUM_MAX) { CAM_ERR(CAM_ISP, - "Incoming num of scratch buffers: %u exceeds max: %u", - ife_scratch_config->num_config, CAM_IFE_SCRATCH_NUM_MAX); + "Incoming num of scratch buffers: %u exceeds max: %u, ctx_idx: %u", + ife_scratch_config->num_config, CAM_IFE_SCRATCH_NUM_MAX, + ctx->ctx_index); return -EINVAL; } @@ -8143,20 +8237,20 @@ static int cam_isp_blob_sfe_scratch_buf_update( res_id_out = buffer_info->resource_type & 0xFF; - CAM_DBG(CAM_ISP, "scratch config idx: %d res: 0x%x", - i, buffer_info->resource_type); + CAM_DBG(CAM_ISP, "scratch config idx: %d res: 0x%x, ctx_idx: %u", + i, buffer_info->resource_type, ctx->ctx_index); if (res_id_out >= CAM_SFE_FE_RDI_NUM_MAX) { - CAM_ERR(CAM_ISP, "invalid out res type: 0x%x", - buffer_info->resource_type); + CAM_ERR(CAM_ISP, "invalid out res type: 0x%x, ctx_idx: %u", + buffer_info->resource_type, ctx->ctx_index); return -EINVAL; } sfe_out_res = &ctx->res_list_sfe_out[res_id_out]; if (!sfe_out_res->hw_res[0]) { CAM_ERR(CAM_ISP, - "SFE rsrc_type: 0x%x not acquired, failing scratch config", - buffer_info->resource_type); + "SFE rsrc_type: 0x%x not acquired, failing scratch config, ctx_idx: %u", + buffer_info->resource_type, ctx->ctx_index); return -EINVAL; } @@ -8171,9 +8265,9 @@ static int cam_isp_blob_sfe_scratch_buf_update( if (ctx->scratch_buf_info.sfe_scratch_config->num_config != ctx->scratch_buf_info.num_fetches) { CAM_ERR(CAM_ISP, - "Mismatch in number of scratch buffers provided: %u expected: %u", + "Mismatch in number of scratch buffers provided: %u expected: %u ctx_idx: %u", ctx->scratch_buf_info.sfe_scratch_config->num_config, - ctx->scratch_buf_info.num_fetches); + ctx->scratch_buf_info.num_fetches, ctx->ctx_index); rc = -EINVAL; } @@ -8212,12 +8306,14 @@ static uint32_t cam_ife_hw_mgr_get_sfe_sys_cache_id(uint32_t exp_type, hw_mgr = ctx->hw_mgr; supported_sc_idx = hw_mgr->sfe_cache_info[hw_idx].supported_scid_idx; if (!supported_sc_idx) { - CAM_DBG(CAM_ISP, "Unsupported SCID for SFE %u exp_type %u", hw_idx, exp_type); + CAM_DBG(CAM_ISP, "Unsupported SCID for SFE %u exp_type %u ctx_idx: %u", + hw_idx, exp_type, ctx->ctx_index); goto end; } if (exp_type >= CAM_ISP_EXPOSURE_MAX) { - CAM_INFO(CAM_ISP, "Invalid Exposure Type for SFE %u exp_type %u", hw_idx, exp_type); + CAM_INFO(CAM_ISP, "Invalid Exposure Type for SFE %u exp_type %u ctx_idx: %u", + hw_idx, exp_type, ctx->ctx_index); goto end; } @@ -8254,7 +8350,8 @@ static uint32_t cam_ife_hw_mgr_get_sfe_sys_cache_id(uint32_t exp_type, scid_idx = CAM_LLCC_MAX; if (scid_idx >= CAM_LLCC_MAX) { - CAM_DBG(CAM_ISP, "Cannot find scid for SFE %u exp_type %u", hw_idx, exp_type); + CAM_DBG(CAM_ISP, "Cannot find scid for SFE %u exp_type %u ctx_idx: %u", + hw_idx, exp_type, ctx->ctx_index); } else { hw_mgr->sfe_cache_info[hw_idx].curr_idx[exp_type] = scid_idx; @@ -8264,8 +8361,8 @@ static uint32_t cam_ife_hw_mgr_get_sfe_sys_cache_id(uint32_t exp_type, hw_mgr->sfe_cache_info[hw_idx].activated[exp_type] = true; - CAM_DBG(CAM_ISP, "SFE %u Exp type %u SCID index %d use_large %d", hw_idx, exp_type, - scid_idx, use_large); + CAM_DBG(CAM_ISP, "SFE %u Exp type %u SCID index %d use_large %d ctx_idx: %u", + hw_idx, exp_type, scid_idx, use_large, ctx->ctx_index); } end: @@ -8293,12 +8390,13 @@ static int cam_isp_blob_sfe_exp_order_update( memset(ctx->flags.sys_cache_usage, false, sizeof(ctx->flags.sys_cache_usage)); if (!hw_mgr->num_caches_found) { - CAM_DBG(CAM_ISP, "No caches found during probe"); + CAM_DBG(CAM_ISP, "No caches found during probe, ctx_idx: %u", ctx->ctx_index); return 0; } if (!exp_config->num_ports) { - CAM_ERR(CAM_ISP, "Invalid number of ports: %d", exp_config->num_ports); + CAM_ERR(CAM_ISP, "Invalid number of ports: %d ctx_idx: %u", + exp_config->num_ports, ctx->ctx_index); return -EINVAL; } @@ -8314,7 +8412,8 @@ static int cam_isp_blob_sfe_exp_order_update( order_cfg->res_type); if (!rc) { CAM_ERR(CAM_ISP, - "Not a SFE fetch RDI: 0x%x", order_cfg->res_type); + "Not a SFE fetch RDI: 0x%x ctx_idx: %u", + order_cfg->res_type, ctx->ctx_index); return -EINVAL; } @@ -8359,8 +8458,9 @@ static int cam_isp_blob_sfe_exp_order_update( /* Configure cache config for WM */ res_id_out = order_cfg->res_type & 0xFF; if (res_id_out >= max_sfe_out_res) { - CAM_ERR_RATE_LIMIT(CAM_ISP, "res_id_out: %d exceeds max size: %d", - res_id_out, max_sfe_out_res); + CAM_ERR_RATE_LIMIT(CAM_ISP, + "res_id_out: %d exceeds max size: %d ctx_idx: %u", + res_id_out, max_sfe_out_res, ctx->ctx_index); return -EINVAL; } @@ -8382,8 +8482,8 @@ static int cam_isp_blob_sfe_exp_order_update( if (rc || !send_config) { CAM_ERR(CAM_ISP, - "Failed to send cache config for WR res: 0x%x base_idx: %u send_config: %d rc: %d", - order_cfg->res_type, base_idx, send_config, rc); + "Failed to send cache config for WR res: 0x%x base_idx: %u send_config: %d rc: %d ctx_idx: %u", + order_cfg->res_type, base_idx, send_config, rc, ctx->ctx_index); return -EINVAL; } @@ -8419,8 +8519,8 @@ static int cam_isp_blob_sfe_exp_order_update( if (rc || !send_config) { CAM_ERR(CAM_ISP, - "Failed to send cache config for RD res: 0x%x base_idx: %u send_config: %d rc: %d", - res_id_in, base_idx, send_config, rc); + "Failed to send cache config for RD res: 0x%x base_idx: %u send_config: %d rc: %d ctx_idx: %u", + res_id_in, base_idx, send_config, rc, ctx->ctx_index); return -EINVAL; } @@ -8431,9 +8531,9 @@ static int cam_isp_blob_sfe_exp_order_update( } CAM_DBG(CAM_ISP, - "cache %s on exp order: %u [max: %u] for out: 0x%x", + "cache %s on exp order: %u [max: %u] for out: 0x%x ctx_idx: %u", (wm_rm_cache_cfg.use_cache ? "enabled" : "not enabled"), - i, exp_order_max, order_cfg->res_type); + i, exp_order_max, order_cfg->res_type, ctx->ctx_index); } return rc; @@ -8460,8 +8560,8 @@ static int cam_isp_blob_sfe_update_fetch_core_cfg( ctx = prepare->ctxt_to_hw_map; if (prepare->num_hw_update_entries + 1 >= prepare->max_hw_update_entries) { - CAM_ERR(CAM_ISP, "Insufficient HW entries :%d", - prepare->num_hw_update_entries); + CAM_ERR(CAM_ISP, "Insufficient HW entries :%d, ctx_idx: %u", + prepare->num_hw_update_entries, ctx->ctx_index); return -EINVAL; } @@ -8474,8 +8574,8 @@ static int cam_isp_blob_sfe_update_fetch_core_cfg( total_used_bytes); } else { CAM_ERR(CAM_ISP, - "No free kmd memory for base idx: %d", - blob_info->base_info->idx); + "No free kmd memory for base idx: %d, ctx_idx: %u", + blob_info->base_info->idx, ctx->ctx_index); rc = -ENOMEM; return rc; } @@ -8512,10 +8612,10 @@ static int cam_isp_blob_sfe_update_fetch_core_cfg( total_used_bytes / 4; CAM_DBG(CAM_ISP, - "SFE:%u RM: %u res_id: 0x%x enable: %u num_exp: %u", + "SFE:%u RM: %u res_id: 0x%x enable: %u num_exp: %u ctx_idx: %u", blob_info->base_info->idx, (res_id - CAM_ISP_SFE_IN_RD_0), res_id, enable, - ctx->scratch_buf_info.sfe_scratch_config->updated_num_exp); + ctx->scratch_buf_info.sfe_scratch_config->updated_num_exp, ctx->ctx_index); rc = cam_isp_add_cmd_buf_update( hw_mgr_res->hw_res[blob_info->base_info->split_id], hw_intf, @@ -8526,10 +8626,10 @@ static int cam_isp_blob_sfe_update_fetch_core_cfg( if (rc < 0) { CAM_ERR(CAM_ISP, - "Failed to dynamically %s SFE: %u RM: %u bytes_used: %u rc: %d", + "Failed to dynamically %s SFE: %u RM: %u bytes_used: %u rc: %d ctx_idx: %u", (enable ? "enable" : "disable"), blob_info->base_info->idx, res_id, - used_bytes, rc); + used_bytes, rc, ctx->ctx_index); return rc; } @@ -8564,15 +8664,15 @@ static int cam_isp_blob_hfr_update( int rc = 0; ctx = prepare->ctxt_to_hw_map; - CAM_DBG(CAM_ISP, "num_ports= %d", - hfr_config->num_ports); + CAM_DBG(CAM_ISP, "ctx_idx: %u num_ports= %d", + ctx->ctx_index, hfr_config->num_ports); /* Max one hw entries required for hfr config update */ if (prepare->num_hw_update_entries + 1 >= prepare->max_hw_update_entries) { - CAM_ERR(CAM_ISP, "Insufficient HW entries :%d %d", + CAM_ERR(CAM_ISP, "Insufficient HW entries :%d %d ctx_idx: %u", prepare->num_hw_update_entries, - prepare->max_hw_update_entries); + prepare->max_hw_update_entries, ctx->ctx_index); return -EINVAL; } @@ -8581,12 +8681,12 @@ static int cam_isp_blob_hfr_update( port_hfr_config = &hfr_config->port_hfr_config[i]; res_id_out = port_hfr_config->resource_type & 0xFF; - CAM_DBG(CAM_ISP, "type %d hfr config idx %d, type=%d", - hw_type, i, res_id_out); + CAM_DBG(CAM_ISP, "type %d hfr config idx %d, type=%d ctx_idx: %u", + hw_type, i, res_id_out, ctx->ctx_index); if (res_id_out >= out_max) { - CAM_ERR(CAM_ISP, "invalid out restype:%x", - port_hfr_config->resource_type); + CAM_ERR(CAM_ISP, "invalid out restype:%x, ctx_idx: %u", + port_hfr_config->resource_type, ctx->ctx_index); return -EINVAL; } @@ -8613,8 +8713,8 @@ static int cam_isp_blob_hfr_update( total_used_bytes); } else { CAM_ERR(CAM_ISP, - "no free kmd memory for base %d", - blob_info->base_info->idx); + "no free kmd memory for base %d, ctx_idx: %u", + blob_info->base_info->idx, ctx->ctx_index); rc = -ENOMEM; return rc; } @@ -8633,9 +8733,9 @@ static int cam_isp_blob_hfr_update( &bytes_used); if (rc < 0) { CAM_ERR(CAM_ISP, - "Failed cmd_update, base_idx=%d, rc=%d, res_id_out=0x%X hw_type=%d", + "Failed cmd_update, base_idx=%d, rc=%d, res_id_out=0x%X hw_type=%d, ctx_idx: %u", blob_info->base_info->idx, bytes_used, - port_hfr_config->resource_type, hw_type); + port_hfr_config->resource_type, hw_type, ctx->ctx_index); return rc; } @@ -8685,8 +8785,9 @@ static int cam_isp_blob_csid_discard_init_frame_update( sizeof(struct cam_ife_csid_discard_init_frame_args)); if (rc) { CAM_ERR(CAM_ISP, - "Failed to update discard frame cfg for res: %s on CSID[%u]", - res->res_name, blob_info->base_info->idx); + "Failed to update discard frame cfg for res: %s on CSID[%u] ctx:%u", + res->res_name, blob_info->base_info->idx, + ctx->ctx_index); break; } } @@ -8714,7 +8815,7 @@ static int cam_isp_blob_csid_dynamic_switch_update( ife_hw_mgr = ctx->hw_mgr; CAM_DBG(CAM_ISP, - "csid mup value=%u", mup_config->mup); + "csid mup value=%u, ctx_idx: %u", mup_config->mup, ctx->ctx_index); prepare_hw_data = (struct cam_isp_prepare_hw_update_data *) prepare->priv; @@ -8745,7 +8846,8 @@ static int cam_isp_blob_csid_dynamic_switch_update( &csid_mup_upd_args, sizeof(struct cam_ife_csid_mode_switch_update_args)); if (rc) - CAM_ERR(CAM_ISP, "Dynamic switch update failed"); + CAM_ERR(CAM_ISP, "Dynamic switch update failed, ctx_idx: %u", + ctx->ctx_index); } } @@ -8769,7 +8871,7 @@ static int cam_isp_blob_csid_clock_update( ctx = prepare->ctxt_to_hw_map; CAM_DBG(CAM_ISP, - "csid clk=%llu", clock_config->csid_clock); + "csid clk=%llu, ctx_idx: %u", clock_config->csid_clock, ctx->ctx_index); list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_csid, list) { for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) { @@ -8790,9 +8892,10 @@ static int cam_isp_blob_csid_clock_update( sizeof( struct cam_ife_csid_clock_update_args)); if (rc) - CAM_ERR(CAM_ISP, "Clock Update failed"); + CAM_ERR(CAM_ISP, "Clock Update failed, ctx_idx: %u", + ctx->ctx_index); } else - CAM_ERR(CAM_ISP, "NULL hw_intf!"); + CAM_ERR(CAM_ISP, "NULL hw_intf! ctx_idx: %u", ctx->ctx_index); } } @@ -8815,7 +8918,7 @@ static int cam_isp_blob_csid_qcfa_update( ctx = prepare->ctxt_to_hw_map; CAM_DBG(CAM_ISP, - "csid binning=%d", qcfa_config->csid_binning); + "csid binning=%d, ctx_idx: %u", qcfa_config->csid_binning, ctx->ctx_index); list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_csid, list) { for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) { @@ -8831,8 +8934,8 @@ static int cam_isp_blob_csid_qcfa_update( csid_qcfa_upd_args.res = hw_mgr_res->hw_res[i]; - CAM_DBG(CAM_ISP, "i= %d QCFA binning=%d\n", - i, csid_qcfa_upd_args.qcfa_binning); + CAM_DBG(CAM_ISP, "i= %d QCFA binning=%d\n ctx_idx: %u", + i, csid_qcfa_upd_args.qcfa_binning, ctx->ctx_index); rc = hw_intf->hw_ops.process_cmd( hw_intf->hw_priv, @@ -8841,9 +8944,10 @@ static int cam_isp_blob_csid_qcfa_update( sizeof( struct cam_ife_csid_qcfa_update_args)); if (rc) - CAM_ERR(CAM_ISP, "QCFA Update failed"); + CAM_ERR(CAM_ISP, "QCFA Update failed, ctx_idx: %u", + ctx->ctx_index); } else - CAM_ERR(CAM_ISP, "NULL hw_intf!"); + CAM_ERR(CAM_ISP, "NULL hw_intf! ctx_idx: %u", ctx->ctx_index); } } @@ -8894,9 +8998,11 @@ static int cam_isp_blob_core_cfg_update( ); if (rc) CAM_ERR(CAM_ISP, - "Core cfg parse fail"); + "Core cfg parse fail, ctx_idx: %u", + ctx->ctx_index); } else { - CAM_WARN(CAM_ISP, "NULL hw_intf!"); + CAM_WARN(CAM_ISP, "NULL hw_intf! ctx_idx: %u", + ctx->ctx_index); } } } @@ -8940,9 +9046,10 @@ static int cam_isp_blob_sfe_core_cfg_update( sizeof(struct cam_sfe_core_config_args)); if (rc) CAM_ERR(CAM_ISP, - "SFE core cfg parse fail"); + "SFE core cfg parse fail, ctx_idx: %u", + ctx->ctx_index); } else { - CAM_WARN(CAM_ISP, "NULL hw_intf!"); + CAM_WARN(CAM_ISP, "NULL hw_intf! ctx_idx: %u", ctx->ctx_index); } } @@ -8962,8 +9069,10 @@ static int cam_isp_blob_ife_clock_update( bool camif_l_clk_updated = false; bool camif_r_clk_updated = false; - CAM_DBG(CAM_PERF, "IFE clk update usage=%u left_clk= %lu right_clk=%lu", - clock_config->usage_type, clock_config->left_pix_hz, clock_config->right_pix_hz); + CAM_DBG(CAM_PERF, + "IFE clk update usage=%u left_clk= %lu right_clk=%lu ctx_idx: %u", + clock_config->usage_type, clock_config->left_pix_hz, + clock_config->right_pix_hz, ctx->ctx_index); list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_src, list) { for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) { @@ -8998,8 +9107,8 @@ static int cam_isp_blob_ife_clock_update( } else { if (hw_mgr_res->res_id != CAM_ISP_HW_VFE_IN_LCR && hw_mgr_res->hw_res[i]) { - CAM_ERR(CAM_ISP, "Invalid res_id %u", - hw_mgr_res->res_id); + CAM_ERR(CAM_ISP, "Invalid res_id %u, ctx_idx: %u", + hw_mgr_res->res_id, ctx->ctx_index); rc = -EINVAL; return rc; } @@ -9009,8 +9118,8 @@ static int cam_isp_blob_ife_clock_update( if (hw_intf && hw_intf->hw_ops.process_cmd) { clock_upd_args.node_res = hw_mgr_res->hw_res[i]; CAM_DBG(CAM_PERF, - "Update Clock value res_id=%u i= %d clk=%llu", - hw_mgr_res->res_id, i, clk_rate); + "Update Clock value res_id=%u i= %d clk=%llu ctx_idx: %u", + hw_mgr_res->res_id, i, clk_rate, ctx->ctx_index); clock_upd_args.clk_rate = clk_rate; @@ -9026,12 +9135,12 @@ static int cam_isp_blob_ife_clock_update( struct cam_vfe_clock_update_args)); if (rc) { CAM_ERR(CAM_PERF, - "IFE:%d Clock Update failed clk_rate:%llu rc:%d", - hw_intf->hw_idx, clk_rate, rc); + "IFE:%d Clock Update failed clk_rate:%llu rc:%d ctx_idx: %u", + hw_intf->hw_idx, clk_rate, rc, ctx->ctx_index); goto end; } } else - CAM_WARN(CAM_ISP, "NULL hw_intf!"); + CAM_WARN(CAM_ISP, "NULL hw_intf! ctx_idx: %u", ctx->ctx_index); } } @@ -9055,8 +9164,9 @@ static int cam_isp_blob_sfe_clock_update( CAM_DBG(CAM_PERF, - "SFE clk update usage: %u left_clk: %lu right_clk: %lu", - clock_config->usage_type, clock_config->left_pix_hz, clock_config->right_pix_hz); + "SFE clk update usage: %u left_clk: %lu right_clk: %lu ctx_idx: %u", + clock_config->usage_type, clock_config->left_pix_hz, clock_config->right_pix_hz, + ctx->ctx_index); list_for_each_entry(hw_mgr_res, &ctx->res_list_sfe_src, list) { for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) { @@ -9091,8 +9201,8 @@ static int cam_isp_blob_sfe_clock_update( clock_upd_args.node_res = hw_mgr_res->hw_res[i]; CAM_DBG(CAM_PERF, - "SFE res_id: %u i: %d clk: %llu", - hw_mgr_res->res_id, i, clk_rate); + "SFE res_id: %u i: %d clk: %llu ctx_idx: %u", + hw_mgr_res->res_id, i, clk_rate, ctx->ctx_index); clock_upd_args.clk_rate = clk_rate; /* @@ -9107,9 +9217,10 @@ static int cam_isp_blob_sfe_clock_update( struct cam_sfe_clock_update_args)); if (rc) CAM_ERR(CAM_PERF, - "SFE clock update failed"); + "SFE clock update failed, ctx_idx: %u", + ctx->ctx_index); } else - CAM_WARN(CAM_ISP, "NULL hw_intf!"); + CAM_WARN(CAM_ISP, "NULL hw_intf! ctx_idx: %u", ctx->ctx_index); } } @@ -9141,13 +9252,13 @@ static int cam_isp_blob_sfe_rd_update( if (!found) { CAM_ERR(CAM_ISP, - "Failed to find SFE rd resource: %u, check if rsrc is acquired", - wm_config->port_type); + "Failed to find SFE rd resource: %u, check if rsrc is acquired, ctx_idx: %u", + wm_config->port_type, ctx->ctx_index); return -EINVAL; } - CAM_DBG(CAM_ISP, "SFE RM config for port: 0x%x", - wm_config->port_type); + CAM_DBG(CAM_ISP, "SFE RM config for port: 0x%x, ctx_idx: %u", + wm_config->port_type, ctx->ctx_index); hw_intf = cam_ife_hw_mgr_get_hw_intf(blob_info->base_info); if (!hw_intf || blob_info->base_info->split_id >= CAM_ISP_HW_SPLIT_MAX) { @@ -9170,9 +9281,9 @@ static int cam_isp_blob_sfe_rd_update( &bytes_used); if (rc < 0) { CAM_ERR(CAM_ISP, - "Failed to update SFE RM config out_type:0x%X base_idx:%d bytes_used:%u rc:%d", + "Failed to update SFE RM config out_type:0x%X base_idx:%d bytes_used:%u rc:%d ctx_idx: %u", wm_config->port_type, blob_info->base_info->idx, - bytes_used, rc); + bytes_used, rc, ctx->ctx_index); return rc; } @@ -9194,23 +9305,23 @@ static int cam_ife_hw_mgr_update_scratch_offset( res_id = wm_config->port_type & 0xFF; if (res_id >= CAM_SFE_FE_RDI_NUM_MAX) { - CAM_ERR_RATE_LIMIT(CAM_ISP, "res_id: %d exceeds max size: %d", - res_id, CAM_SFE_FE_RDI_NUM_MAX); + CAM_ERR_RATE_LIMIT(CAM_ISP, "res_id: %d exceeds max size: %d ctx_idx: %u", + res_id, CAM_SFE_FE_RDI_NUM_MAX, ctx->ctx_index); return -EINVAL; } if (!ctx->scratch_buf_info.sfe_scratch_config->buf_info[res_id].config_done) { CAM_ERR(CAM_ISP, - "Scratch buffer not configured on ctx: %u for res: %u", - ctx->ctx_index, res_id); + "Scratch buffer not configured on ctx: %u for res: %u ctx_idx: %u", + ctx->ctx_index, res_id, ctx->ctx_index); return -EINVAL; } port_info = &ctx->scratch_buf_info.sfe_scratch_config->buf_info[res_id]; port_info->offset = wm_config->offset; - CAM_DBG(CAM_ISP, "Scratch addr: 0x%x offset: %u updated for: 0x%x", - port_info->io_addr, port_info->offset, wm_config->port_type); + CAM_DBG(CAM_ISP, "Scratch addr: 0x%x offset: %u updated for: 0x%x ctx_idx: %u", + port_info->io_addr, port_info->offset, wm_config->port_type, ctx->ctx_index); return 0; } @@ -9240,8 +9351,8 @@ static int cam_isp_blob_vfe_out_update( if (prepare->num_hw_update_entries + 1 >= prepare->max_hw_update_entries) { - CAM_ERR(CAM_ISP, "Insufficient HW entries :%d", - prepare->num_hw_update_entries); + CAM_ERR(CAM_ISP, "Insufficient HW entries :%d, ctx_idx: %u", + prepare->num_hw_update_entries, ctx->ctx_index); return -EINVAL; } @@ -9266,8 +9377,8 @@ static int cam_isp_blob_vfe_out_update( total_used_bytes); } else { CAM_ERR(CAM_ISP, - "No free kmd memory for base idx: %d", - blob_info->base_info->idx); + "No free kmd memory for base idx: %d, ctx_idx: %u", + blob_info->base_info->idx, ctx->ctx_index); rc = -ENOMEM; return rc; } @@ -9289,13 +9400,13 @@ static int cam_isp_blob_vfe_out_update( res_id_out = wm_config->port_type & 0xFF; - CAM_DBG(CAM_ISP, "%s out config idx: %d port: 0x%x", + CAM_DBG(CAM_ISP, "%s out config idx: %d port: 0x%x, ctx_idx: %u", (hw_type == CAM_ISP_HW_TYPE_SFE ? "SFE" : "VFE"), - i, wm_config->port_type); + i, wm_config->port_type, ctx->ctx_index); if (res_id_out >= size_isp_out) { - CAM_ERR(CAM_ISP, "Invalid out port:0x%x", - wm_config->port_type); + CAM_ERR(CAM_ISP, "Invalid out port:0x%x, ctx_idx: %u", + wm_config->port_type, ctx->ctx_index); return -EINVAL; } @@ -9334,11 +9445,11 @@ static int cam_isp_blob_vfe_out_update( &bytes_used); if (rc < 0) { CAM_ERR(CAM_ISP, - "Failed to update %s Out out_type:0x%X base_idx:%d bytes_used:%u rc:%d", + "Failed to update %s Out out_type:0x%X base_idx:%d bytes_used:%u rc:%d ctx_idx: %u", ((hw_type == CAM_ISP_HW_TYPE_SFE) ? "SFE" : "VFE"), wm_config->port_type, blob_info->base_info->idx, - bytes_used, rc); + bytes_used, rc, ctx->ctx_index); return rc; } @@ -9367,7 +9478,7 @@ static int cam_isp_blob_sensor_blanking_config( ctx = prepare->ctxt_to_hw_map; if (list_empty(&ctx->res_list_ife_src)) { - CAM_ERR(CAM_ISP, "Mux List empty"); + CAM_ERR(CAM_ISP, "Mux List empty, ctx_idx: %u", ctx->ctx_index); return -ENODEV; } @@ -9391,7 +9502,7 @@ static int cam_isp_blob_sensor_blanking_config( struct cam_isp_blanking_config)); if (rc) CAM_ERR(CAM_ISP, - "blanking update failed"); + "blanking update failed, ctx_idx: %u", ctx->ctx_index); } } } @@ -9422,9 +9533,9 @@ static int cam_isp_blob_bw_limit_update( if ((prepare->num_hw_update_entries + 1) >= prepare->max_hw_update_entries) { - CAM_ERR(CAM_ISP, "Insufficient HW entries: %d max: %d", + CAM_ERR(CAM_ISP, "Insufficient HW entries: %d max: %d ctx_idx: %u", prepare->num_hw_update_entries, - prepare->max_hw_update_entries); + prepare->max_hw_update_entries, ctx->ctx_index); return -EINVAL; } @@ -9447,12 +9558,13 @@ static int cam_isp_blob_bw_limit_update( (CAM_ISP_IFE_OUT_RES_BASE + max_ife_out_res)))) continue; - CAM_DBG(CAM_ISP, "%s BW limit config idx: %d port: 0x%x enable: %d [0x%x:0x%x]", + CAM_DBG(CAM_ISP, + "%s BW limit config idx: %d port: 0x%x enable: %d [0x%x:0x%x] ctx: %u", (hw_type == CAM_ISP_HW_TYPE_SFE ? "SFE" : "VFE"), i, wm_bw_limit_cfg->res_type, wm_bw_limit_cfg->enable_limiter, wm_bw_limit_cfg->counter_limit[0], - wm_bw_limit_cfg->counter_limit[1]); + wm_bw_limit_cfg->counter_limit[1], ctx->ctx_index); if ((kmd_buf_info->used_bytes + total_used_bytes) < kmd_buf_info->size) { @@ -9461,8 +9573,8 @@ static int cam_isp_blob_bw_limit_update( total_used_bytes); } else { CAM_ERR(CAM_ISP, - "No free kmd memory for base idx: %d", - blob_info->base_info->idx); + "No free kmd memory for base idx: %d, ctx_idx: %u", + blob_info->base_info->idx, ctx->ctx_index); rc = -ENOMEM; return rc; } @@ -9497,14 +9609,14 @@ static int cam_isp_blob_bw_limit_update( &bytes_used); if (rc < 0) { CAM_ERR(CAM_ISP, - "Failed to update %s BW limiter config for res:0x%x enable:%d [0x%x:0x%x] base_idx:%d bytes_used:%u rc:%d", + "Failed to update %s BW limiter config for res:0x%x enable:%d [0x%x:0x%x] base_idx:%d bytes_used:%u rc:%d ctx_idx: %u", ((hw_type == CAM_ISP_HW_TYPE_SFE) ? "SFE" : "VFE"), wm_bw_limit_cfg->res_type, wm_bw_limit_cfg->enable_limiter, wm_bw_limit_cfg->counter_limit[0], wm_bw_limit_cfg->counter_limit[1], - blob_info->base_info->idx, bytes_used, rc); + blob_info->base_info->idx, bytes_used, rc, ctx->ctx_index); return rc; } @@ -9591,13 +9703,15 @@ static int cam_isp_update_ife_pdaf_cfg( */ csid_path_id = cam_ife_hw_mgr_get_ife_csid_rdi_res_type(isp_lcr_cfg->rdi_lcr_cfg->res_id); if (csid_path_id == CAM_IFE_PIX_PATH_RES_MAX) { - CAM_ERR(CAM_ISP, "Invalid res_id %u", isp_lcr_cfg->rdi_lcr_cfg->res_id); + CAM_ERR(CAM_ISP, "Invalid res_id %u, ctx_idx: %u", + isp_lcr_cfg->rdi_lcr_cfg->res_id, ctx->ctx_index); return -EINVAL; } ife_res_id = cam_convert_csid_rdi_res_to_ife_src(csid_path_id); if (ife_res_id == CAM_ISP_HW_VFE_IN_MAX) { - CAM_ERR(CAM_ISP, "Invalid res_id %u", isp_lcr_cfg->rdi_lcr_cfg->res_id); + CAM_ERR(CAM_ISP, "Invalid res_id %u, ctx_idx: %u", + isp_lcr_cfg->rdi_lcr_cfg->res_id, ctx->ctx_index); return -EINVAL; } @@ -9628,7 +9742,7 @@ static int cam_isp_update_ife_pdaf_cfg( CAM_ISP_HW_CMD_RDI_LCR_CFG, blob_type); if (rc) CAM_ERR(CAM_ISP, - "Ctx %d res: %u lcr %u id %u ctx_type %u rc %u", + "Ctx %u res: %u lcr %u id %u ctx_type %u rc %u", ctx->ctx_index, ife_res_id, isp_lcr_cfg->rdi_lcr_cfg->res_id, blob_info->base_info->idx, ctx->ctx_type, rc); @@ -9656,7 +9770,7 @@ static int cam_isp_config_rdi_lcr_csid_init_params( csid_res_id = cam_ife_hw_mgr_get_ife_csid_rdi_res_type( rdi_lcr_cfg->res_id); CAM_DBG(CAM_ISP, - "Ctx: %d csid_res_id: %u rdi_lcr: %u sfe_shdr %u ctx_ctype %u", ctx->ctx_index, + "Ctx: %u csid_res_id: %u rdi_lcr: %u sfe_shdr %u ctx_ctype %u", ctx->ctx_index, csid_res_id, rdi_lcr_cfg->res_id, ctx->flags.is_sfe_shdr, ctx->ctx_type); list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_csid, list) { @@ -9679,7 +9793,7 @@ static int cam_isp_config_rdi_lcr_csid_init_params( acquired_res_id_mask |= BIT(res->res_id); if (rc) { CAM_ERR(CAM_ISP, - "Ctx: %d csid_res_id: %u rdi_lcr: %u sfe_shdr %u ctx_ctype %u", + "Ctx: %u csid_res_id: %u rdi_lcr: %u sfe_shdr %u ctx_ctype %u", ctx->ctx_index, csid_res_id, rdi_lcr_cfg->res_id, ctx->flags.is_sfe_shdr, ctx->ctx_type); break; @@ -9688,7 +9802,7 @@ static int cam_isp_config_rdi_lcr_csid_init_params( if (!(acquired_res_id_mask & BIT(csid_res_id))) { CAM_ERR(CAM_ISP, - "Ctx: %d Unacquired csid_res_id: %u rdi_lcr: %u sfe_shdr %u ctx_ctype %u", + "Ctx: %u Unacquired csid_res_id: %u rdi_lcr: %u sfe_shdr %u ctx_ctype %u", ctx->ctx_index, csid_res_id, rdi_lcr_cfg->res_id, ctx->flags.is_sfe_shdr, ctx->ctx_type); rc = -EINVAL; @@ -9709,17 +9823,17 @@ static int cam_isp_blob_ife_rdi_lcr_config( prepare_hw_data = (struct cam_isp_prepare_hw_update_data *)prepare->priv; CAM_DBG(CAM_ISP, - "Blob opcode %u res %u ctx_type %u shdr %u rdi_lcr %u", + "Blob opcode %u res %u ctx_type %u shdr %u rdi_lcr %u ctx_idx: %u", prepare_hw_data->packet_opcode_type, rdi_lcr_cfg->res_id, ctx->ctx_type, - ctx->flags.is_sfe_shdr, ctx->flags.rdi_lcr_en); + ctx->flags.is_sfe_shdr, ctx->flags.rdi_lcr_en, ctx->ctx_index); if (prepare_hw_data->packet_opcode_type == CAM_ISP_PACKET_INIT_DEV) { rc = cam_isp_config_rdi_lcr_csid_init_params(ctx, prepare, blob_info, rdi_lcr_cfg, blob_type); if (rc) { CAM_ERR(CAM_ISP, - "CSID param failed Ctx: %d rdi_lcr: %u ctx_type: %u", - ctx->ctx_index, rdi_lcr_cfg->res_id, ctx->ctx_type); + "CSID param failed Ctx: %d rdi_lcr: %u ctx_type: %u ctx_idx: %u", + ctx->ctx_index, rdi_lcr_cfg->res_id, ctx->ctx_type, ctx->ctx_index); return rc; } @@ -9731,9 +9845,9 @@ static int cam_isp_blob_ife_rdi_lcr_config( * as the RDI input would remain same for the session. */ CAM_ERR(CAM_ISP, - "Unexpected Blob opcode %u res %u ctx_type %u shdr %u rdi_lcr %u", + "Unexpected Blob opcode %u res %u ctx_type %u shdr %u rdi_lcr %u ctx_idx: %u", prepare_hw_data->packet_opcode_type, rdi_lcr_cfg->res_id, ctx->ctx_type, - ctx->flags.is_sfe_shdr, ctx->flags.rdi_lcr_en); + ctx->flags.is_sfe_shdr, ctx->flags.rdi_lcr_en, ctx->ctx_index); return rc; } @@ -9742,9 +9856,9 @@ static int cam_isp_blob_ife_rdi_lcr_config( &isp_cfg_args, blob_type); if (rc) { CAM_ERR(CAM_ISP, - "IFE param failed %u res %u ctx_type %u shdr %u rdi_lcr %u", + "IFE param failed %u res %u ctx_type %u shdr %u rdi_lcr %u ctx_idx: %u", prepare_hw_data->packet_opcode_type, rdi_lcr_cfg->res_id, ctx->ctx_type, - ctx->flags.is_sfe_shdr, ctx->flags.rdi_lcr_en); + ctx->flags.is_sfe_shdr, ctx->flags.rdi_lcr_en, ctx->ctx_index); return rc; } @@ -9813,8 +9927,8 @@ static int cam_isp_blob_csid_init_config_update( if (hw_intf && hw_intf->hw_ops.process_cmd) { init_cfg_update.node_res = hw_mgr_res->hw_res[i]; - CAM_DBG(CAM_ISP, "Init config update for res_id: %u", - hw_mgr_res->res_id); + CAM_DBG(CAM_ISP, "Init config update for res_id: %u, ctx_idx: %u", + hw_mgr_res->res_id, ctx->ctx_index); rc = hw_intf->hw_ops.process_cmd( hw_intf->hw_priv, @@ -9823,7 +9937,9 @@ static int cam_isp_blob_csid_init_config_update( sizeof( struct cam_isp_hw_init_config_update)); if (rc) - CAM_ERR(CAM_ISP, "Init cfg update failed rc: %d", rc); + CAM_ERR(CAM_ISP, + "Init cfg update failed rc: %d, ctx_idx: %u", + rc, ctx->ctx_index); } } } @@ -9856,8 +9972,8 @@ static int cam_isp_blob_ife_init_config_update( if (hw_intf && hw_intf->hw_ops.process_cmd) { init_cfg_update.node_res = hw_mgr_res->hw_res[i]; - CAM_DBG(CAM_ISP, "Init config update for res_id: %u", - hw_mgr_res->res_id); + CAM_DBG(CAM_ISP, "Init config update for res_id: %u ctx_idx: %u", + hw_mgr_res->res_id, ctx->ctx_index); rc = hw_intf->hw_ops.process_cmd( hw_intf->hw_priv, @@ -9866,7 +9982,8 @@ static int cam_isp_blob_ife_init_config_update( sizeof( struct cam_isp_hw_init_config_update)); if (rc) - CAM_ERR(CAM_ISP, "Init cfg update failed rc: %d", rc); + CAM_ERR(CAM_ISP, "Init cfg update failed rc: %d ctx: %u", + rc, ctx->ctx_index); } } } @@ -9882,14 +9999,15 @@ static int cam_isp_validate_scratch_buffer_blob( if (!(ife_mgr_ctx->flags.is_sfe_fs || ife_mgr_ctx->flags.is_sfe_shdr)) { CAM_ERR(CAM_ISP, - "Not SFE sHDR/FS context: %u scratch buf blob not supported", - ife_mgr_ctx->ctx_index); + "Not SFE sHDR/FS context: %u scratch buf blob not supported, ctx_idx: %u", + ife_mgr_ctx->ctx_index, ife_mgr_ctx->ctx_index); return -EINVAL; } if (blob_size < sizeof(struct cam_isp_sfe_init_scratch_buf_config)) { - CAM_ERR(CAM_ISP, "Invalid blob size %u", blob_size); + CAM_ERR(CAM_ISP, "Invalid blob size %u, ctx_idx: %u", + blob_size, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -9897,8 +10015,8 @@ static int cam_isp_validate_scratch_buffer_blob( (CAM_SFE_FE_RDI_NUM_MAX + CAM_IFE_SCRATCH_NUM_MAX)) || (scratch_config->num_ports == 0)) { CAM_ERR(CAM_ISP, - "Invalid num_ports %u in scratch buf config", - scratch_config->num_ports); + "Invalid num_ports %u in scratch buf config, ctx_idx: %u", + scratch_config->num_ports, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -9909,9 +10027,10 @@ static int cam_isp_validate_scratch_buffer_blob( sizeof(struct cam_isp_sfe_init_scratch_buf_config)) / (scratch_config->num_ports - 1))) { CAM_ERR(CAM_ISP, - "Max size exceeded in scratch config num_ports: %u size per port: %lu", + "Max size exceeded in scratch config num_ports: %u size per port: %lu ctx: %u", scratch_config->num_ports, - sizeof(struct cam_isp_sfe_scratch_buf_info)); + sizeof(struct cam_isp_sfe_scratch_buf_info), + ife_mgr_ctx->ctx_index); return -EINVAL; } } @@ -9920,11 +10039,11 @@ static int cam_isp_validate_scratch_buffer_blob( (sizeof(struct cam_isp_sfe_init_scratch_buf_config) + (scratch_config->num_ports - 1) * sizeof(struct cam_isp_sfe_scratch_buf_info))) { - CAM_ERR(CAM_ISP, "Invalid blob size: %u expected: %lu", + CAM_ERR(CAM_ISP, "Invalid blob size: %u expected: %lu ctx_idx: %u", blob_size, sizeof(struct cam_isp_sfe_init_scratch_buf_config) + (scratch_config->num_ports - 1) * - sizeof(struct cam_isp_sfe_scratch_buf_info)); + sizeof(struct cam_isp_sfe_scratch_buf_info), ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -9953,7 +10072,7 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, } ife_mgr_ctx = prepare->ctxt_to_hw_map; - CAM_DBG(CAM_ISP, "Context[%pK][%d] blob_type=%d, blob_size=%d", + CAM_DBG(CAM_ISP, "Context[%pK][%u] blob_type=%d, blob_size=%d", ife_mgr_ctx, ife_mgr_ctx->ctx_index, blob_type, blob_size); switch (blob_type) { @@ -9961,7 +10080,8 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, struct cam_isp_resource_hfr_config *hfr_config; if (blob_size < sizeof(struct cam_isp_resource_hfr_config)) { - CAM_ERR(CAM_ISP, "Invalid blob size %u", blob_size); + CAM_ERR(CAM_ISP, "Invalid blob size %u, ctx_idx: %u", + blob_size, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -9969,8 +10089,8 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, if (hfr_config->num_ports > g_ife_hw_mgr.isp_caps.max_vfe_out_res_type || hfr_config->num_ports == 0) { - CAM_ERR(CAM_ISP, "Invalid num_ports %u in HFR config", - hfr_config->num_ports); + CAM_ERR(CAM_ISP, "Invalid num_ports %u in HFR config, ctx_idx: %u", + hfr_config->num_ports, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -9981,9 +10101,10 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, sizeof(struct cam_isp_resource_hfr_config)) / (hfr_config->num_ports - 1))) { CAM_ERR(CAM_ISP, - "Max size exceeded in hfr config num_ports:%u size per port:%lu", + "Max size exceeded in hfr config num_ports:%u size per port:%lu ctx_idx: %u", hfr_config->num_ports, - sizeof(struct cam_isp_port_hfr_config)); + sizeof(struct cam_isp_port_hfr_config), + ife_mgr_ctx->ctx_index); return -EINVAL; } } @@ -9991,11 +10112,12 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, if (blob_size < (sizeof(struct cam_isp_resource_hfr_config) + (hfr_config->num_ports - 1) * sizeof(struct cam_isp_port_hfr_config))) { - CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu", + CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu ctx_idx: %u", blob_size, sizeof(struct cam_isp_resource_hfr_config) + (hfr_config->num_ports - 1) * - sizeof(struct cam_isp_port_hfr_config)); + sizeof(struct cam_isp_port_hfr_config), + ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10003,7 +10125,7 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, hfr_config, prepare, max_ife_out_res, CAM_ISP_HW_TYPE_VFE); if (rc) - CAM_ERR(CAM_ISP, "HFR Update Failed"); + CAM_ERR(CAM_ISP, "HFR Update Failed, ctx_idx: %u", ife_mgr_ctx->ctx_index); } break; case CAM_ISP_GENERIC_BLOB_TYPE_CLOCK_CONFIG: { @@ -10012,15 +10134,16 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, struct cam_isp_prepare_hw_update_data *prepare_hw_data; if (blob_size < sizeof(struct cam_isp_clock_config)) { - CAM_ERR(CAM_ISP, "Invalid blob size %u", blob_size); + CAM_ERR(CAM_ISP, "Invalid blob size %u, ctx_idx: %u", + blob_size, ife_mgr_ctx->ctx_index); return -EINVAL; } clock_config = (struct cam_isp_clock_config *)blob_data; if (clock_config->num_rdi > CAM_IFE_RDI_NUM_MAX) { - CAM_ERR(CAM_ISP, "Invalid num_rdi %u in clock config", - clock_config->num_rdi); + CAM_ERR(CAM_ISP, "Invalid num_rdi %u in clock config, ctx_idx: %u", + clock_config->num_rdi, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10030,9 +10153,9 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, sizeof(struct cam_isp_clock_config)) / (clock_config->num_rdi - 1))) { CAM_ERR(CAM_ISP, - "Max size exceeded in clock config num_rdi:%u size per port:%lu", + "Max size exceeded in clock config num_rdi:%u size per port:%lu ctx_idx: %u", clock_config->num_rdi, - sizeof(uint64_t)); + sizeof(uint64_t), ife_mgr_ctx->ctx_index); return -EINVAL; } } @@ -10040,10 +10163,10 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, if ((clock_config->num_rdi != 0) && (blob_size < (sizeof(struct cam_isp_clock_config) + sizeof(uint64_t) * (clock_config->num_rdi - 1)))) { - CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu", + CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu ctx_idx: %u", blob_size, sizeof(uint32_t) * 2 + sizeof(uint64_t) * - (clock_config->num_rdi + 2)); + (clock_config->num_rdi + 2), ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10064,15 +10187,16 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, CAM_WARN_RATE_LIMIT_CUSTOM(CAM_PERF, 300, 1, "Deprecated Blob TYPE_BW_CONFIG"); if (blob_size < sizeof(struct cam_isp_bw_config)) { - CAM_ERR(CAM_ISP, "Invalid blob size %u", blob_size); + CAM_ERR(CAM_ISP, "Invalid blob size %u, ctx_idx: %u", + blob_size, ife_mgr_ctx->ctx_index); return -EINVAL; } bw_config = (struct cam_isp_bw_config *)blob_data; if (bw_config->num_rdi > CAM_IFE_RDI_NUM_MAX) { - CAM_ERR(CAM_ISP, "Invalid num_rdi %u in bw config", - bw_config->num_rdi); + CAM_ERR(CAM_ISP, "Invalid num_rdi %u in bw config, ctx_idx: %u", + bw_config->num_rdi, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10082,9 +10206,9 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, sizeof(struct cam_isp_bw_config)) / (bw_config->num_rdi - 1))) { CAM_ERR(CAM_ISP, - "Max size exceeded in bw config num_rdi:%u size per port:%lu", + "Max size exceeded in bw config num_rdi:%u size per port:%lu ctx_idx: %u", bw_config->num_rdi, - sizeof(struct cam_isp_bw_vote)); + sizeof(struct cam_isp_bw_vote), ife_mgr_ctx->ctx_index); return -EINVAL; } } @@ -10093,17 +10217,17 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, (sizeof(struct cam_isp_bw_config) + (bw_config->num_rdi - 1) * sizeof(struct cam_isp_bw_vote)))) { - CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu", + CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu ctx_idx: %u", blob_size, sizeof(struct cam_isp_bw_config) + (bw_config->num_rdi - 1) * - sizeof(struct cam_isp_bw_vote)); + sizeof(struct cam_isp_bw_vote), ife_mgr_ctx->ctx_index); return -EINVAL; } if (!prepare || !prepare->priv || (bw_config->usage_type >= CAM_ISP_HW_USAGE_TYPE_MAX)) { - CAM_ERR(CAM_ISP, "Invalid inputs usage type %d", - bw_config->usage_type); + CAM_ERR(CAM_ISP, "Invalid inputs usage type %d, ctx_idx: %u", + bw_config->usage_type, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10122,7 +10246,8 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, struct cam_cpas_axi_per_path_bw_vote *path_vote; if (blob_size < sizeof(struct cam_isp_bw_config_v2)) { - CAM_ERR(CAM_ISP, "Invalid blob size %u", blob_size); + CAM_ERR(CAM_ISP, "Invalid blob size %u ctx_idx: %u", blob_size, + ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10130,8 +10255,8 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, if (bw_config->num_paths > CAM_ISP_MAX_PER_PATH_VOTES || !bw_config->num_paths) { - CAM_ERR(CAM_ISP, "Invalid num paths %d", - bw_config->num_paths); + CAM_ERR(CAM_ISP, "Invalid num paths %d ctx_idx: %u", + bw_config->num_paths, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10142,10 +10267,10 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, sizeof(struct cam_isp_bw_config_v2)) / (bw_config->num_paths - 1))) { CAM_ERR(CAM_ISP, - "Size exceeds limit paths:%u size per path:%lu", + "Size exceeds limit paths:%u size per path:%lu ctx_idx: %u", bw_config->num_paths - 1, sizeof( - struct cam_axi_per_path_bw_vote)); + struct cam_axi_per_path_bw_vote), ife_mgr_ctx->ctx_index); return -EINVAL; } } @@ -10155,17 +10280,17 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, (bw_config->num_paths - 1) * sizeof(struct cam_axi_per_path_bw_vote)))) { CAM_ERR(CAM_ISP, - "Invalid blob size: %u, num_paths: %u, bw_config size: %lu, per_path_vote size: %lu", + "Invalid blob size: %u, num_paths: %u, bw_config size: %lu, per_path_vote size: %lu, ctx_idx: %u", blob_size, bw_config->num_paths, sizeof(struct cam_isp_bw_config_v2), - sizeof(struct cam_axi_per_path_bw_vote)); + sizeof(struct cam_axi_per_path_bw_vote), ife_mgr_ctx->ctx_index); return -EINVAL; } if (!prepare || !prepare->priv || (bw_config->usage_type >= CAM_ISP_HW_USAGE_TYPE_MAX)) { - CAM_ERR(CAM_ISP, "Invalid inputs usage type %d", - bw_config->usage_type); + CAM_ERR(CAM_ISP, "Invalid inputs usage type %d ctx_idx: %u", + bw_config->usage_type, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10195,14 +10320,16 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, struct cam_cpas_axi_per_path_bw_vote *path_vote; if (blob_size < sizeof(struct cam_isp_bw_config_v3)) { - CAM_ERR(CAM_ISP, "Invalid blob size %u", blob_size); + CAM_ERR(CAM_ISP, "Invalid blob size %u ctx_idx: %u", blob_size, + ife_mgr_ctx->ctx_index); return -EINVAL; } bw_config = (struct cam_isp_bw_config_v3 *)blob_data; if (bw_config->num_paths > CAM_ISP_MAX_PER_PATH_VOTES || !bw_config->num_paths) { - CAM_ERR(CAM_ISP, "Invalid num paths %d", bw_config->num_paths); + CAM_ERR(CAM_ISP, "Invalid num paths %d, ctx_idx: %u", + bw_config->num_paths, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10212,9 +10339,10 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, sizeof(struct cam_isp_bw_config_v3)) / (bw_config->num_paths - 1))) { CAM_ERR(CAM_ISP, - "Size exceeds limit paths:%u size per path:%lu", + "Size exceeds limit paths:%u size per path:%lu ctx_idx: %u", bw_config->num_paths - 1, - sizeof(struct cam_axi_per_path_bw_vote_v2)); + sizeof(struct cam_axi_per_path_bw_vote_v2), + ife_mgr_ctx->ctx_index); return -EINVAL; } } @@ -10224,17 +10352,17 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, (bw_config->num_paths - 1) * sizeof(struct cam_axi_per_path_bw_vote_v2)))) { CAM_ERR(CAM_ISP, - "Invalid blob size: %u, num_paths: %u, bw_config size: %lu, per_path_vote size: %lu", + "Invalid blob size: %u, num_paths: %u, bw_config size: %lu, per_path_vote size: %lu ctx_idx: %u", blob_size, bw_config->num_paths, sizeof(struct cam_isp_bw_config_v3), - sizeof(struct cam_axi_per_path_bw_vote_v2)); + sizeof(struct cam_axi_per_path_bw_vote_v2), ife_mgr_ctx->ctx_index); return -EINVAL; } if (!prepare || !prepare->priv || (bw_config->usage_type >= CAM_ISP_HW_USAGE_TYPE_MAX)) { - CAM_ERR(CAM_ISP, "Invalid inputs usage type %d", - bw_config->usage_type); + CAM_ERR(CAM_ISP, "Invalid inputs usage type %d, ctx_idx: %u", + bw_config->usage_type, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10263,7 +10391,8 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, struct cam_ubwc_config *ubwc_config; if (blob_size < sizeof(struct cam_ubwc_config)) { - CAM_ERR(CAM_ISP, "Invalid blob_size %u", blob_size); + CAM_ERR(CAM_ISP, "Invalid blob_size %u ctx_idx: %u", + blob_size, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10271,8 +10400,8 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, if (ubwc_config->num_ports > CAM_VFE_MAX_UBWC_PORTS || ubwc_config->num_ports == 0) { - CAM_ERR(CAM_ISP, "Invalid num_ports %u in ubwc config", - ubwc_config->num_ports); + CAM_ERR(CAM_ISP, "Invalid num_ports %u in ubwc config, ctx_idx: %u", + ubwc_config->num_ports, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10282,10 +10411,10 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, ((UINT_MAX - sizeof(struct cam_ubwc_config)) / ((ubwc_config->num_ports - 1) * 2))) { CAM_ERR(CAM_ISP, - "Max size exceeded in ubwc config num_ports:%u size per port:%lu", + "Max size exceeded in ubwc config num_ports:%u size per port:%lu ctx_idx: %u", ubwc_config->num_ports, sizeof(struct cam_ubwc_plane_cfg_v1) * - 2); + 2, ife_mgr_ctx->ctx_index); return -EINVAL; } } @@ -10293,18 +10422,19 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, if (blob_size < (sizeof(struct cam_ubwc_config) + (ubwc_config->num_ports - 1) * sizeof(struct cam_ubwc_plane_cfg_v1) * 2)) { - CAM_ERR(CAM_ISP, "Invalid blob_size %u expected %lu", + CAM_ERR(CAM_ISP, "Invalid blob_size %u expected %lu ctx_idx: %u", blob_size, sizeof(struct cam_ubwc_config) + (ubwc_config->num_ports - 1) * - sizeof(struct cam_ubwc_plane_cfg_v1) * 2); + sizeof(struct cam_ubwc_plane_cfg_v1) * 2, ife_mgr_ctx->ctx_index); return -EINVAL; } rc = cam_isp_blob_ubwc_update(blob_type, blob_info, ubwc_config, prepare); if (rc) - CAM_ERR(CAM_ISP, "UBWC Update Failed rc: %d", rc); + CAM_ERR(CAM_ISP, "UBWC Update Failed rc: %d, ctx_idx: %u", + rc, ife_mgr_ctx->ctx_index); } break; @@ -10312,7 +10442,8 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, struct cam_ubwc_config_v2 *ubwc_config; if (blob_size < sizeof(struct cam_ubwc_config_v2)) { - CAM_ERR(CAM_ISP, "Invalid blob_size %u", blob_size); + CAM_ERR(CAM_ISP, "Invalid blob_size %u, ctx_idx: %u", + blob_size, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10320,8 +10451,8 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, if (ubwc_config->num_ports > CAM_VFE_MAX_UBWC_PORTS || ubwc_config->num_ports == 0) { - CAM_ERR(CAM_ISP, "Invalid num_ports %u in ubwc config", - ubwc_config->num_ports); + CAM_ERR(CAM_ISP, "Invalid num_ports %u in ubwc config, ctx_idx: %u", + ubwc_config->num_ports, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10331,10 +10462,10 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, ((UINT_MAX - sizeof(struct cam_ubwc_config_v2)) / ((ubwc_config->num_ports - 1) * 2))) { CAM_ERR(CAM_ISP, - "Max size exceeded in ubwc config num_ports:%u size per port:%lu", + "Max size exceeded in ubwc config num_ports:%u size per port:%lu ctx_idx: %u", ubwc_config->num_ports, sizeof(struct cam_ubwc_plane_cfg_v2) * - 2); + 2, ife_mgr_ctx->ctx_index); return -EINVAL; } } @@ -10342,27 +10473,28 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, if (blob_size < (sizeof(struct cam_ubwc_config_v2) + (ubwc_config->num_ports - 1) * sizeof(struct cam_ubwc_plane_cfg_v2) * 2)) { - CAM_ERR(CAM_ISP, "Invalid blob_size %u expected %lu", + CAM_ERR(CAM_ISP, "Invalid blob_size %u expected %lu ctx_idx: %u", blob_size, sizeof(struct cam_ubwc_config_v2) + (ubwc_config->num_ports - 1) * - sizeof(struct cam_ubwc_plane_cfg_v2) * 2); + sizeof(struct cam_ubwc_plane_cfg_v2) * 2, ife_mgr_ctx->ctx_index); return -EINVAL; } rc = cam_isp_blob_ubwc_update_v2(blob_type, blob_info, ubwc_config, prepare); if (rc) - CAM_ERR(CAM_ISP, "UBWC Update Failed rc: %d", rc); + CAM_ERR(CAM_ISP, "UBWC Update Failed rc: %d, ctx_idx: %u", + rc, ife_mgr_ctx->ctx_index); } break; case CAM_ISP_GENERIC_BLOB_TYPE_CSID_CLOCK_CONFIG: { struct cam_isp_csid_clock_config *clock_config; if (blob_size < sizeof(struct cam_isp_csid_clock_config)) { - CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu", + CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu ctx_idx: %u", blob_size, - sizeof(struct cam_isp_csid_clock_config)); + sizeof(struct cam_isp_csid_clock_config), ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10371,7 +10503,8 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, rc = cam_isp_blob_csid_clock_update(blob_type, blob_info, clock_config, prepare); if (rc) - CAM_ERR(CAM_ISP, "Clock Update Failed"); + CAM_ERR(CAM_ISP, "Clock Update Failed, ctx_idx: %u", + ife_mgr_ctx->ctx_index); } break; case CAM_ISP_GENERIC_BLOB_TYPE_CSID_QCFA_CONFIG: { @@ -10379,9 +10512,9 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, if (blob_size < sizeof(struct cam_isp_csid_qcfa_config)) { CAM_ERR(CAM_ISP, - "Invalid qcfa blob size %u expected %u", + "Invalid qcfa blob size %u expected %u, ctx_idx: %u", blob_size, - sizeof(struct cam_isp_csid_qcfa_config)); + sizeof(struct cam_isp_csid_qcfa_config), ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10390,7 +10523,8 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, rc = cam_isp_blob_csid_qcfa_update(blob_type, blob_info, qcfa_config, prepare); if (rc) - CAM_ERR(CAM_ISP, "QCFA Update Failed rc: %d", rc); + CAM_ERR(CAM_ISP, "QCFA Update Failed rc: %d, ctx_idx: %u", + rc, ife_mgr_ctx->ctx_index); } break; @@ -10398,8 +10532,8 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, struct cam_fe_config *fe_config; if (blob_size < sizeof(struct cam_fe_config)) { - CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu", - blob_size, sizeof(struct cam_fe_config)); + CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu, ctx_idx: %u", + blob_size, sizeof(struct cam_fe_config), ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10408,15 +10542,17 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, rc = cam_isp_blob_fe_update(blob_type, blob_info, fe_config, prepare); if (rc) - CAM_ERR(CAM_ISP, "FS Update Failed rc: %d", rc); + CAM_ERR(CAM_ISP, "FS Update Failed rc: %d, ctx_idx: %u", + rc, ife_mgr_ctx->ctx_index); } break; case CAM_ISP_GENERIC_BLOB_TYPE_IFE_CORE_CONFIG: { struct cam_isp_core_config *core_config; if (blob_size < sizeof(struct cam_isp_core_config)) { - CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu", - blob_size, sizeof(struct cam_isp_core_config)); + CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu ctx_idx: %u", + blob_size, sizeof(struct cam_isp_core_config), + ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10425,16 +10561,17 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, rc = cam_isp_blob_core_cfg_update(blob_type, blob_info, core_config, prepare); if (rc) - CAM_ERR(CAM_ISP, "Core cfg update fail: %d", rc); + CAM_ERR(CAM_ISP, "Core cfg update fail: %d, ctx_idx: %u", + rc, ife_mgr_ctx->ctx_index); } break; case CAM_ISP_GENERIC_BLOB_TYPE_VFE_OUT_CONFIG: { struct cam_isp_vfe_out_config *vfe_out_config; if (blob_size < sizeof(struct cam_isp_vfe_out_config)) { - CAM_ERR(CAM_ISP, "Invalid blob size %u", + CAM_ERR(CAM_ISP, "Invalid blob size %u, ctx_idx: %u", blob_size, - sizeof(struct cam_isp_vfe_out_config)); + sizeof(struct cam_isp_vfe_out_config), ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10443,8 +10580,8 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, if (vfe_out_config->num_ports > max_ife_out_res || vfe_out_config->num_ports == 0) { CAM_ERR(CAM_ISP, - "Invalid num_ports:%u in vfe out config", - vfe_out_config->num_ports); + "Invalid num_ports:%u in vfe out config, ctx_idx: %u", + vfe_out_config->num_ports, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10454,9 +10591,10 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, sizeof(struct cam_isp_vfe_out_config)) / (vfe_out_config->num_ports - 1))) { CAM_ERR(CAM_ISP, - "Max size exceeded in vfe out config num_ports:%u size per port:%lu", + "Max size exceeded in vfe out config num_ports:%u size per port:%lu, ctx_idx: %u", vfe_out_config->num_ports, - sizeof(struct cam_isp_vfe_wm_config)); + sizeof(struct cam_isp_vfe_wm_config), + ife_mgr_ctx->ctx_index); return -EINVAL; } } @@ -10464,10 +10602,10 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, if (blob_size < (sizeof(struct cam_isp_vfe_out_config) + (vfe_out_config->num_ports - 1) * sizeof(struct cam_isp_vfe_wm_config))) { - CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu", + CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu ctx_idx: %u", blob_size, sizeof(struct cam_isp_vfe_out_config) + (vfe_out_config->num_ports - 1) * - sizeof(struct cam_isp_vfe_wm_config)); + sizeof(struct cam_isp_vfe_wm_config), ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10475,16 +10613,18 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, vfe_out_config, prepare, max_ife_out_res, CAM_ISP_HW_TYPE_VFE); if (rc) - CAM_ERR(CAM_ISP, "VFE out update failed rc: %d", rc); + CAM_ERR(CAM_ISP, "VFE out update failed rc: %d, ctx_idx: %u", + rc, ife_mgr_ctx->ctx_index); } break; case CAM_ISP_GENERIC_BLOB_TYPE_SENSOR_BLANKING_CONFIG: { struct cam_isp_sensor_blanking_config *sensor_blanking_config; if (blob_size < sizeof(struct cam_isp_sensor_blanking_config)) { - CAM_ERR(CAM_ISP, "Invalid blob size %zu expected %zu", + CAM_ERR(CAM_ISP, "Invalid blob size %zu expected %zu ctx_idx: %u", blob_size, - sizeof(struct cam_isp_sensor_blanking_config)); + sizeof(struct cam_isp_sensor_blanking_config), + ife_mgr_ctx->ctx_index); return -EINVAL; } sensor_blanking_config = @@ -10494,7 +10634,8 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, sensor_blanking_config, prepare); if (rc) CAM_ERR(CAM_ISP, - "Epoch Configuration Update Failed rc:%d", rc); + "Epoch Configuration Update Failed rc:%d, ctx_idx: %u", + rc, ife_mgr_ctx->ctx_index); } break; case CAM_ISP_GENERIC_BLOB_TYPE_DISCARD_INITIAL_FRAMES: { @@ -10502,9 +10643,10 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, if (blob_size < sizeof(struct cam_isp_discard_initial_frames)) { CAM_ERR(CAM_ISP, - "Invalid discard frames blob size %u expected %u", + "Invalid discard frames blob size %u expected %u ctx_idx: %u", blob_size, - sizeof(struct cam_isp_discard_initial_frames)); + sizeof(struct cam_isp_discard_initial_frames), + ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10513,7 +10655,8 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, rc = cam_isp_blob_csid_discard_init_frame_update( blob_info, discard_config, prepare); if (rc) - CAM_ERR(CAM_ISP, "Discard initial frames update failed rc: %d", rc); + CAM_ERR(CAM_ISP, "Discard initial frames update failed rc: %d ctx: %u", + rc, ife_mgr_ctx->ctx_index); } break; @@ -10531,7 +10674,8 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, rc = cam_isp_blob_ife_scratch_buf_update( scratch_config, prepare); if (rc) - CAM_ERR(CAM_ISP, "IFE scratch buffer update failed rc: %d", rc); + CAM_ERR(CAM_ISP, "IFE scratch buffer update failed rc: %d, ctx_idx: %u", + rc, ife_mgr_ctx->ctx_index); } break; case CAM_ISP_GENERIC_BLOB_TYPE_SFE_CLOCK_CONFIG: @@ -10546,9 +10690,9 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, struct cam_isp_mode_switch_info *mup_config; if (blob_size < sizeof(struct cam_isp_mode_switch_info)) { - CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu", + CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu ctx_idx: %u", blob_size, - sizeof(struct cam_isp_mode_switch_info)); + sizeof(struct cam_isp_mode_switch_info), ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10557,7 +10701,7 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, rc = cam_isp_blob_csid_dynamic_switch_update( blob_type, blob_info, mup_config, prepare); if (rc) - CAM_ERR(CAM_ISP, "MUP Update Failed"); + CAM_ERR(CAM_ISP, "MUP Update Failed, ctx_idx: %u", ife_mgr_ctx->ctx_index); } break; case CAM_ISP_GENERIC_BLOB_TYPE_BW_LIMITER_CFG: { @@ -10565,9 +10709,10 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, if (blob_size < sizeof(struct cam_isp_out_rsrc_bw_limiter_config)) { - CAM_ERR(CAM_ISP, "Invalid blob size %u", + CAM_ERR(CAM_ISP, "Invalid blob size %u, ctx_idx: %u", blob_size, - sizeof(struct cam_isp_out_rsrc_bw_limiter_config)); + sizeof(struct cam_isp_out_rsrc_bw_limiter_config), + ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10583,7 +10728,8 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, bw_limit_config, prepare, CAM_ISP_HW_TYPE_VFE); if (rc) CAM_ERR(CAM_ISP, - "BW limit update failed for IFE rc: %d", rc); + "BW limit update failed for IFE rc: %d, ctx_idx: %u", + rc, ife_mgr_ctx->ctx_index); } break; case CAM_ISP_GENERIC_BLOB_TYPE_INIT_CONFIG: { @@ -10596,16 +10742,17 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, if (prepare_hw_data->packet_opcode_type != CAM_ISP_PACKET_INIT_DEV) { CAM_ERR(CAM_ISP, - "Init config blob not supported for packet type: %u req: %llu", + "Init config blob not supported for packet type: %u req: %llu ctx_idx: %u", prepare_hw_data->packet_opcode_type, - prepare->packet->header.request_id); + prepare->packet->header.request_id, ife_mgr_ctx->ctx_index); return -EINVAL; } if (blob_size < sizeof(struct cam_isp_init_config)) { CAM_ERR(CAM_ISP, - "Invalid init config blob size %u expected %u", - blob_size, sizeof(struct cam_isp_init_config)); + "Invalid init config blob size %u expected %u, ctx_idx: %u", + blob_size, sizeof(struct cam_isp_init_config), + ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10614,24 +10761,25 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, rc = cam_isp_blob_csid_init_config_update(prepare, init_config); if (rc) { CAM_ERR(CAM_ISP, - "CSID Init config failed for req: %llu rc: %d", - prepare->packet->header.request_id, rc); + "CSID Init config failed for req: %llu rc: %d ctx_idx: %u", + prepare->packet->header.request_id, rc, ife_mgr_ctx->ctx_index); break; } rc = cam_isp_blob_ife_init_config_update(prepare, init_config); if (rc) CAM_ERR(CAM_ISP, - "IFE Init config failed for req: %llu rc: %d", - prepare->packet->header.request_id, rc); + "IFE Init config failed for req: %llu rc: %d ctx_idx: %u", + prepare->packet->header.request_id, rc, ife_mgr_ctx->ctx_index); } break; case CAM_ISP_GENERIC_BLOB_TYPE_RDI_LCR_CONFIG: { struct cam_isp_lcr_rdi_config *lcr_rdi_config; if (blob_size < sizeof(struct cam_isp_lcr_rdi_config)) { - CAM_ERR(CAM_ISP, "Invalid lcr blob size %u expected %u", - blob_size, sizeof(struct cam_isp_lcr_rdi_config)); + CAM_ERR(CAM_ISP, "Invalid lcr blob size %u expected %u ctx_idx: %u", + blob_size, sizeof(struct cam_isp_lcr_rdi_config), + ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10640,8 +10788,8 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, blob_info, lcr_rdi_config, blob_type); if (rc) CAM_ERR(CAM_ISP, - "RDI LCR config failed for res %u", - lcr_rdi_config->res_id); + "RDI LCR config failed for res %u, ctx_idx: %u", + lcr_rdi_config->res_id, ife_mgr_ctx->ctx_index); } break; @@ -10650,8 +10798,9 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, struct cam_isp_prepare_hw_update_data *prepare_hw_data; if (blob_size < sizeof(struct cam_isp_drv_config)) { - CAM_ERR(CAM_ISP, "Invalid DRV blob size %u expected %u", - blob_size, sizeof(struct cam_isp_drv_config)); + CAM_ERR(CAM_ISP, "Invalid DRV blob size %u expected %u ctx_idx: %u", + blob_size, sizeof(struct cam_isp_drv_config), + ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10661,14 +10810,17 @@ static int cam_isp_packet_generic_blob_handler(void *user_data, memcpy(&prepare_hw_data->isp_drv_config, drv_config, sizeof(prepare_hw_data->isp_drv_config)); - CAM_DBG(CAM_ISP, "DRV config blob en:%d timeout_val:%u path_idle_en: 0x%x", - drv_config->drv_en, drv_config->timeout_val, drv_config->path_idle_en); + CAM_DBG(CAM_ISP, + "DRV config blob en:%d timeout_val:%u path_idle_en: 0x%x ctx: %u", + drv_config->drv_en, drv_config->timeout_val, drv_config->path_idle_en, + ife_mgr_ctx->ctx_index); prepare_hw_data->drv_config_valid = true; } break; default: - CAM_WARN(CAM_ISP, "Invalid blob type %d", blob_type); + CAM_WARN(CAM_ISP, "Invalid blob type %d, ctx_idx: %u", + blob_type, ife_mgr_ctx->ctx_index); break; } @@ -10751,7 +10903,7 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, } ife_mgr_ctx = prepare->ctxt_to_hw_map; - CAM_DBG(CAM_ISP, "Context[%pK][%d] blob_type: %d, blob_size: %d", + CAM_DBG(CAM_ISP, "Context[%pK][%u] blob_type: %d, blob_size: %d", ife_mgr_ctx, ife_mgr_ctx->ctx_index, blob_type, blob_size); switch (blob_type) { @@ -10761,15 +10913,16 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, struct cam_isp_prepare_hw_update_data *prepare_hw_data; if (blob_size < sizeof(struct cam_isp_clock_config)) { - CAM_ERR(CAM_ISP, "Invalid blob size %u", blob_size); + CAM_ERR(CAM_ISP, "Invalid blob size %u, ctx_idx: %u", + blob_size, ife_mgr_ctx->ctx_index); return -EINVAL; } clock_config = (struct cam_isp_clock_config *)blob_data; if (clock_config->num_rdi > CAM_SFE_RDI_NUM_MAX) { - CAM_ERR(CAM_ISP, "Invalid num_rdi %u in clock config", - clock_config->num_rdi); + CAM_ERR(CAM_ISP, "Invalid num_rdi %u in clock config, ctx_idx: %u", + clock_config->num_rdi, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10779,9 +10932,9 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, sizeof(struct cam_isp_clock_config)) / (clock_config->num_rdi - 1))) { CAM_ERR(CAM_ISP, - "Max size exceeded in clock config num_rdi:%u size per port:%lu", + "Max size exceeded in clock config num_rdi:%u size per port:%lu ctx_idx: %u", clock_config->num_rdi, - sizeof(uint64_t)); + sizeof(uint64_t), ife_mgr_ctx->ctx_index); return -EINVAL; } } @@ -10789,10 +10942,10 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, if ((clock_config->num_rdi != 0) && (blob_size < (sizeof(struct cam_isp_clock_config) + sizeof(uint64_t) * (clock_config->num_rdi - 1)))) { - CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu", + CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu ctx_idx: %u", blob_size, sizeof(uint32_t) * 2 + sizeof(uint64_t) * - (clock_config->num_rdi + 2)); + (clock_config->num_rdi + 2), ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10810,9 +10963,9 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, struct cam_isp_vfe_out_config *vfe_out_config; if (blob_size < sizeof(struct cam_isp_vfe_out_config)) { - CAM_ERR(CAM_ISP, "Invalid blob size %u", + CAM_ERR(CAM_ISP, "Invalid blob size %u ctx_idx: %u", blob_size, - sizeof(struct cam_isp_vfe_out_config)); + sizeof(struct cam_isp_vfe_out_config), ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10822,9 +10975,9 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, if (vfe_out_config->num_ports > max_sfe_out_res || vfe_out_config->num_ports == 0) { CAM_ERR(CAM_ISP, - "Invalid num_ports:%u in sfe out config", + "Invalid num_ports:%u in sfe out config, ctx_idx: %u", vfe_out_config->num_ports, - max_sfe_out_res); + max_sfe_out_res, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10834,9 +10987,10 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, sizeof(struct cam_isp_vfe_out_config)) / (vfe_out_config->num_ports - 1))) { CAM_ERR(CAM_ISP, - "Max size exceeded in sfe out config num_ports:%u size per port:%lu", + "Max size exceeded in sfe out config num_ports:%u size per port:%lu ctx_idx: %u", vfe_out_config->num_ports, - sizeof(struct cam_isp_vfe_wm_config)); + sizeof(struct cam_isp_vfe_wm_config), + ife_mgr_ctx->ctx_index); return -EINVAL; } } @@ -10844,10 +10998,10 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, if (blob_size < (sizeof(struct cam_isp_vfe_out_config) + (vfe_out_config->num_ports - 1) * sizeof(struct cam_isp_vfe_wm_config))) { - CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu", + CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu ctx_idx: %u", blob_size, sizeof(struct cam_isp_vfe_out_config) + (vfe_out_config->num_ports - 1) * - sizeof(struct cam_isp_vfe_wm_config)); + sizeof(struct cam_isp_vfe_wm_config), ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10855,14 +11009,16 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, vfe_out_config, prepare, max_sfe_out_res, CAM_ISP_HW_TYPE_SFE); if (rc) - CAM_ERR(CAM_ISP, "SFE out update failed rc: %d", rc); + CAM_ERR(CAM_ISP, "SFE out update failed rc: %d, ctx_idx: %u", + rc, ife_mgr_ctx->ctx_index); } break; case CAM_ISP_GENERIC_BLOB_TYPE_SFE_HFR_CONFIG: { struct cam_isp_resource_hfr_config *hfr_config; if (blob_size < sizeof(struct cam_isp_resource_hfr_config)) { - CAM_ERR(CAM_ISP, "Invalid blob size %u", blob_size); + CAM_ERR(CAM_ISP, "Invalid blob size %u, ctx_idx: %u", + blob_size, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10870,8 +11026,8 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, if (hfr_config->num_ports > max_sfe_out_res || hfr_config->num_ports == 0) { - CAM_ERR(CAM_ISP, "Invalid num_ports %u in HFR config", - hfr_config->num_ports); + CAM_ERR(CAM_ISP, "Invalid num_ports %u in HFR config, ctx_idx: %u", + hfr_config->num_ports, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10882,9 +11038,10 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, sizeof(struct cam_isp_resource_hfr_config)) / (hfr_config->num_ports - 1))) { CAM_ERR(CAM_ISP, - "Max size exceeded in hfr config num_ports:%u size per port:%lu", + "Max size exceeded in hfr config num_ports:%u size per port:%lu ctx_idx: %u", hfr_config->num_ports, - sizeof(struct cam_isp_port_hfr_config)); + sizeof(struct cam_isp_port_hfr_config), + ife_mgr_ctx->ctx_index); return -EINVAL; } } @@ -10892,11 +11049,11 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, if (blob_size < (sizeof(struct cam_isp_resource_hfr_config) + (hfr_config->num_ports - 1) * sizeof(struct cam_isp_port_hfr_config))) { - CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu", + CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu, ctx_idx: %u", blob_size, sizeof(struct cam_isp_resource_hfr_config) + (hfr_config->num_ports - 1) * - sizeof(struct cam_isp_port_hfr_config)); + sizeof(struct cam_isp_port_hfr_config), ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10904,7 +11061,7 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, hfr_config, prepare, max_sfe_out_res, CAM_ISP_HW_TYPE_SFE); if (rc) - CAM_ERR(CAM_ISP, "HFR Update Failed"); + CAM_ERR(CAM_ISP, "HFR Update Failed, ctx_idx: %u", ife_mgr_ctx->ctx_index); } break; case CAM_ISP_GENERIC_BLOB_TYPE_SFE_CORE_CONFIG: { @@ -10912,8 +11069,8 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, if (blob_size < sizeof(struct cam_isp_sfe_core_config)) { CAM_ERR(CAM_ISP, - "Invalid blob size: %u expected: %u", blob_size, - sizeof(struct cam_isp_sfe_core_config)); + "Invalid blob size: %u expected: %u ctx_idx: %u", blob_size, + sizeof(struct cam_isp_sfe_core_config), ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10936,15 +11093,16 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, rc = cam_isp_blob_sfe_scratch_buf_update( scratch_config, prepare); if (rc) - CAM_ERR(CAM_ISP, "SFE scratch buffer update failed rc: %d", rc); + CAM_ERR(CAM_ISP, "SFE scratch buffer update failed rc: %d ctx_idx: %u", + rc, ife_mgr_ctx->ctx_index); } break; case CAM_ISP_GENERIC_BLOB_TYPE_SFE_FE_CONFIG: { struct cam_fe_config *fe_config; if (blob_size < sizeof(struct cam_fe_config)) { - CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu", - blob_size, sizeof(struct cam_fe_config)); + CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu ctx_idx: %u", + blob_size, sizeof(struct cam_fe_config), ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10953,7 +11111,8 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, rc = cam_isp_blob_fe_update(blob_type, blob_info, fe_config, prepare); if (rc) - CAM_ERR(CAM_ISP, "FS Update Failed rc: %d", rc); + CAM_ERR(CAM_ISP, "FS Update Failed rc: %d, ctx_idx: %u", + rc, ife_mgr_ctx->ctx_index); } break; case CAM_ISP_GENERIC_BLOB_TYPE_DYNAMIC_MODE_SWITCH: { @@ -10961,9 +11120,9 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, struct cam_isp_prepare_hw_update_data *prepare_hw_data; if (blob_size < sizeof(struct cam_isp_mode_switch_info)) { - CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu", + CAM_ERR(CAM_ISP, "Invalid blob size %u expected %lu ctx_idx: %u", blob_size, - sizeof(struct cam_isp_mode_switch_info)); + sizeof(struct cam_isp_mode_switch_info), ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -10979,7 +11138,8 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, blob_type, blob_info, prepare); if (rc) CAM_ERR(CAM_ISP, - "SFE dynamic enable/disable for fetch failed"); + "SFE dynamic enable/disable for fetch failed, ctx_idx: %u", + ife_mgr_ctx->ctx_index); } } break; @@ -10988,14 +11148,15 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, if (!ife_mgr_ctx->flags.is_sfe_shdr) { CAM_ERR(CAM_ISP, - "Blob %u supported only for sHDR streams", - blob_type); + "Blob %u supported only for sHDR streams, ctx_idx: %u", + blob_type, ife_mgr_ctx->ctx_index); return -EINVAL; } if (blob_size < sizeof(struct cam_isp_sfe_exp_config)) { - CAM_ERR(CAM_ISP, "Invalid blob size %u", blob_size); + CAM_ERR(CAM_ISP, "Invalid blob size %u, ctx_idx: %u", + blob_size, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -11005,8 +11166,8 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, if ((exp_config->num_ports > CAM_SFE_FE_RDI_NUM_MAX) || (exp_config->num_ports == 0)) { CAM_ERR(CAM_ISP, - "Invalid num_ports %u in exp order config", - exp_config->num_ports); + "Invalid num_ports %u in exp order config, ctx_idx: %u", + exp_config->num_ports, ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -11018,10 +11179,11 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, struct cam_isp_sfe_exp_config)) / (exp_config->num_ports - 1))) { CAM_ERR(CAM_ISP, - "Max size exceeded in exp order config num_ports: %u size per port: %lu", + "Max size exceeded in exp order config num_ports: %u size per port: %lu ctx_idx: %u", exp_config->num_ports, sizeof( - struct cam_isp_sfe_wm_exp_order_config)); + struct cam_isp_sfe_wm_exp_order_config), + ife_mgr_ctx->ctx_index); return -EINVAL; } } @@ -11030,20 +11192,21 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, (sizeof(struct cam_isp_sfe_exp_config) + (exp_config->num_ports - 1) * sizeof(struct cam_isp_sfe_wm_exp_order_config))) { - CAM_ERR(CAM_ISP, "Invalid blob size: %u expected: %lu", + CAM_ERR(CAM_ISP, "Invalid blob size: %u expected: %lu ctx_idx: %u", blob_size, sizeof( struct cam_isp_sfe_exp_config) + (exp_config->num_ports - 1) * sizeof( - struct cam_isp_sfe_wm_exp_order_config)); + struct cam_isp_sfe_wm_exp_order_config), ife_mgr_ctx->ctx_index); return -EINVAL; } rc = cam_isp_blob_sfe_exp_order_update( blob_info->base_info->idx, exp_config, prepare); if (rc) - CAM_ERR(CAM_ISP, "SFE exp order update failed"); + CAM_ERR(CAM_ISP, "SFE exp order update failed, ctx_idx: %u", + ife_mgr_ctx->ctx_index); } break; case CAM_ISP_GENERIC_BLOB_TYPE_BW_LIMITER_CFG: { @@ -11051,9 +11214,10 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, if (blob_size < sizeof(struct cam_isp_out_rsrc_bw_limiter_config)) { - CAM_ERR(CAM_ISP, "Invalid blob size %u", + CAM_ERR(CAM_ISP, "Invalid blob size %u ctx_idx: %u", blob_size, - sizeof(struct cam_isp_out_rsrc_bw_limiter_config)); + sizeof(struct cam_isp_out_rsrc_bw_limiter_config), + ife_mgr_ctx->ctx_index); return -EINVAL; } @@ -11069,7 +11233,8 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, bw_limit_config, prepare, CAM_ISP_HW_TYPE_SFE); if (rc) CAM_ERR(CAM_ISP, - "BW limit update failed for SFE rc: %d", rc); + "BW limit update failed for SFE rc: %d, ctx_idx: %u", + rc, ife_mgr_ctx->ctx_index); } break; case CAM_ISP_GENERIC_BLOB_TYPE_HFR_CONFIG: @@ -11092,7 +11257,8 @@ static int cam_sfe_packet_generic_blob_handler(void *user_data, case CAM_ISP_GENERIC_BLOB_TYPE_DRV_CONFIG: break; default: - CAM_WARN(CAM_ISP, "Invalid blob type: %u", blob_type); + CAM_WARN(CAM_ISP, "Invalid blob type: %u, ctx_idx: %u", + blob_type, ife_mgr_ctx->ctx_index); break; } @@ -11208,15 +11374,15 @@ static int cam_isp_sfe_add_scratch_buffer_cfg( if (prepare->num_hw_update_entries + 1 >= prepare->max_hw_update_entries) { - CAM_ERR(CAM_ISP, "Insufficient HW entries :%d %d", + CAM_ERR(CAM_ISP, "Insufficient HW entries :%d %d, ctx_idx: %u", prepare->num_hw_update_entries, - prepare->max_hw_update_entries); + prepare->max_hw_update_entries, ctx->ctx_index); return -EINVAL; } io_cfg_used_bytes = 0; - CAM_DBG(CAM_ISP, "num_ports: %u", - ctx->scratch_buf_info.sfe_scratch_config->num_config); + CAM_DBG(CAM_ISP, "ctx_idx: %u num_ports: %u", + ctx->ctx_index, ctx->scratch_buf_info.sfe_scratch_config->num_config); /* Update RDI WMs */ for (i = 0; i < CAM_SFE_FE_RDI_NUM_MAX; i++) { @@ -11235,8 +11401,8 @@ static int cam_isp_sfe_add_scratch_buffer_cfg( io_cfg_used_bytes); } else { CAM_ERR(CAM_ISP, - "no free kmd memory for base %d", - base_idx); + "no free kmd memory for base %d, ctx_idx: %u", + base_idx, ctx->ctx_index); rc = -ENOMEM; return rc; } @@ -11265,10 +11431,10 @@ static int cam_isp_sfe_add_scratch_buffer_cfg( return -EFAULT; } - CAM_DBG(CAM_ISP, "WM res_id: 0x%x idx: %u io_addr: %pK", + CAM_DBG(CAM_ISP, "WM res_id: 0x%x idx: %u io_addr: %pK, ctx_idx: %u", hw_mgr_res->hw_res[j]->res_id, (res_id - CAM_ISP_SFE_OUT_RES_RDI_0), - buf_info->io_addr); + buf_info->io_addr, ctx->ctx_index); rc = cam_isp_sfe_send_scratch_buf_upd( remain_size, @@ -11298,8 +11464,8 @@ static int cam_isp_sfe_add_scratch_buffer_cfg( io_cfg_used_bytes); } else { CAM_ERR(CAM_ISP, - "no free kmd memory for base %d", - base_idx); + "no free kmd memory for base %d, ctx_idx: %u", + base_idx, ctx->ctx_index); rc = -ENOMEM; return rc; } @@ -11321,10 +11487,10 @@ static int cam_isp_sfe_add_scratch_buffer_cfg( buf_info = &ctx->scratch_buf_info.sfe_scratch_config->buf_info[ res_id - CAM_ISP_SFE_IN_RD_0]; - CAM_DBG(CAM_ISP, "RM res_id: 0x%x idx: %u io_addr: %pK", + CAM_DBG(CAM_ISP, "RM res_id: 0x%x idx: %u io_addr: %pK, ctx_idx: %u", hw_mgr_res->hw_res[j]->res_id, (res_id - CAM_ISP_SFE_IN_RD_0), - buf_info->io_addr); + buf_info->io_addr, ctx->ctx_index); rc = cam_isp_sfe_send_scratch_buf_upd(remain_size, CAM_ISP_HW_CMD_GET_BUF_UPDATE_RM, @@ -11360,9 +11526,9 @@ static int cam_isp_ife_add_scratch_buffer_cfg( if (prepare->num_hw_update_entries + 1 >= prepare->max_hw_update_entries) { - CAM_ERR(CAM_ISP, "Insufficient HW entries :%d %d", + CAM_ERR(CAM_ISP, "Insufficient HW entries :%d %d, ctx_idx: %u", prepare->num_hw_update_entries, - prepare->max_hw_update_entries); + prepare->max_hw_update_entries, ctx->ctx_index); return -EINVAL; } @@ -11394,8 +11560,8 @@ static int cam_isp_ife_add_scratch_buffer_cfg( io_cfg_used_bytes); } else { CAM_ERR(CAM_ISP, - "no free kmd memory for base %u", - base_idx); + "no free kmd memory for base %u, ctx_idx: %u", + base_idx, ctx->ctx_index); rc = -ENOMEM; return rc; } @@ -11403,8 +11569,8 @@ static int cam_isp_ife_add_scratch_buffer_cfg( cpu_addr = kmd_buf_info->cpu_addr + kmd_buf_info->used_bytes / 4 + io_cfg_used_bytes / 4; buf_info = &ctx->scratch_buf_info.ife_scratch_config->buf_info[i]; - CAM_DBG(CAM_ISP, "WM res_id: 0x%x io_addr: %pK", - hw_mgr_res->hw_res[j]->res_id, buf_info->io_addr); + CAM_DBG(CAM_ISP, "WM res_id: 0x%x io_addr: %pK, ctx_idx: %u", + hw_mgr_res->hw_res[j]->res_id, buf_info->io_addr, ctx->ctx_index); rc = cam_isp_sfe_send_scratch_buf_upd( remain_size, @@ -11462,8 +11628,8 @@ static int cam_ife_mgr_csid_add_reg_update(struct cam_ife_hw_mgr_ctx *ctx, rup_args[hw_idx].num_res++; CAM_DBG(CAM_ISP, - "Reg update queued for res %d hw_id %d", - res->res_id, res->hw_intf->hw_idx); + "Reg update queued for res %d hw_id %d, ctx_idx: %u", + res->res_id, res->hw_intf->hw_idx, ctx->ctx_index); } } @@ -11477,12 +11643,12 @@ static int cam_ife_mgr_csid_add_reg_update(struct cam_ife_hw_mgr_ctx *ctx, &ctx->res_list_ife_csid, &change_base_info, kmd_buf); - CAM_DBG(CAM_ISP, "Ctx:%d Change base added for num_res %d", + CAM_DBG(CAM_ISP, "Ctx:%u Change base added for num_res %d", ctx->ctx_index, rup_args[i].num_res); if (rc) { CAM_ERR(CAM_ISP, - "Change base Failed Ctx:%d hw_idx=%d, rc=%d", + "Change base Failed Ctx:%u hw_idx=%d, rc=%d", ctx->ctx_index, i, rc); break; } @@ -11496,7 +11662,7 @@ static int cam_ife_mgr_csid_add_reg_update(struct cam_ife_hw_mgr_ctx *ctx, break; } - CAM_DBG(CAM_ISP, "Ctx:%d Reg update added id:%d num_res %d", + CAM_DBG(CAM_ISP, "Ctx:%u Reg update added id:%d num_res %d", ctx->ctx_index, i, rup_args[i].num_res); } @@ -11524,14 +11690,14 @@ static int cam_ife_mgr_isp_add_reg_update(struct cam_ife_hw_mgr_ctx *ctx, if (rc) { CAM_ERR(CAM_ISP, - "Add Change base cmd Failed i=%d, idx=%d, rc=%d", - i, ctx->base[i].idx, rc); + "Add Change base cmd Failed i=%d, idx=%d, rc=%d ctx_idx: %u", + i, ctx->base[i].idx, rc, ctx->ctx_index); break; } CAM_DBG(CAM_ISP, - "Add Change base cmd i=%d, idx=%d, rc=%d", - i, ctx->base[i].idx, rc); + "Add Change base cmd i=%d, idx=%d, rc=%d ctx_idx: %u", + i, ctx->base[i].idx, rc, ctx->ctx_index); } rc = cam_isp_add_reg_update(prepare, @@ -11540,14 +11706,14 @@ static int cam_ife_mgr_isp_add_reg_update(struct cam_ife_hw_mgr_ctx *ctx, if (rc) { CAM_ERR(CAM_ISP, - "Add Reg Update cmd Failed i=%d, idx=%d, rc=%d", - i, ctx->base[i].idx, rc); + "Add Reg Update cmd Failed i=%d, idx=%d, rc=%d ctx_idx: %u", + i, ctx->base[i].idx, rc, ctx->ctx_index); break; } CAM_DBG(CAM_ISP, - "Add Reg Update cmd i=%d, idx=%d, rc=%d", - i, ctx->base[i].idx, rc); + "Add Reg Update cmd i=%d, idx=%d, rc=%d ctx_idx: %u", + i, ctx->base[i].idx, rc, ctx->ctx_index); } return rc; } @@ -11677,7 +11843,8 @@ static int cam_ife_hw_mgr_update_cmd_buffer( res_list = &ctx->res_list_ife_csid; }else { CAM_ERR(CAM_ISP, - "Invalide hw_type=%d", ctx->base[base_idx].hw_type); + "Invalid hw_type=%d, ctx_idx: %u", + ctx->base[base_idx].hw_type, ctx->ctx_index); return -EINVAL; } @@ -11689,16 +11856,16 @@ static int cam_ife_hw_mgr_update_cmd_buffer( &change_base_info, kmd_buf); if (rc) { CAM_ERR(CAM_ISP, - "Failed change base, i=%d, split_id=%d, hw_type=%d", + "Failed change base, i=%d, split_id=%d, hw_type=%d ctx_idx: %u", base_idx, ctx->base[base_idx].split_id, - ctx->base[base_idx].hw_type); + ctx->base[base_idx].hw_type, ctx->ctx_index); return rc; } CAM_DBG(CAM_ISP, - "changing the base hw_type: %u core_id: %u CDM ID: %d", + "changing the base hw_type: %u core_id: %u CDM ID: %d ctx_idx: %u", ctx->base[base_idx].hw_type, ctx->base[base_idx].idx, - ctx->cdm_id); + ctx->cdm_id, ctx->ctx_index); } if (ctx->base[base_idx].hw_type == CAM_ISP_HW_TYPE_SFE) @@ -11722,15 +11889,15 @@ static int cam_ife_hw_mgr_update_cmd_buffer( kmd_buf, &ctx->base[base_idx]); CAM_DBG(CAM_ISP, - "Add cmdbuf, i=%d, split_id=%d, hw_type=%d", + "Add cmdbuf, i=%d, split_id=%d, hw_type=%d ctx_idx: %u", base_idx, ctx->base[base_idx].split_id, - ctx->base[base_idx].hw_type); + ctx->base[base_idx].hw_type, ctx->ctx_index); if (rc) CAM_ERR(CAM_ISP, - "Failed in add cmdbuf, i=%d, split_id=%d, rc=%d hw_type=%d", + "Failed in add cmdbuf, i=%d, split_id=%d, rc=%d hw_type=%d ctx_idx: %u", base_idx, ctx->base[base_idx].split_id, rc, - ctx->base[base_idx].hw_type); + ctx->base[base_idx].hw_type, ctx->ctx_index); return rc; } @@ -11776,9 +11943,9 @@ static int cam_ife_hw_mgr_sfe_scratch_buf_update( /* For update packets add scratch buffer */ if (opcode_type == CAM_ISP_PACKET_UPDATE_DEV) { CAM_DBG(CAM_ISP, - "Adding SFE scratch buffer cfg_mask expected: 0x%x actual: 0x%x", + "Adding SFE scratch buffer cfg_mask expected: 0x%x actual: 0x%x ctx_idx: %u", ((1 << ctx->scratch_buf_info.num_fetches) - 1), - sfe_res_info->sfe_rdi_cfg_mask); + sfe_res_info->sfe_rdi_cfg_mask, ctx->ctx_index); rc = cam_isp_sfe_add_scratch_buffer_cfg( ctx->base[base_idx].idx, sfe_res_info->sfe_rdi_cfg_mask, prepare, kmd_buf, ctx->res_list_sfe_out, @@ -11814,9 +11981,9 @@ static int cam_ife_hw_mgr_ife_scratch_buf_update( ((1 << ife_res_info->num_ports) - 1)) { if (opcode_type == CAM_ISP_PACKET_UPDATE_DEV) { CAM_DBG(CAM_ISP, - "Adding IFE scratch buffer cfg_mask expected: 0x%x actual: 0x%x", + "Adding IFE scratch buffer cfg_mask expected: 0x%x actual: 0x%x ctx_idx: %u", ((1 << ife_res_info->num_ports) - 1), - ife_res_info->ife_scratch_cfg_mask); + ife_res_info->ife_scratch_cfg_mask, ctx->ctx_index); rc = cam_isp_ife_add_scratch_buffer_cfg( ctx->base[base_idx].idx, ife_res_info->ife_scratch_cfg_mask, prepare, @@ -11896,7 +12063,7 @@ static int cam_ife_mgr_prepare_hw_update(void *hw_mgr_priv, hw_mgr = (struct cam_ife_hw_mgr *)hw_mgr_priv; - CAM_DBG(CAM_REQ, "ctx[%pK][%d] Enter for req_id %lld", + CAM_DBG(CAM_REQ, "ctx[%pK][%u] Enter for req_id %lld", ctx, ctx->ctx_index, prepare->packet->header.request_id); rc = cam_packet_util_validate_packet(prepare->packet, prepare->remain_len); @@ -11928,7 +12095,7 @@ static int cam_ife_mgr_prepare_hw_update(void *hw_mgr_priv, hw_mgr->mgr_common.cmd_iommu_hdl_secure, true); if (rc) { - CAM_ERR(CAM_ISP, "Patch ISP packet failed."); + CAM_ERR(CAM_ISP, "Patch ISP packet failed. ctx_idx: %u", ctx->ctx_index); return rc; } @@ -11944,7 +12111,7 @@ static int cam_ife_mgr_prepare_hw_update(void *hw_mgr_priv, rc = cam_isp_get_cmd_buf_count(prepare, &cmd_buf_count); if (rc) { - CAM_ERR(CAM_ISP, "Invalid cmd buffers"); + CAM_ERR(CAM_ISP, "Invalid cmd buffers, ctx_idx: %u", ctx->ctx_index); return rc; } @@ -11970,8 +12137,9 @@ static int cam_ife_mgr_prepare_hw_update(void *hw_mgr_priv, &prepare_hw_data->kmd_cmd_buff_info, &cmd_buf_count, i); if (rc) { - CAM_ERR(CAM_ISP, "Add cmd buffer failed base_idx: %d hw_type %d", - i, ctx->base[i].hw_type); + CAM_ERR(CAM_ISP, + "Add cmd buffer failed base_idx: %d hw_type %d ctx_idx: %u", + i, ctx->base[i].hw_type, ctx->ctx_index); goto end; } @@ -12002,9 +12170,10 @@ static int cam_ife_mgr_prepare_hw_update(void *hw_mgr_priv, if (rc) { CAM_ERR(CAM_ISP, - "Failed in io buffers, i=%d, rc=%d hw_type=%s", + "Failed in io buffers, i=%d, rc=%d hw_type=%s ctx_idx: %u", i, rc, - (ctx->base[i].hw_type == CAM_ISP_HW_TYPE_SFE ? "SFE" : "IFE")); + (ctx->base[i].hw_type == CAM_ISP_HW_TYPE_SFE ? "SFE" : "IFE"), + ctx->ctx_index); goto end; } @@ -12053,9 +12222,9 @@ static int cam_ife_mgr_prepare_hw_update(void *hw_mgr_priv, frame_header_info.frame_header_res_id; CAM_DBG(CAM_ISP, - "Frame header enabled for res_id 0x%x cpu_addr %pK", + "Frame header enabled for res_id 0x%x cpu_addr %pK ctx_idx: %u", prepare_hw_data->frame_header_res_id, - prepare_hw_data->frame_header_cpu_addr); + prepare_hw_data->frame_header_cpu_addr, ctx->ctx_index); } } @@ -12063,7 +12232,7 @@ static int cam_ife_mgr_prepare_hw_update(void *hw_mgr_priv, if ((ctx->ctx_config & CAM_IFE_CTX_CFG_FRAME_HEADER_TS) && (prepare->num_out_map_entries) && (!prepare_hw_data->frame_header_res_id)) { - CAM_ERR(CAM_ISP, "Failed to configure frame header"); + CAM_ERR(CAM_ISP, "Failed to configure frame header, ctx_idx: %u", ctx->ctx_index); goto end; } @@ -12105,8 +12274,8 @@ static int cam_ife_mgr_prepare_hw_update(void *hw_mgr_priv, prepare, &prepare_hw_data->kmd_cmd_buff_info); if (rc) { - CAM_ERR(CAM_ISP, "Add RUP fail csid_rup_en %d", - hw_mgr->csid_rup_en); + CAM_ERR(CAM_ISP, "Add RUP fail csid_rup_en %d, ctx_idx: %u", + hw_mgr->csid_rup_en, ctx->ctx_index); goto end; } @@ -12129,7 +12298,8 @@ static int cam_ife_mgr_prepare_hw_update(void *hw_mgr_priv, if (prepare_hw_data->kmd_cmd_buff_info.size <= prepare_hw_data->kmd_cmd_buff_info.used_bytes) { - CAM_ERR(CAM_ISP, "No Sufficient memory for the Gen IRQ command"); + CAM_ERR(CAM_ISP, "No Sufficient memory for the Gen IRQ command, ctx_idx: %u", + ctx->ctx_index); rc = -ENOMEM; } @@ -12198,7 +12368,8 @@ static inline void cam_ife_hw_mgr_stop_bus_rd_for_res(struct cam_ife_hw_mgr_ctx list_for_each_entry(isp_hw_res, &ctx->res_list_ife_in_rd, list) { if (isp_hw_res->res_id == res_id) { - CAM_ERR(CAM_ISP, "Stopping IFE/SFE bus rd res id 0x%x", res_id); + CAM_ERR(CAM_ISP, "Stopping IFE/SFE bus rd res id 0x%x, ctx_idx: %u", + res_id, ctx->ctx_index); cam_ife_hw_mgr_stop_hw_res(isp_hw_res); break; } @@ -12213,14 +12384,16 @@ static void cam_ife_hw_mgr_stop_pf_hw_res(struct cam_ife_hw_mgr_ctx *ctx, if (hw_type == CAM_ISP_HW_TYPE_VFE) { if (cam_ife_hw_mgr_is_ife_out_port(res_id)) { isp_hw_res = &ctx->res_list_ife_out[res_id & 0xFF]; - CAM_ERR(CAM_ISP, "Stopping IFE out resource res id 0x%x", res_id); + CAM_ERR(CAM_ISP, "Stopping IFE out resource res id 0x%x ctx_idx: %u", + res_id, ctx->ctx_index); cam_ife_hw_mgr_stop_hw_res(isp_hw_res); } else cam_ife_hw_mgr_stop_bus_rd_for_res(ctx, res_id); } else if (hw_type == CAM_ISP_HW_TYPE_SFE) { if (cam_ife_hw_mgr_is_sfe_out_port(res_id)) { isp_hw_res = &ctx->res_list_sfe_out[res_id & 0XFF]; - CAM_ERR(CAM_ISP, "Stopping SFE out resource res id 0x%x", res_id); + CAM_ERR(CAM_ISP, "Stopping SFE out resource res id 0x%x ctx_idx: %u", + res_id, ctx->ctx_index); cam_ife_hw_mgr_stop_hw_res(isp_hw_res); } else cam_ife_hw_mgr_stop_bus_rd_for_res(ctx, res_id); @@ -12253,8 +12426,8 @@ static void cam_ife_mgr_pf_dump(struct cam_ife_hw_mgr_ctx *ctx) CAM_ISP_PACKET_META_REG_DUMP_ON_ERROR, NULL, false); if (rc) CAM_ERR(CAM_ISP, - "Reg dump on pf failed req id: %llu rc: %d", - ctx->applied_req_id, rc); + "Reg dump on pf failed req id: %llu rc: %d ctx_idx: %u", + ctx->applied_req_id, rc, ctx->ctx_index); /* dump the acquire data */ @@ -12272,9 +12445,10 @@ static void cam_ife_mgr_pf_dump(struct cam_ife_hw_mgr_ctx *ctx) sizeof(void *)); if (rc) CAM_ERR(CAM_ISP, - "csid acquire data dump failed"); + "csid acquire data dump failed, ctx_idx: %u", + ctx->ctx_index); } else - CAM_ERR(CAM_ISP, "NULL hw_intf!"); + CAM_ERR(CAM_ISP, "NULL hw_intf! ctx_idx: %u", ctx->ctx_index); } } } @@ -12299,7 +12473,7 @@ static void cam_ife_mgr_pf_dump_mid_info( if (rc) { CAM_ERR(CAM_ISP, - "getting mid port resource id failed ctx id:%d req id:%lld", + "getting mid port resource id failed ctx id:%u req id:%lld", ctx->ctx_index, packet->header.request_id); return; } @@ -12309,7 +12483,7 @@ static void cam_ife_mgr_pf_dump_mid_info( ctx->pf_info.mid = get_res.mid; ctx->pf_info.out_port_id = get_res.out_res_id; CAM_ERR(CAM_ISP, - "Page fault on resource id:(0x%x) ctx id:%d req id:%lld", + "Page fault on resource id:(0x%x) ctx id:%u req id:%lld", get_res.out_res_id, ctx->ctx_index, packet->header.request_id); } @@ -12362,9 +12536,10 @@ static void cam_ife_mgr_dump_pf_data( for (j = 0; j < hw_intf_data->num_hw_pid; j++) { if (hw_intf_data->hw_pid[j] == pf_args->pf_smmu_info->pid) { *ctx_found = true; - CAM_ERR(CAM_ISP, "PF found for %s%d pid: %u", + CAM_ERR(CAM_ISP, "PF found for %s%d pid: %u ctx_idx: %u", ctx->base[i].hw_type == CAM_ISP_HW_TYPE_VFE ? "VFE" : "SFE", - ctx->base[i].idx, pf_args->pf_smmu_info->pid); + ctx->base[i].idx, pf_args->pf_smmu_info->pid, + ctx->ctx_index); cam_ife_mgr_pf_dump_mid_info(ctx, hw_cmd_args, hw_intf_data, packet); @@ -12385,7 +12560,7 @@ static void cam_ife_mgr_dump_pf_data( if (g_ife_hw_mgr.hw_pid_support && (i == ctx->num_base || !*ctx_found)) CAM_INFO(CAM_ISP, - "This context does not cause pf:pid:%d ctx_id:%d", + "This context does not cause pf:pid:%d ctx_id:%u", pf_args->pf_smmu_info->pid, ctx->ctx_index); cam_ife_mgr_pf_dump(ctx); @@ -12427,8 +12602,9 @@ int cam_isp_config_csid_rup_aup( rup_args[hw_idx].num_res++; CAM_DBG(CAM_ISP, - "Reg update for res %d hw_id %d cdm_idx %d", - res->res_id, res->hw_intf->hw_idx, ctx->base[j].idx); + "Reg update for res %d hw_id %d cdm_idx %d ctx_idx: %u", + res->res_id, res->hw_intf->hw_idx, ctx->base[j].idx, + ctx->ctx_index); } } } @@ -12451,8 +12627,8 @@ int cam_isp_config_csid_rup_aup( return rc; CAM_DBG(CAM_ISP, - "Reg update for CSID: %u mup: %u", - res->hw_intf->hw_idx, ctx->current_mup); + "Reg update for CSID: %u mup: %u ctx_idx: %u", + res->hw_intf->hw_idx, ctx->current_mup, ctx->ctx_index); } return rc; @@ -12491,8 +12667,9 @@ static int cam_ife_mgr_configure_scratch_for_ife( continue; CAM_DBG(CAM_ISP, - "Configure scratch for IFE res: 0x%x io_addr %pK", - ife_buf_info->buf_info[i].res_id, port_info->io_addr); + "Configure scratch for IFE res: 0x%x io_addr %pK ctx_idx: %u", + ife_buf_info->buf_info[i].res_id, port_info->io_addr, + ctx->ctx_index); rc = cam_isp_sfe_send_scratch_buf_upd(0x0, CAM_ISP_HW_CMD_BUF_UPDATE, @@ -12556,11 +12733,11 @@ static int cam_ife_mgr_configure_scratch_for_sfe( } CAM_DBG(CAM_ISP, - "RDI%d res_id 0x%x idx %u io_addr %pK", + "RDI%d res_id 0x%x idx %u io_addr %pK ctx_idx: %u", i, hw_mgr_res->hw_res[j]->res_id, (res_id - CAM_ISP_SFE_OUT_RES_RDI_0), - buf_info->io_addr); + buf_info->io_addr, ctx->ctx_index); rc = cam_isp_sfe_send_scratch_buf_upd(0x0, CAM_ISP_HW_CMD_BUF_UPDATE, @@ -12591,10 +12768,10 @@ static int cam_ife_mgr_configure_scratch_for_sfe( buf_info = &ctx->scratch_buf_info.sfe_scratch_config->buf_info [res_id - CAM_ISP_SFE_IN_RD_0]; CAM_DBG(CAM_ISP, - "RD res_id 0x%x idx %u io_addr %pK", + "RD res_id 0x%x idx %u io_addr %pK ctx_idx: %u", hw_mgr_res->hw_res[j]->res_id, (res_id - CAM_ISP_SFE_IN_RD_0), - buf_info->io_addr); + buf_info->io_addr, ctx->ctx_index); rc = cam_isp_sfe_send_scratch_buf_upd(0x0, CAM_ISP_HW_CMD_BUF_UPDATE_RM, hw_mgr_res->hw_res[j], buf_info, @@ -12757,7 +12934,7 @@ static int cam_ife_mgr_cmd(void *hw_mgr_priv, void *cmd_args) switch (hw_cmd_args->cmd_type) { case CAM_HW_MGR_CMD_INTERNAL: if (!hw_cmd_args->u.internal_args) { - CAM_ERR(CAM_ISP, "Invalid cmd arguments"); + CAM_ERR(CAM_ISP, "Invalid cmd arguments, ctx_idx: %u", ctx->ctx_index); return -EINVAL; } @@ -12791,7 +12968,7 @@ static int cam_ife_mgr_cmd(void *hw_mgr_priv, void *cmd_args) case CAM_ISP_HW_MGR_GET_PACKET_OPCODE: packet = (struct cam_packet *) isp_hw_cmd_args->cmd_data; - if (((packet->header.op_code + 1) & 0xF) == + if (((packet->header.op_code + 1) & 0xF) == //why? CAM_ISP_PACKET_INIT_DEV) isp_hw_cmd_args->u.packet_op_code = CAM_ISP_PACKET_INIT_DEV; @@ -12840,8 +13017,8 @@ static int cam_ife_mgr_cmd(void *hw_mgr_priv, void *cmd_args) CAM_SFE_BUS_COMP_NUM_MAX); break; default: - CAM_ERR(CAM_ISP, "Invalid HW mgr command:0x%x", - hw_cmd_args->cmd_type); + CAM_ERR(CAM_ISP, "Invalid HW mgr command:0x%x, ctx_idx: %u", + hw_cmd_args->cmd_type, ctx->ctx_index); rc = -EINVAL; break; } @@ -12859,7 +13036,7 @@ static int cam_ife_mgr_cmd(void *hw_mgr_priv, void *cmd_args) &ctx->config_done_complete, msecs_to_jiffies(30)); if (rem_jiffies == 0) CAM_ERR(CAM_ISP, - "config done completion timeout, Reg dump will be unreliable rc=%d ctx_index %d", + "config done completion timeout, Reg dump will be unreliable rc=%d ctx_index %u", rc, ctx->ctx_index); rc = cam_ife_mgr_handle_reg_dump(ctx, ctx->reg_dump_buf_desc, @@ -12867,8 +13044,8 @@ static int cam_ife_mgr_cmd(void *hw_mgr_priv, void *cmd_args) CAM_ISP_PACKET_META_REG_DUMP_ON_FLUSH, NULL, false); if (rc) { CAM_ERR(CAM_ISP, - "Reg dump on flush failed req id: %llu rc: %d", - ctx->applied_req_id, rc); + "Reg dump on flush failed req id: %llu rc: %d ctx_idx: %u", + ctx->applied_req_id, rc, ctx->ctx_index); return rc; } break; @@ -12882,8 +13059,8 @@ static int cam_ife_mgr_cmd(void *hw_mgr_priv, void *cmd_args) CAM_ISP_PACKET_META_REG_DUMP_ON_ERROR, NULL, false); if (rc) { CAM_ERR(CAM_ISP, - "Reg dump on error failed req id: %llu rc: %d", - ctx->applied_req_id, rc); + "Reg dump on error failed req id: %llu rc: %d ctx_idx: %u", + ctx->applied_req_id, rc, ctx->ctx_index); return rc; } break; @@ -12891,7 +13068,7 @@ static int cam_ife_mgr_cmd(void *hw_mgr_priv, void *cmd_args) cam_ife_hw_mgr_dump_acq_data(ctx); break; default: - CAM_ERR(CAM_ISP, "Invalid cmd"); + CAM_ERR(CAM_ISP, "Invalid cmd, ctx_idx: %u", ctx->ctx_index); } return rc; @@ -12918,10 +13095,10 @@ static int cam_ife_mgr_user_dump_hw( false); if (rc) { CAM_ERR(CAM_ISP, - "Dump failed req: %lld handle %u offset %u", + "Dump failed req: %lld handle %u offset %u ctx_idx: %u", dump_args->request_id, dump_args->buf_handle, - dump_args->offset); + dump_args->offset, ife_ctx->ctx_index); goto end; } @@ -12944,7 +13121,7 @@ static int cam_ife_mgr_dump(void *hw_mgr_priv, void *args) CAM_ERR(CAM_ISP, "ISP CTX null"); return -EINVAL; } else if (!ife_ctx->num_base) { - CAM_ERR(CAM_ISP, "ISP CTX num_base null"); + CAM_ERR(CAM_ISP, "ISP CTX num_base null, ctx_idx: %u", ife_ctx->ctx_index); return -EINVAL; } @@ -12961,8 +13138,8 @@ static int cam_ife_mgr_dump(void *hw_mgr_priv, void *args) &isp_hw_dump_args.cpu_addr, &isp_hw_dump_args.buf_len); if (rc) { - CAM_ERR(CAM_ISP, "Invalid handle %u rc %d", - dump_args->buf_handle, rc); + CAM_ERR(CAM_ISP, "Invalid handle %u rc %d ctx_idx: %u", + dump_args->buf_handle, rc, ife_ctx->ctx_index); return -EINVAL; } @@ -12971,8 +13148,8 @@ static int cam_ife_mgr_dump(void *hw_mgr_priv, void *args) if (isp_hw_dump_args.buf_len <= isp_hw_dump_args.offset) { CAM_ERR(CAM_ISP, - "Dump offset overshoot offset %zu buf_len %zu", - isp_hw_dump_args.offset, isp_hw_dump_args.buf_len); + "Dump offset overshoot offset %zu buf_len %zu ctx_idx: %u", + isp_hw_dump_args.offset, isp_hw_dump_args.buf_len, ife_ctx->ctx_index); return -EINVAL; } @@ -12983,7 +13160,8 @@ static int cam_ife_mgr_dump(void *hw_mgr_priv, void *args) case CAM_ISP_HW_TYPE_CSID: hw_intf = ife_ctx->hw_mgr->csid_devices[hw_idx]; if (!hw_intf) { - CAM_ERR(CAM_ISP, "hw_intf null, returning rc..."); + CAM_ERR(CAM_ISP, "hw_intf null, returning rc...ctx_idx: %u", + ife_ctx->ctx_index); return -EINVAL; } rc = hw_intf->hw_ops.process_cmd(hw_intf->hw_priv, @@ -12995,7 +13173,8 @@ static int cam_ife_mgr_dump(void *hw_mgr_priv, void *args) case CAM_ISP_HW_TYPE_VFE: hw_intf = ife_ctx->hw_mgr->ife_devices[hw_idx]->hw_intf; if (!hw_intf || !hw_intf->hw_priv) { - CAM_ERR(CAM_ISP, "hw_intf null, returning rc..."); + CAM_ERR(CAM_ISP, "hw_intf null, returning rc...ctx_idx: %u", + ife_ctx->ctx_index); return -EINVAL; } rc = hw_intf->hw_ops.process_cmd(hw_intf->hw_priv, @@ -13007,7 +13186,8 @@ static int cam_ife_mgr_dump(void *hw_mgr_priv, void *args) case CAM_ISP_HW_TYPE_SFE: hw_intf = ife_ctx->hw_mgr->sfe_devices[hw_idx]->hw_intf; if (!hw_intf || !hw_intf->hw_priv) { - CAM_ERR(CAM_ISP, "hw_intf null, returning rc..."); + CAM_ERR(CAM_ISP, "hw_intf null, returning rc...ctx_idx: %u", + ife_ctx->ctx_index); return -EINVAL; } rc = hw_intf->hw_ops.process_cmd(hw_intf->hw_priv, @@ -13094,7 +13274,8 @@ static int cam_ife_mgr_cmd_get_sof_timestamp( } if (rc) - CAM_ERR_RATE_LIMIT(CAM_ISP, "Getting sof time stamp failed"); + CAM_ERR_RATE_LIMIT(CAM_ISP, "Getting sof time stamp failed, ctx_idx: %u", + ife_ctx->ctx_index); return rc; } @@ -13114,7 +13295,7 @@ static int cam_ife_mgr_recover_hw(void *priv, void *data) for (i = 0; i < recovery_data->no_of_context; i++) { ctx = recovery_data->affected_ctx[i]; if (recovery_data->id[i] != atomic_read(&ctx->recovery_id)) { - CAM_INFO(CAM_ISP, "recovery for ctx:%d error-type:%d cancelled", + CAM_INFO(CAM_ISP, "recovery for ctx:%u error-type:%d cancelled", ctx->ctx_index, error_type); cancel = true; } @@ -13154,7 +13335,8 @@ static int cam_ife_mgr_recover_hw(void *priv, void *data) recovery_data->affected_ctx[i]; rc = cam_ife_mgr_stop_hw_in_overflow(&stop_args); if (rc) { - CAM_ERR(CAM_ISP, "CTX stop failed(%d)", rc); + CAM_ERR(CAM_ISP, "CTX stop failed(%d) ctx_idx: %u", + rc, ctx->ctx_index); return rc; } } @@ -13169,7 +13351,7 @@ static int cam_ife_mgr_recover_hw(void *priv, void *data) CAM_IFE_CSID_RESET_PATH); if (rc) { - CAM_ERR(CAM_ISP, "Failed RESET"); + CAM_ERR(CAM_ISP, "Failed RESET, ctx_idx: %u", ctx->ctx_index); return rc; } } @@ -13190,10 +13372,12 @@ static int cam_ife_mgr_recover_hw(void *priv, void *data) rc = cam_ife_mgr_restart_hw(&start_args); if (rc) { - CAM_ERR(CAM_ISP, "CTX start failed(%d)", rc); + CAM_ERR(CAM_ISP, "CTX start failed(%d) ctx_idx: %u", + rc, ctx->ctx_index); return rc; } - CAM_DBG(CAM_ISP, "Started resources rc (%d)", rc); + CAM_DBG(CAM_ISP, "Started resources rc (%d) ctx_idx: %u", + rc, ctx->ctx_index); } atomic_set(&ctx->overflow_pending, 0); @@ -13267,10 +13451,11 @@ static bool cam_ife_hw_mgr_is_ctx_affected( uint32_t max_idx = ife_hwr_mgr_ctx->num_base; uint32_t ctx_affected_core_idx[CAM_IFE_HW_NUM_MAX] = {0}; - CAM_DBG(CAM_ISP, "Enter:max_idx = %d", max_idx); + CAM_DBG(CAM_ISP, "Enter:max_idx = %d, ctx_idx: %u", max_idx, ife_hwr_mgr_ctx->ctx_index); if ((max_idx >= CAM_IFE_HW_NUM_MAX) || (size > CAM_IFE_HW_NUM_MAX)) { - CAM_ERR_RATE_LIMIT(CAM_ISP, "invalid parameter = %d", max_idx); + CAM_ERR_RATE_LIMIT(CAM_ISP, "invalid parameter = %d, ctx_idx: %u", + max_idx, ife_hwr_mgr_ctx->ctx_index); return rc; } @@ -13290,7 +13475,7 @@ static bool cam_ife_hw_mgr_is_ctx_affected( j = j - 1; } } - CAM_DBG(CAM_ISP, "Exit"); + CAM_DBG(CAM_ISP, "Exit, ctx_idx: %u", ife_hwr_mgr_ctx->ctx_index); return rc; } @@ -13332,7 +13517,7 @@ static int cam_ife_hw_mgr_find_affected_ctx( continue; if (atomic_read(&ife_hwr_mgr_ctx->overflow_pending)) { - CAM_INFO(CAM_ISP, "CTX:%d already error reported", + CAM_INFO(CAM_ISP, "CTX:%u already error reported", ife_hwr_mgr_ctx->ctx_index); continue; } @@ -13341,7 +13526,7 @@ static int cam_ife_hw_mgr_find_affected_ctx( notify_err_cb = ife_hwr_mgr_ctx->common.event_cb; /* Add affected_context in list of recovery data */ - CAM_DBG(CAM_ISP, "Add affected ctx %d to list", + CAM_DBG(CAM_ISP, "Add affected ctx %u to list", ife_hwr_mgr_ctx->ctx_index); if (recovery_data->no_of_context < CAM_IFE_CTX_MAX) recovery_data->affected_ctx[ @@ -13357,7 +13542,8 @@ static int cam_ife_hw_mgr_find_affected_ctx( CAM_ISP_HW_EVENT_ERROR, (void *)error_event_data); else { - CAM_WARN(CAM_ISP, "Error call back is not set"); + CAM_WARN(CAM_ISP, "Error call back is not set, ctx_idx: %u", + ife_hwr_mgr_ctx->ctx_index); goto end; } } @@ -13419,7 +13605,8 @@ static int cam_ife_hw_mgr_handle_csid_error( err_evt_info = (struct cam_isp_hw_error_event_info *)event_info->event_data; err_type = err_evt_info->err_type; - CAM_DBG(CAM_ISP, "Entry CSID[%u] error %d", event_info->hw_idx, err_type); + CAM_DBG(CAM_ISP, "Entry CSID[%u] error %d ctx_idx: %u", + event_info->hw_idx, err_type, ctx->ctx_index); spin_lock(&g_ife_hw_mgr.ctx_lock); @@ -13480,8 +13667,8 @@ static int cam_ife_hw_mgr_handle_csid_error( if (!error_event_data.try_internal_recovery) cam_ife_hw_mgr_do_error_recovery(&recovery_data); - CAM_DBG(CAM_ISP, "Exit CSID[%u] error %d", - event_info->hw_idx, err_type); + CAM_DBG(CAM_ISP, "Exit CSID[%u] error %d ctx_idx: %u", + event_info->hw_idx, err_type, ctx->ctx_index); end: spin_unlock(&g_ife_hw_mgr.ctx_lock); @@ -13509,12 +13696,12 @@ static int cam_ife_hw_mgr_handle_csid_rup( break; ife_hwr_irq_rup_cb(ife_hw_mgr_ctx->common.cb_priv, CAM_ISP_HW_EVENT_REG_UPDATE, &rup_event_data); - CAM_DBG(CAM_ISP, "RUP done for CSID:%d source %d", event_info->hw_idx, - event_info->res_id); + CAM_DBG(CAM_ISP, "RUP done for CSID:%d source %d ctx_idx: %u", event_info->hw_idx, + event_info->res_id, ife_hw_mgr_ctx->ctx_index); break; default: - CAM_ERR_RATE_LIMIT(CAM_ISP, "Invalid res_id: %d", - event_info->res_id); + CAM_ERR_RATE_LIMIT(CAM_ISP, "Invalid res_id: %d, ctx_idx: %u", + event_info->res_id, ife_hw_mgr_ctx->ctx_index); break; } @@ -13543,12 +13730,12 @@ static int cam_ife_hw_mgr_handle_csid_eof( ife_hwr_irq_rup_cb(ctx->common.cb_priv, CAM_ISP_HW_EVENT_EOF, &eof_done_event_data); CAM_DBG(CAM_ISP, - "Received CSID[%u] CAMIF EOF res: %d", event_info->hw_idx, - event_info->res_id); + "Received CSID[%u] CAMIF EOF res: %d ctx_idx: %u", event_info->hw_idx, + event_info->res_id, ctx->ctx_index); break; default: - CAM_ERR_RATE_LIMIT(CAM_ISP, "Invalid res_id: %d", - event_info->res_id); + CAM_ERR_RATE_LIMIT(CAM_ISP, "Invalid res_id: %d ctx_idx: %u", + event_info->res_id, ctx->ctx_index); break; } @@ -13567,8 +13754,8 @@ static int cam_ife_hw_mgr_handle_csid_camif_sof( struct cam_isp_hw_secondary_event_data sec_evt_data; CAM_DBG(CAM_ISP, - "Received CSID[%u] CAMIF SOF res: %d as secondary evt", - event_info->hw_idx, event_info->res_id); + "Received CSID[%u] CAMIF SOF res: %d as secondary evt, ctx_idx: %u", + event_info->hw_idx, event_info->res_id, ctx->ctx_index); sec_evt_data.evt_type = CAM_ISP_HW_SEC_EVENT_SOF; rc = ife_hw_irq_sof_cb(ctx->common.cb_priv, @@ -13593,8 +13780,8 @@ static int cam_ife_hw_mgr_handle_csid_camif_sof( sof_done_event_data.boot_time = (uint64_t)((ts.tv_sec * 1000000000) + ts.tv_nsec); - CAM_DBG(CAM_ISP, "boot_time 0x%llx", - sof_done_event_data.boot_time); + CAM_DBG(CAM_ISP, "boot_time 0x%llx, ctx_idx: %u", + sof_done_event_data.boot_time, ctx->ctx_index); } else { if (ctx->flags.is_offline) cam_ife_hw_mgr_get_offline_sof_timestamp( @@ -13610,13 +13797,13 @@ static int cam_ife_hw_mgr_handle_csid_camif_sof( CAM_ISP_HW_EVENT_SOF, (void *)&sof_done_event_data); CAM_DBG(CAM_ISP, - "Received CSID[%u] CAMIF SOF res: %d", event_info->hw_idx, - event_info->res_id); + "Received CSID[%u] CAMIF SOF res: %d, ctx_idx: %u", event_info->hw_idx, + event_info->res_id, ctx->ctx_index); break; default: - CAM_ERR_RATE_LIMIT(CAM_ISP, "Invalid res_id: %d", - event_info->res_id); + CAM_ERR_RATE_LIMIT(CAM_ISP, "Invalid res_id: %d, ctx_idx: %u", + event_info->res_id, ctx->ctx_index); break; } end: @@ -13635,8 +13822,8 @@ static int cam_ife_hw_mgr_handle_csid_camif_epoch( struct cam_isp_hw_secondary_event_data sec_evt_data; CAM_DBG(CAM_ISP, - "Received CSID[%u] CAMIF EPOCH res: %d as secondary evt", - event_info->hw_idx, event_info->res_id); + "Received CSID[%u] CAMIF EPOCH res: %d as secondary evt, ctx_idx: %u", + event_info->hw_idx, event_info->res_id, ctx->ctx_index); sec_evt_data.evt_type = CAM_ISP_HW_SEC_EVENT_EPOCH; rc = ife_hw_irq_epoch_cb(ctx->common.cb_priv, @@ -13659,11 +13846,12 @@ static int cam_ife_hw_mgr_handle_csid_camif_epoch( CAM_ISP_HW_EVENT_EPOCH, (void *)&epoch_done_event_data); CAM_DBG(CAM_ISP, - "Received CSID[%u] CAMIF Epoch res: %d", event_info->hw_idx, - event_info->res_id); + "Received CSID[%u] CAMIF Epoch res: %d, ctx_idx: %u", event_info->hw_idx, + event_info->res_id, ctx->ctx_index); break; default: - CAM_ERR_RATE_LIMIT(CAM_ISP, "Invalid res_id: %d", event_info->res_id); + CAM_ERR_RATE_LIMIT(CAM_ISP, "Invalid res_id: %d ctx_idx: %u", + event_info->res_id, ctx->ctx_index); break; } end: @@ -13755,7 +13943,8 @@ static int cam_ife_hw_mgr_handle_hw_dump_info( sizeof(uint64_t)); if (rc) CAM_ERR(CAM_ISP, - "CSID Clock Dump failed"); + "CSID Clock Dump failed, ctx_idx: %u", + ife_hw_mgr_ctx->ctx_index); } } } @@ -13799,9 +13988,9 @@ static int cam_ife_hw_mgr_handle_sfe_hw_err( err_evt_info = (struct cam_isp_hw_error_event_info *)event_info->event_data; - CAM_DBG(CAM_ISP, "SFE[%u] error [%u] on res_type %u", + CAM_DBG(CAM_ISP, "SFE[%u] error [%u] on res_type %u ctx: %u", event_info->hw_idx, err_evt_info->err_type, - event_info->res_type); + event_info->res_type, ctx->ctx_index); spin_lock(&g_ife_hw_mgr.ctx_lock); /* Dump SFE BUS info */ @@ -13821,7 +14010,7 @@ static int cam_ife_hw_mgr_handle_sfe_hw_err( /* Only report error to userspace */ if (err_evt_info->err_type & CAM_SFE_IRQ_STATUS_VIOLATION) { error_event_data.error_type = CAM_ISP_HW_ERROR_VIOLATION; - CAM_DBG(CAM_ISP, "Notify context for SFE error"); + CAM_DBG(CAM_ISP, "Notify context for SFE error, ctx_idx: %u", ctx->ctx_index); cam_ife_hw_mgr_find_affected_ctx(&error_event_data, event_info->hw_idx, &recovery_data); } @@ -13929,13 +14118,13 @@ static int cam_ife_hw_mgr_handle_hw_rup( case CAM_ISP_HW_VFE_IN_RD: break; default: - CAM_ERR_RATE_LIMIT(CAM_ISP, "Invalid res_id: %d", - event_info->res_id); + CAM_ERR_RATE_LIMIT(CAM_ISP, "Invalid res_id: %d, ctx_idx: %u", + event_info->res_id, ife_hw_mgr_ctx->ctx_index); break; } - CAM_DBG(CAM_ISP, "RUP done for VFE:%d source %d", event_info->hw_idx, - event_info->res_id); + CAM_DBG(CAM_ISP, "RUP done for VFE:%d source %d, ctx_idx: %u", event_info->hw_idx, + event_info->res_id, ife_hw_mgr_ctx->ctx_index); return 0; } @@ -13969,13 +14158,13 @@ static int cam_ife_hw_mgr_handle_hw_epoch( break; default: - CAM_ERR_RATE_LIMIT(CAM_ISP, "Invalid res_id: %d", - event_info->res_id); + CAM_ERR_RATE_LIMIT(CAM_ISP, "Invalid res_id: %d, ctx_idx: %u", + event_info->res_id, ife_hw_mgr_ctx->ctx_index); break; } - CAM_DBG(CAM_ISP, "Epoch for VFE:%d source %d", event_info->hw_idx, - event_info->res_id); + CAM_DBG(CAM_ISP, "Epoch for VFE:%d source %d ctx_idx: %u", event_info->hw_idx, + event_info->res_id, ife_hw_mgr_ctx->ctx_index); return 0; } @@ -14003,8 +14192,8 @@ static int cam_ife_hw_mgr_handle_hw_sof( sof_done_event_data.boot_time = (uint64_t)((ts.tv_sec * 1000000000) + ts.tv_nsec); - CAM_DBG(CAM_ISP, "boot_time 0x%llx", - sof_done_event_data.boot_time); + CAM_DBG(CAM_ISP, "boot_time 0x%llx, ctx_idx: %u", + sof_done_event_data.boot_time, ife_hw_mgr_ctx->ctx_index); } else { if (ife_hw_mgr_ctx->flags.is_offline) cam_ife_hw_mgr_get_offline_sof_timestamp( @@ -14052,13 +14241,13 @@ static int cam_ife_hw_mgr_handle_hw_sof( break; default: - CAM_ERR_RATE_LIMIT(CAM_ISP, "Invalid res_id: %d", - event_info->res_id); + CAM_ERR_RATE_LIMIT(CAM_ISP, "Invalid res_id: %d, ctx_idx: %u", + event_info->res_id, ife_hw_mgr_ctx->ctx_index); break; } - CAM_DBG(CAM_ISP, "SOF for VFE:%d source %d", event_info->hw_idx, - event_info->res_id); + CAM_DBG(CAM_ISP, "SOF for VFE:%d source %d ctx_idx: %u", event_info->hw_idx, + event_info->res_id, ife_hw_mgr_ctx->ctx_index); return 0; } @@ -14099,13 +14288,13 @@ static int cam_ife_hw_mgr_handle_hw_eof( break; default: - CAM_ERR_RATE_LIMIT(CAM_ISP, "Invalid res_id: %d", - event_info->res_id); + CAM_ERR_RATE_LIMIT(CAM_ISP, "Invalid res_id: %d, ctx_idx: %u", + event_info->res_id, ife_hw_mgr_ctx->ctx_index); break; } - CAM_DBG(CAM_ISP, "EOF for VFE:%d source %d", event_info->hw_idx, - event_info->res_id); + CAM_DBG(CAM_ISP, "EOF for VFE:%d source %d ctx_idx: %u", event_info->hw_idx, + event_info->res_id, ife_hw_mgr_ctx->ctx_index); return 0; } @@ -14214,8 +14403,8 @@ static int cam_ife_hw_mgr_handle_hw_buf_done( if (!event_info->event_data) { CAM_ERR(CAM_ISP, - "No additional buf done data failed to process for HW: %u", - event_info->hw_type); + "No additional buf done data failed to process for HW: %u, ctx_idx: %u", + event_info->hw_type, ife_hw_mgr_ctx->ctx_index); return -EINVAL; } @@ -14295,7 +14484,8 @@ static int cam_ife_hw_mgr_handle_ife_event( break; default: - CAM_ERR(CAM_ISP, "Event: %u not handled for IFE", evt_id); + CAM_ERR(CAM_ISP, "Event: %u not handled for IFE, ctx_idx: %u", + evt_id, ctx->ctx_index); rc = -EINVAL; break; } @@ -14335,7 +14525,8 @@ static int cam_ife_hw_mgr_handle_csid_event( rc = cam_ife_hw_mgr_handle_csid_eof(ctx, event_info); break; default: - CAM_ERR(CAM_ISP, "Event: %u not handled for CSID", evt_id); + CAM_ERR(CAM_ISP, "Event: %u not handled for CSID, ctx_idx: %u", + evt_id, ctx->ctx_index); rc = -EINVAL; break; } @@ -14365,7 +14556,8 @@ static int cam_ife_hw_mgr_handle_sfe_event( break; default: - CAM_WARN(CAM_ISP, "Event: %u not handled for SFE", evt_id); + CAM_WARN(CAM_ISP, "Event: %u not handled for SFE, ctx_idx: %u", + evt_id, ctx->ctx_index); rc = -EINVAL; break; } @@ -15309,7 +15501,8 @@ int cam_ife_hw_mgr_init(struct cam_hw_mgr_intf *hw_mgr_intf, int *iommu_hdl) sizeof(struct cam_isp_hw_mgr_res)), GFP_KERNEL); if (!ctx_pool->res_list_ife_out) { rc = -ENOMEM; - CAM_ERR(CAM_ISP, "Alloc failed for ife out res list"); + CAM_ERR(CAM_ISP, "Alloc failed for ife out res list, ctx_idx: %u", + ctx_pool->ctx_index); goto end; } @@ -15318,7 +15511,8 @@ int cam_ife_hw_mgr_init(struct cam_hw_mgr_intf *hw_mgr_intf, int *iommu_hdl) sizeof(struct cam_isp_hw_mgr_res)), GFP_KERNEL); if (!ctx_pool->res_list_sfe_out) { rc = -ENOMEM; - CAM_ERR(CAM_ISP, "Alloc failed for SFE out res list"); + CAM_ERR(CAM_ISP, "Alloc failed for SFE out res list, ctx_idx: %u", + ctx_pool->ctx_index); goto end; } } @@ -15361,7 +15555,7 @@ int cam_ife_hw_mgr_init(struct cam_hw_mgr_intf *hw_mgr_intf, int *iommu_hdl) &g_ife_hw_mgr.workq, CRM_WORKQ_USAGE_NON_IRQ, 0, cam_req_mgr_process_workq_cam_ife_worker); if (rc < 0) { - CAM_ERR(CAM_ISP, "Unable to create worker"); + CAM_ERR(CAM_ISP, "Unable to create worker, ctx_idx: %u", ctx_pool->ctx_index); goto end; } diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c index 84d4d0a484..c2f6662ea4 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c @@ -311,17 +311,18 @@ static int cam_ife_csid_ver2_sof_irq_debug( csid_hw->flags.sof_irq_triggered = false; } - CAM_INFO(CAM_ISP, "SOF freeze: CSID:%u SOF irq %s", + CAM_INFO(CAM_ISP, "SOF freeze: CSID:%u SOF irq %s, Notify CSIPHY: %d", csid_hw->hw_intf->hw_idx, - (sof_irq_enable) ? "enabled" : "disabled"); + (sof_irq_enable) ? "enabled" : "disabled", csid_hw->rx_cfg.phy_sel - 1); data_idx = (int)(csid_hw->rx_cfg.phy_sel - csid_reg->cmn_reg->phy_sel_base_idx); if (sof_irq_enable) { if (data_idx < 0) - CAM_WARN(CAM_ISP, "Can't notify csiphy, incorrect phy selected=%d", - data_idx); + CAM_WARN(CAM_ISP, "CSID:%u Can't notify csiphy, incorrect phy selected=%d", + csid_hw->hw_intf->hw_idx, data_idx); else { - CAM_INFO(CAM_ISP, "Notify CSIPHY: %d", data_idx); + CAM_INFO(CAM_ISP, "CSID:%u Notify CSIPHY: %d", csid_hw->hw_intf->hw_idx, + data_idx); cam_subdev_notify_message(CAM_CSIPHY_DEVICE_TYPE, CAM_SUBDEV_MESSAGE_REG_DUMP, (void *)&data_idx); } @@ -391,13 +392,13 @@ static int cam_ife_csid_ver2_top_info_irq_top_half( &csid_hw->path_free_payload_list, &csid_hw->path_payload_lock); if (rc) { - CAM_WARN_RATE_LIMIT(CAM_ISP, "CSID:%d get payload failed, TOP info status: 0x%x", + CAM_WARN_RATE_LIMIT(CAM_ISP, "CSID:%u get payload failed, TOP info status: 0x%x", csid_hw->hw_intf->hw_idx, th_payload->evt_status_arr[0]); return rc; } - CAM_DBG(CAM_ISP, "CSID:%d TOP info status: 0x%x", csid_hw->hw_intf->hw_idx, + CAM_DBG(CAM_ISP, "CSID:%u TOP info status: 0x%x", csid_hw->hw_intf->hw_idx, th_payload->evt_status_arr[0]); evt_payload->irq_reg_val = th_payload->evt_status_arr[0]; @@ -421,11 +422,11 @@ static int cam_ife_csid_ver2_top_err_irq_top_half( &csid_hw->path_free_payload_list, &csid_hw->path_payload_lock); - CAM_DBG(CAM_ISP, "CSID:%d TOP status: 0x%x", csid_hw->hw_intf->hw_idx, + CAM_DBG(CAM_ISP, "CSID:%u TOP status: 0x%x", csid_hw->hw_intf->hw_idx, th_payload->evt_status_arr[0]); if (rc) { - CAM_INFO_RATE_LIMIT(CAM_ISP, "CSID:%d TOP status: 0x%x", + CAM_INFO_RATE_LIMIT(CAM_ISP, "CSID:%u TOP status: 0x%x", csid_hw->hw_intf->hw_idx, th_payload->evt_status_arr[0]); return rc; } @@ -446,10 +447,10 @@ static int cam_ife_csid_ver2_handle_buf_done_irq( csid_hw = th_payload->handler_priv; - CAM_DBG(CAM_ISP, "CSID:%d Enter", csid_hw->hw_intf->hw_idx); + CAM_DBG(CAM_ISP, "CSID:%u Enter", csid_hw->hw_intf->hw_idx); rc = cam_irq_controller_handle_irq(evt_id, csid_hw->buf_done_irq_controller, CAM_IRQ_EVT_GROUP_0); - CAM_DBG(CAM_ISP, "CSID:%d Exit (rc=%d)", csid_hw->hw_intf->hw_idx, rc); + CAM_DBG(CAM_ISP, "CSID:%u Exit (rc=%d)", csid_hw->hw_intf->hw_idx, rc); return (rc == IRQ_HANDLED) ? 0 : -EINVAL; } @@ -463,10 +464,10 @@ static int cam_ife_csid_ver2_handle_rx_irq( csid_hw = th_payload->handler_priv; - CAM_DBG(CAM_ISP, "CSID:%d Enter", csid_hw->hw_intf->hw_idx); + CAM_DBG(CAM_ISP, "CSID:%u Enter", csid_hw->hw_intf->hw_idx); rc = cam_irq_controller_handle_irq(evt_id, csid_hw->rx_irq_controller, CAM_IRQ_EVT_GROUP_0); - CAM_DBG(CAM_ISP, "CSID:%d Exit (rc=%d)", csid_hw->hw_intf->hw_idx, rc); + CAM_DBG(CAM_ISP, "CSID:%u Exit (rc=%d)", csid_hw->hw_intf->hw_idx, rc); return (rc == IRQ_HANDLED) ? 0 : -EINVAL; } @@ -479,10 +480,10 @@ static int cam_ife_csid_ver2_handle_path_irq( struct cam_ife_csid_ver2_hw *csid_hw = cam_isp_res_core_info(res); int rc = 0; - CAM_DBG(CAM_ISP, "CSID:%d %s Enter", csid_hw->hw_intf->hw_idx, res->res_name); + CAM_DBG(CAM_ISP, "CSID:%u %s Enter", csid_hw->hw_intf->hw_idx, res->res_name); rc = cam_irq_controller_handle_irq(evt_id, csid_hw->path_irq_controller[res->res_id], CAM_IRQ_EVT_GROUP_0); - CAM_DBG(CAM_ISP, "CSID:%d %s Exit (rc=%d)", csid_hw->hw_intf->hw_idx, res->res_name, rc); + CAM_DBG(CAM_ISP, "CSID:%u %s Exit (rc=%d)", csid_hw->hw_intf->hw_idx, res->res_name, rc); return (rc == IRQ_HANDLED) ? 0 : -EINVAL; } @@ -518,13 +519,13 @@ static int cam_ife_csid_ver2_path_err_top_half( &csid_hw->path_payload_lock); irq_reg_tag = cam_ife_csid_get_irq_reg_tag_ptr(); - CAM_DBG(CAM_ISP, "CSID:%d %s status: 0x%x", + CAM_DBG(CAM_ISP, "CSID:%u %s status: 0x%x", csid_hw->hw_intf->hw_idx, irq_reg_tag[path_cfg->irq_reg_idx], th_payload->evt_status_arr[0]); if (rc) { - CAM_INFO_RATE_LIMIT(CAM_ISP, "CSID:%d %s status: 0x%x", + CAM_INFO_RATE_LIMIT(CAM_ISP, "CSID:%u %s status: 0x%x", csid_hw->hw_intf->hw_idx, irq_reg_tag[path_cfg->irq_reg_idx], th_payload->evt_status_arr[0]); @@ -570,13 +571,13 @@ static int cam_ife_csid_ver2_path_top_half( &csid_hw->path_payload_lock); irq_reg_tag = cam_ife_csid_get_irq_reg_tag_ptr(); - CAM_DBG(CAM_ISP, "CSID:%d %s status: 0x%x", + CAM_DBG(CAM_ISP, "CSID:%u %s status: 0x%x", csid_hw->hw_intf->hw_idx, irq_reg_tag[path_cfg->irq_reg_idx], th_payload->evt_status_arr[0]); if (rc) { - CAM_INFO_RATE_LIMIT(CAM_ISP, "CSID:%d %s status: 0x%x", + CAM_INFO_RATE_LIMIT(CAM_ISP, "CSID:%u %s status: 0x%x", csid_hw->hw_intf->hw_idx, irq_reg_tag[path_cfg->irq_reg_idx], th_payload->evt_status_arr[0]); @@ -613,8 +614,8 @@ static inline void cam_ife_csid_ver2_reset_discard_frame_cfg( path_cfg->discard_irq_handle); if (rc) CAM_WARN(CAM_ISP, - "Failed to unsubscribe input SOF for res: %s", - res->res_name); + "CSID[%u] Failed to unsubscribe input SOF for res: %s", + csid_hw->hw_intf->hw_idx, res->res_name); path_cfg->discard_irq_handle = 0; } @@ -644,7 +645,7 @@ static int cam_ife_csid_ver2_discard_sof_top_half( csid_hw = (struct cam_ife_csid_ver2_hw *)hw_info->core_info; path_cfg = (struct cam_ife_csid_ver2_path_cfg *)res->res_priv; - CAM_DBG(CAM_ISP, "CSID: %d status: 0x%x for res: %s", + CAM_DBG(CAM_ISP, "CSID: %u status: 0x%x for res: %s", csid_hw->hw_intf->hw_idx, th_payload->evt_status_arr[path_cfg->irq_reg_idx], res->res_name); @@ -693,7 +694,7 @@ static int cam_ife_csid_ver2_discard_sof_pix_bottom_half( spin_lock(&csid_hw->lock_state); if (csid_hw->hw_info->hw_state != CAM_HW_STATE_POWER_UP) { - CAM_ERR(CAM_ISP, "CSID[%d] powered down state", + CAM_ERR(CAM_ISP, "CSID[%u] powered down state", csid_hw->hw_intf->hw_idx); goto end; } @@ -754,7 +755,7 @@ static int cam_ife_csid_ver2_discard_sof_rdi_bottom_half( spin_lock(&csid_hw->lock_state); if (csid_hw->hw_info->hw_state != CAM_HW_STATE_POWER_UP) { - CAM_ERR(CAM_ISP, "CSID[%d] powered down state", + CAM_ERR(CAM_ISP, "CSID[%u] powered down state", csid_hw->hw_intf->hw_idx); goto end; } @@ -785,7 +786,7 @@ static int cam_ife_csid_ver2_stop_csi2_in_err( soc_info = &csid_hw->hw_info->soc_info; csid_reg = (struct cam_ife_csid_ver2_reg_info *) csid_hw->core_info->csid_reg; - CAM_DBG(CAM_ISP, "CSID:%d Stop csi2 rx", + CAM_DBG(CAM_ISP, "CSID:%u Stop csi2 rx", csid_hw->hw_intf->hw_idx); if (csid_hw->rx_cfg.top_irq_handle) @@ -816,11 +817,11 @@ static int cam_ife_csid_ver2_disable_csi2( soc_info = &csid_hw->hw_info->soc_info; csid_reg = (struct cam_ife_csid_ver2_reg_info *) csid_hw->core_info->csid_reg; - CAM_DBG(CAM_ISP, "CSID:%d Disable csi2 rx", + CAM_DBG(CAM_ISP, "CSID:%u Disable csi2 rx", csid_hw->hw_intf->hw_idx); if (!csid_hw->flags.rx_enabled) { - CAM_DBG(CAM_ISP, "CSID:%d Rx already disabled", + CAM_DBG(CAM_ISP, "CSID:%u Rx already disabled", csid_hw->hw_intf->hw_idx); return 0; } @@ -878,8 +879,11 @@ static int cam_ife_csid_ver2_rx_err_top_half( discard_frame_count = atomic_read(&csid_hw->discard_frame_per_path); if (discard_frame_count) { - CAM_DBG(CAM_ISP, "ignoring rx error (error:0x%x, remaining frames:%d)", - th_payload->evt_status_arr[CAM_IFE_CSID_IRQ_REG_RX], discard_frame_count); + CAM_DBG(CAM_ISP, + "CSID[%u] ignoring rx error (error:0x%x, remaining frames:%d)", + csid_hw->hw_intf->hw_idx, + th_payload->evt_status_arr[CAM_IFE_CSID_IRQ_REG_RX], + discard_frame_count); return -ENODEV; } @@ -926,7 +930,7 @@ end: &csid_hw->rx_free_payload_list, &csid_hw->rx_payload_lock); if (rc) { - CAM_INFO_RATE_LIMIT(CAM_ISP, "CSID:%d status: 0x%X", + CAM_INFO_RATE_LIMIT(CAM_ISP, "CSID:%u status: 0x%X", csid_hw->hw_intf->hw_idx, th_payload->evt_status_arr[0]); } else { @@ -957,7 +961,7 @@ static int cam_ife_csid_ver2_handle_rx_debug_event( val = cam_io_r_mb(soc_info->reg_map[0].mem_base + csi2_reg->captured_long_pkt_0_addr); CAM_INFO(CAM_ISP, - "CSID :%d Long pkt VC: %u DT: %u WC: %u", + "CSID :%u Long pkt VC: %u DT: %u WC: %u", csid_hw->hw_intf->hw_idx, ((val & csi2_reg->vc_mask) >> csi2_reg->vc_shift), ((val & csi2_reg->dt_mask) >> csi2_reg->dt_shift), @@ -966,13 +970,13 @@ static int cam_ife_csid_ver2_handle_rx_debug_event( val = cam_io_r_mb(soc_info->reg_map[0].mem_base + csi2_reg->captured_long_pkt_1_addr); CAM_INFO(CAM_ISP, - "CSID :%d Long pkt ECC: %u", + "CSID :%u Long pkt ECC: %u", csid_hw->hw_intf->hw_idx, val); val = cam_io_r_mb(soc_info->reg_map[0].mem_base + csi2_reg->captured_long_pkt_ftr_addr); CAM_INFO(CAM_ISP, - "CSID :%d Long pkt cal CRC: %u expected CRC: %u", + "CSID :%u Long pkt cal CRC: %u expected CRC: %u", csid_hw->hw_intf->hw_idx, ((val >> csi2_reg->calc_crc_shift) & csi2_reg->calc_crc_mask), (val & csi2_reg->expected_crc_mask)); @@ -986,7 +990,7 @@ static int cam_ife_csid_ver2_handle_rx_debug_event( val = cam_io_r_mb(soc_info->reg_map[0].mem_base + csi2_reg->captured_short_pkt_0_addr); CAM_INFO(CAM_ISP, - "CSID :%d Short pkt VC: %u DT: %u LC: %u", + "CSID :%u Short pkt VC: %u DT: %u LC: %u", csid_hw->hw_intf->hw_idx, ((val & csi2_reg->vc_mask) >> csi2_reg->vc_shift), ((val & csi2_reg->dt_mask) >> csi2_reg->dt_shift), @@ -995,7 +999,7 @@ static int cam_ife_csid_ver2_handle_rx_debug_event( val = cam_io_r_mb(soc_info->reg_map[0].mem_base + csi2_reg->captured_short_pkt_1_addr); CAM_INFO(CAM_ISP, - "CSID :%d Short pkt ECC: %u", + "CSID :%u Short pkt ECC: %u", csid_hw->hw_intf->hw_idx, val); /* Update reset short pkt strobe */ @@ -1006,7 +1010,7 @@ static int cam_ife_csid_ver2_handle_rx_debug_event( val = cam_io_r_mb(soc_info->reg_map[0].mem_base + csi2_reg->captured_cphy_pkt_hdr_addr); CAM_INFO(CAM_ISP, - "CSID :%d CPHY pkt VC: %u DT: %u WC: %u", + "CSID :%u CPHY pkt VC: %u DT: %u WC: %u", csid_hw->hw_intf->hw_idx, ((val & csi2_reg->vc_mask) >> csi2_reg->vc_shift), ((val & csi2_reg->dt_mask) >> csi2_reg->dt_shift), @@ -1020,7 +1024,7 @@ static int cam_ife_csid_ver2_handle_rx_debug_event( csi2_reg->cap_unmap_long_pkt_hdr_0_addr); CAM_ERR(CAM_ISP, - "CSID:%d UNMAPPED_VC_DT: VC: %u DT: %u WC: %u not mapped to any csid paths", + "CSID:%u UNMAPPED_VC_DT: VC: %u DT: %u WC: %u not mapped to any csid paths", csid_hw->hw_intf->hw_idx, ((val & csi2_reg->vc_mask) >> csi2_reg->vc_shift), ((val & csi2_reg->dt_mask) >> csi2_reg->dt_shift), @@ -1037,7 +1041,7 @@ static int cam_ife_csid_ver2_handle_rx_debug_event( break; default: CAM_DBG(CAM_ISP, - "CSID[%d] RX_IRQ: %s", + "CSID[%u] RX_IRQ: %s", csid_hw->hw_intf->hw_idx, csid_reg->rx_irq_desc[bit_pos].desc); break; @@ -1198,13 +1202,14 @@ static int cam_ife_csid_ver2_rx_err_bottom_half( irq_status = payload->irq_reg_val & csi2_reg->fatal_err_mask; if (!csid_hw->flags.device_enabled) { - CAM_DBG(CAM_ISP, "bottom-half after stop [0x%x]", irq_status); + CAM_DBG(CAM_ISP, "CSID[%u] bottom-half after stop [0x%x]", + csid_hw->hw_intf->hw_idx, irq_status); goto end; } spin_lock(&csid_hw->lock_state); if (csid_hw->hw_info->hw_state != CAM_HW_STATE_POWER_UP) { - CAM_ERR(CAM_ISP, "CSID[%d] powered down state", + CAM_ERR(CAM_ISP, "CSID[%u] powered down state", csid_hw->hw_intf->hw_idx); goto unlock; } @@ -1250,7 +1255,7 @@ static int cam_ife_csid_ver2_rx_err_bottom_half( CAM_ERR_BUF(CAM_ISP, log_buf, CAM_IFE_CSID_LOG_BUF_LEN, &len, "DPHY_ERROR_ECC: Pkt hdr errors unrecoverable. ECC: 0x%x", - cam_io_r_mb(soc_info->reg_map[0].mem_base + + cam_io_r_mb(soc_info->reg_map[0].mem_base + csi2_reg->captured_long_pkt_1_addr)); } @@ -1294,7 +1299,7 @@ static int cam_ife_csid_ver2_rx_err_bottom_half( } } - CAM_ERR(CAM_ISP, "Fatal Errors: %s", log_buf); + CAM_ERR(CAM_ISP, "CSID[%u] Fatal Errors: %s", csid_hw->hw_intf->hw_idx, log_buf); rx_irq_status |= irq_status; csid_hw->flags.fatal_err_detected = true; @@ -1309,7 +1314,8 @@ static int cam_ife_csid_ver2_rx_err_bottom_half( "CPHY_SOT_RECEPTION: Less SOTs on lane/s"); } - CAM_ERR(CAM_ISP, "Partly fatal errors: %s", log_buf); + CAM_ERR(CAM_ISP, "CSID[%u] Partly fatal errors: %s", + csid_hw->hw_intf->hw_idx, log_buf); rx_irq_status |= irq_status; } @@ -1326,7 +1332,8 @@ static int cam_ife_csid_ver2_rx_err_bottom_half( (val >> 22), ((val >> 16) & 0x3F)); } - CAM_ERR(CAM_ISP, "Non-fatal-errors: %s", log_buf); + CAM_ERR(CAM_ISP, "CSID[%u] Non-fatal-errors: %s", + csid_hw->hw_intf->hw_idx, log_buf); } CAM_ERR_RATE_LIMIT(CAM_ISP, "CSID[%u] Rx Status 0x%x", @@ -1390,7 +1397,7 @@ void cam_ife_csid_hw_ver2_rdi_line_buffer_conflict_handler( } if (len) - CAM_ERR(CAM_ISP, "CSID[%d] %s", csid_hw->hw_intf->hw_idx, log_buf); + CAM_ERR(CAM_ISP, "CSID[%u] %s", csid_hw->hw_intf->hw_idx, log_buf); } @@ -1410,7 +1417,7 @@ void cam_ife_csid_hw_ver2_drv_err_handler(void *csid) debug_drv_1_val = cam_io_r_mb(base + csid_reg->cmn_reg->debug_drv_1_addr); CAM_INFO(CAM_ISP, - "CSID[%d] DRV cfg0:0x%x cfg1:0x%x cfg2:0x%x qtimer_val [start:end] [0x%x : 0x%x]", + "CSID[%u] DRV cfg0:0x%x cfg1:0x%x cfg2:0x%x qtimer_val [start:end] [0x%x : 0x%x]", csid_hw->hw_intf->hw_idx, cfg0_val, cfg1_val, cfg2_val, debug_drv_0_val, debug_drv_1_val); } @@ -1424,15 +1431,17 @@ void cam_ife_csid_hw_ver2_mup_mismatch_handler( (struct cam_ife_csid_ver2_path_cfg *)res->res_priv; struct cam_ife_csid_cid_data *cid_data = &csid_hw->cid_data[path_cfg->cid]; - CAM_INFO(CAM_ISP, "CSID:%d Last MUP value 0x%x programmed for res [id: %d name: %s]", + CAM_INFO(CAM_ISP, "CSID:%u Last MUP value 0x%x programmed for res [id: %d name: %s]", csid_hw->hw_intf->hw_idx, csid_hw->rx_cfg.mup, res->res_id, res->res_name); if (cid_data->vc_dt[CAM_IFE_CSID_MULTI_VC_DT_GRP_1].valid) { - CAM_INFO(CAM_ISP, "vc0 %d vc1 %d" , + CAM_INFO(CAM_ISP, "CSID:%u vc0 %d vc1 %d", + csid_hw->hw_intf->hw_idx, cid_data->vc_dt[CAM_IFE_CSID_MULTI_VC_DT_GRP_0].vc, cid_data->vc_dt[CAM_IFE_CSID_MULTI_VC_DT_GRP_1].vc); } else { - CAM_ERR(CAM_ISP, "Multi-VCDT is not enabled, vc0 %d" , + CAM_ERR(CAM_ISP, "CSID:%u Multi-VCDT is not enabled, vc0 %d", + csid_hw->hw_intf->hw_idx, cid_data->vc_dt[CAM_IFE_CSID_MULTI_VC_DT_GRP_0].vc); } @@ -1456,8 +1465,8 @@ void cam_ife_csid_ver2_print_illegal_programming_irq_status( csid_reg = csid_hw->core_info->csid_reg; path_cfg = (struct cam_ife_csid_ver2_path_cfg *)res->res_priv; if (!path_cfg || (path_cfg->cid >= CAM_IFE_CSID_CID_MAX)) { - CAM_ERR(CAM_ISP, "Invalid params: path_cfg: %pK, num_cids: %d", - path_cfg, (path_cfg ? (path_cfg->cid) : -1)); + CAM_ERR(CAM_ISP, "CSID:%u Invalid params: path_cfg: %pK, num_cids: %d", + csid_hw->hw_intf->hw_idx, path_cfg, (path_cfg ? (path_cfg->cid) : -1)); return; } @@ -1491,7 +1500,7 @@ void cam_ife_csid_ver2_print_illegal_programming_irq_status( (decode_fmt1 == csid_reg->cmn_reg->decode_format_payload_only)) { if (decode_fmt1 != decode_fmt) { CAM_ERR(CAM_ISP, - "CSID:%d decode_fmt %d decode_fmt1 %d mismatch", + "CSID:%u decode_fmt %d decode_fmt1 %d mismatch", csid_hw->hw_intf->hw_idx, decode_fmt, decode_fmt1); @@ -1501,11 +1510,12 @@ void cam_ife_csid_ver2_print_illegal_programming_irq_status( if ((vc == vc1) && (dt == dt1)) { if (decode_fmt != decode_fmt1) { CAM_ERR(CAM_ISP, - "CSID:%d Wrong multi VC-DT configuration", + "CSID:%u Wrong multi VC-DT configuration", csid_hw->hw_intf->hw_idx); CAM_ERR(CAM_ISP, - "fmt %d fmt1 %d vc %d vc1 %d dt %d dt1 %d", - decode_fmt, decode_fmt, vc, vc1, dt, dt1); + "CSID:%u fmt %d fmt1 %d vc %d vc1 %d dt %d dt1 %d", + csid_hw->hw_intf->hw_idx, decode_fmt, + decode_fmt, vc, vc1, dt, dt1); } } @@ -1514,7 +1524,7 @@ void cam_ife_csid_ver2_print_illegal_programming_irq_status( if (!((mup_rup_cfg & path_reg->rup_aup_mask) && (mup_rup_cfg & csid_reg->cmn_reg->mup_shift_val))) { CAM_ERR(CAM_ISP, - "CSID:%d MUP bit %d is programmed without RUP %d", + "CSID:%u MUP bit %d is programmed without RUP %d", csid_hw->hw_intf->hw_idx, mup_rup_cfg & path_reg->rup_aup_mask, mup_rup_cfg & csid_reg->cmn_reg->mup_shift_val); @@ -1526,7 +1536,7 @@ void cam_ife_csid_ver2_print_illegal_programming_irq_status( if (!((cfg1 & path_reg->early_eof_en_shift_val) && (cfg1 & path_reg->crop_v_en_shift_val))) { CAM_ERR(CAM_ISP, - "CSID:%d Early EOF %d enabled without VCROP %d", + "CSID:%u Early EOF %d enabled without VCROP %d", csid_hw->hw_intf->hw_idx, cfg1 & path_reg->early_eof_en_shift_val, cfg1 & path_reg->crop_v_en_shift_val); @@ -1534,7 +1544,7 @@ void cam_ife_csid_ver2_print_illegal_programming_irq_status( } } - CAM_INFO(CAM_ISP, "CSID:%d Illegal Programming for res [id: %d name: %s]", + CAM_INFO(CAM_ISP, "CSID:%u Illegal Programming for res [id: %d name: %s]", csid_hw->hw_intf->hw_idx, res->res_id, res->res_name); } @@ -1569,9 +1579,10 @@ static void cam_ife_csid_ver2_print_debug_reg_status( csid_reg->cmn_reg->test_bus_debug); CAM_INFO(CAM_ISP, - "debug_camif_0: 0x%x debug_camif_1: 0x%x halt_status: 0x%x test_bus: %s test_bus_val: 0x%x for res: %s ", - val0, val1, val2, CAM_BOOL_TO_YESNO(csid_hw->debug_info.test_bus_enabled), - val3, res->res_name); + "CSID:%u debug_camif_0: 0x%x debug_camif_1: 0x%x halt_status: 0x%x test_bus: %s test_bus_val: 0x%x for res: %s ", + csid_hw->hw_intf->hw_idx, val0, val1, val2, + CAM_BOOL_TO_YESNO(csid_hw->debug_info.test_bus_enabled), + val3, res->res_name); } static int cam_ife_csid_ver2_parse_path_irq_status( @@ -1612,7 +1623,7 @@ static int cam_ife_csid_ver2_parse_path_irq_status( } if (len) - CAM_ERR(CAM_ISP, "CSID[%d] %s status: 0x%x Errors:%s", + CAM_ERR(CAM_ISP, "CSID[%u] %s status: 0x%x Errors:%s", csid_hw->hw_intf->hw_idx, irq_reg_tag[index], irq_status, log_buf); @@ -1620,7 +1631,7 @@ static int cam_ife_csid_ver2_parse_path_irq_status( bit_pos = 0; while (status) { if (status & 0x1) - CAM_INFO(CAM_ISP, "CSID[%d] IRQ %s %s timestamp:[%lld.%09lld]", + CAM_INFO(CAM_ISP, "CSID[%u] IRQ %s %s timestamp:[%lld.%09lld]", csid_hw->hw_intf->hw_idx, irq_reg_tag[index], csid_reg->path_irq_desc[bit_pos].desc, evt_payload->timestamp.tv_sec, @@ -1663,26 +1674,26 @@ static int cam_ife_csid_ver2_top_info_irq_bottom_half( irq_status = payload->irq_reg_val & csid_hw->debug_info.top_mask; if (!irq_status) { - CAM_ERR(CAM_ISP, "Unexpected Scenario"); + CAM_ERR(CAM_ISP, "CSID:%u Unexpected Scenario", csid_hw->hw_intf->hw_idx); return 0; } if (irq_status & IFE_CSID_VER2_TOP_INFO_VOTE_UP) { - CAM_INFO(CAM_ISP, "CSID:%d INFO_VOTE_UP timestamp:[%lld.%09lld]", + cam_cpas_log_votes(true); + CAM_INFO(CAM_ISP, "CSID:%u INFO_VOTE_UP timestamp:[%lld.%09lld]", csid_hw->hw_intf->hw_idx, payload->timestamp.tv_sec, payload->timestamp.tv_nsec); - cam_cpas_log_votes(true); } if (irq_status & IFE_CSID_VER2_TOP_INFO_VOTE_DN) { - CAM_INFO(CAM_ISP, "CSID:%d INFO_VOTE_DN timestamp:[%lld.%09lld]", + cam_cpas_log_votes(true); + CAM_INFO(CAM_ISP, "CSID:%u INFO_VOTE_DN timestamp:[%lld.%09lld]", csid_hw->hw_intf->hw_idx, payload->timestamp.tv_sec, payload->timestamp.tv_nsec); - cam_cpas_log_votes(true); } if (irq_status & IFE_CSID_VER2_TOP_ERR_NO_VOTE_DN) { - CAM_INFO(CAM_ISP, "CSID:%d ERR_NO_VOTE_DN timestamp:[%lld.%09lld]", + CAM_INFO(CAM_ISP, "CSID:%u ERR_NO_VOTE_DN timestamp:[%lld.%09lld]", csid_hw->hw_intf->hw_idx, payload->timestamp.tv_sec, payload->timestamp.tv_nsec); @@ -1721,15 +1732,15 @@ static int cam_ife_csid_ver2_top_err_irq_bottom_half( irq_status = payload->irq_reg_val & csid_reg->cmn_reg->top_err_irq_mask; if (!irq_status) { - CAM_ERR(CAM_ISP, "Unexpected Scenario"); + CAM_ERR(CAM_ISP, "CSID:%u Unexpected Scenario", csid_hw->hw_intf->hw_idx); return 0; } for (i = 0; i < csid_reg->num_top_err_irqs; i++) { if (csid_reg->top_irq_desc[i].bitmask & irq_status) { - CAM_ERR(CAM_ISP, "%s %s", - csid_reg->top_irq_desc[i].err_name, + CAM_ERR(CAM_ISP, "CSID:%u %s %s", + csid_hw->hw_intf->hw_idx, csid_reg->top_irq_desc[i].err_name, csid_reg->top_irq_desc[i].desc); if (csid_reg->top_irq_desc[i].err_handler) @@ -1769,8 +1780,8 @@ void cam_ife_csid_ver2_print_format_measure_info( CAM_INFO(CAM_ISP, "CSID[%u] res [id :%d name : %s]", csid_hw->hw_intf->hw_idx, res->res_id, res->res_name); - CAM_ERR(CAM_ISP, "Frame Size Error Expected[h: %u w: %u] Actual[h: %u w: %u]", - ((expected_frame >> + CAM_ERR(CAM_ISP, "CSID[%u] Frame Size Error Expected[h: %u w: %u] Actual[h: %u w: %u]", + csid_hw->hw_intf->hw_idx, ((expected_frame >> csid_reg->cmn_reg->format_measure_height_shift_val) & csid_reg->cmn_reg->format_measure_height_mask_val), expected_frame & @@ -1829,8 +1840,9 @@ static int cam_ife_csid_ver2_ipp_bottom_half( path_cfg = (struct cam_ife_csid_ver2_path_cfg *)res->res_priv; if (!path_cfg || (path_cfg->irq_reg_idx >= CAM_IFE_CSID_IRQ_REG_MAX)) { - CAM_ERR(CAM_ISP, "Invalid params: path_cfg: %pK, irq_reg_idx: %d", - path_cfg, (path_cfg ? (path_cfg->irq_reg_idx) : -1)); + CAM_ERR(CAM_ISP, "CSID[%u] Invalid params: path_cfg: %pK, irq_reg_idx: %d", + csid_hw->hw_intf->hw_idx, path_cfg, + (path_cfg ? (path_cfg->irq_reg_idx) : -1)); rc = -EINVAL; goto end; } @@ -1841,7 +1853,8 @@ static int cam_ife_csid_ver2_ipp_bottom_half( irq_status_ipp); if (!csid_hw->flags.device_enabled) { - CAM_DBG(CAM_ISP, "bottom-half after stop [0x%x]", irq_status_ipp); + CAM_DBG(CAM_ISP, "CSID[%u] bottom-half after stop [0x%x]", + csid_hw->hw_intf->hw_idx, irq_status_ipp); goto end; } @@ -1887,7 +1900,7 @@ static int cam_ife_csid_ver2_ipp_bottom_half( err_mask = path_reg->fatal_err_mask | path_reg->non_fatal_err_mask; spin_lock(&csid_hw->lock_state); if (csid_hw->hw_info->hw_state != CAM_HW_STATE_POWER_UP) { - CAM_ERR(CAM_ISP, "CSID[%d] powered down state", + CAM_ERR(CAM_ISP, "CSID[%u] powered down state", csid_hw->hw_intf->hw_idx); goto unlock; } @@ -1948,8 +1961,9 @@ static int cam_ife_csid_ver2_ppp_bottom_half( path_cfg = (struct cam_ife_csid_ver2_path_cfg *)res->res_priv; if (!path_cfg || (path_cfg->irq_reg_idx >= CAM_IFE_CSID_IRQ_REG_MAX)) { - CAM_ERR(CAM_ISP, "Invalid params: path_cfg: %pK, irq_reg_idx: %d", - path_cfg, (path_cfg ? (path_cfg->irq_reg_idx) : -1)); + CAM_ERR(CAM_ISP, "CSID:%u Invalid params: path_cfg: %pK, irq_reg_idx: %d", + csid_hw->hw_intf->hw_idx, path_cfg, + (path_cfg ? (path_cfg->irq_reg_idx) : -1)); rc = -EINVAL; goto end; } @@ -1966,13 +1980,14 @@ static int cam_ife_csid_ver2_ppp_bottom_half( irq_status_ppp); if (!csid_hw->flags.device_enabled) { - CAM_DBG(CAM_ISP, "bottom-half after stop [0x%x]", irq_status_ppp); + CAM_DBG(CAM_ISP, "CSID[%u] bottom-half after stop [0x%x]", + csid_hw->hw_intf->hw_idx, irq_status_ppp); goto end; } spin_lock(&csid_hw->lock_state); if (csid_hw->hw_info->hw_state != CAM_HW_STATE_POWER_UP) { - CAM_ERR(CAM_ISP, "CSID[%d] powered down state", + CAM_ERR(CAM_ISP, "CSID[%u] powered down state", csid_hw->hw_intf->hw_idx); goto unlock; } @@ -2030,8 +2045,9 @@ static int cam_ife_csid_ver2_rdi_bottom_half( path_cfg = (struct cam_ife_csid_ver2_path_cfg *)res->res_priv; if (!path_cfg || (path_cfg->irq_reg_idx >= CAM_IFE_CSID_IRQ_REG_MAX)) { - CAM_ERR(CAM_ISP, "Invalid params: path_cfg: %pK, irq_reg_idx: %d", - path_cfg, (path_cfg ? (path_cfg->irq_reg_idx) : -1)); + CAM_ERR(CAM_ISP, "CSID:%u Invalid params: path_cfg: %pK, irq_reg_idx: %d", + csid_hw->hw_intf->hw_idx, path_cfg, + (path_cfg ? (path_cfg->irq_reg_idx) : -1)); rc = -EINVAL; goto end; } @@ -2051,7 +2067,8 @@ static int cam_ife_csid_ver2_rdi_bottom_half( goto end; if (!csid_hw->flags.device_enabled) { - CAM_DBG(CAM_ISP, "bottom-half after stop [0x%x]", irq_status_rdi); + CAM_DBG(CAM_ISP, "CSID:%u bottom-half after stop [0x%x]", + csid_hw->hw_intf->hw_idx, irq_status_rdi); goto end; } @@ -2063,7 +2080,7 @@ static int cam_ife_csid_ver2_rdi_bottom_half( spin_lock(&csid_hw->lock_state); if (csid_hw->hw_info->hw_state != CAM_HW_STATE_POWER_UP) { - CAM_ERR(CAM_ISP, "CSID[%d] powered down state", + CAM_ERR(CAM_ISP, "CSID[%u] powered down state", csid_hw->hw_intf->hw_idx); spin_unlock(&csid_hw->lock_state); goto end; @@ -2185,7 +2202,7 @@ int cam_ife_csid_ver2_get_hw_caps(void *hw_priv, hw_caps->camif_irq_support = csid_reg->cmn_reg->camif_irq_support; CAM_DBG(CAM_ISP, - "CSID:%d num-rdis:%d, num-pix:%d, major:%d minor:%d ver:%d", + "CSID:%u num-rdis:%d, num-pix:%d, major:%d minor:%d ver:%d", csid_hw->hw_intf->hw_idx, hw_caps->num_rdis, hw_caps->num_pix, hw_caps->major_version, hw_caps->minor_version, hw_caps->version_incr); @@ -2211,18 +2228,18 @@ static int cam_ife_csid_ver2_wait_for_reset( (struct cam_ife_csid_ver2_reg_info *) csid_hw->core_info->csid_reg; CAM_ERR(CAM_ISP, - "CSID[%d], sync-mode[%d] test_bus: 0x%x reset timed out", + "CSID[%u], sync-mode[%d] test_bus: 0x%x reset timed out", csid_hw->hw_intf->hw_idx, csid_hw->sync_mode, cam_io_r_mb( soc_info->reg_map[CAM_IFE_CSID_CLC_MEM_BASE_ID].mem_base + csid_reg->cmn_reg->test_bus_debug)); } else { - CAM_ERR(CAM_ISP, "CSID[%d], sync-mode[%d] reset timed out", + CAM_ERR(CAM_ISP, "CSID[%u], sync-mode[%d] reset timed out", csid_hw->hw_intf->hw_idx, csid_hw->sync_mode); } } else { CAM_DBG(CAM_ISP, - "CSID[%d], sync-mode[%d] reset success", + "CSID[%u], sync-mode[%d] reset success", csid_hw->hw_intf->hw_idx, csid_hw->sync_mode); } @@ -2237,7 +2254,7 @@ static int cam_ife_csid_ver2_reset_irq_top_half(uint32_t evt_id, csid_hw = th_payload->handler_priv; - CAM_DBG(CAM_ISP, "CSID[%d] TOP_IRQ_STATUS_0 = 0x%x", csid_hw->hw_intf->hw_idx, + CAM_DBG(CAM_ISP, "CSID[%u] TOP_IRQ_STATUS_0 = 0x%x", csid_hw->hw_intf->hw_idx, th_payload->evt_status_arr[0]); complete(&csid_hw->hw_info->hw_complete); @@ -2261,7 +2278,7 @@ static int cam_ife_csid_ver2_internal_reset( mem_base = soc_info->reg_map[CAM_IFE_CSID_CLC_MEM_BASE_ID].mem_base; if (csid_hw->hw_info->hw_state != CAM_HW_STATE_POWER_UP) { - CAM_ERR(CAM_ISP, "CSID[%d] powered down state", + CAM_ERR(CAM_ISP, "CSID[%u] powered down state", csid_hw->hw_intf->hw_idx); return -EINVAL; } @@ -2350,11 +2367,11 @@ int cam_ife_csid_ver2_reset(void *hw_priv, } if (rc) - CAM_ERR(CAM_ISP, "CSID[%d] reset type: %s failed", + CAM_ERR(CAM_ISP, "CSID[%u] reset type: %s failed", csid_hw->hw_intf->hw_idx, cam_ife_csid_reset_type_to_string(reset->reset_type)); else - CAM_DBG(CAM_ISP, "CSID[%d] reset type: %s", + CAM_DBG(CAM_ISP, "CSID[%u] reset type: %s", csid_hw->hw_intf->hw_idx, cam_ife_csid_reset_type_to_string(reset->reset_type)); @@ -2372,14 +2389,14 @@ static int cam_ife_csid_ver2_disable_path( if (res->res_state != CAM_ISP_RESOURCE_STATE_STREAMING) { CAM_ERR(CAM_ISP, - "CSID:%d path res type:%d res_id:%d Invalid state:%d", + "CSID:%u path res type:%d res_id:%d Invalid state:%d", csid_hw->hw_intf->hw_idx, res->res_type, res->res_id, res->res_state); return -EINVAL; } if (res->res_id >= CAM_IFE_PIX_PATH_RES_MAX) { - CAM_DBG(CAM_ISP, "CSID:%d Invalid res id%d", + CAM_DBG(CAM_ISP, "CSID:%u Invalid res id%d", csid_hw->hw_intf->hw_idx, res->res_id); return -EINVAL; } @@ -2451,7 +2468,7 @@ static int cam_ife_csid_ver2_decode_format1_validate( if (path_cfg->path_format[CAM_IFE_CSID_MULTI_VC_DT_GRP_0].decode_fmt != path_cfg->path_format[CAM_IFE_CSID_MULTI_VC_DT_GRP_1].decode_fmt) { CAM_ERR(CAM_ISP, - "CSID:%d decode_fmt %d decode_fmt1 %d mismatch", + "CSID:%u decode_fmt %d decode_fmt1 %d mismatch", csid_hw->hw_intf->hw_idx, path_cfg->path_format[CAM_IFE_CSID_MULTI_VC_DT_GRP_0].decode_fmt, path_cfg->path_format[CAM_IFE_CSID_MULTI_VC_DT_GRP_1].decode_fmt); @@ -2467,10 +2484,11 @@ static int cam_ife_csid_ver2_decode_format1_validate( if (path_cfg->path_format[CAM_IFE_CSID_MULTI_VC_DT_GRP_0].decode_fmt != path_cfg->path_format[CAM_IFE_CSID_MULTI_VC_DT_GRP_1].decode_fmt) { CAM_ERR(CAM_ISP, - "CSID:%d Wrong multi VC-DT configuration", + "CSID:%u Wrong multi VC-DT configuration", csid_hw->hw_intf->hw_idx); CAM_ERR(CAM_ISP, - "fmt %d fmt1 %d vc %d vc1 %d dt %d dt1 %d", + "CSID:%u fmt %d fmt1 %d vc %d vc1 %d dt %d dt1 %d", + csid_hw->hw_intf->hw_idx, path_cfg->path_format[CAM_IFE_CSID_MULTI_VC_DT_GRP_0].decode_fmt, path_cfg->path_format[CAM_IFE_CSID_MULTI_VC_DT_GRP_1].decode_fmt, cid_data->vc_dt[CAM_IFE_CSID_MULTI_VC_DT_GRP_0].vc, @@ -2484,7 +2502,7 @@ static int cam_ife_csid_ver2_decode_format1_validate( return rc; err: - CAM_ERR(CAM_ISP, "Invalid decode fmt1 cfg csid[%d] res [id %d name %s] rc %d", + CAM_ERR(CAM_ISP, "Invalid decode fmt1 cfg CSID[%u] res [id %d name %s] rc %d", csid_hw->hw_intf->hw_idx, res->res_id, res->res_name, rc); return rc; } @@ -2571,11 +2589,11 @@ static int cam_ife_csid_hw_ver2_config_path_data( path_cfg->start_pixel + 1; } CAM_DBG(CAM_ISP, - "CSID:%d res:%d master:startpixel 0x%x endpixel:0x%x", + "CSID:%u res:%d master:startpixel 0x%x endpixel:0x%x", csid_hw->hw_intf->hw_idx, reserve->res_id, path_cfg->start_pixel, path_cfg->end_pixel); CAM_DBG(CAM_ISP, - "CSID:%d res:%d master:line start:0x%x line end:0x%x", + "CSID:%u res:%d master:line start:0x%x line end:0x%x", csid_hw->hw_intf->hw_idx, reserve->res_id, path_cfg->start_line, path_cfg->end_line); } else if (reserve->sync_mode == CAM_ISP_HW_SYNC_SLAVE) { @@ -2583,12 +2601,12 @@ static int cam_ife_csid_hw_ver2_config_path_data( path_cfg->end_pixel = reserve->in_port->right_stop; path_cfg->width = reserve->in_port->right_width; CAM_DBG(CAM_ISP, - "CSID:%d res:%d slave:start:0x%x end:0x%x width 0x%x", + "CSID:%u res:%d slave:start:0x%x end:0x%x width 0x%x", csid_hw->hw_intf->hw_idx, reserve->res_id, path_cfg->start_pixel, path_cfg->end_pixel, path_cfg->width); CAM_DBG(CAM_ISP, - "CSID:%d res:%d slave:line start:0x%x line end:0x%x", + "CSID:%u res:%d slave:line start:0x%x line end:0x%x", csid_hw->hw_intf->hw_idx, reserve->res_id, path_cfg->start_line, path_cfg->end_line); } else { @@ -2596,7 +2614,7 @@ static int cam_ife_csid_hw_ver2_config_path_data( path_cfg->start_pixel = reserve->in_port->left_start; path_cfg->end_pixel = reserve->in_port->left_stop; CAM_DBG(CAM_ISP, - "CSID:%d res:%d left width %d start: %d stop:%d", + "CSID:%u res:%d left width %d start: %d stop:%d", csid_hw->hw_intf->hw_idx, reserve->res_id, reserve->in_port->left_width, reserve->in_port->left_start, @@ -2659,7 +2677,8 @@ static int cam_ife_csid_hw_ver2_config_path_data( break; default: rc = -EINVAL; - CAM_ERR(CAM_ISP, "Invalid Res id %u", reserve->res_id); + CAM_ERR(CAM_ISP, "CSID[%u] Invalid Res id %u", + csid_hw->hw_intf->hw_idx, reserve->res_id); break; } @@ -2667,7 +2686,7 @@ static int cam_ife_csid_hw_ver2_config_path_data( (cid_data->vc_dt[CAM_IFE_CSID_MULTI_VC_DT_GRP_1].valid)) { rc = cam_ife_csid_ver2_decode_format1_validate(csid_hw, res); if (rc) { - CAM_ERR(CAM_ISP, "CSID[%d] res %d decode fmt1 validation failed", + CAM_ERR(CAM_ISP, "CSID[%u] res %d decode fmt1 validation failed", csid_hw->hw_intf->hw_idx, res); goto end; } @@ -2733,7 +2752,7 @@ static int cam_ife_csid_hw_ver2_config_rx( csid_hw->counters.csi2_reserve_cnt++; CAM_DBG(CAM_ISP, - "CSID:%d Rx lane param: cfg:%u type:%u num:%u res:%u", + "CSID:%u Rx lane param: cfg:%u type:%u num:%u res:%u", csid_hw->hw_intf->hw_idx, reserve->in_port->lane_cfg, reserve->in_port->lane_type, reserve->in_port->lane_num, reserve->in_port->res_type); @@ -2768,11 +2787,12 @@ static int cam_ife_csid_ver_config_camif( if (path_cfg->horizontal_bin || path_cfg->qcfa_bin) path_cfg->epoch_cfg >>= 1; - CAM_DBG(CAM_ISP, "CSID[%d] res_id: %u epoch factor: 0x%x", + CAM_DBG(CAM_ISP, "CSID[%u] res_id: %u epoch factor: 0x%x", csid_hw->hw_intf->hw_idx, reserve->res_id, path_cfg->epoch_cfg); break; default: - CAM_DBG(CAM_ISP, "No CAMIF epoch update for res: %u", reserve->res_id); + CAM_DBG(CAM_ISP, "CSID[%u] No CAMIF epoch update for res: %u", + csid_hw->hw_intf->hw_idx, reserve->res_id); break; } @@ -2790,7 +2810,7 @@ int cam_ife_csid_hw_ver2_hw_cfg( rc = cam_ife_csid_hw_ver2_config_rx(csid_hw, reserve); if (rc) { - CAM_ERR(CAM_ISP, "CSID[%d] rx config failed", + CAM_ERR(CAM_ISP, "CSID[%u] rx config failed", csid_hw->hw_intf->hw_idx); return rc; } @@ -2798,14 +2818,14 @@ int cam_ife_csid_hw_ver2_hw_cfg( rc = cam_ife_csid_hw_ver2_config_path_data(csid_hw, path_cfg, reserve, cid); if (rc) { - CAM_ERR(CAM_ISP, "CSID[%d] path data config failed", + CAM_ERR(CAM_ISP, "CSID[%u] path data config failed", csid_hw->hw_intf->hw_idx); goto end; } rc = cam_ife_csid_ver_config_camif(csid_hw, reserve, path_cfg); if (rc) - CAM_ERR(CAM_ISP, "CSID[%d] camif config failed", + CAM_ERR(CAM_ISP, "CSID[%u] camif config failed", csid_hw->hw_intf->hw_idx); end: @@ -2834,7 +2854,7 @@ static int cam_ife_csid_ver2_in_port_validate( if (csid_hw->token != reserve->cb_priv) { CAM_ERR(CAM_ISP, - "CSID[%d] different Context for res %d", + "CSID[%u] different Context for res %d", csid_hw->hw_intf->hw_idx, reserve->res_id); rc = -EINVAL; @@ -2843,7 +2863,7 @@ static int cam_ife_csid_ver2_in_port_validate( if (csid_hw->res_type != reserve->in_port->res_type) { CAM_ERR(CAM_ISP, - "CSID[%d] Invalid res[%d] in_res_type[%d]", + "CSID[%u] Invalid res[%d] in_res_type[%d]", csid_hw->hw_intf->hw_idx, csid_hw->res_type, reserve->in_port->res_type); @@ -2858,7 +2878,7 @@ static int cam_ife_csid_ver2_in_port_validate( csid_hw->rx_cfg.lane_num != reserve->in_port->lane_num) { CAM_ERR(CAM_ISP, - "lane: num[%d %d] type[%d %d] cfg[%d %d]", + "CSID[%u] lane: num[%d %d] type[%d %d] cfg[%d %d]", csid_hw->hw_intf->hw_idx, csid_hw->rx_cfg.lane_num, reserve->in_port->lane_num, @@ -2873,7 +2893,7 @@ static int cam_ife_csid_ver2_in_port_validate( return rc; err: - CAM_ERR(CAM_ISP, "Invalid args csid[%d] rc %d", + CAM_ERR(CAM_ISP, "Invalid args CSID[%u] rc %d", csid_hw->hw_intf->hw_idx, rc); return rc; } @@ -2942,7 +2962,7 @@ int cam_ife_csid_ver2_reserve(void *hw_priv, rc = cam_ife_csid_hw_ver2_hw_cfg(csid_hw, path_cfg, reserve, cid); if (rc) { - CAM_ERR(CAM_ISP, "CSID[%d] res %d hw_cfg fail", + CAM_ERR(CAM_ISP, "CSID[%u] res %d hw_cfg fail", csid_hw->hw_intf->hw_idx, reserve->res_id); goto release; } @@ -2994,7 +3014,7 @@ int cam_ife_csid_ver2_release(void *hw_priv, res = (struct cam_isp_resource_node *)release_args; if (res->res_type != CAM_ISP_RESOURCE_PIX_PATH) { - CAM_ERR(CAM_ISP, "CSID:%d Invalid res type:%d res id%d", + CAM_ERR(CAM_ISP, "CSID:%u Invalid res type:%d res id%d", csid_hw->hw_intf->hw_idx, res->res_type, res->res_id); return -EINVAL; @@ -3004,7 +3024,7 @@ int cam_ife_csid_ver2_release(void *hw_priv, if ((res->res_type == CAM_ISP_RESOURCE_PIX_PATH && res->res_id >= CAM_IFE_PIX_PATH_RES_MAX)) { - CAM_ERR(CAM_ISP, "CSID:%d Invalid res type:%d res id%d", + CAM_ERR(CAM_ISP, "CSID:%u Invalid res type:%d res id%d", csid_hw->hw_intf->hw_idx, res->res_type, res->res_id); rc = -EINVAL; @@ -3014,14 +3034,14 @@ int cam_ife_csid_ver2_release(void *hw_priv, if ((res->res_state <= CAM_ISP_RESOURCE_STATE_AVAILABLE) || (res->res_state >= CAM_ISP_RESOURCE_STATE_STREAMING)) { CAM_WARN(CAM_ISP, - "CSID:%d res type:%d Res %d in state %d", + "CSID:%u res type:%d Res %d in state %d", csid_hw->hw_intf->hw_idx, res->res_type, res->res_id, res->res_state); goto end; } - CAM_DBG(CAM_ISP, "CSID:%d res type :%d Resource [id:%d name:%s]", + CAM_DBG(CAM_ISP, "CSID:%u res type :%d Resource [id:%d name:%s]", csid_hw->hw_intf->hw_idx, res->res_type, res->res_id, res->res_name); @@ -3119,7 +3139,7 @@ static int cam_ife_csid_ver2_init_config_rdi_path( csid_hw->core_info->csid_reg; if (!csid_reg->path_reg[res->res_id]) { - CAM_ERR(CAM_ISP, "CSID:%d RDI:%d is not supported on HW", + CAM_ERR(CAM_ISP, "CSID:%u RDI:%d is not supported on HW", csid_hw->hw_intf->hw_idx, res->res_id); return -EINVAL; } @@ -3136,7 +3156,7 @@ static int cam_ife_csid_ver2_init_config_rdi_path( path_reg->offline_mode_en_shift_val); val |= (1 << cmn_reg->path_en_shift_val); cam_io_w_mb(val, mem_base + path_reg->cfg0_addr); - CAM_DBG(CAM_ISP, "CSID:%d RDI:%d cfg0: 0x%x for offline", + CAM_DBG(CAM_ISP, "CSID:%u RDI:%d cfg0: 0x%x for offline", csid_hw->hw_intf->hw_idx, res->res_id, val); return 0; } @@ -3175,7 +3195,7 @@ static int cam_ife_csid_ver2_init_config_rdi_path( cfg0 |= 1 << path_reg->sof_retiming_dis_shift; cam_io_w_mb(cfg0, mem_base + path_reg->cfg0_addr); - CAM_DBG(CAM_ISP, "CSID[%d] %s cfg0_addr 0x%x", + CAM_DBG(CAM_ISP, "CSID[%u] %s cfg0_addr 0x%x", csid_hw->hw_intf->hw_idx, res->res_name, cfg0); /*Configure Multi VC DT combo */ @@ -3293,7 +3313,7 @@ static int cam_ife_csid_ver2_init_config_pxl_path( if (!path_reg) { CAM_ERR(CAM_ISP, - "CSID:%d path res type:%d res_id:%d res state %d", + "CSID:%u path res type:%d res_id:%d res state %d", csid_hw->hw_intf->hw_idx, res->res_type, res->res_id, res->res_state); return -EINVAL; @@ -3336,7 +3356,7 @@ static int cam_ife_csid_ver2_init_config_pxl_path( if (cam_ife_csid_ver2_disable_sof_retime(csid_hw, res)) cfg0 |= 1 << path_reg->sof_retiming_dis_shift; - CAM_DBG(CAM_ISP, "CSID[%d] res:%d cfg0_addr 0x%x", + CAM_DBG(CAM_ISP, "CSID[%u] res:%d cfg0_addr 0x%x", csid_hw->hw_intf->hw_idx, res->res_id, cfg0); cam_io_w_mb(cfg0, mem_base + path_reg->cfg0_addr); @@ -3412,7 +3432,7 @@ static int cam_ife_csid_ver2_init_config_pxl_path( (cmn_reg->timestamp_strobe_val << cmn_reg->timestamp_stb_sel_shift_val); - CAM_DBG(CAM_ISP, "CSID[%d] res:%d cfg1_addr 0x%x", + CAM_DBG(CAM_ISP, "CSID[%u] res:%d cfg1_addr 0x%x", csid_hw->hw_intf->hw_idx, res->res_id, cfg1); cam_io_w_mb(cfg1, mem_base + path_reg->cfg1_addr); @@ -3487,14 +3507,14 @@ static inline int cam_ife_csid_ver2_subscribe_sof_for_discard( if (path_cfg->discard_irq_handle < 1) { CAM_ERR(CAM_ISP, - "CSID[%d] Subscribing input SOF failed for discarding %d", + "CSID[%u] Subscribing input SOF failed for discarding %d", csid_hw->hw_intf->hw_idx, res->res_id); rc = -EINVAL; } CAM_DBG(CAM_ISP, - "Subscribing input SOF for discard done res: %s rc: %d", - res->res_name, rc); + "CSID[%u] Subscribing input SOF for discard done res: %s rc: %d", + csid_hw->hw_intf->hw_idx, res->res_name, rc); return rc; } @@ -3519,7 +3539,7 @@ static int cam_ife_csid_ver2_path_irq_subscribe( NULL, NULL, NULL, CAM_IRQ_EVT_GROUP_0); if (path_cfg->top_irq_handle < 1) { - CAM_ERR(CAM_ISP, "csid[%d] subscribe top irq fail %s", + CAM_ERR(CAM_ISP, "CSID[%u] subscribe top irq fail %s", csid_hw->hw_intf->hw_idx, res->res_name); return -EINVAL; } @@ -3542,7 +3562,7 @@ static int cam_ife_csid_ver2_path_irq_subscribe( CAM_IRQ_EVT_GROUP_0); if (path_cfg->irq_handle < 1) { - CAM_ERR(CAM_ISP, "csid[%d] subscribe path irq fail %s", + CAM_ERR(CAM_ISP, "CSID[%u] subscribe path irq fail %s", csid_hw->hw_intf->hw_idx, res->res_name); rc = -EINVAL; goto unreg_path; @@ -3560,7 +3580,7 @@ static int cam_ife_csid_ver2_path_irq_subscribe( CAM_IRQ_EVT_GROUP_0); if (path_cfg->err_irq_handle < 1) { - CAM_ERR(CAM_ISP, "csid[%d] subscribe error irq fail %s", + CAM_ERR(CAM_ISP, "CSID[%u] subscribe error irq fail %s", csid_hw->hw_intf->hw_idx, res->res_name); rc = -EINVAL; goto unsub_path; @@ -3601,7 +3621,7 @@ static int cam_ife_csid_ver2_program_rdi_path( if (rc) { CAM_ERR(CAM_ISP, - "CSID:%d %s path res type:%d res_id:%d %d", + "CSID:%u %s path res type:%d res_id:%d %d", csid_hw->hw_intf->hw_idx, res->res_type, res->res_id, res->res_state); return rc; @@ -3614,7 +3634,7 @@ static int cam_ife_csid_ver2_program_rdi_path( path_reg = csid_reg->path_reg[res->res_id]; if (!path_reg) { - CAM_ERR(CAM_ISP, "CSID:%d RDI:%d is not supported on HW", + CAM_ERR(CAM_ISP, "CSID:%u RDI:%d is not supported on HW", csid_hw->hw_intf->hw_idx, res->res_id); return -EINVAL; } @@ -3622,7 +3642,7 @@ static int cam_ife_csid_ver2_program_rdi_path( mem_base = soc_info->reg_map[CAM_IFE_CSID_CLC_MEM_BASE_ID].mem_base; path_cfg = (struct cam_ife_csid_ver2_path_cfg *)res->res_priv; if (!csid_hw->flags.offline_mode) { - CAM_DBG(CAM_ISP, "CSID:%d Rdi res: %d", + CAM_DBG(CAM_ISP, "CSID:%u Rdi res: %d", csid_hw->hw_intf->hw_idx, res->res_id); /*Program the camif part */ @@ -3647,8 +3667,8 @@ static int cam_ife_csid_ver2_program_rdi_path( val |= path_reg->epoch0_irq_mask; CAM_DBG(CAM_ISP, - "Enable camif: %d evt irq for res: %s", - path_cfg->sec_evt_config.evt_type, res->res_name); + "CSID:%u Enable camif: %d evt irq for res: %s", + csid_hw->hw_intf->hw_idx, path_cfg->sec_evt_config.evt_type, res->res_name); } res->res_state = CAM_ISP_RESOURCE_STATE_STREAMING; @@ -3692,7 +3712,7 @@ static int cam_ife_csid_ver2_program_ipp_path( if (rc) { CAM_ERR(CAM_ISP, - "CSID:%d %s path res type:%d res_id:%d %d", + "CSID:%u %s path res type:%d res_id:%d %d", csid_hw->hw_intf->hw_idx, res->res_type, res->res_id, res->res_state); return rc; @@ -3704,7 +3724,7 @@ static int cam_ife_csid_ver2_program_ipp_path( path_reg = csid_reg->path_reg[CAM_IFE_PIX_PATH_RES_IPP]; if (!path_reg) { - CAM_ERR(CAM_ISP, "CSID:%d IPP is not supported on HW", + CAM_ERR(CAM_ISP, "CSID:%u IPP is not supported on HW", csid_hw->hw_intf->hw_idx); return -EINVAL; } @@ -3715,7 +3735,7 @@ static int cam_ife_csid_ver2_program_ipp_path( cam_io_w_mb(path_cfg->epoch_cfg << path_reg->epoch0_shift_val, mem_base + path_reg->epoch_irq_cfg_addr); - CAM_DBG(CAM_ISP, "csid[%d] frame_cfg 0x%x epoch_cfg 0x%x", + CAM_DBG(CAM_ISP, "CSID[%u] frame_cfg 0x%x epoch_cfg 0x%x", csid_hw->hw_intf->hw_idx, val, path_cfg->epoch_cfg); @@ -3768,7 +3788,7 @@ static int cam_ife_csid_ver2_program_ipp_path( cam_io_w_mb(val, mem_base + path_reg->ctrl_addr); - CAM_DBG(CAM_ISP, "CSID:%d Pix res: %d ctrl val: 0x%x", + CAM_DBG(CAM_ISP, "CSID:%u Pix res: %d ctrl val: 0x%x", csid_hw->hw_intf->hw_idx, res->res_id, val); @@ -3863,7 +3883,7 @@ static int cam_ife_csid_ver2_program_ppp_path( if (rc) { CAM_ERR(CAM_ISP, - "CSID:%d %s path res type:%d res_id:%d %d", + "CSID:%u %s path res type:%d res_id:%d %d", csid_hw->hw_intf->hw_idx, res->res_type, res->res_id, res->res_state); return rc; @@ -3875,7 +3895,7 @@ static int cam_ife_csid_ver2_program_ppp_path( path_reg = csid_reg->path_reg[res->res_id]; if (!path_reg) { - CAM_ERR(CAM_ISP, "CSID:%d PPP is not supported on HW", + CAM_ERR(CAM_ISP, "CSID:%u PPP is not supported on HW", csid_hw->hw_intf->hw_idx); return -EINVAL; } @@ -3909,7 +3929,7 @@ static int cam_ife_csid_ver2_program_ppp_path( cam_io_w_mb(val, mem_base + path_reg->ctrl_addr); - CAM_DBG(CAM_ISP, "CSID:%d Pix res: %d ctrl val: 0x%x", + CAM_DBG(CAM_ISP, "CSID:%u Pix res: %d ctrl val: 0x%x", csid_hw->hw_intf->hw_idx, res->res_id, val); if (path_cfg->sync_mode == CAM_ISP_HW_SYNC_MASTER || @@ -3949,7 +3969,7 @@ static int cam_ife_csid_ver2_rx_capture_config( break; if (i == CAM_IFE_CSID_CID_MAX) { - CAM_WARN(CAM_ISP, "CSID[%d] no valid cid", + CAM_WARN(CAM_ISP, "CSID[%u] no valid cid", csid_hw->hw_intf->hw_idx); return 0; } @@ -3985,7 +4005,7 @@ static int cam_ife_csid_ver2_rx_capture_config( cam_io_w_mb(val, soc_info->reg_map[0].mem_base + csid_reg->csi2_reg->capture_ctrl_addr); - CAM_DBG(CAM_ISP, "CSID[%d] rx capture_ctrl: 0x%x", csid_hw->hw_intf->hw_idx, val); + CAM_DBG(CAM_ISP, "CSID[%u] rx capture_ctrl: 0x%x", csid_hw->hw_intf->hw_idx, val); return 0; } @@ -4007,7 +4027,7 @@ static int cam_ife_csid_ver2_csi2_irq_subscribe(struct cam_ife_csid_ver2_hw *csi NULL, NULL, NULL, CAM_IRQ_EVT_GROUP_0); if (csid_hw->rx_cfg.top_irq_handle < 1) { - CAM_ERR(CAM_ISP, "CSID[%d] RX Subscribe Top Irq fail", + CAM_ERR(CAM_ISP, "CSID[%u] RX Subscribe Top Irq fail", csid_hw->hw_intf->hw_idx); rc = -EINVAL; goto err; @@ -4032,7 +4052,7 @@ static int cam_ife_csid_ver2_csi2_irq_subscribe(struct cam_ife_csid_ver2_hw *csi CAM_IRQ_EVT_GROUP_0); if (csid_hw->rx_cfg.irq_handle < 1) { - CAM_ERR(CAM_ISP, "CSID[%d] RX debug irq register fail", + CAM_ERR(CAM_ISP, "CSID[%u] RX debug irq register fail", csid_hw->hw_intf->hw_idx); rc = -EINVAL; goto unreg_rx; @@ -4051,7 +4071,7 @@ static int cam_ife_csid_ver2_csi2_irq_subscribe(struct cam_ife_csid_ver2_hw *csi CAM_IRQ_EVT_GROUP_0); if (csid_hw->rx_cfg.err_irq_handle < 1) { - CAM_ERR(CAM_ISP, "CSID[%d] RX err irq register fail", + CAM_ERR(CAM_ISP, "CSID[%u] RX err irq register fail", csid_hw->hw_intf->hw_idx); rc = -EINVAL; goto unsub_rx; @@ -4113,7 +4133,7 @@ static int cam_ife_csid_ver2_enable_csi2(struct cam_ife_csid_ver2_hw *csid_hw) cam_io_w_mb(val, mem_base + csi2_reg->cfg0_addr); - CAM_DBG(CAM_ISP, "CSID[%d] rx_cfg0: 0x%x", + CAM_DBG(CAM_ISP, "CSID[%u] rx_cfg0: 0x%x", csid_hw->hw_intf->hw_idx, val); val = 0; @@ -4133,12 +4153,12 @@ static int cam_ife_csid_ver2_enable_csi2(struct cam_ife_csid_ver2_hw *csid_hw) if (vc_full_width == 1) { val |= 1 << csi2_reg->vc_mode_shift_val; } else if (vc_full_width < 0) { - CAM_ERR(CAM_ISP, "Error VC DT"); + CAM_ERR(CAM_ISP, "CSID[%u] Error VC DT", csid_hw->hw_intf->hw_idx); return -EINVAL; } cam_io_w_mb(val, mem_base + csi2_reg->cfg1_addr); - CAM_DBG(CAM_ISP, "CSID[%d] rx_cfg1: 0x%x", + CAM_DBG(CAM_ISP, "CSID[%u] rx_cfg1: 0x%x", csid_hw->hw_intf->hw_idx, val); val = csi2_reg->fatal_err_mask | csi2_reg->part_fatal_err_mask | @@ -4184,11 +4204,11 @@ static int cam_ife_csid_ver2_program_top( input_core_sel = csid_reg->input_core_sel[csid_hw->hw_intf->hw_idx] [csid_hw->top_cfg.input_core_type]; - CAM_DBG(CAM_ISP, "CSID[%d] input_core_sel %d", + CAM_DBG(CAM_ISP, "CSID[%u] input_core_sel %d", csid_hw->hw_intf->hw_idx, input_core_sel); if (input_core_sel == -1) { - CAM_ERR(CAM_ISP, "csid[%d] invalid top input_core_type %u", + CAM_ERR(CAM_ISP, "CSID[%u] invalid top input_core_type %u", csid_hw->hw_intf->hw_idx, csid_hw->top_cfg.input_core_type); return -EINVAL; @@ -4281,7 +4301,7 @@ static int cam_ife_csid_ver2_enable_core(struct cam_ife_csid_ver2_hw *csid_hw) /* overflow check before increment */ if (csid_hw->hw_info->open_count == UINT_MAX) { - CAM_ERR(CAM_ISP, "CSID:%d Open count reached max", + CAM_ERR(CAM_ISP, "CSID:%u Open count reached max", csid_hw->hw_intf->hw_idx); return -EINVAL; } @@ -4290,7 +4310,7 @@ static int cam_ife_csid_ver2_enable_core(struct cam_ife_csid_ver2_hw *csid_hw) csid_hw->hw_info->open_count++; if (csid_hw->hw_info->open_count > 1) { - CAM_DBG(CAM_ISP, "CSID[%d] hw has already been enabled", + CAM_DBG(CAM_ISP, "CSID[%u] hw has already been enabled", csid_hw->hw_intf->hw_idx); return rc; } @@ -4299,13 +4319,13 @@ static int cam_ife_csid_ver2_enable_core(struct cam_ife_csid_ver2_hw *csid_hw) soc_info->src_clk_idx, &clk_lvl); if (rc) { CAM_ERR(CAM_ISP, - "CSID[%d] get clk level fail rate %u", + "CSID[%u] get clk level fail rate %u", csid_hw->clk_rate); } if (soc_private->is_ife_csid_lite) CAM_DBG(CAM_ISP, - "CSID[%d] clk lvl %u received clk_rate %u applied clk_rate :%lu", + "CSID[%u] clk lvl %u received clk_rate %u applied clk_rate :%lu", csid_hw->hw_intf->hw_idx, clk_lvl, csid_hw->clk_rate, soc_info->applied_src_clk_rates.sw_client); else @@ -4353,7 +4373,7 @@ static int cam_ife_csid_ver2_enable_core(struct cam_ife_csid_ver2_hw *csid_hw) CAM_IRQ_EVT_GROUP_0); if (csid_hw->reset_irq_handle < 1) { - CAM_ERR(CAM_ISP, "csid[%d] reset irq subscribe fail", + CAM_ERR(CAM_ISP, "CSID[%u] reset irq subscribe fail", csid_hw->hw_intf->hw_idx); goto disable_res; } @@ -4368,7 +4388,7 @@ disable_res: cam_ife_csid_disable_soc_resources(soc_info); err: - CAM_ERR(CAM_ISP, "CSID[%d] init hw fail rc %d", + CAM_ERR(CAM_ISP, "CSID[%u] init hw fail rc %d", csid_hw->hw_intf->hw_idx, rc); csid_hw->hw_info->open_count--; return rc; @@ -4388,7 +4408,7 @@ static int cam_ife_csid_ver2_enable_hw( uint32_t top_info_irq_mask = 0; if (csid_hw->flags.device_enabled) { - CAM_DBG(CAM_ISP, "CSID[%d] hw has already been enabled", + CAM_DBG(CAM_ISP, "CSID[%u] hw has already been enabled", csid_hw->hw_intf->hw_idx); return 0; } @@ -4439,7 +4459,7 @@ static int cam_ife_csid_ver2_enable_hw( if (csid_hw->buf_done_irq_handle < 1) { - CAM_ERR(CAM_ISP, "csid[%d] buf done irq subscribe fail", + CAM_ERR(CAM_ISP, "CSID[%u] buf done irq subscribe fail", csid_hw->hw_intf->hw_idx); return -EINVAL; } @@ -4457,7 +4477,7 @@ static int cam_ife_csid_ver2_enable_hw( CAM_IRQ_EVT_GROUP_0); if (csid_hw->top_err_irq_handle < 1) { - CAM_ERR(CAM_ISP, "csid[%d] top error irq subscribe fail", + CAM_ERR(CAM_ISP, "CSID[%u] top error irq subscribe fail", csid_hw->hw_intf->hw_idx); rc = -EINVAL; goto unsubscribe_buf_done; @@ -4487,7 +4507,7 @@ static int cam_ife_csid_ver2_enable_hw( CAM_IRQ_EVT_GROUP_0); if (csid_hw->top_info_irq_handle < 1) { - CAM_ERR(CAM_ISP, "CSID[%d] Subscribe Top Info Irq fail", + CAM_ERR(CAM_ISP, "CSID[%u] Subscribe Top Info Irq fail", csid_hw->hw_intf->hw_idx); rc = -EINVAL; goto unsubscribe_top_err; @@ -4496,7 +4516,7 @@ static int cam_ife_csid_ver2_enable_hw( csid_hw->flags.device_enabled = true; csid_hw->flags.fatal_err_detected = false; - CAM_DBG(CAM_ISP, "CSID:%d CSID HW version: 0x%x", + CAM_DBG(CAM_ISP, "CSID:%u CSID HW version: 0x%x", csid_hw->hw_intf->hw_idx, val); return 0; @@ -4534,7 +4554,7 @@ int cam_ife_csid_ver2_init_hw(void *hw_priv, rc = cam_ife_csid_ver2_enable_core(csid_hw); if (rc) { - CAM_ERR(CAM_ISP, "CSID[%d] init hw fail", + CAM_ERR(CAM_ISP, "CSID[%u] init hw fail", csid_hw->hw_intf->hw_idx); goto end; } @@ -4542,7 +4562,7 @@ int cam_ife_csid_ver2_init_hw(void *hw_priv, res->res_state = CAM_ISP_RESOURCE_STATE_INIT_HW; - CAM_DBG(CAM_ISP, "CSID[%d] init hw", + CAM_DBG(CAM_ISP, "CSID[%u] init hw", csid_hw->hw_intf->hw_idx); end: mutex_unlock(&csid_hw->hw_info->hw_mutex); @@ -4560,7 +4580,7 @@ static int cam_ife_csid_ver2_disable_core( /* Check for refcount */ if (!csid_hw->hw_info->open_count) { - CAM_WARN(CAM_ISP, "Unbalanced disable_hw"); + CAM_WARN(CAM_ISP, "CSID[%u] Unbalanced disable_hw", csid_hw->hw_intf->hw_idx); return rc; } @@ -4618,7 +4638,7 @@ static int cam_ife_csid_ver2_disable_core( spin_unlock_bh(&csid_hw->lock_state); rc = cam_ife_csid_disable_soc_resources(soc_info); if (rc) - CAM_ERR(CAM_ISP, "CSID:%d Disable CSID SOC failed", + CAM_ERR(CAM_ISP, "CSID:%u Disable CSID SOC failed", csid_hw->hw_intf->hw_idx); csid_hw->counters.error_irq_count = 0; @@ -4650,14 +4670,14 @@ int cam_ife_csid_ver2_deinit_hw(void *hw_priv, } if (res->res_type != CAM_ISP_RESOURCE_PIX_PATH) { - CAM_ERR(CAM_ISP, "CSID:%d Invalid Res type %d", + CAM_ERR(CAM_ISP, "CSID:%u Invalid Res type %d", csid_hw->hw_intf->hw_idx, res->res_type); return -EINVAL; } if (res->res_state == CAM_ISP_RESOURCE_STATE_RESERVED) { - CAM_DBG(CAM_ISP, "CSID:%d Res:%d already in De-init state", + CAM_DBG(CAM_ISP, "CSID:%u Res:%d already in De-init state", csid_hw->hw_intf->hw_idx, res->res_id); return -EINVAL; @@ -4679,7 +4699,7 @@ int cam_ife_csid_ver2_deinit_hw(void *hw_priv, rc = cam_ife_csid_ver2_disable_path(csid_hw, res); break; default: - CAM_ERR(CAM_ISP, "CSID:%d Invalid res type%d", + CAM_ERR(CAM_ISP, "CSID:%u Invalid res type%d", csid_hw->hw_intf->hw_idx, res->res_type); break; } @@ -4827,12 +4847,12 @@ int cam_ife_csid_ver2_start(void *hw_priv, void *args, for (i = 0; i < start_args->num_res; i++) { res = start_args->node_res[i]; - CAM_DBG(CAM_ISP, "CSID:%d res_type :%d res[id:%d name:%s]", + CAM_DBG(CAM_ISP, "CSID:%u res_type :%d res[id:%d name:%s]", csid_hw->hw_intf->hw_idx, res->res_type, res->res_id, res->res_name); if (res->res_id >= CAM_IFE_PIX_PATH_RES_MAX) { - CAM_ERR(CAM_ISP, "CSID:%d Invalid res tpe:%d res id:%d", + CAM_ERR(CAM_ISP, "CSID:%u Invalid res tpe:%d res id:%d", csid_hw->hw_intf->hw_idx, res->res_type, res->res_id); rc = -EINVAL; @@ -4863,7 +4883,7 @@ int cam_ife_csid_ver2_start(void *hw_priv, void *args, break; default: - CAM_ERR(CAM_ISP, "CSID:%d Invalid res type %d", + CAM_ERR(CAM_ISP, "CSID:%u Invalid res type %d", csid_hw->hw_intf->hw_idx, res->res_type); break; } @@ -5001,11 +5021,11 @@ int cam_ife_csid_ver2_stop(void *hw_priv, csid_stop = (struct cam_csid_hw_stop_args *) stop_args; if (!csid_stop->num_res) { - CAM_ERR(CAM_ISP, "CSID: Invalid args"); + CAM_ERR(CAM_ISP, "CSID:%u Invalid args", csid_hw->hw_intf->hw_idx); return -EINVAL; } - CAM_DBG(CAM_ISP, "CSID:%d num_res %d", csid_hw->hw_intf->hw_idx, + CAM_DBG(CAM_ISP, "CSID:%u num_res %d", csid_hw->hw_intf->hw_idx, csid_stop->num_res); csid_hw->flags.device_enabled = false; @@ -5031,7 +5051,7 @@ int cam_ife_csid_ver2_stop(void *hw_priv, res = csid_stop->node_res[i]; rc = cam_ife_csid_ver2_disable_path(csid_hw, res); res->res_state = CAM_ISP_RESOURCE_STATE_INIT_HW; - CAM_DBG(CAM_ISP, "CSID:%d res_type %d Resource[id:%d name:%s]", + CAM_DBG(CAM_ISP, "CSID:%u res_type %d Resource[id:%d name:%s]", csid_hw->hw_intf->hw_idx, res->res_type, res->res_id, res->res_name); @@ -5134,7 +5154,7 @@ static int cam_ife_csid_ver2_top_cfg( } else { rc = -EINVAL; CAM_ERR(CAM_ISP, - "CSID: %d Invalid SFE node %d", + "CSID: %u Invalid SFE node %d", hw_idx, top_args->core_idx); } @@ -5145,7 +5165,7 @@ static int cam_ife_csid_ver2_top_cfg( if (!(csid_reg->csid_cust_node_map[hw_idx] & BIT(top_args->core_idx))) { CAM_ERR(CAM_ISP, - "CSID: %d not supported for cust node %d", + "CSID: %u not supported for cust node %d", hw_idx, top_args->core_idx); rc = -EINVAL; break; @@ -5160,7 +5180,7 @@ static int cam_ife_csid_ver2_top_cfg( } else { rc = -EINVAL; CAM_ERR(CAM_ISP, - "CSID: %d Invalid Cust node %d", + "CSID: %u Invalid Cust node %d", hw_idx, top_args->core_idx); } break; @@ -5171,13 +5191,13 @@ static int cam_ife_csid_ver2_top_cfg( csid_hw->top_cfg.offline_sfe_en = top_args->is_sfe_offline; csid_hw->top_cfg.sfe_fs = top_args->is_sfe_fs; CAM_DBG(CAM_ISP, - "CSID[%d] input_core_type:%d ife_out:%d sfe_offline:%d sfe_fs:%d", + "CSID[%u] input_core_type:%d ife_out:%d sfe_offline:%d sfe_fs:%d", hw_idx, csid_hw->top_cfg.input_core_type, csid_hw->top_cfg.out_ife_en, csid_hw->top_cfg.offline_sfe_en, csid_hw->top_cfg.sfe_fs); CAM_DBG(CAM_ISP, - "CSID[%d] Top config received: input_core_type%d core_idx:%d", + "CSID[%u] Top config received: input_core_type%d core_idx:%d", hw_idx, top_args->input_core_type, top_args->core_idx); /*config dual sync params */ @@ -5215,35 +5235,36 @@ static int cam_ife_csid_ver2_reg_update( int rc = 0; if (arg_size != sizeof(struct cam_isp_csid_reg_update_args)) { - CAM_ERR(CAM_ISP, "Invalid arg size: %d expected:%ld", - arg_size, sizeof(struct cam_isp_csid_reg_update_args)); + CAM_ERR(CAM_ISP, "CSID[%u] Invalid arg size: %d expected:%ld", + csid_hw->hw_intf->hw_idx, arg_size, + sizeof(struct cam_isp_csid_reg_update_args)); return -EINVAL; } if (!rup_args) { - CAM_ERR(CAM_ISP, "Invalid args"); + CAM_ERR(CAM_ISP, "CSID[%u] Invalid args", csid_hw->hw_intf->hw_idx); return -EINVAL; } if (!rup_args->num_res || rup_args->num_res > CAM_IFE_PIX_PATH_RES_MAX) { - CAM_ERR(CAM_ISP, "Invalid num_res %u", - rup_args->num_res); + CAM_ERR(CAM_ISP, "CSID[%u] Invalid num_res %u", + csid_hw->hw_intf->hw_idx, rup_args->num_res); return -EINVAL; } cdm_util_ops = (struct cam_cdm_utils_ops *)rup_args->res[0]->cdm_ops; if (!cdm_util_ops) { - CAM_ERR(CAM_ISP, "Invalid CDM ops"); + CAM_ERR(CAM_ISP, "CSID[%u] Invalid CDM ops", csid_hw->hw_intf->hw_idx); return -EINVAL; } size = cdm_util_ops->cdm_required_size_reg_random(1); /* since cdm returns dwords, we need to convert it into bytes */ if ((!rup_args->reg_write) && ((size * 4) > rup_args->cmd.size)) { - CAM_ERR(CAM_ISP, "buf size:%d is not sufficient, expected: %d", - rup_args->cmd.size, (size*4)); + CAM_ERR(CAM_ISP, "CSID[%u] buf size:%d is not sufficient, expected: %d", + csid_hw->hw_intf->hw_idx, rup_args->cmd.size, (size*4)); return -EINVAL; } @@ -5253,8 +5274,8 @@ static int cam_ife_csid_ver2_reg_update( for (i = 0; i < rup_args->num_res; i++) { path_reg = csid_reg->path_reg[rup_args->res[i]->res_id]; if (!path_reg) { - CAM_ERR(CAM_ISP, "Invalid Path Resource [id %d name %s]", - rup_args->res[i]->res_id, + CAM_ERR(CAM_ISP, "CSID[%u] Invalid Path Resource [id %d name %s]", + csid_hw->hw_intf->hw_idx, rup_args->res[i]->res_id, rup_args->res[i]->res_name); rc = -EINVAL; goto err; @@ -5273,7 +5294,7 @@ static int cam_ife_csid_ver2_reg_update( reg_val_pair[1] |= (csid_hw->rx_cfg.mup << csid_reg->cmn_reg->mup_shift_val); - CAM_DBG(CAM_ISP, "CSID:%d configure rup_aup_mup: 0x%x offset: 0x%x via %s", + CAM_DBG(CAM_ISP, "CSID:%u configure rup_aup_mup: 0x%x offset: 0x%x via %s", csid_hw->hw_intf->hw_idx, reg_val_pair[1], reg_val_pair[0], (rup_args->reg_write ? "AHB" : "CDM")); @@ -5291,7 +5312,7 @@ static int cam_ife_csid_ver2_reg_update( return rc; err: - CAM_ERR(CAM_ISP, "CSID[%d] wrong Resource[id:%d name:%s]", + CAM_ERR(CAM_ISP, "CSID[%u] wrong Resource[id:%d name:%s]", csid_hw->hw_intf->hw_idx, rup_args->res[i]->res_id, rup_args->res[i]->res_name); @@ -5309,29 +5330,30 @@ static int cam_ife_csid_ver2_program_offline_go_cmd( uint32_t reg_val_pair[2]; if (!go_args) { - CAM_ERR(CAM_ISP, "Invalid args"); + CAM_ERR(CAM_ISP, "CSID[%u] Invalid args", csid_hw->hw_intf->hw_idx); return -EINVAL; } if (arg_size != sizeof(struct cam_ife_csid_offline_cmd_update_args)) { - CAM_ERR(CAM_ISP, "Invalid arg size: %d expected:%ld", - arg_size, sizeof(struct cam_ife_csid_offline_cmd_update_args)); + CAM_ERR(CAM_ISP, "CSID[%u] Invalid arg size: %d expected:%ld", + csid_hw->hw_intf->hw_idx, arg_size, + sizeof(struct cam_ife_csid_offline_cmd_update_args)); return -EINVAL; } cdm_util_ops = (struct cam_cdm_utils_ops *)go_args->res->cdm_ops; if (!cdm_util_ops) { - CAM_ERR(CAM_ISP, "Invalid CDM ops"); + CAM_ERR(CAM_ISP, "CSID[%u] Invalid CDM ops", csid_hw->hw_intf->hw_idx); return -EINVAL; } size = cdm_util_ops->cdm_required_size_reg_random(1); /* since cdm returns dwords, we need to convert it into bytes */ if ((size * 4) > go_args->cmd.size) { - CAM_ERR(CAM_ISP, "buf size:%d is not sufficient, expected: %d", - go_args->cmd.size, (size*4)); + CAM_ERR(CAM_ISP, "CSID[%u] buf size:%d is not sufficient, expected: %d", + csid_hw->hw_intf->hw_idx, go_args->cmd.size, (size*4)); return -EINVAL; } @@ -5341,7 +5363,7 @@ static int cam_ife_csid_ver2_program_offline_go_cmd( reg_val_pair[0] = csid_reg->cmn_reg->offline_cmd_addr; reg_val_pair[1] = 0x1; - CAM_DBG(CAM_ISP, "CSID:%d offline_cmd 0x%x offset 0x%X", + CAM_DBG(CAM_ISP, "CSID:%u offline_cmd 0x%x offset 0x%X", csid_hw->hw_intf->hw_idx, reg_val_pair[1], reg_val_pair[0]); @@ -5385,14 +5407,14 @@ static int cam_ife_csid_ver2_get_time_stamp( if (res->res_type != CAM_ISP_RESOURCE_PIX_PATH || res->res_id >= CAM_IFE_PIX_PATH_RES_MAX) { - CAM_DBG(CAM_ISP, "CSID:%d Invalid res_type:%d res id%d", + CAM_DBG(CAM_ISP, "CSID:%u Invalid res_type:%d res id%d", csid_hw->hw_intf->hw_idx, res->res_type, res->res_id); return -EINVAL; } if (csid_hw->hw_info->hw_state != CAM_HW_STATE_POWER_UP) { - CAM_ERR(CAM_ISP, "CSID:%d Invalid dev state :%d", + CAM_ERR(CAM_ISP, "CSID:%u Invalid dev state :%d", csid_hw->hw_intf->hw_idx, csid_hw->hw_info->hw_state); return -EINVAL; @@ -5401,7 +5423,7 @@ static int cam_ife_csid_ver2_get_time_stamp( path_reg = csid_reg->path_reg[res->res_id]; if (!path_reg) { - CAM_ERR(CAM_ISP, "CSID:%d Invalid res :%d", + CAM_ERR(CAM_ISP, "CSID:%u Invalid res :%d", csid_hw->hw_intf->hw_idx, res->res_id); return -EINVAL; } @@ -5427,8 +5449,9 @@ static int cam_ife_csid_ver2_get_time_stamp( timestamp_args->boot_timestamp = timestamp_args->time_stamp_val + qtime_to_boottime; - CAM_DBG(CAM_ISP, "Resource[id:%d name:%s timestamp:%lld]", - res->res_id, res->res_name, timestamp_args->boot_timestamp); + CAM_DBG(CAM_ISP, "CSID:%u Resource[id:%d name:%s timestamp:%lld]", + csid_hw->hw_intf->hw_idx, res->res_id, res->res_name, + timestamp_args->boot_timestamp); csid_hw->timestamp.prev_sof_ts = timestamp_args->time_stamp_val; csid_hw->timestamp.prev_boot_ts = timestamp_args->boot_timestamp; @@ -5466,7 +5489,7 @@ static int cam_ife_csid_ver2_print_hbi_vbi( path_reg = csid_reg->path_reg[res->res_id]; if (!path_reg) { - CAM_ERR(CAM_ISP, "CSID:%d invalid res %d", + CAM_ERR(CAM_ISP, "CSID:%u invalid res %d", csid_hw->hw_intf->hw_idx, res->res_id); return -EINVAL; } @@ -5669,7 +5692,8 @@ static int cam_ife_csid_ver2_user_dump( csid_hw->hw_info, sizeof(uint64_t), "CLK_RATE_PRINT:"); if (rc) { - CAM_ERR(CAM_ISP, "CSID VER2: Clock dump failed, rc: %d", rc); + CAM_ERR(CAM_ISP, "CSID:%u VER2: Clock dump failed, rc: %d", + csid_hw->hw_intf->hw_idx, rc); return rc; } @@ -5679,8 +5703,8 @@ static int cam_ife_csid_ver2_user_dump( if (res->res_state < CAM_ISP_RESOURCE_STATE_RESERVED) { CAM_DBG(CAM_ISP, - "CSID VER2: path inactive res ID: %d, continuing", - res->res_id); + "CSID:%u VER2: path inactive res ID: %d, continuing", + csid_hw->hw_intf->hw_idx, res->res_id); continue; } @@ -5692,7 +5716,8 @@ static int cam_ife_csid_ver2_user_dump( res, sizeof(uint32_t), "CSID2_PATH.%s:", res->res_name); if (rc) { - CAM_ERR(CAM_ISP, "CSID VER2: Info dump failed, rc:%d", rc); + CAM_ERR(CAM_ISP, "CSID:%u VER2: Info dump failed, rc:%d", + csid_hw->hw_intf->hw_idx, rc); return rc; } @@ -5738,13 +5763,13 @@ static int cam_ife_csid_ver2_set_discard_frame_cfg( (struct cam_ife_csid_discard_init_frame_args *)cmd_args; if (discard_config->num_frames == 0xffffffff) { - CAM_ERR(CAM_ISP, "Invalid number of frames: 0x%x", - discard_config->num_frames); + CAM_ERR(CAM_ISP, "CSID[%u] Invalid number of frames: 0x%x", + csid_hw->hw_intf->hw_idx, discard_config->num_frames); return -EINVAL; } if (!discard_config->num_frames) { - CAM_DBG(CAM_ISP, "No discard requested"); + CAM_DBG(CAM_ISP, "CSID[%u] No discard requested", csid_hw->hw_intf->hw_idx); return 0; } @@ -5799,13 +5824,15 @@ static int cam_ife_csid_ver2_rdi_lcr_cfg( path_cfg = (struct cam_ife_csid_ver2_path_cfg *)res->res_priv; if (!path_cfg || !path_reg || !path_reg->capabilities || !(path_reg->capabilities & CAM_IFE_CSID_CAP_INPUT_LCR)) { - CAM_ERR(CAM_ISP, "Invalid res %s", res->res_name); + CAM_ERR(CAM_ISP, "CSID[%u] Invalid res %s", + csid_hw->hw_intf->hw_idx, res->res_name); return -EINVAL; } if (!path_cfg->sfe_shdr && (res->res_id != CAM_IFE_PIX_PATH_RES_RDI_0)) { - CAM_ERR(CAM_ISP, "Invalid res: %s, capabilities 0x%x sfe_shdr: %u", - res->res_name, path_reg->capabilities, path_cfg->sfe_shdr); + CAM_ERR(CAM_ISP, "CSID[%u] Invalid res: %s, capabilities 0x%x sfe_shdr: %u", + csid_hw->hw_intf->hw_idx, res->res_name, + path_reg->capabilities, path_cfg->sfe_shdr); return -EINVAL; } @@ -5814,16 +5841,19 @@ static int cam_ife_csid_ver2_rdi_lcr_cfg( * this case would come for formats which are not supported. */ if (path_cfg->path_format[CAM_IFE_CSID_MULTI_VC_DT_GRP_0].packing_fmt) { - CAM_ERR(CAM_ISP, "[%s] LCR not supported in_format %d out_format %d", - res->res_name, path_cfg->in_format[CAM_IFE_CSID_MULTI_VC_DT_GRP_0], + CAM_ERR(CAM_ISP, "CSID[%u] [%s] LCR not supported in_format %d out_format %d", + csid_hw->hw_intf->hw_idx, res->res_name, + path_cfg->in_format[CAM_IFE_CSID_MULTI_VC_DT_GRP_0], path_cfg->out_format); return -EINVAL; } /* if CSID unpacked data is not in MSB, we loose few bits going into PDAF, warn for now */ if (!path_cfg->csid_out_unpack_msb) - CAM_WARN(CAM_ISP, "[%s] Input data to LCR is in LSB, in_format %d out_format %d", - res->res_name, path_cfg->in_format[CAM_IFE_CSID_MULTI_VC_DT_GRP_0], + CAM_WARN(CAM_ISP, + "CSID[%u] [%s] Input data to LCR is in LSB, in_format %d out_format %d", + csid_hw->hw_intf->hw_idx, res->res_name, + path_cfg->in_format[CAM_IFE_CSID_MULTI_VC_DT_GRP_0], path_cfg->out_format); if (csid_hw->flags.sfe_en) @@ -5932,7 +5962,8 @@ static int cam_ife_csid_ver2_drv_config( CAM_ISP_RESOURCE_STATE_RESERVED) { cfg1_val = csid_reg->cmn_reg->drv_rup_en_val_map[CAM_IFE_PIX_PATH_RES_PPP]; } else { - CAM_ERR(CAM_ISP, "Failed to configure rup_en for drv"); + CAM_ERR(CAM_ISP, "CSID:%u Failed to configure rup_en for drv", + csid_hw->hw_intf->hw_idx); return -EINVAL; } @@ -5941,7 +5972,8 @@ static int cam_ife_csid_ver2_drv_config( } if (!csid_hw->drv_init_done) { - CAM_ERR(CAM_ISP, "Failed to update drv config, init config not done"); + CAM_ERR(CAM_ISP, "CSID:%u Failed to update drv config, init config not done", + csid_hw->hw_intf->hw_idx); return -EINVAL; } @@ -6066,7 +6098,7 @@ static int cam_ife_csid_ver2_process_cmd(void *hw_priv, rc = cam_ife_csid_ver2_reset_out_of_sync_cnt(csid_hw, cmd_args); break; default: - CAM_ERR(CAM_ISP, "CSID:%d unsupported cmd:%d", + CAM_ERR(CAM_ISP, "CSID:%u unsupported cmd:%d", csid_hw->hw_intf->hw_idx, cmd_type); rc = -EINVAL; break; @@ -6161,7 +6193,7 @@ static int cam_ife_csid_ver2_hw_init_path_res( csid_hw->hw_intf, CAM_IFE_PIX_PATH_RES_IPP); if (rc) { - CAM_ERR(CAM_ISP, "CSID: %d IPP res init fail", + CAM_ERR(CAM_ISP, "CSID: %u IPP res init fail", csid_hw->hw_intf->hw_idx); goto free_res; } @@ -6178,7 +6210,7 @@ static int cam_ife_csid_ver2_hw_init_path_res( csid_hw->hw_intf, CAM_IFE_PIX_PATH_RES_PPP); if (rc) { - CAM_ERR(CAM_ISP, "CSID: %d PPP res init fail", + CAM_ERR(CAM_ISP, "CSID: %u PPP res init fail", csid_hw->hw_intf->hw_idx); goto free_res; } @@ -6196,7 +6228,7 @@ static int cam_ife_csid_ver2_hw_init_path_res( csid_hw->hw_intf, CAM_IFE_PIX_PATH_RES_RDI_0 + i); if (rc) { - CAM_ERR(CAM_ISP, "CSID: %d RDI[%d] res init fail", + CAM_ERR(CAM_ISP, "CSID: %u RDI[%d] res init fail", csid_hw->hw_intf->hw_idx, i); goto free_res; } @@ -6213,7 +6245,7 @@ static int cam_ife_csid_ver2_hw_init_path_res( csid_hw->hw_intf, CAM_IFE_PIX_PATH_RES_UDI_0 + i); if (rc) { - CAM_ERR(CAM_ISP, "CSID: %d UDI[%d] res init fail", + CAM_ERR(CAM_ISP, "CSID: %u UDI[%d] res init fail", csid_hw->hw_intf->hw_idx, i); goto free_res; } @@ -6276,7 +6308,8 @@ static int cam_ife_csid_hw_init_irq( if (rc) { CAM_ERR(CAM_ISP, - "Failed to init CSID top irq controller rc = %d", rc); + "CSID:%u Failed to init CSID top irq controller rc = %d", + csid_hw->hw_intf->hw_idx, rc); return rc; } @@ -6284,7 +6317,8 @@ static int cam_ife_csid_hw_init_irq( &csid_hw->rx_irq_controller); if (rc) { - CAM_ERR(CAM_ISP, "Failed to init CSID rx irq controller rc = %d", rc); + CAM_ERR(CAM_ISP, "CSID:%u Failed to init CSID rx irq controller rc = %d", + csid_hw->hw_intf->hw_idx, rc); goto deinit_controller; } @@ -6292,7 +6326,8 @@ static int cam_ife_csid_hw_init_irq( &csid_hw->buf_done_irq_controller); if (rc) { - CAM_ERR(CAM_ISP, "Failed to init CSID buf_done irq controller rc = %d", rc); + CAM_ERR(CAM_ISP, "CSID:%u Failed to init CSID buf_done irq controller rc = %d", + csid_hw->hw_intf->hw_idx, rc); goto deinit_controller; } @@ -6302,7 +6337,8 @@ static int cam_ife_csid_hw_init_irq( &csid_hw->path_irq_controller[CAM_IFE_PIX_PATH_RES_IPP]); if (rc) { - CAM_ERR(CAM_ISP, "Failed to init CSID ipp irq controller rc = %d", rc); + CAM_ERR(CAM_ISP, "CSID:%u Failed to init CSID ipp irq controller rc = %d", + csid_hw->hw_intf->hw_idx, rc); goto deinit_controller; } } @@ -6314,7 +6350,8 @@ static int cam_ife_csid_hw_init_irq( if (rc) { CAM_ERR(CAM_ISP, - "Failed to init CSID ppp irq controller rc = %d", rc); + "CSID:%u Failed to init CSID ppp irq controller rc = %d", + csid_hw->hw_intf->hw_idx, rc); goto deinit_controller; } } @@ -6325,7 +6362,9 @@ static int cam_ife_csid_hw_init_irq( csid_reg->path_irq_reg_info[CAM_IFE_PIX_PATH_RES_RDI_0 + i], &csid_hw->path_irq_controller[CAM_IFE_PIX_PATH_RES_RDI_0 + i]); if (rc) { - CAM_ERR(CAM_ISP, "Failed to init CSID rdi%d irq controller rc = %d", i, rc); + CAM_ERR(CAM_ISP, + "CSID:%u Failed to init CSID rdi%d irq controller rc = %d", + csid_hw->hw_intf->hw_idx, i, rc); goto deinit_controller; } } @@ -6372,15 +6411,15 @@ int cam_ife_csid_ver2_irq_line_test(void *hw_priv) csid_reg = csid_hw->core_info->csid_reg; rc = cam_ife_csid_enable_soc_resources(soc_info, CAM_LOWSVS_VOTE); if (rc) { - CAM_ERR(CAM_ISP, "CSID[%d] Enable soc failed", csid_hw->hw_intf->hw_idx); + CAM_ERR(CAM_ISP, "CSID[%u] Enable soc failed", csid_hw->hw_intf->hw_idx); return rc; } - CAM_DBG(CAM_ISP, "CSID[%d] hw-version:0x%x", + CAM_DBG(CAM_ISP, "CSID[%u] hw-version:0x%x", csid_hw->hw_intf->hw_idx, cam_io_r_mb(mem_base + csid_reg->cmn_reg->hw_version_addr)); - rc = cam_irq_controller_test_irq_line(csid_hw->top_irq_controller, "CSID:%d", + rc = cam_irq_controller_test_irq_line(csid_hw->top_irq_controller, "CSID:%u", csid_hw->hw_intf->hw_idx); cam_ife_csid_disable_soc_resources(soc_info); @@ -6430,7 +6469,7 @@ int cam_ife_csid_hw_ver2_init(struct cam_hw_intf *hw_intf, rc = cam_ife_csid_init_soc_resources(&csid_hw->hw_info->soc_info, cam_ife_csid_irq, cam_ife_csid_ver2_cpas_cb, csid_hw, is_custom); if (rc < 0) { - CAM_ERR(CAM_ISP, "CSID:%d Failed to init_soc", + CAM_ERR(CAM_ISP, "CSID:%u Failed to init_soc", hw_intf->hw_idx); return rc; } @@ -6460,7 +6499,7 @@ int cam_ife_csid_hw_ver2_init(struct cam_hw_intf *hw_intf, rc = cam_ife_csid_ver2_hw_init_path_res(csid_hw); if (rc) { - CAM_ERR(CAM_ISP, "CSID[%d] Probe Init failed", + CAM_ERR(CAM_ISP, "CSID[%u] Probe Init failed", hw_intf->hw_idx); return rc; } diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver3.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver3.c index 4d489a3777..85e2de61fc 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver3.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver3.c @@ -243,7 +243,7 @@ static int cam_vfe_bus_ver3_get_evt_payload( if (!common_data->hw_init) { *evt_payload = NULL; - CAM_ERR_RATE_LIMIT(CAM_ISP, "VFE:%d Bus uninitialized", + CAM_ERR_RATE_LIMIT(CAM_ISP, "VFE:%u Bus uninitialized", common_data->core_index); rc = -EPERM; goto done; @@ -251,7 +251,8 @@ static int cam_vfe_bus_ver3_get_evt_payload( if (list_empty(&common_data->free_payload_list)) { *evt_payload = NULL; - CAM_ERR_RATE_LIMIT(CAM_ISP, "No free BUS event payload"); + CAM_ERR_RATE_LIMIT(CAM_ISP, "VFE:%u No free BUS event payload", + common_data->core_index); rc = -ENODEV; goto done; } @@ -277,7 +278,7 @@ static int cam_vfe_bus_ver3_put_evt_payload( } if (*evt_payload == NULL) { - CAM_ERR(CAM_ISP, "No payload to put"); + CAM_ERR(CAM_ISP, "VFE:%u No payload to put", common_data->core_index); return -EINVAL; } @@ -289,7 +290,7 @@ static int cam_vfe_bus_ver3_put_evt_payload( *evt_payload = NULL; - CAM_DBG(CAM_ISP, "Done"); + CAM_DBG(CAM_ISP, "VFE:%u Done", common_data->core_index); return 0; } @@ -453,8 +454,8 @@ static enum cam_vfe_bus_ver3_vfe_out_type vfe_out_type = CAM_VFE_BUS_VER3_VFE_OUT_STATS_ALSC; break; default: - CAM_WARN(CAM_ISP, "Invalid isp res id: %d , assigning max", - res_type); + CAM_WARN(CAM_ISP, "VFE:%u Invalid isp res id: %d , assigning max", + bus_priv->common_data.core_index, res_type); vfe_out_type = CAM_VFE_BUS_VER3_VFE_OUT_MAX; *index = CAM_VFE_BUS_VER3_VFE_OUT_MAX; return CAM_VFE_BUS_VER3_VFE_OUT_MAX; @@ -538,7 +539,7 @@ static int cam_vfe_bus_ver3_handle_rup_top_half(uint32_t evt_id, rsrc_data = vfe_out->res_priv; - CAM_DBG(CAM_ISP, "VFE:%d Bus IRQ status_0: 0x%X", + CAM_DBG(CAM_ISP, "VFE:%u Bus IRQ status_0: 0x%X", rsrc_data->common_data->core_index, th_payload->evt_status_arr[0]); @@ -547,7 +548,7 @@ static int cam_vfe_bus_ver3_handle_rup_top_half(uint32_t evt_id, if (rc) { CAM_INFO_RATE_LIMIT(CAM_ISP, - "VFE:%d Bus IRQ status_0: 0x%X", + "VFE:%u Bus IRQ status_0: 0x%X", rsrc_data->common_data->core_index, th_payload->evt_status_arr[0]); return rc; @@ -575,15 +576,15 @@ static void cam_vfe_bus_ver3_print_constraint_errors( { uint32_t i; - CAM_INFO(CAM_ISP, "Constraint violation bitflags: 0x%X", - constraint_errors); + CAM_INFO(CAM_ISP, "VFE:%u Constraint violation bitflags: 0x%X", + bus_priv->common_data.core_index, constraint_errors); for (i = 0; i < bus_priv->num_cons_err; i++) { if (bus_priv->constraint_error_list[i].bitmask & constraint_errors) { - CAM_INFO(CAM_ISP, "WM:%s %s", - wm_name, bus_priv->constraint_error_list[i] - .error_description); + CAM_INFO(CAM_ISP, "VFE:%u WM:%s %s", + bus_priv->common_data.core_index, wm_name, + bus_priv->constraint_error_list[i].error_description); } } } @@ -601,7 +602,8 @@ static void cam_vfe_bus_ver3_get_constraint_errors( out_rsrc_node = &bus_priv->vfe_out[i]; if (!out_rsrc_node || !out_rsrc_node->res_priv) { CAM_DBG(CAM_ISP, - "Vfe out:%d out rsrc node or data is NULL", i); + "VFE:%u out:%d out rsrc node or data is NULL", + bus_priv->common_data.core_index, i); continue; } out_rsrc_data = out_rsrc_node->res_priv; @@ -642,7 +644,7 @@ static int cam_vfe_bus_ver3_handle_rup_bottom_half(void *handler_priv, rsrc_data = vfe_out->res_priv; if (!rsrc_data->common_data->event_cb) { - CAM_ERR(CAM_ISP, "Callback to HW MGR not found"); + CAM_ERR(CAM_ISP, "VFE:%u Callback to HW MGR not found", vfe_out->hw_intf->hw_idx); return ret; } @@ -654,7 +656,7 @@ static int cam_vfe_bus_ver3_handle_rup_bottom_half(void *handler_priv, if (!rsrc_data->common_data->is_lite) { if (irq_status & 0x1) { - CAM_DBG(CAM_ISP, "VFE:%d Received CAMIF RUP", + CAM_DBG(CAM_ISP, "VFE:%u Received CAMIF RUP", evt_info.hw_idx); evt_info.res_id = CAM_ISP_HW_VFE_IN_CAMIF; rsrc_data->common_data->event_cb( @@ -663,7 +665,7 @@ static int cam_vfe_bus_ver3_handle_rup_bottom_half(void *handler_priv, } if (irq_status & 0x2) { - CAM_DBG(CAM_ISP, "VFE:%d Received PDLIB RUP", + CAM_DBG(CAM_ISP, "VFE:%u Received PDLIB RUP", evt_info.hw_idx); evt_info.res_id = CAM_ISP_HW_VFE_IN_PDLIB; rsrc_data->common_data->event_cb( @@ -672,11 +674,11 @@ static int cam_vfe_bus_ver3_handle_rup_bottom_half(void *handler_priv, } if (irq_status & 0x4) - CAM_DBG(CAM_ISP, "VFE:%d Received LCR RUP", + CAM_DBG(CAM_ISP, "VFE:%u Received LCR RUP", evt_info.hw_idx); if (irq_status & 0x8) { - CAM_DBG(CAM_ISP, "VFE:%d Received RDI0 RUP", + CAM_DBG(CAM_ISP, "VFE:%u Received RDI0 RUP", evt_info.hw_idx); evt_info.res_id = CAM_ISP_HW_VFE_IN_RDI0; rsrc_data->common_data->event_cb( @@ -685,7 +687,7 @@ static int cam_vfe_bus_ver3_handle_rup_bottom_half(void *handler_priv, } if (irq_status & 0x10) { - CAM_DBG(CAM_ISP, "VFE:%d Received RDI1 RUP", + CAM_DBG(CAM_ISP, "VFE:%u Received RDI1 RUP", evt_info.hw_idx); evt_info.res_id = CAM_ISP_HW_VFE_IN_RDI1; rsrc_data->common_data->event_cb( @@ -694,7 +696,7 @@ static int cam_vfe_bus_ver3_handle_rup_bottom_half(void *handler_priv, } if (irq_status & 0x20) { - CAM_DBG(CAM_ISP, "VFE:%d Received RDI2 RUP", + CAM_DBG(CAM_ISP, "VFE:%u Received RDI2 RUP", evt_info.hw_idx); evt_info.res_id = CAM_ISP_HW_VFE_IN_RDI2; rsrc_data->common_data->event_cb( @@ -703,7 +705,7 @@ static int cam_vfe_bus_ver3_handle_rup_bottom_half(void *handler_priv, } } else { if (irq_status & 0x1) { - CAM_DBG(CAM_ISP, "VFE:%d Received RDI0 RUP", + CAM_DBG(CAM_ISP, "VFE:%u Received RDI0 RUP", evt_info.hw_idx); evt_info.res_id = CAM_ISP_HW_VFE_IN_RDI0; rsrc_data->common_data->event_cb( @@ -712,7 +714,7 @@ static int cam_vfe_bus_ver3_handle_rup_bottom_half(void *handler_priv, } if (irq_status & 0x2) { - CAM_DBG(CAM_ISP, "VFE:%d Received RDI1 RUP", + CAM_DBG(CAM_ISP, "VFE:%u Received RDI1 RUP", evt_info.hw_idx); evt_info.res_id = CAM_ISP_HW_VFE_IN_RDI1; rsrc_data->common_data->event_cb( @@ -721,7 +723,7 @@ static int cam_vfe_bus_ver3_handle_rup_bottom_half(void *handler_priv, } if (irq_status & 0x4) { - CAM_DBG(CAM_ISP, "VFE:%d Received RDI2 RUP", + CAM_DBG(CAM_ISP, "VFE:%u Received RDI2 RUP", evt_info.hw_idx); evt_info.res_id = CAM_ISP_HW_VFE_IN_RDI2; rsrc_data->common_data->event_cb( @@ -730,7 +732,7 @@ static int cam_vfe_bus_ver3_handle_rup_bottom_half(void *handler_priv, } if (irq_status & 0x8) { - CAM_DBG(CAM_ISP, "VFE:%d Received RDI3 RUP", + CAM_DBG(CAM_ISP, "VFE:%u Received RDI3 RUP", evt_info.hw_idx); evt_info.res_id = CAM_ISP_HW_VFE_IN_RDI3; rsrc_data->common_data->event_cb( @@ -742,7 +744,7 @@ static int cam_vfe_bus_ver3_handle_rup_bottom_half(void *handler_priv, ret = CAM_VFE_IRQ_STATUS_SUCCESS; CAM_DBG(CAM_ISP, - "VFE:%d Bus RUP IRQ status_0:0x%X rc:%d", + "VFE:%u Bus RUP IRQ status_0:0x%X rc:%d", evt_info.hw_idx, CAM_ISP_HW_EVENT_REG_UPDATE, irq_status, ret); cam_vfe_bus_ver3_put_evt_payload(rsrc_data->common_data, &payload); @@ -916,8 +918,8 @@ static int cam_vfe_bus_ver3_config_rdi_wm( } break; default: - CAM_ERR(CAM_ISP, "Unsupported RDI format %d", - rsrc_data->format); + CAM_ERR(CAM_ISP, "VFE:%u Unsupported RDI format %d", + rsrc_data->common_data->core_index, rsrc_data->format); return -EINVAL; } @@ -938,8 +940,8 @@ static int cam_vfe_bus_ver3_acquire_wm( char wm_mode[50] = {'\0'}; if (wm_res->res_state != CAM_ISP_RESOURCE_STATE_AVAILABLE) { - CAM_ERR(CAM_ISP, "WM:%d not available state:%d", - wm_idx, wm_res->res_state); + CAM_ERR(CAM_ISP, "VFE:%u WM:%d not available state:%d", + wm_res->hw_intf->hw_idx, wm_idx, wm_res->res_state); return -EALREADY; } @@ -957,7 +959,8 @@ static int cam_vfe_bus_ver3_acquire_wm( rsrc_data->is_dual = out_acq_args->is_dual; /* Set WM offset value to default */ rsrc_data->offset = 0; - CAM_DBG(CAM_ISP, "WM:%d width %d height %d", rsrc_data->index, + CAM_DBG(CAM_ISP, "VFE:%u WM:%d width %d height %d", + wm_res->hw_intf->hw_idx, rsrc_data->index, rsrc_data->width, rsrc_data->height); if ((vfe_out_res_id >= CAM_VFE_BUS_VER3_VFE_OUT_RDI0) && @@ -987,7 +990,8 @@ static int cam_vfe_bus_ver3_acquire_wm( case PLANE_Y: break; default: - CAM_ERR(CAM_ISP, "Invalid plane %d", plane); + CAM_ERR(CAM_ISP, "VFE:%u Invalid plane %d", + wm_res->hw_intf->hw_idx, plane); return -EINVAL; } break; @@ -1005,7 +1009,8 @@ static int cam_vfe_bus_ver3_acquire_wm( case PLANE_Y: break; default: - CAM_ERR(CAM_ISP, "Invalid plane %d", plane); + CAM_ERR(CAM_ISP, "VFE:%u Invalid plane %d", + wm_res->hw_intf->hw_idx, plane); return -EINVAL; } break; @@ -1018,7 +1023,8 @@ static int cam_vfe_bus_ver3_acquire_wm( case PLANE_Y: break; default: - CAM_ERR(CAM_ISP, "Invalid plane %d", plane); + CAM_ERR(CAM_ISP, "VFE:%u Invalid plane %d", + wm_res->hw_intf->hw_idx, plane); return -EINVAL; } break; @@ -1030,7 +1036,8 @@ static int cam_vfe_bus_ver3_acquire_wm( case PLANE_Y: break; default: - CAM_ERR(CAM_ISP, "Invalid plane %d", plane); + CAM_ERR(CAM_ISP, "VFE:%u Invalid plane %d", + wm_res->hw_intf->hw_idx, plane); return -EINVAL; } break; @@ -1042,13 +1049,14 @@ static int cam_vfe_bus_ver3_acquire_wm( case PLANE_Y: break; default: - CAM_ERR(CAM_ISP, "Invalid plane %d", plane); + CAM_ERR(CAM_ISP, "VFE:%u Invalid plane %d", + wm_res->hw_intf->hw_idx, plane); return -EINVAL; } break; default: - CAM_ERR(CAM_ISP, "Invalid format %d out_type:%d", - rsrc_data->format, vfe_out_res_id); + CAM_ERR(CAM_ISP, "VFE:%u Invalid format %d out_type:%d", + wm_res->hw_intf->hw_idx, rsrc_data->format, vfe_out_res_id); return -EINVAL; } rsrc_data->en_cfg = 0x1; @@ -1085,8 +1093,8 @@ static int cam_vfe_bus_ver3_acquire_wm( break; default: - CAM_ERR(CAM_ISP, "Invalid format %d out_type:%d", - rsrc_data->format, vfe_out_res_id); + CAM_ERR(CAM_ISP, "VFE:%u Invalid format %d out_type:%d", + wm_res->hw_intf->hw_idx, rsrc_data->format, vfe_out_res_id); return -EINVAL; } @@ -1107,8 +1115,8 @@ static int cam_vfe_bus_ver3_acquire_wm( ver3_bus_priv->common_data.pack_align_shift); break; default: - CAM_ERR(CAM_ISP, "Invalid format %d out_type:%d", - rsrc_data->format, vfe_out_res_id); + CAM_ERR(CAM_ISP, "VFE:%u Invalid format %d out_type:%d", + wm_res->hw_intf->hw_idx, rsrc_data->format, vfe_out_res_id); return -EINVAL; } @@ -1131,8 +1139,8 @@ static int cam_vfe_bus_ver3_acquire_wm( rsrc_data->en_cfg = (0x1 << 16) | 0x1; break; default: - CAM_ERR(CAM_ISP, "Invalid format %d out_type:%d", - rsrc_data->format, vfe_out_res_id); + CAM_ERR(CAM_ISP, "VFE:%u Invalid format %d out_type:%d", + wm_res->hw_intf->hw_idx, rsrc_data->format, vfe_out_res_id); return -EINVAL; } @@ -1143,8 +1151,8 @@ static int cam_vfe_bus_ver3_acquire_wm( rsrc_data->en_cfg = 0x1; break; default: - CAM_ERR(CAM_ISP, "Invalid format %d out_type:%d", - rsrc_data->format, vfe_out_res_id); + CAM_ERR(CAM_ISP, "VFE:%u Invalid format %d out_type:%d", + wm_res->hw_intf->hw_idx, rsrc_data->format, vfe_out_res_id); return -EINVAL; } @@ -1155,8 +1163,8 @@ static int cam_vfe_bus_ver3_acquire_wm( rsrc_data->en_cfg = 0x1; break; default: - CAM_ERR(CAM_ISP, "Invalid format %d out_type:%d", - rsrc_data->format, vfe_out_res_id); + CAM_ERR(CAM_ISP, "VFE:%u Invalid format %d out_type:%d", + wm_res->hw_intf->hw_idx, rsrc_data->format, vfe_out_res_id); return -EINVAL; } @@ -1182,8 +1190,8 @@ static int cam_vfe_bus_ver3_acquire_wm( rsrc_data->en_cfg = (0x1 << 16) | 0x1; break; default: - CAM_ERR(CAM_ISP, "Invalid format %d out_type:%d", - rsrc_data->format, vfe_out_res_id); + CAM_ERR(CAM_ISP, "VFE:%u Invalid format %d out_type:%d", + wm_res->hw_intf->hw_idx, rsrc_data->format, vfe_out_res_id); return -EINVAL; } @@ -1196,8 +1204,8 @@ static int cam_vfe_bus_ver3_acquire_wm( rsrc_data->en_cfg = (0x1 << 16) | 0x1; break; default: - CAM_ERR(CAM_ISP, "Invalid format %d out_type:%d", - rsrc_data->format, vfe_out_res_id); + CAM_ERR(CAM_ISP, "VFE:%u Invalid format %d out_type:%d", + wm_res->hw_intf->hw_idx, rsrc_data->format, vfe_out_res_id); return -EINVAL; } @@ -1212,14 +1220,14 @@ static int cam_vfe_bus_ver3_acquire_wm( break; default: - CAM_ERR(CAM_ISP, "Invalid format %d out_type:%d", - rsrc_data->format, vfe_out_res_id); + CAM_ERR(CAM_ISP, "VFE:%u Invalid format %d out_type:%d", + wm_res->hw_intf->hw_idx, rsrc_data->format, vfe_out_res_id); return -EINVAL; } } else { - CAM_ERR(CAM_ISP, "Invalid out_type:%d requested", - vfe_out_res_id); + CAM_ERR(CAM_ISP, "VFE:%u Invalid out_type:%d requested", + wm_res->hw_intf->hw_idx, vfe_out_res_id); return -EINVAL; } @@ -1241,7 +1249,7 @@ static int cam_vfe_bus_ver3_acquire_wm( wm_res->tasklet_info = tasklet; CAM_DBG(CAM_ISP, - "VFE:%d WM:%d %s processed width:%d height:%d stride:%d format:0x%X en_ubwc:%d %s", + "VFE:%u WM:%d %s processed width:%d height:%d stride:%d format:0x%X en_ubwc:%d %s", rsrc_data->common_data->core_index, rsrc_data->index, wm_res->res_name, rsrc_data->width, rsrc_data->height, rsrc_data->stride, rsrc_data->format, rsrc_data->en_ubwc, @@ -1287,7 +1295,7 @@ static int cam_vfe_bus_ver3_release_wm(void *bus_priv, wm_res->tasklet_info = NULL; wm_res->res_state = CAM_ISP_RESOURCE_STATE_AVAILABLE; - CAM_DBG(CAM_ISP, "VFE:%d Release WM:%d %s", + CAM_DBG(CAM_ISP, "VFE:%u Release WM:%d %s", rsrc_data->common_data->core_index, rsrc_data->index, wm_res->res_name); @@ -1319,7 +1327,7 @@ static int cam_vfe_bus_ver3_start_wm(struct cam_isp_resource_node *wm_res) if (rsrc_data->en_ubwc) { if (!ubwc_regs) { CAM_ERR(CAM_ISP, - "ubwc_regs is NULL, VFE:%d WM:%d en_ubwc:%d", + "ubwc_regs is NULL, VFE:%u WM:%d en_ubwc:%d", rsrc_data->common_data->core_index, rsrc_data->index, rsrc_data->en_ubwc); return -EINVAL; @@ -1335,7 +1343,7 @@ static int cam_vfe_bus_ver3_start_wm(struct cam_isp_resource_node *wm_res) if (disable_ubwc_comp) { val &= ~ubwc_regs->ubwc_comp_en_bit; CAM_DBG(CAM_ISP, - "Force disable UBWC compression, VFE:%d WM:%d ubwc_mode_cfg: 0x%x", + "Force disable UBWC compression, VFE:%u WM:%d ubwc_mode_cfg: 0x%x", rsrc_data->common_data->core_index, rsrc_data->index, val); } @@ -1349,7 +1357,7 @@ static int cam_vfe_bus_ver3_start_wm(struct cam_isp_resource_node *wm_res) rsrc_data->hw_regs->mmu_prefetch_cfg); cam_io_w_mb(0xFFFFFFFF, common_data->mem_base + rsrc_data->hw_regs->mmu_prefetch_max_offset); - CAM_DBG(CAM_ISP, "VFE: %d WM: %d MMU prefetch enabled", + CAM_DBG(CAM_ISP, "VFE: %u WM: %d MMU prefetch enabled", rsrc_data->common_data->core_index, rsrc_data->index); } @@ -1364,12 +1372,12 @@ static int cam_vfe_bus_ver3_start_wm(struct cam_isp_resource_node *wm_res) rsrc_data->hw_regs->debug_status_cfg); CAM_DBG(CAM_ISP, - "Start VFE:%d WM:%d %s offset:0x%X en_cfg:0x%X width:%d height:%d", + "Start VFE:%u WM:%d %s offset:0x%X en_cfg:0x%X width:%d height:%d", rsrc_data->common_data->core_index, rsrc_data->index, wm_res->res_name, (uint32_t) rsrc_data->hw_regs->cfg, rsrc_data->en_cfg, rsrc_data->width, rsrc_data->height); - CAM_DBG(CAM_ISP, "WM:%d pk_fmt:%d stride:%d burst len:%d", - rsrc_data->index, rsrc_data->pack_fmt, + CAM_DBG(CAM_ISP, "VFE:%u WM:%d pk_fmt:%d stride:%d burst len:%d", + rsrc_data->common_data->core_index, rsrc_data->index, rsrc_data->pack_fmt, rsrc_data->stride, 0xF); wm_res->res_state = CAM_ISP_RESOURCE_STATE_STREAMING; @@ -1386,7 +1394,7 @@ static int cam_vfe_bus_ver3_stop_wm(struct cam_isp_resource_node *wm_res) /* Disable WM */ cam_io_w_mb(0x0, common_data->mem_base + rsrc_data->hw_regs->cfg); - CAM_DBG(CAM_ISP, "Stop VFE:%d WM:%d %s", + CAM_DBG(CAM_ISP, "Stop VFE:%u WM:%d %s", rsrc_data->common_data->core_index, rsrc_data->index, wm_res->res_name); @@ -1423,7 +1431,8 @@ static int cam_vfe_bus_ver3_init_wm_resource(uint32_t index, rsrc_data = kzalloc(sizeof(struct cam_vfe_bus_ver3_wm_resource_data), GFP_KERNEL); if (!rsrc_data) { - CAM_DBG(CAM_ISP, "Failed to alloc for WM res priv"); + CAM_DBG(CAM_ISP, "VFE:%u Failed to alloc for WM res priv", + ver3_bus_priv->common_data.hw_intf->hw_idx); return -ENOMEM; } wm_res->res_priv = rsrc_data; @@ -1502,14 +1511,14 @@ static int cam_vfe_bus_ver3_acquire_comp_grp( /* Do not support runtime change in composite mask */ if (comp_grp->res_state == CAM_ISP_RESOURCE_STATE_STREAMING) { - CAM_ERR(CAM_ISP, "Invalid State %d comp_grp:%u", - comp_grp->res_state, + CAM_ERR(CAM_ISP, "VFE:%u Invalid State %d comp_grp:%u", + rsrc_data->common_data->core_index, comp_grp->res_state, rsrc_data->comp_grp_type); return -EBUSY; } } - CAM_DBG(CAM_ISP, "Acquire VFE:%d comp_grp:%u", + CAM_DBG(CAM_ISP, "Acquire VFE:%u comp_grp:%u", rsrc_data->common_data->core_index, rsrc_data->comp_grp_type); rsrc_data->acquire_dev_cnt++; @@ -1530,18 +1539,19 @@ static int cam_vfe_bus_ver3_release_comp_grp( } if (in_comp_grp->res_state == CAM_ISP_RESOURCE_STATE_AVAILABLE) { - CAM_ERR(CAM_ISP, "Already released comp_grp"); + CAM_ERR(CAM_ISP, "VFE:%u Already released comp_grp", + ver3_bus_priv->common_data.core_index); return 0; } if (in_comp_grp->res_state == CAM_ISP_RESOURCE_STATE_STREAMING) { - CAM_ERR(CAM_ISP, "Invalid State %d", - in_comp_grp->res_state); + CAM_ERR(CAM_ISP, "VFE:%u Invalid State %d", + ver3_bus_priv->common_data.core_index, in_comp_grp->res_state); return -EBUSY; } in_rsrc_data = in_comp_grp->res_priv; - CAM_DBG(CAM_ISP, "Release VFE:%d comp_grp:%u", + CAM_DBG(CAM_ISP, "Release VFE:%u comp_grp:%u", ver3_bus_priv->common_data.core_index, in_rsrc_data->comp_grp_type); @@ -1571,7 +1581,7 @@ static int cam_vfe_bus_ver3_start_comp_grp( struct cam_vfe_bus_ver3_common_data *common_data = rsrc_data->common_data; CAM_DBG(CAM_ISP, - "Start VFE:%d comp_grp:%d streaming state:%d comp_mask:0x%X", + "Start VFE:%u comp_grp:%d streaming state:%d comp_mask:0x%X", rsrc_data->common_data->core_index, rsrc_data->comp_grp_type, comp_grp->res_state, rsrc_data->composite_mask); @@ -1631,7 +1641,7 @@ skip_comp_cfg: bus_irq_reg_mask[CAM_VFE_BUS_VER3_IRQ_REG0] = rsrc_data->comp_done_mask; - CAM_DBG(CAM_ISP, "Start Done VFE:%d comp_grp:%d bus_irq_mask_0: 0x%X", + CAM_DBG(CAM_ISP, "Start Done VFE:%u comp_grp:%d bus_irq_mask_0: 0x%X", rsrc_data->common_data->core_index, rsrc_data->comp_grp_type, bus_irq_reg_mask[CAM_VFE_BUS_VER3_IRQ_REG0]); @@ -1672,8 +1682,9 @@ static int cam_vfe_bus_ver3_handle_comp_done_bottom_half( return rc; if (rsrc_data->is_dual && (!rsrc_data->is_master)) { - CAM_ERR(CAM_ISP, "Invalid comp_grp:%u is_master:%u", - rsrc_data->comp_grp_type, rsrc_data->is_master); + CAM_ERR(CAM_ISP, "VFE:%u Invalid comp_grp:%u is_master:%u", + rsrc_data->common_data->core_index, rsrc_data->comp_grp_type, + rsrc_data->is_master); return rc; } @@ -1685,7 +1696,7 @@ static int cam_vfe_bus_ver3_handle_comp_done_bottom_half( rc = CAM_VFE_IRQ_STATUS_SUCCESS; } - CAM_DBG(CAM_ISP, "VFE:%d comp_grp:%d Bus IRQ status_0: 0x%X rc:%d", + CAM_DBG(CAM_ISP, "VFE:%u comp_grp:%d Bus IRQ status_0: 0x%X rc:%d", rsrc_data->common_data->core_index, rsrc_data->comp_grp_type, status_0, rc); @@ -1804,7 +1815,7 @@ static int cam_vfe_bus_ver3_acquire_vfe_out(void *bus_priv, void *acquire_args, out_acquire_args = &acq_args->vfe_out; format = out_acquire_args->out_port_info->format; - CAM_DBG(CAM_ISP, "VFE:%d Acquire out_type:0x%X", + CAM_DBG(CAM_ISP, "VFE:%u Acquire out_type:0x%X", ver3_bus_priv->common_data.core_index, out_acquire_args->out_port_info->res_type); @@ -1815,7 +1826,8 @@ static int cam_vfe_bus_ver3_acquire_vfe_out(void *bus_priv, void *acquire_args, if ((vfe_out_res_id == CAM_VFE_BUS_VER3_VFE_OUT_MAX) || (outmap_index >= ver3_bus_priv->num_out)) { CAM_WARN(CAM_ISP, - "target does not support req res id :0x%x outtype:%d index:%d", + "VFE:%u target does not support req res id :0x%x outtype:%d index:%d", + ver3_bus_priv->common_data.core_index, out_acquire_args->out_port_info->res_type, vfe_out_res_id, outmap_index); return -ENODEV; @@ -1824,7 +1836,7 @@ static int cam_vfe_bus_ver3_acquire_vfe_out(void *bus_priv, void *acquire_args, rsrc_node = &ver3_bus_priv->vfe_out[outmap_index]; if (rsrc_node->res_state != CAM_ISP_RESOURCE_STATE_AVAILABLE) { CAM_ERR(CAM_ISP, - "VFE:%d out_type:0x%X resource not available state:%d", + "VFE:%u out_type:0x%X resource not available state:%d", ver3_bus_priv->common_data.core_index, vfe_out_res_id, rsrc_node->res_state); return -EBUSY; @@ -1864,7 +1876,8 @@ static int cam_vfe_bus_ver3_acquire_vfe_out(void *bus_priv, void *acquire_args, } else { rc = -EINVAL; CAM_ERR_RATE_LIMIT(CAM_ISP, - "Mismatch: Acquire mode[%d], drvr mode[%d]", + "VFE:%u Mismatch: Acquire mode[%d], drvr mode[%d]", + ver3_bus_priv->common_data.core_index, rsrc_data->common_data->secure_mode, mode); mutex_unlock( @@ -1899,7 +1912,7 @@ static int cam_vfe_bus_ver3_acquire_vfe_out(void *bus_priv, void *acquire_args, &comp_acq_args.comp_grp_id); if (rc) { CAM_ERR(CAM_ISP, - "Failed to acquire WM VFE:%d out_type:%d rc:%d", + "Failed to acquire WM VFE:%u out_type:%d rc:%d", rsrc_data->common_data->core_index, vfe_out_res_id, rc); goto release_wm; @@ -1916,7 +1929,7 @@ static int cam_vfe_bus_ver3_acquire_vfe_out(void *bus_priv, void *acquire_args, &comp_acq_args); if (rc) { CAM_ERR(CAM_ISP, - "Failed to acquire comp_grp VFE:%d out_typp:%d rc:%d", + "Failed to acquire comp_grp VFE:%u out_typp:%d rc:%d", rsrc_data->common_data->core_index, vfe_out_res_id, rc); goto release_wm; @@ -1929,7 +1942,7 @@ static int cam_vfe_bus_ver3_acquire_vfe_out(void *bus_priv, void *acquire_args, out_acquire_args->rsrc_node = rsrc_node; out_acquire_args->comp_grp_id = comp_acq_args.comp_grp_id; - CAM_DBG(CAM_ISP, "Acquire successful"); + CAM_DBG(CAM_ISP, "VFE:%u Acquire successful", rsrc_data->common_data->core_index); return rc; release_wm: @@ -1959,7 +1972,7 @@ static int cam_vfe_bus_ver3_release_vfe_out(void *bus_priv, void *release_args, if (vfe_out->res_state != CAM_ISP_RESOURCE_STATE_RESERVED) { CAM_ERR(CAM_ISP, - "Invalid resource state:%d VFE:%d out_type:0x%X", + "Invalid resource state:%d VFE:%u out_type:0x%X", vfe_out->res_state, rsrc_data->common_data->core_index, vfe_out->res_id); } @@ -1995,7 +2008,8 @@ static int cam_vfe_bus_ver3_release_vfe_out(void *bus_priv, void *release_args, * not expected to reach here, unless there is * some corruption. */ - CAM_ERR(CAM_ISP, "driver[%d],resource[%d] mismatch", + CAM_ERR(CAM_ISP, "VFE:%u driver[%d],resource[%d] mismatch", + rsrc_data->common_data->core_index, rsrc_data->common_data->secure_mode, rsrc_data->secure_mode); } @@ -2031,12 +2045,12 @@ static int cam_vfe_bus_ver3_start_vfe_out( common_data = rsrc_data->common_data; source_group = rsrc_data->source_group; - CAM_DBG(CAM_ISP, "Start VFE:%d out_type:0x%X", + CAM_DBG(CAM_ISP, "Start VFE:%u out_type:0x%X", rsrc_data->common_data->core_index, rsrc_data->out_type); if (vfe_out->res_state != CAM_ISP_RESOURCE_STATE_RESERVED) { CAM_ERR(CAM_ISP, - "Invalid resource state:%d VFE:%d out_type:0x%X", + "Invalid resource state:%d VFE:%u out_type:0x%X", vfe_out->res_state, rsrc_data->common_data->core_index, rsrc_data->out_type); return -EACCES; @@ -2073,8 +2087,8 @@ static int cam_vfe_bus_ver3_start_vfe_out( CAM_IRQ_EVT_GROUP_0); if (vfe_out->irq_handle < 1) { - CAM_ERR(CAM_ISP, "Subscribe IRQ failed for VFE out_res %d", - vfe_out->res_id); + CAM_ERR(CAM_ISP, "Subscribe IRQ failed for VFE out_res %d, VFE:%u", + vfe_out->res_id, rsrc_data->common_data->core_index); vfe_out->irq_handle = 0; return -EFAULT; } @@ -2090,7 +2104,7 @@ static int cam_vfe_bus_ver3_start_vfe_out( 0x1 << source_group; CAM_DBG(CAM_ISP, - "VFE:%d out_type:0x%X bus_irq_mask_0:0x%X for RUP", + "VFE:%u out_type:0x%X bus_irq_mask_0:0x%X for RUP", rsrc_data->common_data->core_index, rsrc_data->out_type, rup_irq_reg_mask[CAM_VFE_BUS_VER3_IRQ_REG0]); @@ -2107,7 +2121,8 @@ static int cam_vfe_bus_ver3_start_vfe_out( CAM_IRQ_EVT_GROUP_1); if (common_data->rup_irq_handle[source_group] < 1) { - CAM_ERR(CAM_ISP, "Failed to subscribe RUP IRQ"); + CAM_ERR(CAM_ISP, "VFE:%u Failed to subscribe RUP IRQ", + rsrc_data->common_data->core_index); common_data->rup_irq_handle[source_group] = 0; return -EFAULT; } @@ -2135,7 +2150,7 @@ static int cam_vfe_bus_ver3_stop_vfe_out( if (vfe_out->res_state == CAM_ISP_RESOURCE_STATE_AVAILABLE || vfe_out->res_state == CAM_ISP_RESOURCE_STATE_RESERVED) { - CAM_DBG(CAM_ISP, "Stop VFE:%d out_type:0x%X state:%d", + CAM_DBG(CAM_ISP, "Stop VFE:%u out_type:0x%X state:%d", rsrc_data->common_data->core_index, rsrc_data->out_type, vfe_out->res_state); return rc; @@ -2194,7 +2209,7 @@ static int cam_vfe_bus_ver3_handle_vfe_out_done_top_half(uint32_t evt_id, if (rc) { for (i = 0; i < th_payload->num_registers; i++) CAM_INFO_RATE_LIMIT(CAM_ISP, - "VFE:%d Bus IRQ status_%d: 0x%X", + "VFE:%u Bus IRQ status_%d: 0x%X", rsrc_data->common_data->core_index, i, th_payload->evt_status_arr[i]); return rc; @@ -2207,7 +2222,7 @@ static int cam_vfe_bus_ver3_handle_vfe_out_done_top_half(uint32_t evt_id, for (i = 0; i < th_payload->num_registers; i++) { evt_payload->irq_reg_val[i] = th_payload->evt_status_arr[i]; - CAM_DBG(CAM_ISP, "VFE:%d Bus IRQ status_%d: 0x%X", + CAM_DBG(CAM_ISP, "VFE:%u Bus IRQ status_%d: 0x%X", rsrc_data->common_data->core_index, i, th_payload->evt_status_arr[i]); } @@ -2228,7 +2243,7 @@ static int cam_vfe_bus_ver3_handle_vfe_out_done_top_half(uint32_t evt_id, if (status_0 & 0x1) trace_cam_log_event("UnexpectedRUP", "RUP_IRQ", status_0, 40); - CAM_DBG(CAM_ISP, "Exit"); + CAM_DBG(CAM_ISP, "VFE:%u Exit", rsrc_data->common_data->core_index); return rc; } @@ -2248,7 +2263,7 @@ static int cam_vfe_bus_ver3_handle_vfe_out_done_bottom_half( rc = cam_vfe_bus_ver3_handle_comp_done_bottom_half( rsrc_data, evt_payload_priv, &comp_grp_id); - CAM_DBG(CAM_ISP, "VFE:%d out_type:0x%x comp_grp_id:%d rc:%d", + CAM_DBG(CAM_ISP, "VFE:%u out_type:0x%x comp_grp_id:%d rc:%d", rsrc_data->common_data->core_index, rsrc_data->out_type, comp_grp_id, rc); @@ -2347,7 +2362,7 @@ static int cam_vfe_bus_ver3_init_vfe_out_resource(uint32_t index, ver3_hw_info->vfe_out_hw_info[index].name[i], ver3_hw_info->vfe_out_hw_info[index].line_based); if (rc < 0) { - CAM_ERR(CAM_ISP, "VFE:%d init WM:%d failed rc:%d", + CAM_ERR(CAM_ISP, "VFE:%u init WM:%d failed rc:%d", ver3_bus_priv->common_data.core_index, i, rc); return rc; } @@ -2402,7 +2417,7 @@ static int cam_vfe_bus_ver3_deinit_vfe_out_resource( rc = cam_vfe_bus_ver3_deinit_wm_resource(&rsrc_data->wm_res[i]); if (rc < 0) CAM_ERR(CAM_ISP, - "VFE:%d deinit WM:%d failed rc:%d", + "VFE:%u deinit WM:%d failed rc:%d", rsrc_data->common_data->core_index, i, rc); } @@ -2430,7 +2445,7 @@ static void cam_vfe_bus_ver3_print_wm_info( wm_data->hw_regs->addr_status_3); CAM_INFO(CAM_ISP, - "VFE:%d WM:%d wm_name:%s width:%u height:%u stride:%u x_init:%u en_cfg:%u acquired width:%u height:%u", + "VFE:%u WM:%d wm_name:%s width:%u height:%u stride:%u x_init:%u en_cfg:%u acquired width:%u height:%u", wm_data->common_data->core_index, wm_data->index, wm_name, wm_data->width, wm_data->height, @@ -2439,7 +2454,7 @@ static void cam_vfe_bus_ver3_print_wm_info( wm_data->acquired_width, wm_data->acquired_height); CAM_INFO(CAM_ISP, - "hw:%d WM:%d last consumed address:0x%x last frame addr:0x%x fifo cnt:0x%x current client address:0x%x", + "hw:%u WM:%d last consumed address:0x%x last frame addr:0x%x fifo cnt:0x%x current client address:0x%x", common_data->hw_intf->hw_idx, wm_data->index, addr_status0, @@ -2622,7 +2637,7 @@ static int cam_vfe_bus_ver3_user_dump( if (hw_info->hw_state == CAM_HW_STATE_POWER_DOWN) { CAM_WARN(CAM_ISP, - "VFE BUS powered down"); + "VFE:%u BUS powered down", bus_priv->common_data.core_index); return -EINVAL; } @@ -2630,7 +2645,8 @@ static int cam_vfe_bus_ver3_user_dump( hw_info, sizeof(uint64_t), "CLK_RATE_PRINT:"); if (rc) { - CAM_ERR(CAM_ISP, "VFE BUS VER3: Clock dump failed, rc: %d", rc); + CAM_ERR(CAM_ISP, "VFE:%u BUS VER3: Clock dump failed, rc: %d", + bus_priv->common_data.core_index, rc); return rc; } @@ -2641,8 +2657,8 @@ static int cam_vfe_bus_ver3_user_dump( if (rsrc_node->res_state < CAM_ISP_RESOURCE_STATE_RESERVED) { CAM_DBG(CAM_ISP, - "VFE BUS VER3: path inactive res ID: %d, continuing", - rsrc_node->res_id); + "VFE:%u BUS VER3: path inactive res ID: %d, continuing", + bus_priv->common_data.core_index, rsrc_node->res_id); continue; } @@ -2661,7 +2677,8 @@ static int cam_vfe_bus_ver3_user_dump( rsrc_data->common_data->core_index); if (rc) { - CAM_ERR(CAM_ISP, "VFE BUS VER3: Info dump failed, rc: %d", rc); + CAM_ERR(CAM_ISP, "VFE:%u BUS VER3: Info dump failed, rc: %d", + bus_priv->common_data.core_index, rc); return rc; } } @@ -2676,7 +2693,7 @@ static int cam_vfe_bus_ver3_handle_bus_irq(uint32_t evt_id, int rc = 0; bus_priv = th_payload->handler_priv; - CAM_DBG(CAM_ISP, "Enter"); + CAM_DBG(CAM_ISP, "Enter VFE:%u", bus_priv->common_data.core_index); rc = cam_irq_controller_handle_irq(evt_id, bus_priv->common_data.bus_irq_controller, CAM_IRQ_EVT_GROUP_0); return (rc == IRQ_HANDLED) ? 0 : -EINVAL; @@ -2689,7 +2706,7 @@ static int cam_vfe_bus_ver3_handle_rup_irq(uint32_t evt_id, int rc = 0; bus_priv = th_payload->handler_priv; - CAM_DBG(CAM_ISP, "Enter"); + CAM_DBG(CAM_ISP, "Enter, VFE:%u", bus_priv->common_data.core_index); rc = cam_irq_controller_handle_irq(evt_id, bus_priv->common_data.bus_irq_controller, CAM_IRQ_EVT_GROUP_1); return (rc == IRQ_HANDLED) ? 0 : -EINVAL; @@ -2703,10 +2720,10 @@ static int cam_vfe_bus_ver3_err_irq_top_half(uint32_t evt_id, th_payload->handler_priv; struct cam_vfe_bus_irq_evt_payload *evt_payload; - CAM_ERR(CAM_ISP, "VFE:%d BUS Err IRQ", + CAM_ERR(CAM_ISP, "VFE:%u BUS Err IRQ", bus_priv->common_data.core_index); for (i = 0; i < th_payload->num_registers; i++) { - CAM_ERR(CAM_ISP, "VFE:%d BUS IRQ status_%d: 0x%X", + CAM_ERR(CAM_ISP, "VFE:%u BUS IRQ status_%d: 0x%X", bus_priv->common_data.core_index, i, th_payload->evt_status_arr[i]); } @@ -2757,7 +2774,8 @@ static void cam_vfe_print_violations( rsrc_node = &bus_priv->vfe_out[i]; rsrc_data = rsrc_node->res_priv; if (!rsrc_data) { - CAM_ERR(CAM_ISP, "VFE out data is null, res_id: %d", i); + CAM_ERR(CAM_ISP, "VFE:%u out data is null, res_id: %d", + bus_priv->common_data.core_index, i); return; } @@ -2767,7 +2785,8 @@ static void cam_vfe_print_violations( wm_name = rsrc_data->wm_res[j].res_name; if (status & (1 << wm_data->index)) { - CAM_INFO(CAM_ISP, "%s Violation", error_type); + CAM_INFO(CAM_ISP, "VFE:%u, %s Violation", + bus_priv->common_data.core_index, error_type); cam_vfe_bus_ver3_print_wm_info(wm_data, common_data, wm_name); } @@ -2796,12 +2815,12 @@ static int cam_vfe_bus_ver3_err_irq_bottom_half( constraint_violation = (status >> 28) & 0x1; CAM_ERR(CAM_ISP, - "VFE:%d BUS error image size violation %d CCIF violation %d constraint violation %d", + "VFE:%u BUS error image size violation %d CCIF violation %d constraint violation %d", bus_priv->common_data.core_index, image_size_violation, ccif_violation, constraint_violation); CAM_INFO(CAM_ISP, - "Image Size violation status 0x%X CCIF violation status 0x%X", - evt_payload->image_size_violation_status, + "VFE:%u Image Size violation status 0x%X CCIF violation status 0x%X", + bus_priv->common_data.core_index, evt_payload->image_size_violation_status, evt_payload->ccif_violation_status); if (image_size_violation || constraint_violation) { @@ -2844,7 +2863,8 @@ static void cam_vfe_bus_ver3_unsubscribe_init_irq( bus_priv->common_data.bus_irq_controller, bus_priv->error_irq_handle); if (rc) - CAM_WARN(CAM_ISP, "failed to unsubscribe error irqs"); + CAM_WARN(CAM_ISP, "VFE:%u failed to unsubscribe error irqs", + bus_priv->common_data.core_index); bus_priv->error_irq_handle = 0; } @@ -2854,7 +2874,8 @@ static void cam_vfe_bus_ver3_unsubscribe_init_irq( bus_priv->common_data.vfe_irq_controller, bus_priv->bus_irq_handle); if (rc) - CAM_WARN(CAM_ISP, "failed to unsubscribe top irq"); + CAM_WARN(CAM_ISP, "VFE:%u failed to unsubscribe top irq", + bus_priv->common_data.core_index); bus_priv->bus_irq_handle = 0; cam_irq_controller_unregister_dependent(bus_priv->common_data.vfe_irq_controller, @@ -2866,13 +2887,14 @@ static void cam_vfe_bus_ver3_unsubscribe_init_irq( bus_priv->common_data.vfe_irq_controller, bus_priv->rup_irq_handle); if (rc) - CAM_WARN(CAM_ISP, "failed to unsubscribe rup done irq"); + CAM_WARN(CAM_ISP, "VFE:%u failed to unsubscribe rup done irq", + bus_priv->common_data.core_index); bus_priv->rup_irq_handle = 0; } bus_priv->common_data.init_irq_subscribed = false; - CAM_DBG(CAM_ISP, "BUS init irq unsubscribed"); + CAM_DBG(CAM_ISP, "BUS init irq unsubscribed, VFE:%u", bus_priv->common_data.core_index); } static int cam_vfe_bus_ver3_subscribe_init_irq( @@ -2900,7 +2922,8 @@ static int cam_vfe_bus_ver3_subscribe_init_irq( CAM_IRQ_EVT_GROUP_0); if (bus_priv->bus_irq_handle < 1) { - CAM_ERR(CAM_ISP, "Failed to subscribe BUS (buf_done) IRQ"); + CAM_ERR(CAM_ISP, "VFE:%u Failed to subscribe BUS (buf_done) IRQ", + bus_priv->common_data.core_index); bus_priv->bus_irq_handle = 0; return -EFAULT; } @@ -2919,7 +2942,8 @@ static int cam_vfe_bus_ver3_subscribe_init_irq( CAM_IRQ_EVT_GROUP_0); if (bus_priv->error_irq_handle < 1) { - CAM_ERR(CAM_ISP, "Failed to subscribe BUS Error IRQ"); + CAM_ERR(CAM_ISP, "VFE:%u Failed to subscribe BUS Error IRQ", + bus_priv->common_data.core_index); bus_priv->error_irq_handle = 0; return -EFAULT; } @@ -2938,14 +2962,15 @@ static int cam_vfe_bus_ver3_subscribe_init_irq( CAM_IRQ_EVT_GROUP_0); if (bus_priv->rup_irq_handle < 1) { - CAM_ERR(CAM_ISP, "Failed to subscribe BUS (rup) IRQ"); + CAM_ERR(CAM_ISP, "VFE:%u Failed to subscribe BUS (rup) IRQ", + bus_priv->common_data.core_index); bus_priv->rup_irq_handle = 0; return -EFAULT; } } bus_priv->common_data.init_irq_subscribed = true; - CAM_DBG(CAM_ISP, "BUS irq subscribed"); + CAM_DBG(CAM_ISP, "VFE:%u BUS irq subscribed", bus_priv->common_data.core_index); return 0; } @@ -2995,45 +3020,45 @@ static int cam_vfe_bus_ver3_update_ubwc_regs( CAM_VFE_ADD_REG_VAL_PAIR(reg_val_pair, *j, wm_data->hw_regs->packer_cfg, wm_data->packer_cfg); - CAM_DBG(CAM_ISP, "WM:%d packer cfg 0x%X", - wm_data->index, reg_val_pair[*j-1]); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d packer cfg 0x%X", + wm_data->common_data->core_index, wm_data->index, reg_val_pair[*j-1]); CAM_VFE_ADD_REG_VAL_PAIR(reg_val_pair, *j, ubwc_regs->meta_cfg, wm_data->ubwc_meta_cfg); - CAM_DBG(CAM_ISP, "WM:%d meta stride 0x%X", - wm_data->index, reg_val_pair[*j-1]); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d meta stride 0x%X", + wm_data->common_data->core_index, wm_data->index, reg_val_pair[*j-1]); if (wm_data->common_data->disable_ubwc_comp) { wm_data->ubwc_mode_cfg &= ~ubwc_regs->ubwc_comp_en_bit; CAM_DBG(CAM_ISP, - "Force disable UBWC compression on VFE:%d WM:%d", + "Force disable UBWC compression on VFE:%u WM:%d", wm_data->common_data->core_index, wm_data->index); } CAM_VFE_ADD_REG_VAL_PAIR(reg_val_pair, *j, ubwc_regs->mode_cfg, wm_data->ubwc_mode_cfg); - CAM_DBG(CAM_ISP, "WM:%d ubwc_mode_cfg 0x%X", - wm_data->index, reg_val_pair[*j-1]); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d ubwc_mode_cfg 0x%X", + wm_data->common_data->core_index, wm_data->index, reg_val_pair[*j-1]); CAM_VFE_ADD_REG_VAL_PAIR(reg_val_pair, *j, ubwc_regs->ctrl_2, wm_data->ubwc_ctrl_2); - CAM_DBG(CAM_ISP, "WM:%d ubwc_ctrl_2 0x%X", - wm_data->index, reg_val_pair[*j-1]); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d ubwc_ctrl_2 0x%X", + wm_data->common_data->core_index, wm_data->index, reg_val_pair[*j-1]); CAM_VFE_ADD_REG_VAL_PAIR(reg_val_pair, *j, ubwc_regs->lossy_thresh0, wm_data->ubwc_lossy_threshold_0); - CAM_DBG(CAM_ISP, "WM:%d lossy_thresh0 0x%X", - wm_data->index, reg_val_pair[*j-1]); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d lossy_thresh0 0x%X", + wm_data->common_data->core_index, wm_data->index, reg_val_pair[*j-1]); CAM_VFE_ADD_REG_VAL_PAIR(reg_val_pair, *j, ubwc_regs->lossy_thresh1, wm_data->ubwc_lossy_threshold_1); - CAM_DBG(CAM_ISP, "WM:%d lossy_thresh1 0x%X", - wm_data->index, reg_val_pair[*j-1]); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d lossy_thresh1 0x%X", + wm_data->common_data->core_index, wm_data->index, reg_val_pair[*j-1]); CAM_VFE_ADD_REG_VAL_PAIR(reg_val_pair, *j, ubwc_regs->off_lossy_var, wm_data->ubwc_offset_lossy_variance); - CAM_DBG(CAM_ISP, "WM:%d off_lossy_var 0x%X", - wm_data->index, reg_val_pair[*j-1]); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d off_lossy_var 0x%X", + wm_data->common_data->core_index, wm_data->index, reg_val_pair[*j-1]); /* * If limit value >= 0xFFFF, limit configured by @@ -3042,8 +3067,9 @@ static int cam_vfe_bus_ver3_update_ubwc_regs( if (wm_data->ubwc_bandwidth_limit < 0xFFFF) { CAM_VFE_ADD_REG_VAL_PAIR(reg_val_pair, *j, ubwc_regs->bw_limit, wm_data->ubwc_bandwidth_limit); - CAM_DBG(CAM_ISP, "WM:%d ubwc bw limit 0x%X", - wm_data->index, wm_data->ubwc_bandwidth_limit); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d ubwc bw limit 0x%X", + wm_data->common_data->core_index, wm_data->index, + wm_data->ubwc_bandwidth_limit); } end: @@ -3059,45 +3085,45 @@ static int cam_vfe_bus_ver3_config_ubwc_regs( cam_io_w_mb(wm_data->packer_cfg, wm_data->common_data->mem_base + wm_data->hw_regs->packer_cfg); - CAM_DBG(CAM_ISP, "WM:%d packer cfg:0x%x", - wm_data->index, wm_data->packer_cfg); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d packer cfg:0x%x", + wm_data->common_data->core_index, wm_data->index, wm_data->packer_cfg); cam_io_w_mb(wm_data->ubwc_meta_cfg, wm_data->common_data->mem_base + ubwc_regs->meta_cfg); - CAM_DBG(CAM_ISP, "WM:%d meta stride:0x%x", - wm_data->index, wm_data->ubwc_meta_cfg); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d meta stride:0x%x", + wm_data->common_data->core_index, wm_data->index, wm_data->ubwc_meta_cfg); if (wm_data->common_data->disable_ubwc_comp) { wm_data->ubwc_mode_cfg &= ~ubwc_regs->ubwc_comp_en_bit; CAM_DBG(CAM_ISP, - "Force disable UBWC compression on VFE:%d WM:%d", + "Force disable UBWC compression on VFE:%u WM:%d", wm_data->common_data->core_index, wm_data->index); } cam_io_w_mb(wm_data->ubwc_mode_cfg, wm_data->common_data->mem_base + ubwc_regs->mode_cfg); - CAM_DBG(CAM_ISP, "WM:%d ubwc_mode_cfg:0x%x", - wm_data->index, wm_data->ubwc_mode_cfg); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d ubwc_mode_cfg:0x%x", + wm_data->common_data->core_index, wm_data->index, wm_data->ubwc_mode_cfg); cam_io_w_mb(wm_data->ubwc_ctrl_2, wm_data->common_data->mem_base + ubwc_regs->ctrl_2); - CAM_DBG(CAM_ISP, "WM:%d ubwc_ctrl_2:0x%x", - wm_data->index, wm_data->ubwc_ctrl_2); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d ubwc_ctrl_2:0x%x", + wm_data->common_data->core_index, wm_data->index, wm_data->ubwc_ctrl_2); cam_io_w_mb(wm_data->ubwc_lossy_threshold_0, wm_data->common_data->mem_base + ubwc_regs->lossy_thresh0); - CAM_DBG(CAM_ISP, "WM:%d lossy_thresh0: 0x%x", - wm_data->index, wm_data->ubwc_lossy_threshold_0); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d lossy_thresh0: 0x%x", + wm_data->common_data->core_index, wm_data->index, wm_data->ubwc_lossy_threshold_0); cam_io_w_mb(wm_data->ubwc_lossy_threshold_1, wm_data->common_data->mem_base + ubwc_regs->lossy_thresh1); - CAM_DBG(CAM_ISP, "WM:%d lossy_thresh0:0x%x", - wm_data->index, wm_data->ubwc_lossy_threshold_1); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d lossy_thresh0:0x%x", + wm_data->common_data->core_index, wm_data->index, wm_data->ubwc_lossy_threshold_1); cam_io_w_mb(wm_data->ubwc_offset_lossy_variance, wm_data->common_data->mem_base + ubwc_regs->off_lossy_var); - CAM_DBG(CAM_ISP, "WM:%d off_lossy_var:0x%x", - wm_data->index, wm_data->ubwc_offset_lossy_variance); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d off_lossy_var:0x%x", + wm_data->common_data->core_index, wm_data->index, wm_data->ubwc_offset_lossy_variance); /* * If limit value >= 0xFFFF, limit configured by @@ -3106,8 +3132,9 @@ static int cam_vfe_bus_ver3_config_ubwc_regs( if (wm_data->ubwc_bandwidth_limit < 0xFFFF) { cam_io_w_mb(wm_data->ubwc_bandwidth_limit, wm_data->common_data->mem_base + ubwc_regs->bw_limit); - CAM_DBG(CAM_ISP, "WM:%d ubwc bw limit:0x%x", - wm_data->index, wm_data->ubwc_bandwidth_limit); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d ubwc bw limit:0x%x", + wm_data->common_data->core_index, wm_data->index, + wm_data->ubwc_bandwidth_limit); } return 0; @@ -3136,8 +3163,8 @@ static int cam_vfe_bus_ver3_config_wm(void *priv, void *cmd_args, if (!vfe_out_data->limiter_enabled) CAM_WARN(CAM_ISP, - "Configuring scratch for VFE out_type: %u, with no BW limiter enabled", - vfe_out_data->out_type); + "Configuring scratch for VFE:%u out_type: %u, with no BW limiter enabled", + bus_priv->common_data.core_index, vfe_out_data->out_type); for (i = 0; i < vfe_out_data->num_wm; i++) { wm_data = vfe_out_data->wm_res[i].res_priv; @@ -3149,15 +3176,15 @@ static int cam_vfe_bus_ver3_config_wm(void *priv, void *cmd_args, val = ALIGNUP(val, 16); if (val != stride && val != wm_data->stride) - CAM_WARN(CAM_SFE, "Warning stride %u expected %u", - stride, val); + CAM_WARN(CAM_SFE, "VFE:%u Warning stride %u expected %u", + bus_priv->common_data.core_index, stride, val); if (wm_data->stride != val || !wm_data->init_cfg_done) { cam_io_w_mb(stride, wm_data->common_data->mem_base + wm_data->hw_regs->image_cfg_2); wm_data->stride = val; - CAM_DBG(CAM_ISP, "WM:%d image stride 0x%x", - wm_data->index, stride); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d image stride 0x%x", + bus_priv->common_data.core_index, wm_data->index, stride); } /* WM Image address */ @@ -3171,21 +3198,22 @@ static int cam_vfe_bus_ver3_config_wm(void *priv, void *cmd_args, cam_io_w_mb(iova_offset, wm_data->common_data->mem_base + wm_data->hw_regs->addr_cfg); - CAM_DBG(CAM_ISP, "WM:%d image address 0x%x 0x%x", - wm_data->index, iova_addr, iova_offset); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d image address 0x%x 0x%x", + bus_priv->common_data.core_index, wm_data->index, + iova_addr, iova_offset); } else { iova_addr = iova; cam_io_w_mb(iova_addr, wm_data->common_data->mem_base + wm_data->hw_regs->image_addr); - CAM_DBG(CAM_ISP, "WM:%d image address 0x%X", - wm_data->index, iova_addr); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d image address 0x%X", + bus_priv->common_data.core_index, wm_data->index, iova_addr); } if (wm_data->en_ubwc) { if (!wm_data->hw_regs->ubwc_regs) { CAM_ERR(CAM_ISP, - "No UBWC register to configure for WM: %u", - wm_data->index); + "VFE:%u No UBWC register to configure for WM: %u", + bus_priv->common_data.core_index, wm_data->index); return -EINVAL; } @@ -3196,14 +3224,15 @@ static int cam_vfe_bus_ver3_config_wm(void *priv, void *cmd_args, cam_io_w_mb(iova_addr, wm_data->common_data->mem_base + ubwc_regs->meta_addr); - CAM_DBG(CAM_ISP, "WM:%d meta address 0x%x", - wm_data->index, iova_addr); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d meta address 0x%x", + bus_priv->common_data.core_index, wm_data->index, iova_addr); } /* enable the WM */ cam_io_w_mb(wm_data->en_cfg, wm_data->common_data->mem_base + wm_data->hw_regs->cfg); - CAM_DBG(CAM_ISP, "WM:%d en_cfg 0x%x", wm_data->index, wm_data->en_cfg); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d en_cfg 0x%x", + bus_priv->common_data.core_index, wm_data->index, wm_data->en_cfg); } return 0; @@ -3240,20 +3269,21 @@ static int cam_vfe_bus_ver3_update_wm(void *priv, void *cmd_args, if ((update_buf->wm_update->num_buf != vfe_out_data->num_wm) && (!(update_buf->use_scratch_cfg))) { CAM_ERR(CAM_ISP, - "Failed! Invalid number buffers:%d required:%d", - update_buf->wm_update->num_buf, vfe_out_data->num_wm); + "VFE:%u Failed! Invalid number buffers:%d required:%d", + bus_priv->common_data.core_index, update_buf->wm_update->num_buf, + vfe_out_data->num_wm); return -EINVAL; } reg_val_pair = &vfe_out_data->common_data->io_buf_update[0]; if (update_buf->use_scratch_cfg) { - CAM_DBG(CAM_ISP, "Using scratch for IFE out_type: %u", - vfe_out_data->out_type); + CAM_DBG(CAM_ISP, "VFE:%u Using scratch for IFE out_type: %u", + bus_priv->common_data.core_index, vfe_out_data->out_type); if (!vfe_out_data->limiter_enabled) CAM_WARN(CAM_ISP, - "Configuring scratch for VFE out_type: %u, with no BW limiter enabled", - vfe_out_data->out_type); + "Configuring scratch for VFE:%u out_type: %u, with no BW limiter enabled", + bus_priv->common_data.core_index, vfe_out_data->out_type); } else { io_cfg = update_buf->wm_update->io_cfg; } @@ -3261,8 +3291,8 @@ static int cam_vfe_bus_ver3_update_wm(void *priv, void *cmd_args, for (i = 0, j = 0; i < vfe_out_data->num_wm; i++) { if (j >= (MAX_REG_VAL_PAIR_SIZE - MAX_BUF_UPDATE_REG_NUM * 2)) { CAM_ERR(CAM_ISP, - "reg_val_pair %d exceeds the array limit %zu", - j, MAX_REG_VAL_PAIR_SIZE); + "VFE:%u reg_val_pair %d exceeds the array limit %zu", + bus_priv->common_data.core_index, j, MAX_REG_VAL_PAIR_SIZE); return -ENOMEM; } @@ -3290,31 +3320,31 @@ static int cam_vfe_bus_ver3_update_wm(void *priv, void *cmd_args, } if (iova_offset) - CAM_ERR(CAM_ISP, "Error, address not aligned! offset:0x%x", - iova_offset); + CAM_ERR(CAM_ISP, "VFE:%u Error, address not aligned! offset:0x%x", + bus_priv->common_data.core_index, iova_offset); CAM_VFE_ADD_REG_VAL_PAIR(reg_val_pair, j, wm_data->hw_regs->frame_header_addr, iova_addr); CAM_VFE_ADD_REG_VAL_PAIR(reg_val_pair, j, wm_data->hw_regs->frame_header_cfg, update_buf->wm_update->local_id); CAM_DBG(CAM_ISP, - "WM: %d en_cfg 0x%x frame_header %pK local_id %u", - wm_data->index, wm_data->en_cfg, + "VFE:%u WM: %d en_cfg 0x%x frame_header %pK local_id %u", + bus_priv->common_data.core_index, wm_data->index, wm_data->en_cfg, update_buf->wm_update->frame_header, update_buf->wm_update->local_id); } CAM_VFE_ADD_REG_VAL_PAIR(reg_val_pair, j, wm_data->hw_regs->cfg, wm_data->en_cfg); - CAM_DBG(CAM_ISP, "WM:%d %s en_cfg 0x%X", - wm_data->index, vfe_out_data->wm_res[i].res_name, - reg_val_pair[j-1]); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d %s en_cfg 0x%X", + bus_priv->common_data.core_index, wm_data->index, + vfe_out_data->wm_res[i].res_name, reg_val_pair[j-1]); val = (wm_data->height << 16) | wm_data->width; CAM_VFE_ADD_REG_VAL_PAIR(reg_val_pair, j, wm_data->hw_regs->image_cfg_0, val); - CAM_DBG(CAM_ISP, "WM:%d image height and width 0x%X", - wm_data->index, reg_val_pair[j-1]); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d image height and width 0x%X", + bus_priv->common_data.core_index, wm_data->index, reg_val_pair[j-1]); /* For initial configuration program all bus registers */ if (update_buf->use_scratch_cfg) { @@ -3326,25 +3356,28 @@ static int cam_vfe_bus_ver3_update_wm(void *priv, void *cmd_args, } val = stride; - CAM_DBG(CAM_ISP, "before stride %d", val); + CAM_DBG(CAM_ISP, "VFE:%u val before stride %d", + bus_priv->common_data.core_index, val); val = ALIGNUP(val, 16); if (val != stride) - CAM_DBG(CAM_ISP, "Warning stride %u expected %u", - stride, val); + CAM_DBG(CAM_ISP, "VFE:%u Warning stride %u expected %u", + bus_priv->common_data.core_index, stride, val); if (wm_data->stride != val || !wm_data->init_cfg_done) { CAM_VFE_ADD_REG_VAL_PAIR(reg_val_pair, j, wm_data->hw_regs->image_cfg_2, stride); wm_data->stride = val; - CAM_DBG(CAM_ISP, "WM:%d image stride 0x%X", - wm_data->index, reg_val_pair[j-1]); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d image stride 0x%X", + bus_priv->common_data.core_index, wm_data->index, + reg_val_pair[j-1]); } if (wm_data->en_ubwc) { if (!wm_data->hw_regs->ubwc_regs) { CAM_ERR(CAM_ISP, - "No UBWC register to configure."); + "VFE:%u No UBWC register to configure.", + bus_priv->common_data.core_index); return -EINVAL; } if (wm_data->ubwc_updated) { @@ -3358,8 +3391,8 @@ static int cam_vfe_bus_ver3_update_wm(void *priv, void *cmd_args, reg_val_pair, &j, wm_data->hw_regs->ubwc_regs, update_buf->wm_update->image_buf[i]); - CAM_DBG(CAM_ISP, "WM:%d ubwc meta addr 0x%llx", - wm_data->index, + CAM_DBG(CAM_ISP, "VFE:%u WM:%d ubwc meta addr 0x%llx", + bus_priv->common_data.core_index, wm_data->index, update_buf->wm_update->image_buf[i]); } @@ -3371,9 +3404,9 @@ static int cam_vfe_bus_ver3_update_wm(void *priv, void *cmd_args, if (!update_buf->use_scratch_cfg) { frame_inc += io_cfg->planes[i].meta_size; CAM_DBG(CAM_ISP, - "WM:%d frm %d: ht: %d stride %d meta: %d", - wm_data->index, frame_inc, - io_cfg->planes[i].slice_height, + "VFE:%u WM:%d frm %d: ht: %d stride %d meta: %d", + bus_priv->common_data.core_index, wm_data->index, + frame_inc, io_cfg->planes[i].slice_height, io_cfg->planes[i].plane_stride, io_cfg->planes[i].meta_size); } @@ -3382,8 +3415,9 @@ static int cam_vfe_bus_ver3_update_wm(void *priv, void *cmd_args, if (!(wm_data->en_cfg & (0x3 << 16))) { CAM_VFE_ADD_REG_VAL_PAIR(reg_val_pair, j, wm_data->hw_regs->image_cfg_1, wm_data->h_init); - CAM_DBG(CAM_ISP, "WM:%d h_init 0x%X", - wm_data->index, reg_val_pair[j-1]); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d h_init 0x%X", + bus_priv->common_data.core_index, wm_data->index, + reg_val_pair[j-1]); } if ((wm_data->en_ubwc) && (!update_buf->use_scratch_cfg)) @@ -3409,15 +3443,17 @@ static int cam_vfe_bus_ver3_update_wm(void *priv, void *cmd_args, CAM_VFE_ADD_REG_VAL_PAIR(reg_val_pair, j, wm_data->hw_regs->addr_cfg, iova_offset); - CAM_DBG(CAM_ISP, "WM:%d image address:0x%X image offset: 0x%X", - wm_data->index, reg_val_pair[j-3], reg_val_pair[j-1]); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d image address:0x%X image offset: 0x%X", + bus_priv->common_data.core_index, wm_data->index, + reg_val_pair[j-3], reg_val_pair[j-1]); } else { iova_addr = iova; CAM_VFE_ADD_REG_VAL_PAIR(reg_val_pair, j, wm_data->hw_regs->image_addr, iova_addr); - CAM_DBG(CAM_ISP, "WM:%d image address 0x%X", + CAM_DBG(CAM_ISP, "VFE:%u WM:%d image address 0x%X", + bus_priv->common_data.core_index, wm_data->index, reg_val_pair[j-1]); } @@ -3425,8 +3461,8 @@ static int cam_vfe_bus_ver3_update_wm(void *priv, void *cmd_args, CAM_VFE_ADD_REG_VAL_PAIR(reg_val_pair, j, wm_data->hw_regs->frame_incr, frame_inc); - CAM_DBG(CAM_ISP, "WM:%d frame_inc: %d expanded_mem: %s", - wm_data->index, reg_val_pair[j-1], + CAM_DBG(CAM_ISP, "VFE:%u WM:%d frame_inc: %d expanded_mem: %s", + bus_priv->common_data.core_index, wm_data->index, reg_val_pair[j-1], CAM_BOOL_TO_YESNO(cam_smmu_is_expanded_memory)); /* enable the WM */ @@ -3447,8 +3483,8 @@ static int cam_vfe_bus_ver3_update_wm(void *priv, void *cmd_args, /* cdm util returns dwords, need to convert to bytes */ if ((size * 4) > update_buf->cmd.size) { CAM_ERR(CAM_ISP, - "Failed! Buf size:%d insufficient, expected size:%d", - update_buf->cmd.size, size); + "VFE:%u Failed! Buf size:%d insufficient, expected size:%d", + bus_priv->common_data.core_index, update_buf->cmd.size, size); return -ENOMEM; } @@ -3460,8 +3496,8 @@ static int cam_vfe_bus_ver3_update_wm(void *priv, void *cmd_args, update_buf->cmd.used_bytes = size * 4; } else { CAM_DBG(CAM_ISP, - "No reg val pairs. num_wms: %u", - vfe_out_data->num_wm); + "No reg val pairs. num_wms: %u VFE:%u", + vfe_out_data->num_wm, bus_priv->common_data.core_index); update_buf->cmd.used_bytes = 0; } @@ -3499,8 +3535,8 @@ static int cam_vfe_bus_ver3_update_hfr(void *priv, void *cmd_args, for (i = 0, j = 0; i < vfe_out_data->num_wm; i++) { if (j >= (MAX_REG_VAL_PAIR_SIZE - MAX_BUF_UPDATE_REG_NUM * 2)) { CAM_ERR(CAM_ISP, - "reg_val_pair %d exceeds the array limit %zu", - j, MAX_REG_VAL_PAIR_SIZE); + "VFE:%u reg_val_pair %d exceeds the array limit %zu", + bus_priv->common_data.core_index, j, MAX_REG_VAL_PAIR_SIZE); return -ENOMEM; } @@ -3512,8 +3548,9 @@ static int cam_vfe_bus_ver3_update_hfr(void *priv, void *cmd_args, wm_data->hw_regs->framedrop_pattern, hfr_cfg->framedrop_pattern); wm_data->framedrop_pattern = hfr_cfg->framedrop_pattern; - CAM_DBG(CAM_ISP, "WM:%d framedrop pattern 0x%X", - wm_data->index, wm_data->framedrop_pattern); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d framedrop pattern 0x%X", + bus_priv->common_data.core_index, wm_data->index, + wm_data->framedrop_pattern); } if (wm_data->framedrop_period != hfr_cfg->framedrop_period || @@ -3522,8 +3559,9 @@ static int cam_vfe_bus_ver3_update_hfr(void *priv, void *cmd_args, wm_data->hw_regs->framedrop_period, hfr_cfg->framedrop_period); wm_data->framedrop_period = hfr_cfg->framedrop_period; - CAM_DBG(CAM_ISP, "WM:%d framedrop period 0x%X", - wm_data->index, wm_data->framedrop_period); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d framedrop period 0x%X", + bus_priv->common_data.core_index, wm_data->index, + wm_data->framedrop_period); } if (wm_data->irq_subsample_period != hfr_cfg->subsample_period @@ -3533,8 +3571,9 @@ static int cam_vfe_bus_ver3_update_hfr(void *priv, void *cmd_args, hfr_cfg->subsample_period); wm_data->irq_subsample_period = hfr_cfg->subsample_period; - CAM_DBG(CAM_ISP, "WM:%d irq subsample period 0x%X", - wm_data->index, wm_data->irq_subsample_period); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d irq subsample period 0x%X", + bus_priv->common_data.core_index, wm_data->index, + wm_data->irq_subsample_period); } if (wm_data->irq_subsample_pattern != hfr_cfg->subsample_pattern @@ -3544,8 +3583,9 @@ static int cam_vfe_bus_ver3_update_hfr(void *priv, void *cmd_args, hfr_cfg->subsample_pattern); wm_data->irq_subsample_pattern = hfr_cfg->subsample_pattern; - CAM_DBG(CAM_ISP, "WM:%d irq subsample pattern 0x%X", - wm_data->index, wm_data->irq_subsample_pattern); + CAM_DBG(CAM_ISP, "VFE:%u WM:%d irq subsample pattern 0x%X", + bus_priv->common_data.core_index, wm_data->index, + wm_data->irq_subsample_pattern); } /* set initial configuration done */ @@ -3562,8 +3602,8 @@ static int cam_vfe_bus_ver3_update_hfr(void *priv, void *cmd_args, /* cdm util returns dwords, need to convert to bytes */ if ((size * 4) > update_hfr->cmd.size) { CAM_ERR(CAM_ISP, - "Failed! Buf size:%d insufficient, expected size:%d", - update_hfr->cmd.size, size); + "VFE:%u Failed! Buf size:%d insufficient, expected size:%d", + bus_priv->common_data.core_index, update_hfr->cmd.size, size); return -ENOMEM; } @@ -3576,8 +3616,8 @@ static int cam_vfe_bus_ver3_update_hfr(void *priv, void *cmd_args, } else { update_hfr->cmd.used_bytes = 0; CAM_DBG(CAM_ISP, - "No reg val pairs. num_wms: %u", - vfe_out_data->num_wm); + "VFE:%u No reg val pairs. num_wms: %u", + bus_priv->common_data.core_index, vfe_out_data->num_wm); } return 0; @@ -3620,13 +3660,15 @@ static int cam_vfe_bus_ver3_update_ubwc_config_v2(void *cmd_args) if (!wm_data->hw_regs->ubwc_regs) { CAM_ERR(CAM_ISP, - "No UBWC register to configure."); + "VFE:%u No UBWC register to configure.", + vfe_out_data->common_data->core_index); rc = -EINVAL; goto end; } if (!wm_data->en_ubwc) { - CAM_ERR(CAM_ISP, "UBWC Disabled"); + CAM_ERR(CAM_ISP, "VFE:%u UBWC Disabled", + vfe_out_data->common_data->core_index); rc = -EINVAL; goto end; } @@ -3755,9 +3797,9 @@ static int cam_vfe_bus_ver3_update_stripe_cfg(void *priv, void *cmd_args, wm_data->h_init = stripe_config->offset; CAM_DBG(CAM_ISP, - "out_type:0x%X WM:%d width:%d offset:0x%X h_init:%d", - stripe_args->res->res_id, wm_data->index, - wm_data->width, wm_data->offset, wm_data->h_init); + "VFE:%u out_type:0x%X WM:%d width:%d offset:0x%X h_init:%d", + vfe_out_data->common_data->core_index, stripe_args->res->res_id, + wm_data->index, wm_data->width, wm_data->offset, wm_data->h_init); } return 0; @@ -3791,8 +3833,9 @@ static int cam_vfe_bus_ver3_update_wm_config( wm_data = vfe_out_data->wm_res[i].res_priv; if (wm_config->wm_mode > 0x2) { - CAM_ERR(CAM_ISP, "Invalid wm_mode: 0x%X WM:%d", - wm_config->wm_mode, wm_data->index); + CAM_ERR(CAM_ISP, "VFE:%u Invalid wm_mode: 0x%X WM:%d", + vfe_out_data->common_data->core_index, wm_config->wm_mode, + wm_data->index); return -EINVAL; } @@ -3806,9 +3849,9 @@ static int cam_vfe_bus_ver3_update_wm_config( wm_data->height = wm_config->height; CAM_DBG(CAM_ISP, - "WM:%d en_cfg:0x%X height:%d width:%d", - wm_data->index, wm_data->en_cfg, wm_data->height, - wm_data->width); + "VFE:%u WM:%d en_cfg:0x%X height:%d width:%d", + vfe_out_data->common_data->core_index, wm_data->index, wm_data->en_cfg, + wm_data->height, wm_data->width); } return 0; @@ -3845,15 +3888,17 @@ static int cam_vfe_bus_update_bw_limiter( for (i = 0, j = 0; i < vfe_out_data->num_wm; i++) { if (j >= (MAX_REG_VAL_PAIR_SIZE - (MAX_BUF_UPDATE_REG_NUM * 2))) { CAM_ERR(CAM_ISP, - "reg_val_pair %d exceeds the array limit %zu for WM idx %d", - j, MAX_REG_VAL_PAIR_SIZE, i); + "VFE:%u reg_val_pair %d exceeds the array limit %zu for WM idx %d", + vfe_out_data->common_data->core_index, j, + MAX_REG_VAL_PAIR_SIZE, i); return -ENOMEM; } /* Num WMs needs to match max planes */ if (i >= CAM_PACKET_MAX_PLANES) { CAM_WARN(CAM_ISP, - "Num of WMs: %d exceeded max planes", i); + "VFE:%u Num of WMs: %d exceeded max planes", + vfe_out_data->common_data->core_index, i); goto add_reg_pair; } @@ -3861,8 +3906,9 @@ static int cam_vfe_bus_update_bw_limiter( vfe_out_data->wm_res[i].res_priv; if (!wm_data->hw_regs->bw_limiter_addr) { CAM_ERR(CAM_ISP, - "WM: %d %s has no support for bw limiter", - wm_data->index, vfe_out_data->wm_res[i].res_name); + "VFE:%u WM: %d %s has no support for bw limiter", + vfe_out_data->common_data->core_index, wm_data->index, + vfe_out_data->wm_res[i].res_name); return -EINVAL; } @@ -3872,7 +3918,8 @@ static int cam_vfe_bus_update_bw_limiter( if (counter_limit > wm_data->common_data->max_bw_counter_limit) { CAM_WARN(CAM_ISP, - "Invalid counter limit: 0x%x capping to max: 0x%x", + "VFE:%u Invalid counter limit: 0x%x capping to max: 0x%x", + vfe_out_data->common_data->core_index, wm_bw_limit_cfg->counter_limit[i], wm_data->common_data->max_bw_counter_limit); counter_limit = @@ -3889,8 +3936,9 @@ static int cam_vfe_bus_update_bw_limiter( CAM_VFE_ADD_REG_VAL_PAIR(reg_val_pair, j, wm_data->hw_regs->bw_limiter_addr, reg_val); - CAM_DBG(CAM_ISP, "WM: %d for %s bw_limter: 0x%x", - wm_data->index, vfe_out_data->wm_res[i].res_name, + CAM_DBG(CAM_ISP, "VFE:%u WM: %d for %s bw_limter: 0x%x", + vfe_out_data->common_data->core_index, wm_data->index, + vfe_out_data->wm_res[i].res_name, reg_val_pair[j-1]); } @@ -3905,7 +3953,8 @@ add_reg_pair: /* cdm util returns dwords, need to convert to bytes */ if ((size * 4) > wm_config_update->cmd.size) { CAM_ERR(CAM_ISP, - "Failed! Buf size:%d insufficient, expected size:%d", + "VFE:%u Failed! Buf size:%d insufficient, expected size:%d", + vfe_out_data->common_data->core_index, wm_config_update->cmd.size, size); return -ENOMEM; } @@ -3918,8 +3967,8 @@ add_reg_pair: wm_config_update->cmd.used_bytes = size * 4; } else { CAM_DBG(CAM_ISP, - "No reg val pairs. num_wms: %u", - vfe_out_data->num_wm); + "VFE:%u No reg val pairs. num_wms: %u", + vfe_out_data->common_data->core_index, vfe_out_data->num_wm); wm_config_update->cmd.used_bytes = 0; } @@ -3961,7 +4010,7 @@ static int cam_vfe_bus_ver3_init_hw(void *hw_priv, bus_priv->common_data.hw_init = true; - CAM_DBG(CAM_ISP, "VFE:%d bus-wr hw-version:0x%x", + CAM_DBG(CAM_ISP, "VFE:%u bus-wr hw-version:0x%x", bus_priv->common_data.core_index, cam_io_r_mb(bus_priv->common_data.mem_base + bus_priv->common_data.common_reg->hw_version)); @@ -4028,15 +4077,15 @@ static int cam_vfe_bus_get_res_for_mid( if (i == bus_priv->num_out) { CAM_ERR(CAM_ISP, - "mid:%d does not match with any out resource", - get_res->mid); + "VFE:%u mid:%d does not match with any out resource", + bus_priv->common_data.core_index, get_res->mid); get_res->out_res_id = 0; return -EINVAL; } end: - CAM_INFO(CAM_ISP, "match mid :%d out resource:0x%x found", - get_res->mid, bus_priv->vfe_out[i].res_id); + CAM_INFO(CAM_ISP, "VFE:%u match mid :%d out resource:0x%x found", + bus_priv->common_data.core_index, get_res->mid, bus_priv->vfe_out[i].res_id); get_res->out_res_id = bus_priv->vfe_out[i].res_id; return 0; } @@ -4079,7 +4128,8 @@ static int cam_vfe_bus_ver3_process_cmd( case CAM_ISP_HW_CMD_STOP_BUS_ERR_IRQ: bus_priv = (struct cam_vfe_bus_ver3_priv *) priv; if (bus_priv->error_irq_handle) { - CAM_DBG(CAM_ISP, "Mask off bus error irq handler"); + CAM_DBG(CAM_ISP, "VFE:%u Mask off bus error irq handler", + priv->hw_intf->hw_idx); rc = cam_irq_controller_unsubscribe_irq( bus_priv->common_data.bus_irq_controller, bus_priv->error_irq_handle); @@ -4156,8 +4206,8 @@ static int cam_vfe_bus_ver3_process_cmd( rc = cam_vfe_bus_update_bw_limiter(priv, cmd_args, arg_size); break; default: - CAM_ERR_RATE_LIMIT(CAM_ISP, "Invalid camif process command:%d", - cmd_type); + CAM_ERR_RATE_LIMIT(CAM_ISP, "VFE:%u Invalid camif process command:%d", + priv->hw_intf->hw_idx, cmd_type); break; } @@ -4243,8 +4293,9 @@ int cam_vfe_bus_ver3_init( bus_priv->constraint_error_list = ver3_hw_info->constraint_error_list; if (bus_priv->num_out >= CAM_VFE_BUS_VER3_VFE_OUT_MAX) { - CAM_ERR(CAM_ISP, "number of vfe out:%d more than max value:%d ", - bus_priv->num_out, CAM_VFE_BUS_VER3_VFE_OUT_MAX); + CAM_ERR(CAM_ISP, "VFE:%u number of vfe out:%d more than max value:%d ", + bus_priv->common_data.core_index, bus_priv->num_out, + CAM_VFE_BUS_VER3_VFE_OUT_MAX); rc = -EINVAL; goto free_bus_priv; } @@ -4252,7 +4303,8 @@ int cam_vfe_bus_ver3_init( bus_priv->comp_grp = kzalloc((sizeof(struct cam_isp_resource_node) * bus_priv->num_comp_grp), GFP_KERNEL); if (!bus_priv->comp_grp) { - CAM_ERR(CAM_ISP, "Failed to alloc for bus comp groups"); + CAM_ERR(CAM_ISP, "VFE:%u Failed to alloc for bus comp groups", + bus_priv->common_data.core_index); rc = -ENOMEM; goto free_bus_priv; } @@ -4260,7 +4312,8 @@ int cam_vfe_bus_ver3_init( bus_priv->vfe_out = kzalloc((sizeof(struct cam_isp_resource_node) * bus_priv->num_out), GFP_KERNEL); if (!bus_priv->vfe_out) { - CAM_ERR(CAM_ISP, "Failed to alloc for bus out res"); + CAM_ERR(CAM_ISP, "VFE:%u Failed to alloc for bus out res", + bus_priv->common_data.core_index); rc = -ENOMEM; goto free_comp_grp; } @@ -4274,7 +4327,8 @@ int cam_vfe_bus_ver3_init( &ver3_hw_info->common_reg.irq_reg_info, &bus_priv->common_data.bus_irq_controller); if (rc) { - CAM_ERR(CAM_ISP, "Init bus_irq_controller failed"); + CAM_ERR(CAM_ISP, "VFE:%u Init bus_irq_controller failed", + bus_priv->common_data.core_index); goto free_vfe_out; } @@ -4283,7 +4337,7 @@ int cam_vfe_bus_ver3_init( bus_priv, bus_hw_info, &bus_priv->comp_grp[i]); if (rc < 0) { - CAM_ERR(CAM_ISP, "VFE:%d init comp_grp:%d failed rc:%d", + CAM_ERR(CAM_ISP, "VFE:%u init comp_grp:%d failed rc:%d", bus_priv->common_data.core_index, i, rc); goto deinit_comp_grp; } @@ -4298,7 +4352,7 @@ int cam_vfe_bus_ver3_init( bus_hw_info); if (rc < 0) { CAM_ERR(CAM_ISP, - "VFE:%d init out_type:0x%X failed rc:%d", + "VFE:%u init out_type:0x%X failed rc:%d", bus_priv->common_data.core_index, i, rc); goto deinit_vfe_out; } @@ -4324,7 +4378,7 @@ int cam_vfe_bus_ver3_init( *vfe_bus = vfe_bus_local; - CAM_DBG(CAM_ISP, "Exit"); + CAM_DBG(CAM_ISP, "Exit, VFE:%u", bus_priv->common_data.core_index); return rc; deinit_vfe_out: @@ -4386,7 +4440,7 @@ int cam_vfe_bus_ver3_deinit( rc = cam_vfe_bus_ver3_deinit_comp_grp(&bus_priv->comp_grp[i]); if (rc < 0) CAM_ERR(CAM_ISP, - "VFE:%d deinit comp_grp:%d failed rc:%d", + "VFE:%u deinit comp_grp:%d failed rc:%d", bus_priv->common_data.core_index, i, rc); } @@ -4395,7 +4449,7 @@ int cam_vfe_bus_ver3_deinit( &bus_priv->vfe_out[i]); if (rc < 0) CAM_ERR(CAM_ISP, - "VFE:%d deinit out_type:0x%X failed rc:%d", + "VFE:%u deinit out_type:0x%X failed rc:%d", bus_priv->common_data.core_index, i, rc); } @@ -4404,7 +4458,8 @@ int cam_vfe_bus_ver3_deinit( &bus_priv->common_data.bus_irq_controller); if (rc) CAM_ERR(CAM_ISP, - "Deinit BUS IRQ Controller failed rc=%d", rc); + "VFE:%u Deinit BUS IRQ Controller failed rc=%d", + bus_priv->common_data.core_index, rc); kfree(bus_priv->comp_grp); kfree(bus_priv->vfe_out); diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_top_ver4.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_top_ver4.c index cd89c430db..4d0c2d7ebe 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_top_ver4.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_top_ver4.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include @@ -134,13 +134,13 @@ static int cam_vfe_top_ver4_pdaf_lcr_config(struct cam_vfe_top_ver4_priv *top_pr cdm_args = (struct cam_isp_hw_get_cmd_update *)cmd_args; if (!cdm_args->res) { - CAM_ERR(CAM_ISP, "Error, Invalid res"); + CAM_ERR(CAM_ISP, "VFE:%u Error, Invalid res", top_priv->top_common.hw_idx); return -EINVAL; } hw_info = top_priv->common_data.hw_info; if (!hw_info->num_pdaf_lcr_res || !hw_info->pdaf_lcr_res_mask) { - CAM_DBG(CAM_ISP, "PDAF LCR is not supported"); + CAM_DBG(CAM_ISP, "VFE:%u PDAF LCR is not supported", top_priv->top_common.hw_idx); return 0; } @@ -148,7 +148,7 @@ static int cam_vfe_top_ver4_pdaf_lcr_config(struct cam_vfe_top_ver4_priv *top_pr cdm_util_ops = (struct cam_cdm_utils_ops *)cdm_args->res->cdm_ops; if (!cdm_util_ops) { - CAM_ERR(CAM_ISP, "Invalid CDM ops"); + CAM_ERR(CAM_ISP, "VFE:%u Invalid CDM ops", top_priv->top_common.hw_idx); return -EINVAL; } @@ -157,8 +157,9 @@ static int cam_vfe_top_ver4_pdaf_lcr_config(struct cam_vfe_top_ver4_priv *top_pr break; if (i == hw_info->num_pdaf_lcr_res) { - CAM_ERR(CAM_ISP, "Res :%d src_res :%u is not supported for mux", - cfg_args->rdi_lcr_cfg->res_id, cfg_args->ife_src_res_id); + CAM_ERR(CAM_ISP, "VFE:%u Res :%d src_res :%u is not supported for mux", + top_priv->top_common.hw_idx, cfg_args->rdi_lcr_cfg->res_id, + cfg_args->ife_src_res_id); return -EINVAL; } @@ -170,8 +171,8 @@ static int cam_vfe_top_ver4_pdaf_lcr_config(struct cam_vfe_top_ver4_priv *top_pr size = cdm_util_ops->cdm_required_size_reg_random(num_reg_vals); /* since cdm returns dwords, we need to convert it into bytes */ if ((size * 4) > cdm_args->cmd.size) { - CAM_ERR(CAM_ISP, "buf size:%d is not sufficient, expected: %d", - cdm_args->cmd.size, (size*4)); + CAM_ERR(CAM_ISP, "VFE:%u buf size:%d is not sufficient, expected: %d", + top_priv->top_common.hw_idx, cdm_args->cmd.size, (size*4)); return -EINVAL; } @@ -211,7 +212,7 @@ static int cam_vfe_top_ver4_mux_get_base(struct cam_vfe_top_ver4_priv *top_priv, soc_private = top_priv->top_common.soc_info->soc_private; if (!soc_private) { - CAM_ERR(CAM_ISP, "soc_private is null"); + CAM_ERR(CAM_ISP, "VFE:%u soc_private is null", top_priv->top_common.hw_idx); return -EINVAL; } @@ -219,15 +220,15 @@ static int cam_vfe_top_ver4_mux_get_base(struct cam_vfe_top_ver4_priv *top_priv, (struct cam_cdm_utils_ops *)cdm_args->res->cdm_ops; if (!cdm_util_ops) { - CAM_ERR(CAM_ISP, "Invalid CDM ops"); + CAM_ERR(CAM_ISP, "VFE:%u Invalid CDM ops", top_priv->top_common.hw_idx); return -EINVAL; } size = cdm_util_ops->cdm_required_size_changebase(); /* since cdm returns dwords, we need to convert it into bytes */ if ((size * 4) > cdm_args->cmd.size) { - CAM_ERR(CAM_ISP, "buf size:%d is not sufficient, expected: %d", - cdm_args->cmd.size, size); + CAM_ERR(CAM_ISP, "VFE:%u buf size:%d is not sufficient, expected: %d", + top_priv->top_common.hw_idx, cdm_args->cmd.size, size); return -EINVAL; } @@ -235,14 +236,15 @@ static int cam_vfe_top_ver4_mux_get_base(struct cam_vfe_top_ver4_priv *top_priv, top_priv->top_common.soc_info, VFE_CORE_BASE_IDX); if (cdm_args->cdm_id == CAM_CDM_RT) { if (!soc_private->rt_wrapper_base) { - CAM_ERR(CAM_ISP, "rt_wrapper_base_addr is null"); + CAM_ERR(CAM_ISP, "VFE:%u rt_wrapper_base_addr is null", + top_priv->top_common.hw_idx); return -EINVAL; } mem_base -= soc_private->rt_wrapper_base; } - CAM_DBG(CAM_ISP, "core %d mem_base 0x%x, cdm_id: %u", + CAM_DBG(CAM_ISP, "core %u mem_base 0x%x, cdm_id: %u", top_priv->top_common.soc_info->index, mem_base, cdm_args->cdm_id); @@ -442,7 +444,7 @@ static void cam_vfe_top_ver4_print_debug_reg_status( common_reg->top_debug[i]); reg_val[i] = val; CAM_INFO_BUF(CAM_ISP, log_buf, CAM_VFE_LEN_LOG_BUF, &len, - "status %2d : 0x%08x", i, val); + "VFE[%u] status %2d : 0x%08x", soc_info->index, i, val); } CAM_INFO(CAM_ISP, "VFE[%u]: Top Debug Status: %s", soc_info->index, log_buf); len = 0; @@ -468,7 +470,8 @@ int cam_vfe_top_ver4_dump_timestamps( res = &top_priv->top_common.mux_rsrc[i]; if (!res || !res->res_priv) { - CAM_ERR_RATE_LIMIT(CAM_ISP, "Invalid Resource"); + CAM_ERR_RATE_LIMIT(CAM_ISP, "VFE[%u] Invalid Resource", + top_priv->common_data.hw_intf->hw_idx); return -EINVAL; } @@ -504,8 +507,8 @@ int cam_vfe_top_ver4_dump_timestamps( vfe_priv->hw_intf->hw_idx, ts.tv_sec, ts.tv_nsec); CAM_INFO(CAM_ISP, - "CAMIF Error timestamp:[%lld.%09lld] SOF timestamp:[%lld.%09lld] EPOCH timestamp:[%lld.%09lld] EOF timestamp:[%lld.%09lld]", - vfe_priv->error_ts.tv_sec, + "VFE[%u] CAMIF Error timestamp:[%lld.%09lld] SOF timestamp:[%lld.%09lld] EPOCH timestamp:[%lld.%09lld] EOF timestamp:[%lld.%09lld]", + vfe_priv->hw_intf->hw_idx, vfe_priv->error_ts.tv_sec, vfe_priv->error_ts.tv_nsec, vfe_priv->sof_ts.tv_sec, vfe_priv->sof_ts.tv_nsec, @@ -542,14 +545,14 @@ static int cam_vfe_top_ver4_print_overflow_debug_info( if (soc_private->is_ife_lite) CAM_ERR(CAM_ISP, - "VFE[%d] sof_cnt:%d src_clk:%lu overflow:%s violation:%s", + "VFE[%u] sof_cnt:%d src_clk:%lu overflow:%s violation:%s", soc_info->index, top_priv->sof_cnt, soc_info->applied_src_clk_rates.sw_client, CAM_BOOL_TO_YESNO(bus_overflow_status), CAM_BOOL_TO_YESNO(violation_status)); else CAM_ERR(CAM_ISP, - "VFE[%d] sof_cnt:%d src_clk sw_client:%lu hw_client:[%lu %lu] overflow:%s violation:%s", + "VFE[%u] sof_cnt:%d src_clk sw_client:%lu hw_client:[%lu %lu] overflow:%s violation:%s", soc_info->index, top_priv->sof_cnt, soc_info->applied_src_clk_rates.sw_client, soc_info->applied_src_clk_rates.hw_client[soc_info->index].high, @@ -559,14 +562,14 @@ static int cam_vfe_top_ver4_print_overflow_debug_info( if (bus_overflow_status) { overflow_info->is_bus_overflow = true; - CAM_INFO(CAM_ISP, "VFE[%d] Bus overflow status: 0x%x", + CAM_INFO(CAM_ISP, "VFE[%u] Bus overflow status: 0x%x", soc_info->index, bus_overflow_status); } tmp = bus_overflow_status; while (tmp) { if (tmp & 0x1) - CAM_ERR(CAM_ISP, "VFE[%d] Bus Overflow %s", + CAM_ERR(CAM_ISP, "VFE[%u] Bus Overflow %s", soc_info->index, common_data->hw_info->wr_client_desc[i].desc); tmp = tmp >> 1; i++; @@ -578,14 +581,14 @@ static int cam_vfe_top_ver4_print_overflow_debug_info( cam_cpas_log_votes(false); if (violation_status) - CAM_INFO(CAM_ISP, "VFE[%d] Bus violation status: 0x%x", + CAM_INFO(CAM_ISP, "VFE[%u] Bus violation status: 0x%x", soc_info->index, violation_status); i = 0; tmp = violation_status; while (tmp) { if (tmp & 0x1) - CAM_ERR(CAM_ISP, "VFE[%d] Bus Violation %s", + CAM_ERR(CAM_ISP, "VFE[%u] Bus Violation %s", soc_info->index, common_data->hw_info->wr_client_desc[i].desc); tmp = tmp >> 1; i++; @@ -634,8 +637,8 @@ static int cam_vfe_init_config_update( struct cam_vfe_mux_ver4_data *mux_data = rsrc_node->res_priv; if (arg_size != sizeof(struct cam_isp_hw_init_config_update)) { - CAM_ERR(CAM_ISP, "Invalid args size expected: %zu actual: %zu", - sizeof(struct cam_isp_hw_init_config_update), + CAM_ERR(CAM_ISP, "VFE:%u Invalid args size expected: %zu actual: %zu", + rsrc_node->hw_intf->hw_idx, sizeof(struct cam_isp_hw_init_config_update), arg_size); return -EINVAL; } @@ -644,8 +647,8 @@ static int cam_vfe_init_config_update( init_cfg->init_config->epoch_cfg.epoch_factor; CAM_DBG(CAM_ISP, - "Init Update for res_name: %s epoch_factor: %u%%", - rsrc_node->res_name, mux_data->epoch_factor); + "VFE:%u Init Update for res_name: %s epoch_factor: %u%%", + rsrc_node->hw_intf->hw_idx, rsrc_node->res_name, mux_data->epoch_factor); return 0; } @@ -654,7 +657,8 @@ static int cam_vfe_top_ver4_mux_get_reg_update( struct cam_vfe_top_ver4_priv *top_priv, void *cmd_args, uint32_t arg_size) { - CAM_ERR(CAM_ISP, "Invalid request, Add RUP in CSID"); + CAM_ERR(CAM_ISP, "VFE:%u Invalid request, Add RUP in CSID", + top_priv->common_data.hw_intf->hw_idx); return -EINVAL; } @@ -711,7 +715,7 @@ int cam_vfe_top_ver4_init_hw(void *device_priv, top_priv->top_common.hw_version = cam_io_r_mb( top_priv->top_common.soc_info->reg_map[0].mem_base + common_data.common_reg->hw_version); - CAM_DBG(CAM_ISP, "VFE:%d hw-version:0x%x", + CAM_DBG(CAM_ISP, "VFE:%u hw-version:0x%x", top_priv->top_common.hw_idx, top_priv->top_common.hw_version); @@ -767,7 +771,7 @@ int cam_vfe_top_acquire_resource( config_done: CAM_DBG(CAM_ISP, - "VFE:%d Res:[id:%d name:%s] dsp_mode:%d is_dual:%d dual_hw_idx:%d", + "VFE:%u Res:[id:%d name:%s] dsp_mode:%d is_dual:%d dual_hw_idx:%d", vfe_full_res->hw_intf->hw_idx, vfe_full_res->res_id, vfe_full_res->res_name, @@ -795,7 +799,8 @@ int cam_vfe_top_ver4_reserve(void *device_priv, args = (struct cam_vfe_acquire_args *)reserve_args; acquire_args = &args->vfe_in; - CAM_DBG(CAM_ISP, "res id %d", acquire_args->res_id); + CAM_DBG(CAM_ISP, "VFE:%u res id %d", + top_priv->common_data.hw_intf->hw_idx, acquire_args->res_id); for (i = 0; i < top_priv->top_common.num_mux; i++) { @@ -853,10 +858,11 @@ int cam_vfe_top_ver4_release(void *device_priv, top_priv = (struct cam_vfe_top_ver4_priv *)device_priv; mux_res = (struct cam_isp_resource_node *)release_args; - CAM_DBG(CAM_ISP, "Resource in state %d", mux_res->res_state); + CAM_DBG(CAM_ISP, "VFE:%u Resource in state %d", + top_priv->common_data.hw_intf->hw_idx, mux_res->res_state); if (mux_res->res_state < CAM_ISP_RESOURCE_STATE_RESERVED) { - CAM_ERR(CAM_ISP, "Error, Resource in Invalid res_state :%d", - mux_res->res_state); + CAM_ERR(CAM_ISP, "VFE:%u Error, Resource in Invalid res_state :%d", + top_priv->common_data.hw_intf->hw_idx, mux_res->res_state); return -EINVAL; } mux_res->res_state = CAM_ISP_RESOURCE_STATE_AVAILABLE; @@ -883,7 +889,8 @@ int cam_vfe_top_ver4_start(void *device_priv, soc_info = top_priv->top_common.soc_info; soc_private = soc_info->soc_private; if (!soc_private) { - CAM_ERR(CAM_ISP, "Error soc_private NULL"); + CAM_ERR(CAM_ISP, "VFE:%u Error soc_private NULL", + top_priv->common_data.hw_intf->hw_idx); return -EINVAL; } @@ -894,7 +901,7 @@ int cam_vfe_top_ver4_start(void *device_priv, rc = cam_vfe_top_apply_clock_start_stop(&top_priv->top_common); if (rc) { CAM_ERR(CAM_ISP, - "VFE:%d Failed in applying start clock rc:%d", + "VFE:%u Failed in applying start clock rc:%d", hw_info->soc_info.index, rc); return rc; } @@ -902,7 +909,7 @@ int cam_vfe_top_ver4_start(void *device_priv, rc = cam_vfe_top_apply_bw_start_stop(&top_priv->top_common); if (rc) { CAM_ERR(CAM_ISP, - "VFE:%d Failed in applying start bw rc:%d", + "VFE:%u Failed in applying start bw rc:%d", hw_info->soc_info.index, rc); return rc; } @@ -911,7 +918,8 @@ int cam_vfe_top_ver4_start(void *device_priv, rc = mux_res->start(mux_res); } else { CAM_ERR(CAM_ISP, - "Invalid res id:%d", mux_res->res_id); + "VFE:%u Invalid res id:%d", + hw_info->soc_info.index, mux_res->res_id); rc = -EINVAL; } @@ -929,7 +937,7 @@ int cam_vfe_top_ver4_start(void *device_priv, top_priv->perf_counters[i].perf_counter_val); } } else { - CAM_ERR(CAM_ISP, "VFE HW not powered up"); + CAM_ERR(CAM_ISP, "VFE:%u HW not powered up", hw_info->soc_info.index); rc = -EPERM; } @@ -959,7 +967,8 @@ int cam_vfe_top_ver4_stop(void *device_priv, if (mux_res->res_id < CAM_ISP_HW_VFE_IN_MAX) { rc = mux_res->stop(mux_res); } else { - CAM_ERR(CAM_ISP, "Invalid res id:%d", mux_res->res_id); + CAM_ERR(CAM_ISP, "VFE:%u Invalid res id:%d", + top_priv->common_data.hw_intf->hw_idx, mux_res->res_id); return -EINVAL; } @@ -1024,7 +1033,8 @@ int cam_vfe_top_ver4_process_cmd(void *device_priv, uint32_t cmd_type, soc_info = top_priv->top_common.soc_info; soc_private = soc_info->soc_private; if (!soc_private) { - CAM_ERR(CAM_ISP, "Error soc_private NULL"); + CAM_ERR(CAM_ISP, "VFE:%u Error soc_private NULL", + top_priv->common_data.hw_intf->hw_idx); return -EINVAL; } @@ -1105,7 +1115,8 @@ int cam_vfe_top_ver4_process_cmd(void *device_priv, uint32_t cmd_type, break; default: rc = -EINVAL; - CAM_ERR(CAM_ISP, "Error, Invalid cmd:%d", cmd_type); + CAM_ERR(CAM_ISP, "VFE:%u Error, Invalid cmd:%d", + top_priv->common_data.hw_intf->hw_idx, cmd_type); break; } @@ -1144,7 +1155,7 @@ static int cam_vfe_top_put_evt_payload( return -EINVAL; } if (*evt_payload == NULL) { - CAM_ERR(CAM_ISP, "No payload to put"); + CAM_ERR(CAM_ISP, "VFE:%u No payload to put", vfe_priv->hw_intf->hw_idx); return -EINVAL; } @@ -1153,7 +1164,7 @@ static int cam_vfe_top_put_evt_payload( *evt_payload = NULL; spin_unlock_irqrestore(&vfe_priv->spin_lock, flags); - CAM_DBG(CAM_ISP, "Done"); + CAM_DBG(CAM_ISP, "VFE:%u Done", vfe_priv->hw_intf->hw_idx); return 0; } @@ -1170,14 +1181,14 @@ static int cam_vfe_handle_irq_top_half(uint32_t evt_id, vfe_priv = vfe_res->res_priv; CAM_DBG(CAM_ISP, - "VFE:%d IRQ status_0: 0x%X status_1: 0x%X", + "VFE:%u IRQ status_0: 0x%X status_1: 0x%X", vfe_res->hw_intf->hw_idx, th_payload->evt_status_arr[0], th_payload->evt_status_arr[1]); rc = cam_vfe_get_evt_payload(vfe_priv, &evt_payload); if (rc) { CAM_INFO_RATE_LIMIT(CAM_ISP, - "VFE:%d IRQ status_0: 0x%X status_1: 0x%X", + "VFE:%u IRQ status_0: 0x%X status_1: 0x%X", vfe_res->hw_intf->hw_idx, th_payload->evt_status_arr[0], th_payload->evt_status_arr[1]); return rc; @@ -1212,7 +1223,7 @@ static int cam_vfe_handle_irq_top_half(uint32_t evt_id, vfe_res->hw_intf->hw_idx); } - CAM_DBG(CAM_ISP, "Exit"); + CAM_DBG(CAM_ISP, "VFE:%u Exit", vfe_res->hw_intf->hw_idx); return rc; } @@ -1264,7 +1275,7 @@ static int cam_vfe_handle_sof(struct cam_vfe_mux_ver4_data *vfe_priv, if ((vfe_priv->enable_sof_irq_debug) && (vfe_priv->irq_debug_cnt <= CAM_VFE_CAMIF_IRQ_SOF_DEBUG_CNT_MAX)) { - CAM_INFO_RATE_LIMIT(CAM_ISP, "VFE:%d Received SOF", + CAM_INFO_RATE_LIMIT(CAM_ISP, "VFE:%u Received SOF", vfe_priv->hw_intf->hw_idx); vfe_priv->irq_debug_cnt++; @@ -1274,7 +1285,7 @@ static int cam_vfe_handle_sof(struct cam_vfe_mux_ver4_data *vfe_priv, vfe_priv->irq_debug_cnt = 0; } } else { - CAM_DBG(CAM_ISP, "VFE:%d Received SOF", + CAM_DBG(CAM_ISP, "VFE:%u Received SOF", vfe_priv->hw_intf->hw_idx); vfe_priv->sof_ts.tv_sec = payload->ts.mono_time.tv_sec; vfe_priv->sof_ts.tv_nsec = payload->ts.mono_time.tv_nsec; @@ -1290,7 +1301,7 @@ static int cam_vfe_handle_epoch(struct cam_vfe_mux_ver4_data *vfe_priv, struct cam_vfe_top_irq_evt_payload *payload, struct cam_isp_hw_event_info *evt_info) { - CAM_DBG(CAM_ISP, "VFE:%d Received EPOCH", vfe_priv->hw_intf->hw_idx); + CAM_DBG(CAM_ISP, "VFE:%u Received EPOCH", vfe_priv->hw_intf->hw_idx); evt_info->reg_val = payload->reg_val; vfe_priv->epoch_ts.tv_sec = payload->ts.mono_time.tv_sec; vfe_priv->epoch_ts.tv_nsec = payload->ts.mono_time.tv_nsec; @@ -1303,7 +1314,7 @@ static int cam_vfe_handle_eof(struct cam_vfe_mux_ver4_data *vfe_priv, struct cam_vfe_top_irq_evt_payload *payload, struct cam_isp_hw_event_info *evt_info) { - CAM_DBG(CAM_ISP, "VFE:%d Received EOF", vfe_priv->hw_intf->hw_idx); + CAM_DBG(CAM_ISP, "VFE:%u Received EOF", vfe_priv->hw_intf->hw_idx); vfe_priv->eof_ts.tv_sec = payload->ts.mono_time.tv_sec; vfe_priv->eof_ts.tv_nsec = payload->ts.mono_time.tv_nsec; @@ -1418,7 +1429,7 @@ static int cam_vfe_handle_irq_bottom_half(void *handler_priv, if (atomic_read(&vfe_priv->top_priv->overflow_pending)) { CAM_INFO(CAM_ISP, - "VFE:%d Handling overflow, Ignore bottom half", + "VFE:%u Handling overflow, Ignore bottom half", vfe_res->hw_intf->hw_idx); cam_vfe_top_put_evt_payload(vfe_priv, &payload); return IRQ_HANDLED; @@ -1445,14 +1456,14 @@ static int cam_vfe_handle_irq_bottom_half(void *handler_priv, if (irq_status[CAM_IFE_IRQ_CAMIF_REG_STATUS0] & vfe_priv->reg_data->error_irq_mask) { - CAM_ERR(CAM_ISP, "VFE:%d Error", evt_info.hw_idx); + CAM_ERR(CAM_ISP, "VFE:%u Error", evt_info.hw_idx); err_evt_info.err_type = CAM_VFE_IRQ_STATUS_VIOLATION; evt_info.event_data = (void *)&err_evt_info; ktime_get_boottime_ts64(&ts); CAM_INFO(CAM_ISP, - "current monotonic timestamp:[%lld.%09lld]", - ts.tv_sec, ts.tv_nsec); + "VFE:%u current monotonic timestamp:[%lld.%09lld]", + evt_info.hw_idx, ts.tv_sec, ts.tv_nsec); if (vfe_priv->event_cb) vfe_priv->event_cb(vfe_priv->priv, @@ -1467,7 +1478,7 @@ static int cam_vfe_handle_irq_bottom_half(void *handler_priv, } if (vfe_priv->camif_debug & CAMIF_DEBUG_ENABLE_SENSOR_DIAG_STATUS) { - CAM_DBG(CAM_ISP, "VFE:%d VFE_DIAG_SENSOR_STATUS: 0x%X", + CAM_DBG(CAM_ISP, "VFE:%u VFE_DIAG_SENSOR_STATUS: 0x%X", evt_info.hw_idx, vfe_priv->mem_base, cam_io_r(vfe_priv->mem_base + vfe_priv->common_reg->diag_sensor_status_0)); @@ -1484,7 +1495,7 @@ static int cam_vfe_handle_irq_bottom_half(void *handler_priv, cam_vfe_top_put_evt_payload(vfe_priv, &payload); - CAM_DBG(CAM_ISP, "returning status = %d", ret); + CAM_DBG(CAM_ISP, "VFE:%u returning status = %d", evt_info.hw_idx, ret); return ret; } @@ -1508,10 +1519,10 @@ static int cam_vfe_ver4_err_irq_top_half( if ((th_payload->evt_status_arr[0] & vfe_priv->reg_data->error_irq_mask)) { CAM_ERR(CAM_ISP, - "VFE:%d Err IRQ status_0: 0x%X", + "VFE:%u Err IRQ status_0: 0x%X", vfe_res->hw_intf->hw_idx, th_payload->evt_status_arr[0]); - CAM_ERR(CAM_ISP, "Stopping further IRQ processing from VFE:%d", + CAM_ERR(CAM_ISP, "Stopping further IRQ processing from VFE:%u", vfe_res->hw_intf->hw_idx); cam_irq_controller_disable_all( vfe_priv->vfe_irq_controller); @@ -1553,8 +1564,8 @@ static int cam_vfe_resource_start( } if (vfe_res->res_state != CAM_ISP_RESOURCE_STATE_RESERVED) { - CAM_ERR(CAM_ISP, "Error, Invalid camif res res_state:%d", - vfe_res->res_state); + CAM_ERR(CAM_ISP, "VFE:%u Error, Invalid camif res res_state:%d", + vfe_res->hw_intf->hw_idx, vfe_res->res_state); return -EINVAL; } @@ -1571,7 +1582,7 @@ static int cam_vfe_resource_start( goto skip_core_cfg; /* IFE top cfg programmed via CDM */ - CAM_DBG(CAM_ISP, "VFE:%d TOP core_cfg0: 0x%x core_cfg1: 0x%x", + CAM_DBG(CAM_ISP, "VFE:%u TOP core_cfg0: 0x%x core_cfg1: 0x%x", vfe_res->hw_intf->hw_idx, cam_io_r_mb(rsrc_data->mem_base + rsrc_data->common_reg->core_cfg_0), @@ -1595,8 +1606,8 @@ static int cam_vfe_resource_start( cam_io_w_mb(val, rsrc_data->mem_base + rsrc_data->common_reg->epoch_height_cfg); CAM_DBG(CAM_ISP, - "height [0x%x : 0x%x] vbi_val: 0x%x epoch_factor: %u%% epoch_line_cfg: 0x%x", - rsrc_data->first_line, rsrc_data->last_line, + "VFE:%u height [0x%x : 0x%x] vbi_val: 0x%x epoch_factor: %u%% epoch_line_cfg: 0x%x", + vfe_res->hw_intf->hw_idx, rsrc_data->first_line, rsrc_data->last_line, rsrc_data->vbi_value, epoch_factor, val); skip_core_cfg: @@ -1646,7 +1657,8 @@ skip_core_cfg: CAM_IRQ_EVT_GROUP_0); if (rsrc_data->frame_irq_handle < 1) { - CAM_ERR(CAM_ISP, "Frame IRQs handle subscribe failure"); + CAM_ERR(CAM_ISP, "VFE:%u Frame IRQs handle subscribe failure", + vfe_res->hw_intf->hw_idx); rc = -ENOMEM; rsrc_data->frame_irq_handle = 0; } @@ -1668,7 +1680,8 @@ subscribe_err: CAM_IRQ_EVT_GROUP_0); if (rsrc_data->irq_err_handle < 1) { - CAM_ERR(CAM_ISP, "Error IRQ handle subscribe failure"); + CAM_ERR(CAM_ISP, "VFE:%u Error IRQ handle subscribe failure", + vfe_res->hw_intf->hw_idx); rc = -ENOMEM; rsrc_data->irq_err_handle = 0; } @@ -1676,7 +1689,7 @@ subscribe_err: rsrc_data->fsm_state = VFE_TOP_VER4_FSM_SOF; - CAM_DBG(CAM_ISP, "VFE:%d Res: %s Start Done", + CAM_DBG(CAM_ISP, "VFE:%u Res: %s Start Done", vfe_res->hw_intf->hw_idx, vfe_res->res_name); @@ -1746,7 +1759,7 @@ skip_core_decfg: if (!top_priv->top_common.skip_data_rst_on_stop) vfe_priv->epoch_factor = 0; - CAM_DBG(CAM_ISP, "VFE:%d Res: %s Stopped", + CAM_DBG(CAM_ISP, "VFE:%u Res: %s Stopped", vfe_res->hw_intf->hw_idx, vfe_res->res_name); @@ -1774,7 +1787,8 @@ static int cam_vfe_resource_init( rc = cam_vfe_soc_enable_clk(soc_info, CAM_VFE_DSP_CLK_NAME); if (rc) CAM_ERR(CAM_ISP, - "failed to enable dsp clk, rc = %d", rc); + "VFE:%u failed to enable dsp clk, rc = %d", + vfe_res->hw_intf->hw_idx, rc); } rsrc_data->sof_ts.tv_sec = 0; @@ -1786,7 +1800,7 @@ static int cam_vfe_resource_init( rsrc_data->error_ts.tv_sec = 0; rsrc_data->error_ts.tv_nsec = 0; - CAM_DBG(CAM_ISP, "VFE:%d Res: %s Init Done", + CAM_DBG(CAM_ISP, "VFE:%u Res: %s Init Done", vfe_res->hw_intf->hw_idx, vfe_res->res_name); @@ -1813,10 +1827,11 @@ static int cam_vfe_resource_deinit( (rsrc_data->dsp_mode <= CAM_ISP_DSP_MODE_ROUND)) { rc = cam_vfe_soc_disable_clk(soc_info, CAM_VFE_DSP_CLK_NAME); if (rc) - CAM_ERR(CAM_ISP, "failed to disable dsp clk"); + CAM_ERR(CAM_ISP, "VFE:%u failed to disable dsp clk", + vfe_res->hw_intf->hw_idx); } - CAM_DBG(CAM_ISP, "VFE:%d Res: %s DeInit Done", + CAM_DBG(CAM_ISP, "VFE:%u Res: %s DeInit Done", vfe_res->hw_intf->hw_idx, vfe_res->res_name); return rc; @@ -1891,7 +1906,7 @@ int cam_vfe_res_mux_deinit( vfe_res->res_priv = NULL; if (!vfe_priv) { - CAM_ERR(CAM_ISP, "vfe_priv is NULL %pK", vfe_priv); + CAM_ERR(CAM_ISP, "VFE:%u vfe_priv is NULL %pK", vfe_res->hw_intf->hw_idx, vfe_priv); return -ENODEV; } @@ -1917,7 +1932,7 @@ int cam_vfe_top_ver4_init( vfe_top = kzalloc(sizeof(struct cam_vfe_top), GFP_KERNEL); if (!vfe_top) { - CAM_DBG(CAM_ISP, "Error, Failed to alloc for vfe_top"); + CAM_DBG(CAM_ISP, "VFE:%u Error, Failed to alloc for vfe_top", hw_intf->hw_idx); rc = -ENOMEM; goto end; } @@ -1925,7 +1940,7 @@ int cam_vfe_top_ver4_init( top_priv = kzalloc(sizeof(struct cam_vfe_top_ver4_priv), GFP_KERNEL); if (!top_priv) { - CAM_DBG(CAM_ISP, "Error, Failed to alloc for vfe_top_priv"); + CAM_DBG(CAM_ISP, "VFE:%u Error, Failed to alloc for vfe_top_priv", hw_intf->hw_idx); rc = -ENOMEM; goto free_vfe_top; } @@ -1934,8 +1949,8 @@ int cam_vfe_top_ver4_init( top_priv->top_common.applied_clk_rate = 0; if (hw_info->num_mux > CAM_VFE_TOP_MUX_MAX) { - CAM_ERR(CAM_ISP, "Invalid number of input rsrc: %d, max: %d", - hw_info->num_mux, CAM_VFE_TOP_MUX_MAX); + CAM_ERR(CAM_ISP, "VFE:%u Invalid number of input rsrc: %d, max: %d", + hw_intf->hw_idx, hw_info->num_mux, CAM_VFE_TOP_MUX_MAX); rc = -EINVAL; goto free_top_priv; } @@ -1989,8 +2004,8 @@ int cam_vfe_top_ver4_init( &top_priv->top_common.mux_rsrc[i], vfe_irq_controller); } else { - CAM_WARN(CAM_ISP, "Invalid mux type: %u", - hw_info->mux_type[i]); + CAM_WARN(CAM_ISP, "VFE:%u Invalid mux type: %u", + hw_intf->hw_idx, hw_info->mux_type[i]); } if (rc) goto deinit_resources; @@ -2023,13 +2038,13 @@ deinit_resources: if (hw_info->mux_type[i] == CAM_VFE_CAMIF_VER_4_0) { if (cam_vfe_res_mux_deinit( &top_priv->top_common.mux_rsrc[i])) - CAM_ERR(CAM_ISP, "Camif Deinit failed"); + CAM_ERR(CAM_ISP, "VFE:%u Camif Deinit failed", hw_intf->hw_idx); } else { if (cam_vfe_res_mux_deinit( &top_priv->top_common.mux_rsrc[i])) CAM_ERR(CAM_ISP, - "Camif lite res id %d Deinit failed", - top_priv->top_common.mux_rsrc[i] + "VFE:%u Camif lite res id %d Deinit failed", + hw_intf->hw_idx, top_priv->top_common.mux_rsrc[i] .res_id); } top_priv->top_common.mux_rsrc[i].res_state = @@ -2074,7 +2089,8 @@ int cam_vfe_top_ver4_deinit(struct cam_vfe_top **vfe_top_ptr) CAM_ISP_RESOURCE_STATE_UNAVAILABLE; rc = cam_vfe_res_mux_deinit(&top_priv->top_common.mux_rsrc[i]); if (rc) - CAM_ERR(CAM_ISP, "Mux[%d] deinit failed rc=%d", i, rc); + CAM_ERR(CAM_ISP, "VFE:%u Mux[%d] deinit failed rc=%d", + top_priv->common_data.hw_intf->hw_idx, i, rc); } kfree(vfe_top->top_priv);