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

Commit fd47adca authored by Camera Software Integration's avatar Camera Software Integration Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: icp: Send error notification for camnoc recovery" into camera-kernel.lnx.1.0

parents fd66b87b 1200da17
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -559,6 +559,7 @@ int32_t cam_context_acquire_dev_to_hw(struct cam_context *ctx,
	param.event_cb = ctx->irq_cb_intf;
	param.num_acq = cmd->num_resources;
	param.acquire_info = cmd->resource_hdl;
	param.session_hdl = cmd->session_handle;

	/* call HW manager to reserve the resource */
	rc = ctx->hw_mgr_intf->hw_acquire(ctx->hw_mgr_intf->hw_mgr_priv,
+2 −0
Original line number Diff line number Diff line
@@ -99,6 +99,7 @@ struct cam_hw_done_event_data {
 * @context_data:          Context data pointer for the callback function
 * @event_cb:              Callback function array
 * @num_acq:               Total number of acquire in the payload
 * @session_hdl:           Session Handle
 * @acquire_info:          Acquired resource array pointer
 * @ctxt_to_hw_map:        HW context (returned)
 * @custom_enabled:        ctx has custom enabled
@@ -114,6 +115,7 @@ struct cam_hw_acquire_args {
	void                        *context_data;
	cam_hw_event_cb_func         event_cb;
	uint32_t                     num_acq;
	uint32_t                     session_hdl;
	uint32_t                     acquire_info_size;
	uintptr_t                    acquire_info;
	void                        *ctxt_to_hw_map;
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@
#define HFI_ERR_SYS_UNSUPPORT_CMD       (HFI_COMMON_BASE + 0x4)
#define HFI_ERR_SYS_CMDFAILED           (HFI_COMMON_BASE + 0x5)
#define HFI_ERR_SYS_CMDSIZE             (HFI_COMMON_BASE + 0x6)
#define HFI_ERR_SYS_RESET_FAILURE       (HFI_COMMON_BASE + 0x7)

/* System Level Event types */
#define HFI_EVENT_SYS_ERROR             (HFI_COMMON_BASE + 0x1)
+31 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <media/cam_defs.h>
#include <media/cam_icp.h>
#include <media/cam_cpas.h>
#include <media/cam_req_mgr.h>

#include "cam_sync_api.h"
#include "cam_packet_util.h"
@@ -44,6 +45,7 @@
#include "cam_trace.h"
#include "cam_cpas_api.h"
#include "cam_common_util.h"
#include "cam_req_mgr_dev.h"

#define ICP_WORKQ_TASK_CMD_TYPE 1
#define ICP_WORKQ_TASK_MSG_TYPE 2
@@ -2487,7 +2489,9 @@ static int cam_icp_mgr_process_fatal_error(
	struct cam_icp_hw_mgr *hw_mgr, uint32_t *msg_ptr)
{
	struct hfi_msg_event_notify *event_notify;
	int rc = 0;
	int rc = 0, i = 0;
	struct cam_req_mgr_message req_msg;
	struct cam_acquire_dev_cmd *acq_cmd;

	CAM_DBG(CAM_ICP, "Enter");

@@ -2507,6 +2511,31 @@ static int cam_icp_mgr_process_fatal_error(
		if (event_notify->event_data1 == HFI_ERR_SYS_FATAL) {
			CAM_ERR(CAM_ICP, "received HFI_ERR_SYS_FATAL");
			BUG();
		} else if (event_notify->event_data1 ==
			HFI_ERR_SYS_RESET_FAILURE) {
			for (i = 0; i < CAM_ICP_CTX_MAX; i++) {
				if (hw_mgr->ctx_data[i].state !=
					CAM_CTX_ACQUIRED)
					continue;

				acq_cmd = &hw_mgr->ctx_data[i].acquire_dev_cmd;
				CAM_INFO(CAM_ICP,
					"Sending Full Recovery on sess %x",
					acq_cmd->session_handle);

				req_msg.session_hdl =
					acq_cmd->session_handle;
				req_msg.u.err_msg.device_hdl = -1;
				req_msg.u.err_msg.link_hdl = -1;
				req_msg.u.err_msg.request_id = 0;
				req_msg.u.err_msg.resource_size = 0x0;
				req_msg.u.err_msg.error_type =
					CAM_REQ_MGR_ERROR_TYPE_FULL_RECOVERY;
				cam_req_mgr_notify_message(&req_msg,
					V4L_EVENT_CAM_REQ_MGR_ERROR,
					V4L_EVENT_CAM_REQ_MGR_EVENT);
				break;
			}
		}
		rc = cam_icp_mgr_trigger_recovery(hw_mgr);
		cam_icp_mgr_process_dbg_buf(icp_hw_mgr.a5_dbg_lvl);
@@ -5601,6 +5630,7 @@ static int cam_icp_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args)
	}
	ctx_data = &hw_mgr->ctx_data[ctx_id];
	ctx_data->ctx_id = ctx_id;
	ctx_data->acquire_dev_cmd.session_handle = args->session_hdl;

	mutex_lock(&ctx_data->ctx_mutex);
	rc = cam_icp_get_acquire_info(hw_mgr, args, ctx_data);
+2 −0
Original line number Diff line number Diff line
@@ -418,12 +418,14 @@ struct cam_mem_cache_ops_cmd {
 * @CAM_REQ_MGR_ERROR_TYPE_BUFFER: Buffer was not filled, not fatal
 * @CAM_REQ_MGR_ERROR_TYPE_RECOVERY: Fatal error, can be recovered
 * @CAM_REQ_MGR_ERROR_TYPE_SOF_FREEZE: SOF freeze, can be recovered
 * @CAM_REQ_MGR_ERROR_TYPE_FULL_RECOVERY: Full recovery, 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
#define CAM_REQ_MGR_ERROR_TYPE_SOF_FREEZE       4
#define CAM_REQ_MGR_ERROR_TYPE_FULL_RECOVERY    5

/**
 * struct cam_req_mgr_error_msg