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

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

Merge "msm: camera: ife: Change data type for timeout" into camera-kernel.lnx.1.0

parents 00c97ccc 827e3266
Loading
Loading
Loading
Loading
+15 −17
Original line number Diff line number Diff line
@@ -3540,6 +3540,7 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv,
	struct cam_cdm_bl_request *cdm_cmd;
	struct cam_ife_hw_mgr_ctx *ctx;
	struct cam_isp_prepare_hw_update_data *hw_update_data;
	unsigned long rem_jiffies = 0;

	if (!hw_mgr_priv || !config_hw_args) {
		CAM_ERR(CAM_ISP,
@@ -3652,22 +3653,19 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv,
		}

		if (cfg->init_packet) {
			rc = wait_for_completion_timeout(
			rem_jiffies = wait_for_completion_timeout(
				&ctx->config_done_complete,
				msecs_to_jiffies(30));
			if (rc <= 0) {
			if (rem_jiffies == 0) {
				CAM_ERR(CAM_ISP,
					"config done completion timeout for req_id=%llu rc=%d ctx_index %d",
					cfg->request_id, rc, ctx->ctx_index);
				if (rc == 0)
					"config done completion timeout for req_id=%llu ctx_index %d",
					cfg->request_id, ctx->ctx_index);
				rc = -ETIMEDOUT;
			} else {
				rc = 0;
			} else
				CAM_DBG(CAM_ISP,
					"config done Success for req_id=%llu ctx_index %d",
					cfg->request_id, ctx->ctx_index);
		}
		}
	} else {
		CAM_ERR(CAM_ISP, "No commands to config");
	}
@@ -3814,6 +3812,7 @@ static int cam_ife_mgr_stop_hw(void *hw_mgr_priv, void *stop_hw_args)
	struct cam_ife_hw_mgr_ctx        *ctx;
	enum cam_ife_csid_halt_cmd        csid_halt_type;
	uint32_t                          i, master_base_idx = 0;
	unsigned long                     rem_jiffies = 0;

	if (!hw_mgr_priv || !stop_hw_args) {
		CAM_ERR(CAM_ISP, "Invalid arguments");
@@ -3913,9 +3912,9 @@ static int cam_ife_mgr_stop_hw(void *hw_mgr_priv, void *stop_hw_args)

	cam_ife_mgr_pause_hw(ctx);

	rc = wait_for_completion_timeout(&ctx->config_done_complete,
	rem_jiffies = wait_for_completion_timeout(&ctx->config_done_complete,
		msecs_to_jiffies(10));
	if (rc == 0) {
	if (rem_jiffies == 0) {
		CAM_WARN(CAM_ISP,
			"config done completion timeout for last applied req_id=%llu rc=%d ctx_index %d",
			ctx->applied_req_id, rc, ctx->ctx_index);
@@ -6147,6 +6146,7 @@ static int cam_ife_mgr_cmd(void *hw_mgr_priv, void *cmd_args)
		hw_cmd_args->ctxt_to_hw_map;
	struct cam_isp_hw_cmd_args *isp_hw_cmd_args = NULL;
	struct cam_packet          *packet;
	unsigned long rem_jiffies = 0;

	if (!hw_mgr_priv || !cmd_args) {
		CAM_ERR(CAM_ISP, "Invalid arguments");
@@ -6220,15 +6220,13 @@ static int cam_ife_mgr_cmd(void *hw_mgr_priv, void *cmd_args)
		if (ctx->last_dump_flush_req_id == ctx->applied_req_id)
			return 0;

		rc = wait_for_completion_timeout(
		rem_jiffies = wait_for_completion_timeout(
			&ctx->config_done_complete,
			msecs_to_jiffies(30));
		if (rc <= 0) {
		if (rem_jiffies == 0)
			CAM_ERR(CAM_ISP,
				"config done completion timeout, Reg dump will be unreliable rc=%d ctx_index %d",
				rc, ctx->ctx_index);
			rc = 0;
		}
				"config done completion timeout, Reg dump will be unreliable ctx_index %d",
				ctx->ctx_index);

		ctx->last_dump_flush_req_id = ctx->applied_req_id;
		rc = cam_ife_mgr_handle_reg_dump(ctx, ctx->reg_dump_buf_desc,
+9 −10
Original line number Diff line number Diff line
@@ -3284,7 +3284,7 @@ static int cam_ife_csid_reset_regs(
		csid_hw->csid_info->csid_reg;
	struct cam_hw_soc_info          *soc_info;
	uint32_t val = 0;
	unsigned long flags;
	unsigned long flags, rem_jiffies = 0;

	soc_info = &csid_hw->hw_info->soc_info;

@@ -3327,9 +3327,9 @@ static int cam_ife_csid_reset_regs(

	spin_unlock_irqrestore(&csid_hw->hw_info->hw_lock, flags);
	CAM_DBG(CAM_ISP, "CSID reset start");
	rc = wait_for_completion_timeout(&csid_hw->csid_top_complete,
	rem_jiffies = wait_for_completion_timeout(&csid_hw->csid_top_complete,
		msecs_to_jiffies(IFE_CSID_TIMEOUT));
	if (rc <= 0) {
	if (rem_jiffies == 0) {
		val = cam_io_r_mb(soc_info->reg_map[0].mem_base +
			csid_reg->cmn_reg->csid_top_irq_status_addr);
		if (val & 0x1) {
@@ -3341,19 +3341,18 @@ static int cam_ife_csid_reset_regs(
			CAM_DBG(CAM_ISP, "CSID:%d %s reset completed %d",
				csid_hw->hw_intf->hw_idx,
				reset_hw ? "hw" : "sw",
				rc);
			rc = 0;
				rem_jiffies);
			goto end;
		}
		CAM_ERR(CAM_ISP, "CSID:%d csid_reset %s fail rc = %d",
			csid_hw->hw_intf->hw_idx, reset_hw ? "hw" : "sw", rc);
			csid_hw->hw_intf->hw_idx, reset_hw ? "hw" : "sw",
			rem_jiffies);
		rc = -ETIMEDOUT;
		goto end;
	} else {
	} else
		CAM_DBG(CAM_ISP, "CSID:%d %s reset completed %d",
			csid_hw->hw_intf->hw_idx, reset_hw ? "hw" : "sw", rc);
		rc = 0;
	}
			csid_hw->hw_intf->hw_idx, reset_hw ? "hw" : "sw",
			rem_jiffies);

end:
	return rc;