Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11e95cbe authored by Abhilash Kumar's avatar Abhilash Kumar
Browse files

msm: camera: crm: Notify UMD on Error to preform recovery



There can be cases when overflow can occur in KMD due to
many reasons. Some of these errors can be recovered and
needs to be initiated via UMD. Having a notify mechanism
to help UMD to perform recovery during time of such event
will help the device for fast recovery and dump the all
the relevant info regarding the usecase context.

Change-Id: I9d37cb7131c58e40d5bc454eeee8b072a417610d
Signed-off-by: default avatarAbhilash Kumar <krabhi@codeaurora.org>
parent b048651c
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -1025,6 +1025,7 @@ static int __cam_isp_ctx_handle_error(struct cam_isp_context *ctx_isp,
	struct cam_req_mgr_error_notify  notify;
	uint64_t                         error_request_id;
	struct cam_hw_fence_map_entry   *fence_map_out = NULL;
	struct cam_req_mgr_message       req_msg;

	struct cam_context *ctx = ctx_isp->base;
	struct cam_isp_hw_error_event_data  *error_event_data =
@@ -1193,6 +1194,29 @@ static int __cam_isp_ctx_handle_error(struct cam_isp_context *ctx_isp,
			error_request_id, ctx_isp->frame_id);

		ctx->ctx_crm_intf->notify_err(&notify);

		/*
		 * Need to send error occurred in KMD
		 * This will help UMD to take necessary action
		 * and to dump relevant info
		 */

		if (notify.error == CRM_KMD_ERR_OVERFLOW) {
			req_msg.session_hdl = ctx_isp->base->session_hdl;
			req_msg.u.err_msg.device_hdl = ctx_isp->base->dev_hdl;
			req_msg.u.err_msg.error_type =
				CAM_REQ_MGR_ERROR_TYPE_RECOVERY;
			req_msg.u.err_msg.link_hdl = ctx_isp->base->link_hdl;
			req_msg.u.err_msg.request_id = error_request_id;
			req_msg.u.err_msg.resource_size = 0x0;

			if (cam_req_mgr_notify_message(&req_msg,
					V4L_EVENT_CAM_REQ_MGR_ERROR,
					V4L_EVENT_CAM_REQ_MGR_EVENT))
				CAM_ERR(CAM_ISP,
					"Error in notifying the error time for req id:%lld",
						ctx_isp->last_applied_req_id);
		}
		ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_HW_ERROR;
	} else {
		CAM_ERR_RATE_LIMIT(CAM_ISP, "Can not notify ERRROR to CRM");
+6 −5
Original line number Diff line number Diff line
@@ -4323,17 +4323,17 @@ static int cam_ife_hw_mgr_handle_camif_error(

	error_status = cam_ife_hw_mgr_get_err_type(ife_hwr_mgr_ctx,
		evt_payload);

	if (atomic_read(&ife_hwr_mgr_ctx->overflow_pending))
		return error_status;
	if (atomic_read(&ife_hwr_mgr_ctx->overflow_pending)) {
		rc = error_status;
		goto end;
	}

	switch (error_status) {
	case CAM_ISP_HW_ERROR_OVERFLOW:
	case CAM_ISP_HW_ERROR_P2I_ERROR:
	case CAM_ISP_HW_ERROR_VIOLATION:
		CAM_ERR(CAM_ISP, "Enter: error_type (%d)", error_status);
		rc = -EFAULT;

		rc = error_status;
		if (g_ife_hw_mgr.debug_cfg.enable_recovery)
			error_event_data.recovery_enabled = true;

@@ -4360,6 +4360,7 @@ static int cam_ife_hw_mgr_handle_camif_error(
		break;
	}

end:
	return rc;
}

+2 −0
Original line number Diff line number Diff line
@@ -383,10 +383,12 @@ struct cam_mem_cache_ops_cmd {
 * @CAM_REQ_MGR_ERROR_TYPE_DEVICE: Device error message, fatal to session
 * @CAM_REQ_MGR_ERROR_TYPE_REQUEST: Error on a single request, not fatal
 * @CAM_REQ_MGR_ERROR_TYPE_BUFFER: Buffer was not filled, not fatal
 * @CAM_REQ_MGR_ERROR_TYPE_RECOVERY: Fatal error, can be recovered
 */
#define CAM_REQ_MGR_ERROR_TYPE_DEVICE           0
#define CAM_REQ_MGR_ERROR_TYPE_REQUEST          1
#define CAM_REQ_MGR_ERROR_TYPE_BUFFER           2
#define CAM_REQ_MGR_ERROR_TYPE_RECOVERY         3

/**
 * struct cam_req_mgr_error_msg