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

Commit f9781dae authored by Alok Pandey's avatar Alok Pandey Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: icp: Avoid accessing unclocked registers



If icp-pc is set, it may access register after clock
is disabled. This change avoid any such access.

Change-Id: I6cb56059e3ba5c7bf809ad544c50b2e89288e271
Signed-off-by: default avatarAlok Pandey <akumarpa@codeaurora.org>
parent 9b08cf3d
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -533,6 +533,11 @@ void cam_hfi_disable_cpu(void __iomem *icp_base)

	val = cam_io_r(icp_base + HFI_REG_A5_CSR_NSEC_RESET);
	cam_io_w_mb(val, icp_base + HFI_REG_A5_CSR_NSEC_RESET);

	cam_io_w_mb((uint32_t)ICP_INIT_REQUEST_RESET,
		icp_base + HFI_REG_HOST_ICP_INIT_REQUEST);
	cam_io_w_mb((uint32_t)INTR_DISABLE,
		g_hfi->csr_base + HFI_REG_A5_CSR_A2HOSTINTEN);
}

void cam_hfi_enable_cpu(void __iomem *icp_base)
@@ -883,11 +888,6 @@ void cam_hfi_deinit(void __iomem *icp_base)
	g_hfi->cmd_q_state = false;
	g_hfi->msg_q_state = false;

	cam_io_w_mb((uint32_t)ICP_INIT_REQUEST_RESET,
		icp_base + HFI_REG_HOST_ICP_INIT_REQUEST);

	cam_io_w_mb((uint32_t)INTR_DISABLE,
		g_hfi->csr_base + HFI_REG_A5_CSR_A2HOSTINTEN);
	kzfree(g_hfi);
	g_hfi = NULL;

+2 −2
Original line number Diff line number Diff line
@@ -4574,8 +4574,8 @@ static int cam_icp_mgr_create_wq(void)
	if (rc)
		goto debugfs_create_failed;

	icp_hw_mgr.icp_pc_flag = false;
	icp_hw_mgr.ipe_bps_pc_flag = false;
	icp_hw_mgr.icp_pc_flag = true;
	icp_hw_mgr.ipe_bps_pc_flag = true;

	for (i = 0; i < ICP_WORKQ_NUM_TASK; i++)
		icp_hw_mgr.msg_work->task.pool[i].payload =