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

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

Merge "cnss2: Extend idle restart timeout"

parents 7b7e4e4f dcf8badf
Loading
Loading
Loading
Loading
+18 −10
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@
#define FW_ASSERT_TIMEOUT		5000
#define CNSS_EVENT_PENDING		2989
#define COLD_BOOT_CAL_SHUTDOWN_DELAY_MS	50
#define WLAN_WD_TIMEOUT_MS		60000

#define CNSS_QUIRKS_DEFAULT		BIT(DISABLE_IO_COHERENCY)
#ifdef CONFIG_CNSS_EMULATION
@@ -628,6 +629,14 @@ int cnss_idle_restart(struct device *dev)

	cnss_pr_dbg("Doing idle restart\n");

	reinit_completion(&plat_priv->power_up_complete);

	if (test_bit(CNSS_IN_REBOOT, &plat_priv->driver_state)) {
		cnss_pr_dbg("Reboot or shutdown is in progress, ignore idle restart\n");
		ret = -EINVAL;
		goto out;
	}

	ret = cnss_driver_event_post(plat_priv,
				     CNSS_DRIVER_EVENT_IDLE_RESTART,
				     CNSS_EVENT_SYNC_UNINTERRUPTIBLE, NULL);
@@ -640,23 +649,22 @@ int cnss_idle_restart(struct device *dev)
	}

	timeout = cnss_get_boot_timeout(dev);

	reinit_completion(&plat_priv->power_up_complete);
	ret = wait_for_completion_timeout(&plat_priv->power_up_complete,
					  msecs_to_jiffies((timeout << 1) +
							   WLAN_WD_TIMEOUT_MS));
	if (!ret) {
		cnss_pr_err("Timeout waiting for idle restart to complete\n");
		ret = -ETIMEDOUT;
		goto out;
	}

	if (test_bit(CNSS_IN_REBOOT, &plat_priv->driver_state)) {
		cnss_pr_dbg("Reboot or shutdown is in progress, ignore idle restart\n");
		del_timer(&plat_priv->fw_boot_timer);
		ret = -EINVAL;
		goto out;
	}

	ret = wait_for_completion_timeout(&plat_priv->power_up_complete,
					  msecs_to_jiffies(timeout) << 2);
	if (!ret) {
		cnss_pr_err("Timeout waiting for idle restart to complete\n");
		ret = -EAGAIN;
		goto out;
	}

	return 0;

out: