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

Commit fb1d6cda authored by Jilai Wang's avatar Jilai Wang
Browse files

msm: npu: Don't allow RSC handshake to be interrupted



If the RSC handshake is interrupted during NPU power down, it is
possible that NPUSS clocks will be turned off before it enters
power collapse mode which will put it into bad state.

Change-Id: Iae9023a8246b2816af341a9bd7234ae2b0ebf26e
Signed-off-by: default avatarJilai Wang <jilaiw@codeaurora.org>
parent 8c887428
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -312,7 +312,7 @@ static int enable_fw_nolock(struct npu_device *npu_dev)
		goto notify_fw_pwr_fail;
	}

	ret = wait_for_completion_interruptible_timeout(
	ret = wait_for_completion_timeout(
		&host_ctx->fw_bringup_done, NW_CMD_TIMEOUT);
	if (!ret) {
		NPU_ERR("Wait for fw bringup timedout\n");
@@ -388,7 +388,7 @@ static void disable_fw_nolock(struct npu_device *npu_dev)
	}

	if (!host_ctx->auto_pil_disable) {
		ret = wait_for_completion_interruptible_timeout(
		ret = wait_for_completion_timeout(
			&host_ctx->fw_shutdown_done, NW_CMD_TIMEOUT);
		if (!ret)
			NPU_ERR("Wait for fw shutdown timedout\n");
@@ -1613,7 +1613,7 @@ int32_t npu_host_unmap_buf(struct npu_client *client,
	 * fw is disabled
	 */
	if (host_ctx->fw_error && (host_ctx->fw_state == FW_ENABLED) &&
		!wait_for_completion_interruptible_timeout(
		!wait_for_completion_timeout(
		&host_ctx->fw_deinit_done, NW_CMD_TIMEOUT))
		NPU_WARN("npu: wait for fw_deinit_done time out\n");