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

Commit 0f4778c7 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 2dee6973 860da245
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -146,7 +146,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;
@@ -188,7 +188,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;
@@ -340,7 +340,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;
@@ -416,7 +416,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
@@ -880,7 +880,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 */