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

Commit af857534 authored by Shankar Ravi's avatar Shankar Ravi Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: Check for csid_irq status bit in case of


time out

Csid interrupt time out is happening due to system load.
Check if the interrupt is actually done by hardware by
reading the irq.

Change-Id: I8a07f98d1b769c53762cd71e87f1900c683115cd
Signed-off-by: default avatarShankar Ravi <rshankar@codeaurora.org>
parent 8f3515e7
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -229,7 +229,9 @@ static void msm_csid_set_sof_freeze_debug_reg(
static int msm_csid_reset(struct csid_device *csid_dev)
{
	int32_t rc = 0;
	uint32_t irq = 0, irq_bitshift;

	irq_bitshift = csid_dev->ctrl_reg->csid_reg.csid_rst_done_irq_bitshift;
	msm_camera_io_w(csid_dev->ctrl_reg->csid_reg.csid_rst_stb_all,
		csid_dev->base +
		csid_dev->ctrl_reg->csid_reg.csid_rst_cmd_addr);
@@ -238,8 +240,23 @@ static int msm_csid_reset(struct csid_device *csid_dev)
	if (rc < 0) {
		pr_err("wait_for_completion in msm_csid_reset fail rc = %d\n",
			rc);
	} else if (rc == 0) {
		irq = msm_camera_io_r(csid_dev->base +
			csid_dev->ctrl_reg->csid_reg.csid_irq_status_addr);
		pr_err_ratelimited("%s CSID%d_IRQ_STATUS_ADDR = 0x%x\n",
			__func__, csid_dev->pdev->id, irq);
		if (irq & (0x1 << irq_bitshift)) {
			rc = 1;
			CDBG("%s succeeded", __func__);
		} else {
			rc = 0;
			pr_err("%s reset csid_irq_status failed = 0x%x\n",
				__func__, irq);
		}
		if (rc == 0)
			rc = -ETIMEDOUT;
	} else {
		CDBG("%s succeeded", __func__);
	}
	return rc;
}