Merge "cnss2: Extend idle restart timeout"

This commit is contained in:
qctecmdr 2020-02-27 00:18:53 -08:00 • committed by Gerrit - the friendly Code Review server
commit 82e11449a5

View file

@ -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,20 +649,19 @@ int cnss_idle_restart(struct device *dev)
}
timeout = cnss_get_boot_timeout(dev);
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;
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;
}
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;
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;
}