Loading drivers/media/platform/msm/ais/cam_isp/cam_isp_context.c +118 −21 Original line number Diff line number Diff line /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -271,6 +271,39 @@ static void __cam_isp_ctx_dump_state_monitor_array( } } static void __cam_isp_ctx_dump_list(struct list_head *p_list) { struct cam_ctx_request *req = NULL; struct cam_ctx_request *req_temp = NULL; struct cam_isp_ctx_req *req_isp = NULL; list_for_each_entry_safe(req, req_temp, p_list, list){ req_isp = (struct cam_isp_ctx_req *) req->req_priv; CAM_WARN(CAM_ISP, "= req %d sts %d sync %d (bbl %d %d %d)", req->request_id, req->status, req_isp->fence_map_out[0].sync_id, req_isp->bubble_detected, req_isp->bubble_report, req_isp->reapply); } } static void __cam_isp_ctx_dump_lists(struct cam_context *ctx) { CAM_WARN(CAM_ISP, "== DUMP ACTIVE LIST =="); __cam_isp_ctx_dump_list(&ctx->active_req_list); CAM_WARN(CAM_ISP, "== DUMP PENDING LIST =="); __cam_isp_ctx_dump_list(&ctx->pending_req_list); CAM_WARN(CAM_ISP, "== DUMP WAIT LIST =="); __cam_isp_ctx_dump_list(&ctx->wait_req_list); CAM_WARN(CAM_ISP, "== DUMP FREE LIST =="); __cam_isp_ctx_dump_list(&ctx->free_req_list); } static void cam_isp_ctx_dump_req(struct cam_isp_ctx_req *req_isp, uintptr_t cpu_addr, size_t buf_len, Loading Loading @@ -723,6 +756,13 @@ static int __cam_isp_ctx_handle_buf_done_in_activated_state( req_isp = (struct cam_isp_ctx_req *) req->req_priv; for (j = 0; j < req_isp->num_fence_map_out; j++) { CAM_ERR(CAM_ISP, "Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u", req->request_id, req_isp->fence_map_out[j].resource_handle, req_isp->fence_map_out[j].sync_id, ctx->ctx_id); rc = cam_sync_signal(req_isp->fence_map_out[j].sync_id, CAM_SYNC_STATE_SIGNALED_ERROR); if (rc) Loading Loading @@ -1421,8 +1461,9 @@ static int __cam_isp_ctx_handle_error(struct cam_isp_context *ctx_isp, fence_map_out = &req_isp->fence_map_out[i]; CAM_ERR(CAM_ISP, "req %llu, Sync fd 0x%x ctx %u", "Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u", req->request_id, req_isp->fence_map_out[i].resource_handle, req_isp->fence_map_out[i].sync_id, ctx->ctx_id); if (req_isp->fence_map_out[i].sync_id != -1) { Loading Loading @@ -1451,11 +1492,14 @@ static int __cam_isp_ctx_handle_error(struct cam_isp_context *ctx_isp, for (i = 0; i < req_isp->num_fence_map_out; i++) { fence_map_out = &req_isp->fence_map_out[i]; CAM_ERR(CAM_ISP, "req %llu, Sync fd 0x%x ctx %u", "Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u", req->request_id, req_isp->fence_map_out[i].resource_handle, req_isp->fence_map_out[i].sync_id, ctx->ctx_id); if (req_isp->fence_map_out[i].sync_id != -1) { rc = cam_sync_signal( fence_map_out->sync_id, Loading Loading @@ -1520,6 +1564,14 @@ static int __cam_isp_ctx_handle_error(struct cam_isp_context *ctx_isp, } for (i = 0; i < req_isp->num_fence_map_out; i++) { CAM_ERR(CAM_ISP, "Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u", req->request_id, req_isp->fence_map_out[i].resource_handle, req_isp->fence_map_out[i].sync_id, ctx->ctx_id); if (req_isp->fence_map_out[i].sync_id != -1) rc = cam_sync_signal( req_isp->fence_map_out[i].sync_id, Loading Loading @@ -1626,6 +1678,7 @@ static int __cam_isp_ctx_fs2_sof_in_sof_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.req_id = ctx_isp->req_info.last_bufdone_req_id; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); Loading Loading @@ -1810,6 +1863,7 @@ static int __cam_isp_ctx_fs2_reg_upd_in_applied_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.req_id = ctx_isp->req_info.last_bufdone_req_id; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); Loading Loading @@ -2311,7 +2365,7 @@ static int __cam_isp_ctx_flush_req(struct cam_context *ctx, req_isp = (struct cam_isp_ctx_req *) req->req_priv; for (i = 0; i < req_isp->num_fence_map_out; i++) { if (req_isp->fence_map_out[i].sync_id != -1) { CAM_DBG(CAM_ISP, "Flush req 0x%llx, fence %d", CAM_INFO(CAM_ISP, "Flush req 0x%llx, fence %d", req->request_id, req_isp->fence_map_out[i].sync_id); rc = cam_sync_signal( Loading Loading @@ -2585,6 +2639,7 @@ static int __cam_isp_ctx_rdi_only_sof_in_top_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.req_id = ctx_isp->req_info.last_bufdone_req_id; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); Loading Loading @@ -2751,22 +2806,31 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state( CAM_DBG(CAM_ISP, "frame id: %lld time stamp:0x%llx", ctx_isp->frame_id, ctx_isp->sof_timestamp_val); /* * Signal all active requests with error and move the all the active * requests to free list * Signal all active requests with error and move them * to free list */ while (!list_empty(&ctx->active_req_list)) { req = list_first_entry(&ctx->active_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 active list. fence num %d", req_isp->num_fence_map_out); for (i = 0; i < req_isp->num_fence_map_out; i++) CAM_DBG(CAM_ISP, "signal fence in active list. req %lld", req->request_id); for (i = 0; i < req_isp->num_fence_map_out; i++) { CAM_ERR(CAM_ISP, "Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u", req->request_id, req_isp->fence_map_out[i].resource_handle, req_isp->fence_map_out[i].sync_id, ctx->ctx_id); if (req_isp->fence_map_out[i].sync_id != -1) { cam_sync_signal( req_isp->fence_map_out[i].sync_id, CAM_SYNC_STATE_SIGNALED_ERROR); } } list_add_tail(&req->list, &ctx->free_req_list); ctx_isp->active_req_cnt--; } Loading @@ -2777,6 +2841,7 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.req_id = ctx_isp->req_info.last_bufdone_req_id; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); Loading Loading @@ -2848,6 +2913,7 @@ static int __cam_isp_ctx_rdi_only_reg_upd_in_bubble_applied_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.req_id = ctx_isp->req_info.last_bufdone_req_id; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); Loading Loading @@ -3833,12 +3899,20 @@ static int __cam_isp_ctx_stop_dev_in_activated_unlock( 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); for (i = 0; i < req_isp->num_fence_map_out; i++) for (i = 0; i < req_isp->num_fence_map_out; i++) { CAM_INFO(CAM_ISP, "Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u", req->request_id, req_isp->fence_map_out[i].resource_handle, req_isp->fence_map_out[i].sync_id, ctx->ctx_id); if (req_isp->fence_map_out[i].sync_id != -1) { cam_sync_signal( req_isp->fence_map_out[i].sync_id, CAM_SYNC_STATE_SIGNALED_ERROR); } } list_add_tail(&req->list, &ctx->free_req_list); } Loading @@ -3849,12 +3923,20 @@ static int __cam_isp_ctx_stop_dev_in_activated_unlock( 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); for (i = 0; i < req_isp->num_fence_map_out; i++) for (i = 0; i < req_isp->num_fence_map_out; i++) { CAM_INFO(CAM_ISP, "Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u", req->request_id, req_isp->fence_map_out[i].resource_handle, req_isp->fence_map_out[i].sync_id, ctx->ctx_id); if (req_isp->fence_map_out[i].sync_id != -1) { cam_sync_signal( req_isp->fence_map_out[i].sync_id, CAM_SYNC_STATE_SIGNALED_ERROR); } } list_add_tail(&req->list, &ctx->free_req_list); } Loading @@ -3865,12 +3947,20 @@ static int __cam_isp_ctx_stop_dev_in_activated_unlock( 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); for (i = 0; i < req_isp->num_fence_map_out; i++) for (i = 0; i < req_isp->num_fence_map_out; i++) { CAM_INFO(CAM_ISP, "Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u", req->request_id, req_isp->fence_map_out[i].resource_handle, req_isp->fence_map_out[i].sync_id, ctx->ctx_id); if (req_isp->fence_map_out[i].sync_id != -1) { cam_sync_signal( req_isp->fence_map_out[i].sync_id, CAM_SYNC_STATE_SIGNALED_ERROR); } } list_add_tail(&req->list, &ctx->free_req_list); } ctx_isp->frame_id = 0; Loading Loading @@ -4060,7 +4150,11 @@ static int __cam_isp_ctx_apply_req(struct cam_context *ctx, CAM_ERR_RATE_LIMIT(CAM_ISP, "Ctx:%d No handle function in activated substate %d", ctx->ctx_id, ctx_isp->substate_activated); if (0) __cam_isp_ctx_dump_state_monitor_array(ctx_isp, true); else __cam_isp_ctx_dump_lists(ctx); rc = -EFAULT; } Loading Loading @@ -4093,8 +4187,11 @@ static int __cam_isp_ctx_handle_irq_in_activated(void *context, if (irq_ops->irq_ops[evt_id]) { rc = irq_ops->irq_ops[evt_id](ctx_isp, evt_data); } else { CAM_INFO(CAM_ISP, "Ctx:%d No handle function for substate %d", ctx->ctx_id, ctx_isp->substate_activated); CAM_INFO(CAM_ISP, "Ctx:%d No handle function for %d substate %d", ctx->ctx_id, evt_id, ctx_isp->substate_activated); __cam_isp_ctx_dump_lists(ctx); } if (evt_id != CAM_ISP_HW_EVENT_DONE) __cam_isp_ctx_update_state_monitor_array(ctx_isp, evt_id, Loading drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_core.c +48 −4 Original line number Diff line number Diff line /* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -2242,21 +2242,65 @@ static int cam_req_mgr_process_trigger(void *priv, void *data) task_data = (struct crm_task_payload *)data; trigger_data = (struct cam_req_mgr_trigger_notify *)&task_data->u; CAM_DBG(CAM_REQ, "link_hdl %x frame_id %lld, trigger %x\n", CAM_DBG(CAM_REQ, "link_hdl %x frame_id %lld, trigger %x req_id %llu", trigger_data->link_hdl, trigger_data->frame_id, trigger_data->trigger); trigger_data->trigger, trigger_data->req_id); in_q = link->req.in_q; mutex_lock(&link->req.lock); CAM_DBG(CAM_REQ, "++link_hdl %x frame_id %lld, trigger %x req_id %llu", trigger_data->link_hdl, trigger_data->frame_id, trigger_data->trigger, trigger_data->req_id); if (trigger_data->trigger == CAM_TRIGGER_POINT_SOF) { idx = __cam_req_mgr_find_slot_for_req(in_q, trigger_data->req_id); if (idx >= 0) { if (idx == in_q->last_applied_idx) if (idx == in_q->last_applied_idx) { CAM_INFO(CAM_REQ, "Reset last applied idx (%d) from req_id %llu", in_q->last_applied_idx, trigger_data->req_id); in_q->last_applied_idx = -1; } /* * In case of idx is matching the current rd_idx * increment the rd_idx to process next requests */ if (idx == in_q->rd_idx) { #ifdef DEBUG_Q_DUMP //DUMP ALL Qs if (0 == (trigger_data->frame_id % 100)) { int i; //IN Q CAM_WARN(CAM_REQ, "== IN Q rd:%d wr:%d last:%d ==", in_q->rd_idx, in_q->wr_idx, in_q->last_applied_idx); for (i = 0; i < in_q->num_slots; i++) { CAM_WARN(CAM_REQ, "%d-idx:%d req:%d st:%d skip:%d sync:%d rcovr:%d", i, in_q->slot[i].idx, in_q->slot[i].req_id, in_q->slot[i].status, in_q->slot[i].skip_idx, in_q->slot[i].sync_mode, in_q->slot[i].recover); } } #endif CAM_INFO(CAM_REQ, "Increment rd_idx %d from req_id %llu", in_q->rd_idx, trigger_data->req_id); __cam_req_mgr_inc_idx(&in_q->rd_idx, 1, in_q->num_slots); } __cam_req_mgr_reset_req_slot(link, idx); } } Loading drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_workq.c +2 −1 Original line number Diff line number Diff line /* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2016-2018, 2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -117,6 +117,7 @@ static void cam_req_mgr_process_workq(struct work_struct *w) atomic_sub(1, &workq->task.pending_cnt); list_del_init(&task->entry); WORKQ_RELEASE_LOCK(workq, flags); CAM_DBG(CAM_CRM, "processing task %pK", task); cam_req_mgr_process_task(task); CAM_DBG(CAM_CRM, "processed task %pK free_cnt %d", task, atomic_read(&workq->task.free_cnt)); Loading drivers/media/platform/msm/ais/cam_sync/cam_sync.c +3 −2 Original line number Diff line number Diff line Loading @@ -192,8 +192,9 @@ int cam_sync_signal(int32_t sync_obj, uint32_t status) int rc = 0; if (sync_obj >= CAM_SYNC_MAX_OBJS || sync_obj <= 0) { CAM_ERR(CAM_SYNC, "Error: Out of range sync obj (0 <= %d < %d)", sync_obj, CAM_SYNC_MAX_OBJS); CAM_ERR(CAM_SYNC, "Error: Out of range sync obj (0 <= %d < %d) [%d]", sync_obj, CAM_SYNC_MAX_OBJS, status); return -EINVAL; } row = sync_dev->sync_table + sync_obj; Loading Loading
drivers/media/platform/msm/ais/cam_isp/cam_isp_context.c +118 −21 Original line number Diff line number Diff line /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -271,6 +271,39 @@ static void __cam_isp_ctx_dump_state_monitor_array( } } static void __cam_isp_ctx_dump_list(struct list_head *p_list) { struct cam_ctx_request *req = NULL; struct cam_ctx_request *req_temp = NULL; struct cam_isp_ctx_req *req_isp = NULL; list_for_each_entry_safe(req, req_temp, p_list, list){ req_isp = (struct cam_isp_ctx_req *) req->req_priv; CAM_WARN(CAM_ISP, "= req %d sts %d sync %d (bbl %d %d %d)", req->request_id, req->status, req_isp->fence_map_out[0].sync_id, req_isp->bubble_detected, req_isp->bubble_report, req_isp->reapply); } } static void __cam_isp_ctx_dump_lists(struct cam_context *ctx) { CAM_WARN(CAM_ISP, "== DUMP ACTIVE LIST =="); __cam_isp_ctx_dump_list(&ctx->active_req_list); CAM_WARN(CAM_ISP, "== DUMP PENDING LIST =="); __cam_isp_ctx_dump_list(&ctx->pending_req_list); CAM_WARN(CAM_ISP, "== DUMP WAIT LIST =="); __cam_isp_ctx_dump_list(&ctx->wait_req_list); CAM_WARN(CAM_ISP, "== DUMP FREE LIST =="); __cam_isp_ctx_dump_list(&ctx->free_req_list); } static void cam_isp_ctx_dump_req(struct cam_isp_ctx_req *req_isp, uintptr_t cpu_addr, size_t buf_len, Loading Loading @@ -723,6 +756,13 @@ static int __cam_isp_ctx_handle_buf_done_in_activated_state( req_isp = (struct cam_isp_ctx_req *) req->req_priv; for (j = 0; j < req_isp->num_fence_map_out; j++) { CAM_ERR(CAM_ISP, "Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u", req->request_id, req_isp->fence_map_out[j].resource_handle, req_isp->fence_map_out[j].sync_id, ctx->ctx_id); rc = cam_sync_signal(req_isp->fence_map_out[j].sync_id, CAM_SYNC_STATE_SIGNALED_ERROR); if (rc) Loading Loading @@ -1421,8 +1461,9 @@ static int __cam_isp_ctx_handle_error(struct cam_isp_context *ctx_isp, fence_map_out = &req_isp->fence_map_out[i]; CAM_ERR(CAM_ISP, "req %llu, Sync fd 0x%x ctx %u", "Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u", req->request_id, req_isp->fence_map_out[i].resource_handle, req_isp->fence_map_out[i].sync_id, ctx->ctx_id); if (req_isp->fence_map_out[i].sync_id != -1) { Loading Loading @@ -1451,11 +1492,14 @@ static int __cam_isp_ctx_handle_error(struct cam_isp_context *ctx_isp, for (i = 0; i < req_isp->num_fence_map_out; i++) { fence_map_out = &req_isp->fence_map_out[i]; CAM_ERR(CAM_ISP, "req %llu, Sync fd 0x%x ctx %u", "Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u", req->request_id, req_isp->fence_map_out[i].resource_handle, req_isp->fence_map_out[i].sync_id, ctx->ctx_id); if (req_isp->fence_map_out[i].sync_id != -1) { rc = cam_sync_signal( fence_map_out->sync_id, Loading Loading @@ -1520,6 +1564,14 @@ static int __cam_isp_ctx_handle_error(struct cam_isp_context *ctx_isp, } for (i = 0; i < req_isp->num_fence_map_out; i++) { CAM_ERR(CAM_ISP, "Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u", req->request_id, req_isp->fence_map_out[i].resource_handle, req_isp->fence_map_out[i].sync_id, ctx->ctx_id); if (req_isp->fence_map_out[i].sync_id != -1) rc = cam_sync_signal( req_isp->fence_map_out[i].sync_id, Loading Loading @@ -1626,6 +1678,7 @@ static int __cam_isp_ctx_fs2_sof_in_sof_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.req_id = ctx_isp->req_info.last_bufdone_req_id; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); Loading Loading @@ -1810,6 +1863,7 @@ static int __cam_isp_ctx_fs2_reg_upd_in_applied_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.req_id = ctx_isp->req_info.last_bufdone_req_id; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); Loading Loading @@ -2311,7 +2365,7 @@ static int __cam_isp_ctx_flush_req(struct cam_context *ctx, req_isp = (struct cam_isp_ctx_req *) req->req_priv; for (i = 0; i < req_isp->num_fence_map_out; i++) { if (req_isp->fence_map_out[i].sync_id != -1) { CAM_DBG(CAM_ISP, "Flush req 0x%llx, fence %d", CAM_INFO(CAM_ISP, "Flush req 0x%llx, fence %d", req->request_id, req_isp->fence_map_out[i].sync_id); rc = cam_sync_signal( Loading Loading @@ -2585,6 +2639,7 @@ static int __cam_isp_ctx_rdi_only_sof_in_top_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.req_id = ctx_isp->req_info.last_bufdone_req_id; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); Loading Loading @@ -2751,22 +2806,31 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state( CAM_DBG(CAM_ISP, "frame id: %lld time stamp:0x%llx", ctx_isp->frame_id, ctx_isp->sof_timestamp_val); /* * Signal all active requests with error and move the all the active * requests to free list * Signal all active requests with error and move them * to free list */ while (!list_empty(&ctx->active_req_list)) { req = list_first_entry(&ctx->active_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 active list. fence num %d", req_isp->num_fence_map_out); for (i = 0; i < req_isp->num_fence_map_out; i++) CAM_DBG(CAM_ISP, "signal fence in active list. req %lld", req->request_id); for (i = 0; i < req_isp->num_fence_map_out; i++) { CAM_ERR(CAM_ISP, "Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u", req->request_id, req_isp->fence_map_out[i].resource_handle, req_isp->fence_map_out[i].sync_id, ctx->ctx_id); if (req_isp->fence_map_out[i].sync_id != -1) { cam_sync_signal( req_isp->fence_map_out[i].sync_id, CAM_SYNC_STATE_SIGNALED_ERROR); } } list_add_tail(&req->list, &ctx->free_req_list); ctx_isp->active_req_cnt--; } Loading @@ -2777,6 +2841,7 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.req_id = ctx_isp->req_info.last_bufdone_req_id; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); Loading Loading @@ -2848,6 +2913,7 @@ static int __cam_isp_ctx_rdi_only_reg_upd_in_bubble_applied_state( notify.dev_hdl = ctx->dev_hdl; notify.frame_id = ctx_isp->frame_id; notify.trigger = CAM_TRIGGER_POINT_SOF; notify.req_id = ctx_isp->req_info.last_bufdone_req_id; notify.sof_timestamp_val = ctx_isp->sof_timestamp_val; ctx->ctx_crm_intf->notify_trigger(¬ify); Loading Loading @@ -3833,12 +3899,20 @@ static int __cam_isp_ctx_stop_dev_in_activated_unlock( 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); for (i = 0; i < req_isp->num_fence_map_out; i++) for (i = 0; i < req_isp->num_fence_map_out; i++) { CAM_INFO(CAM_ISP, "Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u", req->request_id, req_isp->fence_map_out[i].resource_handle, req_isp->fence_map_out[i].sync_id, ctx->ctx_id); if (req_isp->fence_map_out[i].sync_id != -1) { cam_sync_signal( req_isp->fence_map_out[i].sync_id, CAM_SYNC_STATE_SIGNALED_ERROR); } } list_add_tail(&req->list, &ctx->free_req_list); } Loading @@ -3849,12 +3923,20 @@ static int __cam_isp_ctx_stop_dev_in_activated_unlock( 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); for (i = 0; i < req_isp->num_fence_map_out; i++) for (i = 0; i < req_isp->num_fence_map_out; i++) { CAM_INFO(CAM_ISP, "Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u", req->request_id, req_isp->fence_map_out[i].resource_handle, req_isp->fence_map_out[i].sync_id, ctx->ctx_id); if (req_isp->fence_map_out[i].sync_id != -1) { cam_sync_signal( req_isp->fence_map_out[i].sync_id, CAM_SYNC_STATE_SIGNALED_ERROR); } } list_add_tail(&req->list, &ctx->free_req_list); } Loading @@ -3865,12 +3947,20 @@ static int __cam_isp_ctx_stop_dev_in_activated_unlock( 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); for (i = 0; i < req_isp->num_fence_map_out; i++) for (i = 0; i < req_isp->num_fence_map_out; i++) { CAM_INFO(CAM_ISP, "Sync with failure: req %lld res 0x%x fd 0x%x, ctx %u", req->request_id, req_isp->fence_map_out[i].resource_handle, req_isp->fence_map_out[i].sync_id, ctx->ctx_id); if (req_isp->fence_map_out[i].sync_id != -1) { cam_sync_signal( req_isp->fence_map_out[i].sync_id, CAM_SYNC_STATE_SIGNALED_ERROR); } } list_add_tail(&req->list, &ctx->free_req_list); } ctx_isp->frame_id = 0; Loading Loading @@ -4060,7 +4150,11 @@ static int __cam_isp_ctx_apply_req(struct cam_context *ctx, CAM_ERR_RATE_LIMIT(CAM_ISP, "Ctx:%d No handle function in activated substate %d", ctx->ctx_id, ctx_isp->substate_activated); if (0) __cam_isp_ctx_dump_state_monitor_array(ctx_isp, true); else __cam_isp_ctx_dump_lists(ctx); rc = -EFAULT; } Loading Loading @@ -4093,8 +4187,11 @@ static int __cam_isp_ctx_handle_irq_in_activated(void *context, if (irq_ops->irq_ops[evt_id]) { rc = irq_ops->irq_ops[evt_id](ctx_isp, evt_data); } else { CAM_INFO(CAM_ISP, "Ctx:%d No handle function for substate %d", ctx->ctx_id, ctx_isp->substate_activated); CAM_INFO(CAM_ISP, "Ctx:%d No handle function for %d substate %d", ctx->ctx_id, evt_id, ctx_isp->substate_activated); __cam_isp_ctx_dump_lists(ctx); } if (evt_id != CAM_ISP_HW_EVENT_DONE) __cam_isp_ctx_update_state_monitor_array(ctx_isp, evt_id, Loading
drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_core.c +48 −4 Original line number Diff line number Diff line /* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -2242,21 +2242,65 @@ static int cam_req_mgr_process_trigger(void *priv, void *data) task_data = (struct crm_task_payload *)data; trigger_data = (struct cam_req_mgr_trigger_notify *)&task_data->u; CAM_DBG(CAM_REQ, "link_hdl %x frame_id %lld, trigger %x\n", CAM_DBG(CAM_REQ, "link_hdl %x frame_id %lld, trigger %x req_id %llu", trigger_data->link_hdl, trigger_data->frame_id, trigger_data->trigger); trigger_data->trigger, trigger_data->req_id); in_q = link->req.in_q; mutex_lock(&link->req.lock); CAM_DBG(CAM_REQ, "++link_hdl %x frame_id %lld, trigger %x req_id %llu", trigger_data->link_hdl, trigger_data->frame_id, trigger_data->trigger, trigger_data->req_id); if (trigger_data->trigger == CAM_TRIGGER_POINT_SOF) { idx = __cam_req_mgr_find_slot_for_req(in_q, trigger_data->req_id); if (idx >= 0) { if (idx == in_q->last_applied_idx) if (idx == in_q->last_applied_idx) { CAM_INFO(CAM_REQ, "Reset last applied idx (%d) from req_id %llu", in_q->last_applied_idx, trigger_data->req_id); in_q->last_applied_idx = -1; } /* * In case of idx is matching the current rd_idx * increment the rd_idx to process next requests */ if (idx == in_q->rd_idx) { #ifdef DEBUG_Q_DUMP //DUMP ALL Qs if (0 == (trigger_data->frame_id % 100)) { int i; //IN Q CAM_WARN(CAM_REQ, "== IN Q rd:%d wr:%d last:%d ==", in_q->rd_idx, in_q->wr_idx, in_q->last_applied_idx); for (i = 0; i < in_q->num_slots; i++) { CAM_WARN(CAM_REQ, "%d-idx:%d req:%d st:%d skip:%d sync:%d rcovr:%d", i, in_q->slot[i].idx, in_q->slot[i].req_id, in_q->slot[i].status, in_q->slot[i].skip_idx, in_q->slot[i].sync_mode, in_q->slot[i].recover); } } #endif CAM_INFO(CAM_REQ, "Increment rd_idx %d from req_id %llu", in_q->rd_idx, trigger_data->req_id); __cam_req_mgr_inc_idx(&in_q->rd_idx, 1, in_q->num_slots); } __cam_req_mgr_reset_req_slot(link, idx); } } Loading
drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_workq.c +2 −1 Original line number Diff line number Diff line /* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2016-2018, 2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -117,6 +117,7 @@ static void cam_req_mgr_process_workq(struct work_struct *w) atomic_sub(1, &workq->task.pending_cnt); list_del_init(&task->entry); WORKQ_RELEASE_LOCK(workq, flags); CAM_DBG(CAM_CRM, "processing task %pK", task); cam_req_mgr_process_task(task); CAM_DBG(CAM_CRM, "processed task %pK free_cnt %d", task, atomic_read(&workq->task.free_cnt)); Loading
drivers/media/platform/msm/ais/cam_sync/cam_sync.c +3 −2 Original line number Diff line number Diff line Loading @@ -192,8 +192,9 @@ int cam_sync_signal(int32_t sync_obj, uint32_t status) int rc = 0; if (sync_obj >= CAM_SYNC_MAX_OBJS || sync_obj <= 0) { CAM_ERR(CAM_SYNC, "Error: Out of range sync obj (0 <= %d < %d)", sync_obj, CAM_SYNC_MAX_OBJS); CAM_ERR(CAM_SYNC, "Error: Out of range sync obj (0 <= %d < %d) [%d]", sync_obj, CAM_SYNC_MAX_OBJS, status); return -EINVAL; } row = sync_dev->sync_table + sync_obj; Loading