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

Commit 860da245 authored by Da Hoon Pyun's avatar Da Hoon Pyun Committed by Gerrit - the friendly Code Review server
Browse files

msm: npu: Use different timeout for RSC and power up handshake



Different type of handshake requires different timeout setting.
Also increase IPC command's handshake timeout to 20 seconds and
power up's handshake timeout to 60 seconds.

Change-Id: I6519c2aae60c603767b1e0bb1d75ae91773c86c2
Signed-off-by: default avatarDa Hoon Pyun <dpyun@codeaurora.org>
parent fd6491fe
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ static int load_fw_nolock(struct npu_device *npu_dev, bool enable)
	}

	ret = wait_for_completion_timeout(
		&host_ctx->npu_power_up_done, NW_CMD_TIMEOUT);
		&host_ctx->npu_power_up_done, NW_PWR_UP_TIMEOUT);
	if (!ret) {
		NPU_ERR("Wait for npu powers up timed out\n");
		ret = -ETIMEDOUT;
@@ -168,7 +168,7 @@ static int load_fw_nolock(struct npu_device *npu_dev, bool enable)
	}

	ret = wait_for_completion_timeout(
		&host_ctx->fw_shutdown_done, NW_CMD_TIMEOUT);
		&host_ctx->fw_shutdown_done, NW_RSC_TIMEOUT_MS);
	if (!ret) {
		NPU_ERR("Wait for fw shutdown timedout\n");
		ret = -ETIMEDOUT;
@@ -320,7 +320,7 @@ static int enable_fw_nolock(struct npu_device *npu_dev)
	}

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

	if (!host_ctx->auto_pil_disable) {
		ret = wait_for_completion_timeout(
			&host_ctx->fw_shutdown_done, NW_CMD_TIMEOUT);
			&host_ctx->fw_shutdown_done, NW_RSC_TIMEOUT_MS);
		if (!ret)
			NPU_ERR("Wait for fw shutdown timedout\n");
		else
@@ -826,7 +826,7 @@ static int host_error_hdlr(struct npu_device *npu_dev, bool force)
	NPU_INFO("npu subsystem is restarted\n");

	ret = wait_for_completion_timeout(
		&host_ctx->npu_power_up_done, NW_CMD_TIMEOUT);
		&host_ctx->npu_power_up_done, NW_PWR_UP_TIMEOUT);
	if (!ret) {
		NPU_ERR("Wait for npu powers up timed out\n");
		ret = -ETIMEDOUT;
+5 −1
Original line number Diff line number Diff line
@@ -25,8 +25,12 @@
 * Defines
 * -------------------------------------------------------------------------
 */
#define NW_CMD_TIMEOUT_MS (1000 * 5) /* set for 5 seconds */
#define NW_RSC_TIMEOUT_MS (1000 * 5) /* set for 5 seconds */
#define NW_RSC_TIMEOUT msecs_to_jiffies(NW_RSC_TIMEOUT_MS)
#define NW_CMD_TIMEOUT_MS (1000 * 20) /* set for 20 seconds */
#define NW_CMD_TIMEOUT msecs_to_jiffies(NW_CMD_TIMEOUT_MS)
#define NW_PWR_UP_TIMEOUT_MS (1000 * 60) /* set for 60 seconds */
#define NW_PWR_UP_TIMEOUT msecs_to_jiffies(NW_PWR_UP_TIMEOUT_MS)
#define NW_DEBUG_TIMEOUT_MS (1000 * 60 * 30) /* set for 30 minutes */
#define NW_DEBUG_TIMEOUT msecs_to_jiffies(NW_DEBUG_TIMEOUT_MS)
#define NPU_MBOX_IDLE_TIMEOUT_MS 500 /* set for 500ms */