فهرست منبع

msm: camera: isp: Avoid multiple bubble handling

If there is a genuine bubble followed by an out of sync,
handle bubble once. If the out of sync continues to happen,
try for internal recovery.

CRs-Fixed: 3336466
Change-Id: Ib697ac1b8907459d06313a9f301cb00a480bd858
Signed-off-by: Karthik Anantha Ram <[email protected]>
Signed-off-by: Depeng Shao <[email protected]>
Karthik Anantha Ram 2 سال پیش
والد
کامیت
06142d3894
2فایلهای تغییر یافته به همراه17 افزوده شده و 3 حذف شده
  1. 15 3
      drivers/cam_isp/cam_isp_context.c
  2. 2 0
      drivers/cam_isp/cam_isp_context.h

+ 15 - 3
drivers/cam_isp/cam_isp_context.c

@@ -1484,7 +1484,6 @@ static void __cam_isp_context_reset_internal_recovery_params(
 {
 {
 	atomic_set(&ctx_isp->internal_recovery_set, 0);
 	atomic_set(&ctx_isp->internal_recovery_set, 0);
 	atomic_set(&ctx_isp->process_bubble, 0);
 	atomic_set(&ctx_isp->process_bubble, 0);
-	ctx_isp->recovery_req_id = 0;
 	ctx_isp->aeb_error_cnt = 0;
 	ctx_isp->aeb_error_cnt = 0;
 	ctx_isp->bubble_frame_cnt = 0;
 	ctx_isp->bubble_frame_cnt = 0;
 	ctx_isp->sof_dbg_irq_en = false;
 	ctx_isp->sof_dbg_irq_en = false;
@@ -4211,6 +4210,7 @@ static int __cam_isp_ctx_handle_secondary_events(
 		__cam_isp_ctx_update_state_monitor_array(ctx_isp,
 		__cam_isp_ctx_update_state_monitor_array(ctx_isp,
 			CAM_ISP_STATE_CHANGE_TRIGGER_SEC_EVT_EPOCH,
 			CAM_ISP_STATE_CHANGE_TRIGGER_SEC_EVT_EPOCH,
 			ctx_isp->last_applied_req_id);
 			ctx_isp->last_applied_req_id);
+		ctx_isp->out_of_sync_cnt = 0;
 
 
 		/*
 		/*
 		 * Master RDI frame dropped in CSID, due to programming delay no RUP/AUP
 		 * Master RDI frame dropped in CSID, due to programming delay no RUP/AUP
@@ -4242,11 +4242,22 @@ static int __cam_isp_ctx_handle_secondary_events(
 			break;
 			break;
 		}
 		}
 
 
+		if (!(ctx_isp->out_of_sync_cnt++) &&
+			(ctx_isp->recovery_req_id == ctx_isp->last_applied_req_id)) {
+			CAM_WARN(CAM_ISP,
+				"Sensor sync [vc mismatch] frame dropped ctx: %u on link: 0x%x last_applied_req: %llu last_recovered_req: %llu out_of_sync_cnt: %u, recovery maybe in progress...",
+				ctx->ctx_id, ctx->link_hdl, ctx_isp->last_applied_req_id,
+				ctx_isp->recovery_req_id, ctx_isp->out_of_sync_cnt);
+			break;
+		}
+
 		recover = true;
 		recover = true;
 		sync_frame_drop = true;
 		sync_frame_drop = true;
+		ctx_isp->out_of_sync_cnt = 0;
 		CAM_WARN(CAM_ISP,
 		CAM_WARN(CAM_ISP,
-			"Sensor sync [vc mismatch] frame dropped ctx: %u on link: 0x%x last_applied_req: %llu, kicking in internal recovery....",
-			ctx->ctx_id, ctx->link_hdl, ctx_isp->last_applied_req_id);
+			"Sensor sync [vc mismatch] frame dropped ctx: %u on link: 0x%x last_applied_req: %llu last_recovered_req: %llu out_of_sync_cnt: %u, kicking in internal recovery....",
+			ctx->ctx_id, ctx->link_hdl, ctx_isp->last_applied_req_id,
+			ctx_isp->recovery_req_id, ctx_isp->out_of_sync_cnt);
 		break;
 		break;
 	default:
 	default:
 		break;
 		break;
@@ -7251,6 +7262,7 @@ static inline void __cam_isp_context_reset_ctx_params(
 	ctx_isp->bubble_frame_cnt = 0;
 	ctx_isp->bubble_frame_cnt = 0;
 	ctx_isp->recovery_req_id = 0;
 	ctx_isp->recovery_req_id = 0;
 	ctx_isp->aeb_error_cnt = 0;
 	ctx_isp->aeb_error_cnt = 0;
+	ctx_isp->out_of_sync_cnt = 0;
 	ctx_isp->sof_dbg_irq_en = false;
 	ctx_isp->sof_dbg_irq_en = false;
 	ctx_isp->last_sof_jiffies = 0;
 	ctx_isp->last_sof_jiffies = 0;
 	ctx_isp->last_applied_jiffies = 0;
 	ctx_isp->last_applied_jiffies = 0;

+ 2 - 0
drivers/cam_isp/cam_isp_context.h

@@ -269,6 +269,7 @@ struct cam_isp_context_event_record {
  * @bubble_frame_cnt:          Count of the frame after bubble
  * @bubble_frame_cnt:          Count of the frame after bubble
  * @aeb_error_cnt:             Count number of times a specific AEB error scenario is
  * @aeb_error_cnt:             Count number of times a specific AEB error scenario is
  *                             enountered
  *                             enountered
+ * @out_of_sync_cnt:           Out of sync error count for AEB
  * @state_monitor_head:        Write index to the state monitoring array
  * @state_monitor_head:        Write index to the state monitoring array
  * @req_info                   Request id information about last buf done
  * @req_info                   Request id information about last buf done
  * @cam_isp_ctx_state_monitor: State monitoring array
  * @cam_isp_ctx_state_monitor: State monitoring array
@@ -329,6 +330,7 @@ struct cam_isp_context {
 	uint64_t                         last_sof_timestamp;
 	uint64_t                         last_sof_timestamp;
 	uint32_t                         bubble_frame_cnt;
 	uint32_t                         bubble_frame_cnt;
 	uint32_t                         aeb_error_cnt;
 	uint32_t                         aeb_error_cnt;
+	uint32_t                         out_of_sync_cnt;
 	atomic64_t                       state_monitor_head;
 	atomic64_t                       state_monitor_head;
 	struct cam_isp_context_state_monitor cam_isp_ctx_state_monitor[
 	struct cam_isp_context_state_monitor cam_isp_ctx_state_monitor[
 		CAM_ISP_CTX_STATE_MONITOR_MAX_ENTRIES];
 		CAM_ISP_CTX_STATE_MONITOR_MAX_ENTRIES];