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

Commit 090b2be8 authored by Peter Liu's avatar Peter Liu
Browse files

msm: camera: isp: rate limit some potential per irq log



when camera system goes wrong, driver should still avoid
print per irq log since it could lead to irq starving
and watch dog bark.

Change-Id: Ie7f25dd09e328089418a7ec79375f8d865a3fc10
Signed-off-by: default avatarPeter Liu <pingchie@codeaurora.org>
parent 66f4f85a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -407,11 +407,11 @@ static int msm_isp_get_buf(struct msm_isp_buf_mgr *buf_mgr, uint32_t id,
	struct msm_isp_buffer_mapped_info *mped_info_tmp2;
	bufq = msm_isp_get_bufq(buf_mgr, bufq_handle);
	if (!bufq) {
		pr_err("%s: Invalid bufq\n", __func__);
		pr_err_ratelimited("%s: Invalid bufq\n", __func__);
		return rc;
	}
	if (!bufq->bufq_handle) {
		pr_err("%s: Invalid bufq handle\n", __func__);
		pr_err_ratelimited("%s: Invalid bufq handle\n", __func__);
		return rc;
	}

+5 −0
Original line number Diff line number Diff line
@@ -1614,6 +1614,11 @@ static int msm_vfe47_axi_halt(struct vfe_device *vfe_dev,
		msm_camera_io_w_mb(0x1, vfe_dev->vfe_base + 0x400);
	}

	if (atomic_read(&vfe_dev->error_info.overflow_state)
		== OVERFLOW_DETECTED)
		pr_err_ratelimited("%s: VFE%d halt recovery in process, HALT AXI\n",
			__func__, vfe_dev->pdev->id);

	for (i = VFE_PIX_0; i <= VFE_RAW_2; i++) {
		/* if any stream is waiting for update, signal complete */
		if (vfe_dev->axi_data.stream_update[i]) {
+11 −16
Original line number Diff line number Diff line
@@ -1122,7 +1122,7 @@ static void msm_isp_get_done_buf(struct vfe_device *vfe_dev,
	if (stream_info->controllable_output) {
		stream_info->buf[pingpong_bit] = NULL;
		if (!stream_info->undelivered_request_cnt) {
			pr_err("%s:%d error undelivered_request_cnt 0\n",
			pr_err_ratelimited("%s:%d error undelivered_request_cnt 0\n",
				__func__, __LINE__);
		} else {
			stream_info->undelivered_request_cnt--;
@@ -1230,7 +1230,7 @@ static int msm_isp_cfg_ping_pong_address(struct vfe_device *vfe_dev,
			bufq_handle[queue_req->buff_queue_id];

		if (!bufq_handle || stream_info->request_q_cnt <= 0) {
			pr_err("%s: Drop request. Shared stream is stopped.\n",
			pr_err_ratelimited("%s: Drop request. Shared stream is stopped.\n",
				__func__);
			return -EINVAL;
		}
@@ -1312,12 +1312,12 @@ static void msm_isp_process_done_buf(struct vfe_device *vfe_dev,
		src_info[SRC_TO_INTF(stream_info->stream_src)].frame_id;

	if (stream_idx >= MAX_NUM_STREAM) {
		pr_err("%s: Invalid stream_idx", __func__);
		pr_err_ratelimited("%s: Invalid stream_idx", __func__);
		return;
	}

	if (SRC_TO_INTF(stream_info->stream_src) >= VFE_SRC_MAX) {
		pr_err("%s: Invalid stream index, put buf back to vb2 queue\n",
		pr_err_ratelimited("%s: Invalid stream index, put buf back to vb2 queue\n",
			__func__);
		rc = vfe_dev->buf_mgr->ops->put_buf(vfe_dev->buf_mgr,
			buf->bufq_handle, buf->buf_idx);
@@ -1347,7 +1347,7 @@ static void msm_isp_process_done_buf(struct vfe_device *vfe_dev,
		return;

	if (vfe_dev->buf_mgr->frameId_mismatch_recovery == 1) {
		pr_err("%s: Mismatch Recovery in progress, don't send any more buf\n",
		pr_err_ratelimited("%s: Mismatch Recovery in progress, drop frame!\n",
			__func__);
		return;
	}
@@ -1362,7 +1362,7 @@ static void msm_isp_process_done_buf(struct vfe_device *vfe_dev,
	rc = vfe_dev->buf_mgr->ops->get_buf_src(vfe_dev->buf_mgr,
					buf->bufq_handle, &buf_src);
	if (rc != 0) {
		pr_err("%s: Error getting buf_src\n", __func__);
		pr_err_ratelimited("%s: Error getting buf_src\n", __func__);
		return;
	}

@@ -1449,7 +1449,8 @@ static void msm_isp_process_done_buf(struct vfe_device *vfe_dev,
				frame_id, stream_info->runtime_output_format);
		}
	} else {
		pr_warn("%s: Warning! Unexpected return value\n", __func__);
		pr_err_ratelimited("%s: Warning! Unexpected return value\n",
			__func__);
	}
}

@@ -2560,7 +2561,7 @@ void msm_isp_process_axi_irq(struct vfe_device *vfe_dev,
			stream_idx = HANDLE_TO_IDX(comp_info->stream_handle);
			if ((!comp_info->stream_handle) ||
				(stream_idx >= MAX_NUM_STREAM)) {
				pr_err("%s: Invalid handle for composite irq\n",
				pr_err_ratelimited("%s: Invalid handle for composite irq\n",
					__func__);
				continue;
			}
@@ -2568,14 +2569,11 @@ void msm_isp_process_axi_irq(struct vfe_device *vfe_dev,
			stream_info = &axi_data->stream_info[stream_idx];

			if (stream_info->state == INACTIVE) {
				pr_warn("%s: Warning! Stream already inactive. Drop irq handling\n",
				pr_err_ratelimited("%s: Warning! Stream already inactive. Drop irq handling\n",
					__func__);
				continue;
			}

			ISP_DBG("%s: stream id %x frame id: 0x%x\n", __func__,
				stream_info->stream_id, stream_info->frame_id);

			spin_lock_irqsave(&stream_info->lock, flags);
			stream_info->frame_id++;

@@ -2617,14 +2615,11 @@ void msm_isp_process_axi_irq(struct vfe_device *vfe_dev,
			stream_info = &axi_data->stream_info[stream_idx];

			if (stream_info->state == INACTIVE) {
				pr_warn("%s: Warning! Stream already inactive. Drop irq handling\n",
				pr_err_ratelimited("%s: Warning! Stream already inactive. Drop irq handling\n",
					__func__);
				continue;
			}

			ISP_DBG("%s: stream id %x frame id: 0x%x\n", __func__,
				stream_info->stream_id, stream_info->frame_id);

			spin_lock_irqsave(&stream_info->lock, flags);
			stream_info->frame_id++;

+2 −2
Original line number Diff line number Diff line
@@ -1755,7 +1755,7 @@ irqreturn_t msm_isp_process_irq(int irq_num, void *data)
		read_irq_status(vfe_dev, &irq_status0, &irq_status1);

	if ((irq_status0 == 0) && (irq_status1 == 0)) {
		pr_err_ratelimited("%s:VFE%d irq_status0 & 1 are both 0\n",
		ISP_DBG("%s:VFE%d irq_status0 & 1 are both 0\n",
			__func__, vfe_dev->pdev->id);
		return IRQ_HANDLED;
	}
@@ -1823,7 +1823,7 @@ void msm_isp_do_tasklet(unsigned long data)
			irq_status0, irq_status1);
		if (atomic_read(&vfe_dev->error_info.overflow_state)
			!= NO_OVERFLOW) {
			pr_err("%s: Recovery in processing, Ignore IRQs!!!\n",
			ISP_DBG("%s: Recovery in processing, Ignore IRQs!!!\n",
				__func__);
			continue;
		}
+4 −6
Original line number Diff line number Diff line
@@ -1004,14 +1004,12 @@ static int msm_ispif_restart_frame_boundary(struct ispif_device *ispif,

	if (vfe_mask & (1 << VFE0)) {
		init_completion(&ispif->reset_complete[VFE0]);
		pr_err("%s Init completion VFE0\n", __func__);
		/* initiate reset of ISPIF */
		msm_camera_io_w(ISPIF_RST_CMD_MASK_RESTART,
				ispif->base + ISPIF_RST_CMD_ADDR);
	}
	if (ispif->hw_num_isps > 1 && (vfe_mask & (1 << VFE1))) {
		init_completion(&ispif->reset_complete[VFE1]);
		pr_err("%s Init completion VFE1\n", __func__);
		msm_camera_io_w(ISPIF_RST_CMD_1_MASK_RESTART,
			ispif->base + ISPIF_RST_CMD_1_ADDR);
	}
@@ -1037,7 +1035,7 @@ static int msm_ispif_restart_frame_boundary(struct ispif_device *ispif,
		}
	}

	pr_info("%s: ISPIF reset hw done", __func__);
	pr_info("%s: ISPIF reset hw done, Restarting", __func__);
	rc = msm_cam_clk_enable(&ispif->pdev->dev,
		ispif_clk_info, ispif->clk,
		ispif->num_clk, 0);