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

Commit cc986419 authored by Prakasha Nayak's avatar Prakasha Nayak Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: icp: Mapping fw error numbers with error names



This change will print ICP error names based on error type.

CRs-Fixed: 2456658
Change-Id: I975598a7404f7520912d7b3211b6baa249e7f238
Signed-off-by: default avatarPrakasha Nayak <pnayak@codeaurora.org>
parent 2f86e738
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -82,6 +82,12 @@
#define CAMERAICP_EHWVIOLATION         11
#define CAMERAICP_ECDMERROR            12

/* HFI Specific errors. */
#define CAMERAICP_HFI_ERR_COMMAND_SIZE 1000
#define CAMERAICP_HFI_ERR_MESSAGE_SIZE 1001
#define CAMERAICP_HFI_QUEUE_EMPTY      1002
#define CAMERAICP_HFI_QUEUE_FULL       1003

/* Core level commands */
/* IPE/BPS core Commands */
#define HFI_CMD_IPE_BPS_COMMON_START \
+87 −8
Original line number Diff line number Diff line
@@ -1955,6 +1955,70 @@ static int cam_icp_mgr_cleanup_ctx(struct cam_icp_hw_ctx_data *ctx_data)
	return 0;
}

static const char *cam_icp_error_handle_id_to_type(
	uint32_t error_handle)
{
	const char *name = NULL;

	switch (error_handle) {
	case CAMERAICP_SUCCESS:
		name = "SUCCESS";
		break;
	case CAMERAICP_EFAILED:
		name = "EFAILED";
		break;
	case CAMERAICP_ENOMEMORY:
		name = "ENOMEMORY";
		break;
	case CAMERAICP_EBADSTATE:
		name = "EBADSTATE";
		break;
	case CAMERAICP_EBADPARM:
		name = "EBADPARM";
		break;
	case CAMERAICP_EBADITEM:
		name = "EBADITEM";
		break;
	case CAMERAICP_EINVALIDFORMAT:
		name = "EINVALIDFORMAT";
		break;
	case CAMERAICP_EUNSUPPORTED:
		name = "EUNSUPPORTED";
		break;
	case CAMERAICP_EOUTOFBOUND:
		name = "EOUTOFBOUND";
		break;
	case CAMERAICP_ETIMEDOUT:
		name = "ETIMEDOUT";
		break;
	case CAMERAICP_EABORTED:
		name = "EABORTED";
		break;
	case CAMERAICP_EHWVIOLATION:
		name = "EHWVIOLATION";
		break;
	case CAMERAICP_ECDMERROR:
		name = "ECDMERROR";
		break;
	case CAMERAICP_HFI_ERR_COMMAND_SIZE:
		name = "HFI_ERR_COMMAND_SIZE";
		break;
	case CAMERAICP_HFI_ERR_MESSAGE_SIZE:
		name = "HFI_ERR_MESSAGE_SIZE";
		break;
	case CAMERAICP_HFI_QUEUE_EMPTY:
		name = "HFI_QUEUE_EMPTY";
		break;
	case CAMERAICP_HFI_QUEUE_FULL:
		name = "HFI_QUEUE_FULL";
		break;
	default:
		name = NULL;
		break;
	}
	return name;
}

static int cam_icp_mgr_handle_frame_process(uint32_t *msg_ptr, int flag)
{
	int i;
@@ -2014,8 +2078,10 @@ static int cam_icp_mgr_handle_frame_process(uint32_t *msg_ptr, int flag)
				ctx_data->icp_dev_acquire_info->dev_type);
		else
			CAM_ERR(CAM_ICP,
				"Done with error: %u on ctx_id %d dev %d for req %llu",
				"Done with error: %u err_type= [%s] on ctx_id %d dev %d for req %llu",
				ioconfig_ack->err_type,
				cam_icp_error_handle_id_to_type(
				ioconfig_ack->err_type),
				ctx_data->ctx_id,
				ctx_data->icp_dev_acquire_info->dev_type,
				request_id);
@@ -2088,8 +2154,13 @@ static int cam_icp_mgr_process_msg_config_io(uint32_t *msg_ptr)
		ipe_config_ack =
			(struct hfi_msg_ipe_config *)(ioconfig_ack->msg_data);
		if (ipe_config_ack->rc) {
			CAM_ERR(CAM_ICP, "rc = %d err = %u",
				ipe_config_ack->rc, ioconfig_ack->err_type);
			CAM_ERR(CAM_ICP, "rc = %d failed with\n"
				"err_no = [%u] err_type = [%s]",
				ipe_config_ack->rc,
				ioconfig_ack->err_type,
				cam_icp_error_handle_id_to_type(
				ioconfig_ack->err_type));

			return -EIO;
		}
		ctx_data = (struct cam_icp_hw_ctx_data *)
@@ -2254,9 +2325,13 @@ static int cam_icp_mgr_process_direct_ack_msg(uint32_t *msg_ptr)
			(struct cam_icp_hw_ctx_data *)ioconfig_ack->user_data1;
		if (ctx_data->state != CAM_ICP_CTX_STATE_FREE)
			complete(&ctx_data->wait_complete);
		CAM_DBG(CAM_ICP,
			"received IPE/BPS MAP ACK:ctx_state =%d err_status =%u",
			ctx_data->state, ioconfig_ack->err_type);
		CAM_DBG(CAM_ICP, "received IPE/BPS\n"
			"MAP ACK:ctx_state =%d\n"
			"failed with err_no = [%u] err_type = [%s]",
			ctx_data->state,
			ioconfig_ack->err_type,
			cam_icp_error_handle_id_to_type(
			ioconfig_ack->err_type));
		break;
	case HFI_IPEBPS_CMD_OPCODE_MEM_UNMAP:
		ioconfig_ack = (struct hfi_msg_ipebps_async_ack *)msg_ptr;
@@ -2265,8 +2340,12 @@ static int cam_icp_mgr_process_direct_ack_msg(uint32_t *msg_ptr)
		if (ctx_data->state != CAM_ICP_CTX_STATE_FREE)
			complete(&ctx_data->wait_complete);
		CAM_DBG(CAM_ICP,
			"received IPE/BPS UNMAP ACK:ctx_state =%d err_status =%u",
			ctx_data->state, ioconfig_ack->err_type);
			"received IPE/BPS UNMAP ACK:ctx_state =%d\n"
			"failed with err_no = [%u] err_type = [%s]",
			ctx_data->state,
			ioconfig_ack->err_type,
			cam_icp_error_handle_id_to_type(
			ioconfig_ack->err_type));
		break;
	default:
		CAM_ERR(CAM_ICP, "Invalid opcode : %u",