Merge "msm: camera: isp: Update internal recovery scheme" into camera-kernel.lnx.5.0
This commit is contained in:

gecommit door
Gerrit - the friendly Code Review server

commit
f2f3189463
@@ -530,6 +530,15 @@ static int __cam_isp_ctx_notify_trigger_util(
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Skip CRM notify when recovery is in progress */
|
||||
if (atomic_read(&ctx_isp->internal_recovery_set)) {
|
||||
CAM_DBG(CAM_ISP,
|
||||
"Internal recovery in progress skip notifying %s trigger point in ctx: %u on link: 0x%x",
|
||||
__cam_isp_ctx_crm_trigger_point_to_string(trigger_type),
|
||||
ctx->ctx_id, ctx->link_hdl);
|
||||
return 0;
|
||||
}
|
||||
|
||||
notify.link_hdl = ctx->link_hdl;
|
||||
notify.dev_hdl = ctx->dev_hdl;
|
||||
notify.frame_id = ctx_isp->frame_id;
|
||||
@@ -1189,6 +1198,7 @@ static void __cam_isp_context_reset_internal_recovery_params(
|
||||
atomic_set(&ctx_isp->internal_recovery_set, 0);
|
||||
atomic_set(&ctx_isp->process_bubble, 0);
|
||||
ctx_isp->recovery_req_id = 0;
|
||||
ctx_isp->aeb_error_cnt = 0;
|
||||
}
|
||||
|
||||
static int __cam_isp_context_try_internal_recovery(
|
||||
@@ -3224,9 +3234,16 @@ static void __cam_isp_ctx_notify_aeb_error_for_sec_event(
|
||||
{
|
||||
struct cam_context *ctx = ctx_isp->base;
|
||||
|
||||
if ((++ctx_isp->aeb_error_cnt) <= CAM_ISP_CONTEXT_AEB_ERROR_CNT_MAX) {
|
||||
CAM_WARN(CAM_ISP,
|
||||
"AEB slave RDI's current request's SOF seen after next req is applied for ctx: %u on link: 0x%x last_applied_req: %llu err_cnt: %u",
|
||||
ctx->ctx_id, ctx->link_hdl, ctx_isp->last_applied_req_id, ctx_isp->aeb_error_cnt);
|
||||
return;
|
||||
}
|
||||
|
||||
CAM_ERR(CAM_ISP,
|
||||
"AEB slave RDI's current request's SOF seen after next req is applied, EPOCH height need to be re-configured for ctx: %u on link: 0x%x",
|
||||
ctx->ctx_id, ctx->link_hdl);
|
||||
"Fatal - AEB slave RDI's current request's SOF seen after next req is applied, EPOCH height need to be re-configured for ctx: %u on link: 0x%x err_cnt: %u",
|
||||
ctx->ctx_id, ctx->link_hdl, ctx_isp->aeb_error_cnt);
|
||||
|
||||
/* Pause CRM timer */
|
||||
if (!ctx_isp->offline_context)
|
||||
@@ -3369,6 +3386,9 @@ static int __cam_isp_ctx_handle_secondary_events(
|
||||
(ctx_isp->substate_activated ==
|
||||
CAM_ISP_CTX_ACTIVATED_BUBBLE_APPLIED))
|
||||
__cam_isp_ctx_notify_aeb_error_for_sec_event(ctx_isp);
|
||||
else
|
||||
/* Reset error count */
|
||||
ctx_isp->aeb_error_cnt = 0;
|
||||
break;
|
||||
case CAM_ISP_HW_SEC_EVENT_EPOCH:
|
||||
__cam_isp_ctx_update_state_monitor_array(ctx_isp,
|
||||
@@ -6115,6 +6135,7 @@ static inline void __cam_isp_context_reset_ctx_params(
|
||||
ctx_isp->reported_req_id = 0;
|
||||
ctx_isp->bubble_frame_cnt = 0;
|
||||
ctx_isp->recovery_req_id = 0;
|
||||
ctx_isp->aeb_error_cnt = 0;
|
||||
}
|
||||
|
||||
static int __cam_isp_ctx_start_dev_in_ready(struct cam_context *ctx,
|
||||
@@ -6521,6 +6542,9 @@ static int __cam_isp_ctx_reset_and_recover(
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* Block all events till HW is resumed */
|
||||
ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_HALT;
|
||||
|
||||
req = list_first_entry(&ctx->pending_req_list,
|
||||
struct cam_ctx_request, list);
|
||||
req_isp = (struct cam_isp_ctx_req *) req->req_priv;
|
||||
|
@@ -55,6 +55,9 @@
|
||||
/* Maximum length of tag while dumping */
|
||||
#define CAM_ISP_CONTEXT_DUMP_TAG_MAX_LEN 32
|
||||
|
||||
/* AEB error count threshold */
|
||||
#define CAM_ISP_CONTEXT_AEB_ERROR_CNT_MAX 3
|
||||
|
||||
/* forward declaration */
|
||||
struct cam_isp_context;
|
||||
|
||||
@@ -256,6 +259,8 @@ struct cam_isp_context_event_record {
|
||||
* @recovery_req_id: Req ID flagged for internal recovery
|
||||
* @last_sof_timestamp: SOF timestamp of the last frame
|
||||
* @bubble_frame_cnt: Count of the frame after bubble
|
||||
* @aeb_error_cnt: Count number of times a specific AEB error scenario is
|
||||
* enountered
|
||||
* @state_monitor_head: Write index to the state monitoring array
|
||||
* @req_info Request id information about last buf done
|
||||
* @cam_isp_ctx_state_monitor: State monitoring array
|
||||
@@ -307,6 +312,7 @@ struct cam_isp_context {
|
||||
uint64_t recovery_req_id;
|
||||
uint64_t last_sof_timestamp;
|
||||
uint32_t bubble_frame_cnt;
|
||||
uint32_t aeb_error_cnt;
|
||||
atomic64_t state_monitor_head;
|
||||
struct cam_isp_context_state_monitor cam_isp_ctx_state_monitor[
|
||||
CAM_ISP_CTX_STATE_MONITOR_MAX_ENTRIES];
|
||||
|
Verwijs in nieuw issue
Block a user