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

Commit 9812e86a authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: icp: Add fw error message in kmd logging"

parents 1dd83cb4 b869646e
Loading
Loading
Loading
Loading
+18 −9
Original line number Original line Diff line number Diff line
@@ -55,6 +55,8 @@


static struct cam_icp_hw_mgr icp_hw_mgr;
static struct cam_icp_hw_mgr icp_hw_mgr;


static void cam_icp_mgr_process_dbg_buf(unsigned int debug_lvl);

static int cam_icp_send_ubwc_cfg(struct cam_icp_hw_mgr *hw_mgr)
static int cam_icp_send_ubwc_cfg(struct cam_icp_hw_mgr *hw_mgr)
{
{
	struct cam_hw_intf *a5_dev_intf = NULL;
	struct cam_hw_intf *a5_dev_intf = NULL;
@@ -1829,12 +1831,13 @@ static int cam_icp_mgr_process_fatal_error(
	if (event_notify->event_id == HFI_EVENT_SYS_ERROR) {
	if (event_notify->event_id == HFI_EVENT_SYS_ERROR) {
		CAM_INFO(CAM_ICP, "received HFI_EVENT_SYS_ERROR");
		CAM_INFO(CAM_ICP, "received HFI_EVENT_SYS_ERROR");
		rc = cam_icp_mgr_trigger_recovery(hw_mgr);
		rc = cam_icp_mgr_trigger_recovery(hw_mgr);
		cam_icp_mgr_process_dbg_buf(icp_hw_mgr.a5_dbg_lvl);
	}
	}


	return rc;
	return rc;
}
}


static void cam_icp_mgr_process_dbg_buf(void)
static void cam_icp_mgr_process_dbg_buf(unsigned int debug_lvl)
{
{
	uint32_t *msg_ptr = NULL, *pkt_ptr = NULL;
	uint32_t *msg_ptr = NULL, *pkt_ptr = NULL;
	struct hfi_msg_debug *dbg_msg;
	struct hfi_msg_debug *dbg_msg;
@@ -1856,6 +1859,8 @@ static void cam_icp_mgr_process_dbg_buf(void)
			timestamp = ((((uint64_t)(dbg_msg->timestamp_hi) << 32)
			timestamp = ((((uint64_t)(dbg_msg->timestamp_hi) << 32)
				| dbg_msg->timestamp_lo) >> 16);
				| dbg_msg->timestamp_lo) >> 16);
			trace_cam_icp_fw_dbg(dbg_buf, timestamp/2);
			trace_cam_icp_fw_dbg(dbg_buf, timestamp/2);
			if (!debug_lvl)
				CAM_INFO(CAM_ICP, "FW_DBG:%s", dbg_buf);
		}
		}
		size_processed += (pkt_ptr[ICP_PACKET_SIZE] >>
		size_processed += (pkt_ptr[ICP_PACKET_SIZE] >>
			BYTE_WORD_SHIFT);
			BYTE_WORD_SHIFT);
@@ -1981,9 +1986,7 @@ static int32_t cam_icp_mgr_process_msg(void *priv, void *data)
		}
		}
	}
	}


	if (icp_hw_mgr.a5_debug_type ==
	cam_icp_mgr_process_dbg_buf(icp_hw_mgr.a5_dbg_lvl);
		HFI_DEBUG_MODE_QUEUE)
		cam_icp_mgr_process_dbg_buf();


	if ((task_data->irq_status & A5_WDT_0) ||
	if ((task_data->irq_status & A5_WDT_0) ||
		(task_data->irq_status & A5_WDT_1)) {
		(task_data->irq_status & A5_WDT_1)) {
@@ -2503,6 +2506,7 @@ static int cam_icp_mgr_abort_handle(
	if (!rem_jiffies) {
	if (!rem_jiffies) {
		rc = -ETIMEDOUT;
		rc = -ETIMEDOUT;
		CAM_ERR(CAM_ICP, "FW timeout/err in abort handle command");
		CAM_ERR(CAM_ICP, "FW timeout/err in abort handle command");
		cam_icp_mgr_process_dbg_buf(icp_hw_mgr.a5_dbg_lvl);
		cam_hfi_queue_dump();
		cam_hfi_queue_dump();
	}
	}


@@ -2557,9 +2561,7 @@ static int cam_icp_mgr_destroy_handle(
		rc = -ETIMEDOUT;
		rc = -ETIMEDOUT;
		CAM_ERR(CAM_ICP, "FW response timeout: %d for %u",
		CAM_ERR(CAM_ICP, "FW response timeout: %d for %u",
			rc, ctx_data->ctx_id);
			rc, ctx_data->ctx_id);
		if (icp_hw_mgr.a5_debug_type ==
		cam_icp_mgr_process_dbg_buf(icp_hw_mgr.a5_dbg_lvl);
			HFI_DEBUG_MODE_QUEUE)
			cam_icp_mgr_process_dbg_buf();
		cam_hfi_queue_dump();
		cam_hfi_queue_dump();
	}
	}
	kfree(destroy_cmd);
	kfree(destroy_cmd);
@@ -2866,6 +2868,7 @@ static int cam_icp_mgr_send_fw_init(struct cam_icp_hw_mgr *hw_mgr)
	if (!rem_jiffies) {
	if (!rem_jiffies) {
		rc = -ETIMEDOUT;
		rc = -ETIMEDOUT;
		CAM_ERR(CAM_ICP, "FW response timed out %d", rc);
		CAM_ERR(CAM_ICP, "FW response timed out %d", rc);
		cam_icp_mgr_process_dbg_buf(icp_hw_mgr.a5_dbg_lvl);
		cam_hfi_queue_dump();
		cam_hfi_queue_dump();
	}
	}
	CAM_DBG(CAM_ICP, "Done Waiting for INIT DONE Message");
	CAM_DBG(CAM_ICP, "Done Waiting for INIT DONE Message");
@@ -3117,6 +3120,7 @@ static int cam_icp_mgr_send_config_io(struct cam_icp_hw_ctx_data *ctx_data,
	if (!rem_jiffies) {
	if (!rem_jiffies) {
		rc = -ETIMEDOUT;
		rc = -ETIMEDOUT;
		CAM_ERR(CAM_ICP, "FW response timed out %d", rc);
		CAM_ERR(CAM_ICP, "FW response timed out %d", rc);
		cam_icp_mgr_process_dbg_buf(icp_hw_mgr.a5_dbg_lvl);
		cam_hfi_queue_dump();
		cam_hfi_queue_dump();
	}
	}


@@ -3880,8 +3884,9 @@ static void cam_icp_mgr_print_io_bufs(struct cam_packet *packet,
			}
			}


			CAM_INFO(CAM_ICP,
			CAM_INFO(CAM_ICP,
				"pln %d w %d h %d s %u sh %u size %d addr 0x%x offset 0x%x memh %x",
				"pln %d dir %d w %d h %d s %u sh %u sz %d addr 0x%x off 0x%x memh %x",
				j, io_cfg[i].planes[j].width,
				j, io_cfg[i].direction,
				io_cfg[i].planes[j].width,
				io_cfg[i].planes[j].height,
				io_cfg[i].planes[j].height,
				io_cfg[i].planes[j].plane_stride,
				io_cfg[i].planes[j].plane_stride,
				io_cfg[i].planes[j].slice_height,
				io_cfg[i].planes[j].slice_height,
@@ -4339,6 +4344,7 @@ static int cam_icp_mgr_create_handle(uint32_t dev_type,
	if (!rem_jiffies) {
	if (!rem_jiffies) {
		rc = -ETIMEDOUT;
		rc = -ETIMEDOUT;
		CAM_ERR(CAM_ICP, "FW response timed out %d", rc);
		CAM_ERR(CAM_ICP, "FW response timed out %d", rc);
		cam_icp_mgr_process_dbg_buf(icp_hw_mgr.a5_dbg_lvl);
		cam_hfi_queue_dump();
		cam_hfi_queue_dump();
	}
	}


@@ -4385,6 +4391,7 @@ static int cam_icp_mgr_send_ping(struct cam_icp_hw_ctx_data *ctx_data)
	if (!rem_jiffies) {
	if (!rem_jiffies) {
		rc = -ETIMEDOUT;
		rc = -ETIMEDOUT;
		CAM_ERR(CAM_ICP, "FW response timed out %d", rc);
		CAM_ERR(CAM_ICP, "FW response timed out %d", rc);
		cam_icp_mgr_process_dbg_buf(icp_hw_mgr.a5_dbg_lvl);
		cam_hfi_queue_dump();
		cam_hfi_queue_dump();
	}
	}


@@ -4658,6 +4665,7 @@ static int cam_icp_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args)
	hw_mgr->ctx_data[ctx_id].icp_dev_acquire_info = NULL;
	hw_mgr->ctx_data[ctx_id].icp_dev_acquire_info = NULL;
acquire_info_failed:
acquire_info_failed:
	cam_icp_mgr_put_ctx(ctx_data);
	cam_icp_mgr_put_ctx(ctx_data);
	cam_icp_mgr_process_dbg_buf(icp_hw_mgr.a5_dbg_lvl);
	mutex_unlock(&ctx_data->ctx_mutex);
	mutex_unlock(&ctx_data->ctx_mutex);
	mutex_unlock(&hw_mgr->hw_mgr_mutex);
	mutex_unlock(&hw_mgr->hw_mgr_mutex);
	return rc;
	return rc;
@@ -4937,6 +4945,7 @@ static int cam_icp_mgr_cmd(void *hw_mgr_priv, void *cmd_args)
			hw_mgr->iommu_sec_hdl,
			hw_mgr->iommu_sec_hdl,
			hw_cmd_args->u.pf_args.buf_info,
			hw_cmd_args->u.pf_args.buf_info,
			hw_cmd_args->u.pf_args.mem_found);
			hw_cmd_args->u.pf_args.mem_found);

		break;
		break;
	default:
	default:
		CAM_ERR(CAM_ICP, "Invalid cmd");
		CAM_ERR(CAM_ICP, "Invalid cmd");