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

Commit 019cfb6e authored by Jilai Wang's avatar Jilai Wang
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: I71f130976134c989ea26f907d9915a0c8cc6f657
Signed-off-by: default avatarJilai Wang <jilaiw@codeaurora.org>
parent f08e34e4
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -139,7 +139,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;
@@ -181,7 +181,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;
@@ -333,7 +333,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;
@@ -409,7 +409,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
@@ -874,7 +874,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
@@ -18,8 +18,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 */