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

Commit d0e2538e authored by Alok Chauhan's avatar Alok Chauhan
Browse files

msm: camera: cdm: Update hang detect logic



Currently cdm driver is updating work records
in case of all the interrupts received, but
decrementing only when it schedule workq for
inline irq interrupt. This causes the mismatch
in work records and return incorrect work record
count when cdm client check the cdm hang detect.

Updated hang detect logic in cdm driver.

CRs-Fixed: 2878695
Change-Id: I7039422bf573a7105c16ac2f752eb235c377bfee
Signed-off-by: default avatarAlok Chauhan <alokc@codeaurora.org>
parent 2ee0a3ec
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1499,6 +1499,8 @@ irqreturn_t cam_hw_cdm_irq(int irq_num, void *data)
			if (payload[i]->irq_data ==
				CAM_CDM_DBG_GEN_IRQ_USR_DATA)
				CAM_INFO(CAM_CDM, "Debug gen_irq received");

			atomic_inc(&cdm_core->bl_fifo[i].work_record);
		}

		CAM_DBG(CAM_CDM,
@@ -1525,7 +1527,6 @@ irqreturn_t cam_hw_cdm_irq(int irq_num, void *data)
			return IRQ_HANDLED;
		}

		atomic_inc(&cdm_core->bl_fifo[i].work_record);
		payload[i]->workq_scheduled_ts = ktime_get();

		work_status = queue_work(
@@ -1857,14 +1858,17 @@ int cam_hw_cdm_hang_detect(
	uint32_t            handle)
{
	struct cam_cdm *cdm_core = NULL;
	struct cam_hw_soc_info *soc_info;
	int i, rc = -1;

	cdm_core = (struct cam_cdm *)cdm_hw->core_info;
	soc_info = &cdm_hw->soc_info;

	for (i = 0; i < cdm_core->offsets->reg_data->num_bl_fifo; i++)
		if (atomic_read(&cdm_core->bl_fifo[i].work_record)) {
			CAM_WARN(CAM_CDM,
				"workqueue got delayed, work_record :%u",
				"workqueue got delayed for %s%u, work_record :%u",
				soc_info->label_name, soc_info->index,
				atomic_read(&cdm_core->bl_fifo[i].work_record));
			rc = 0;
			break;