cnss2: Add debug assert on idle restart timeout

On idle restart failure, power down the device and assert for
debug.

Change-Id: I0b77a9d2087e08bfa3051367a7789999c070bf00
Signed-off-by: Manikandan Mohan <manikand@codeaurora.org>
This commit is contained in:
Manikandan Mohan 2020-07-09 15:35:04 -07:00 • committed by Gerrit - the friendly Code Review server
commit 094f1d2ff3
3 changed files with 15 additions and 5 deletions

View file

@ -656,12 +656,22 @@ int cnss_idle_restart(struct device *dev)
}
timeout = cnss_get_boot_timeout(dev);
/* In Idle restart power up sequence, we have fw_boot_timer to handle
* FW initialization failure. It uses WLAN_DRIVER_LOAD_TIMEOUT.
* Thus setup 3x that completion wait time to account for FW reinit /
* dump collection on retry.
*/
ret = wait_for_completion_timeout(&plat_priv->power_up_complete,
msecs_to_jiffies((timeout << 1) +
WLAN_WD_TIMEOUT_MS));
msecs_to_jiffies(timeout +
WLAN_MISSION_MODE_TIMEOUT * 3));
if (!ret) {
cnss_pr_err("Timeout waiting for idle restart to complete\n");
/* This exception occurs after attempting retry of FW recovery.
* Thus we can safely power off the device.
*/
cnss_fatal_err("Timeout for idle restart to complete\n");
ret = -ETIMEDOUT;
cnss_power_down(dev);
CNSS_ASSERT(0);
goto out;
}

View file

@ -26,7 +26,7 @@
#define RECOVERY_TIMEOUT 60000
#define WLAN_WD_TIMEOUT_MS 60000
#define WLAN_COLD_BOOT_CAL_TIMEOUT 60000
#define WLAN_DRIVER_LOAD_TIMEOUT 90000
#define WLAN_MISSION_MODE_TIMEOUT 30000
#define TIME_CLOCK_FREQ_HZ 19200000
#define CNSS_RAMDUMP_MAGIC 0x574C414E
#define CNSS_RAMDUMP_VERSION 0

View file

@ -1919,7 +1919,7 @@ retry:
if (test_bit(CNSS_IN_COLD_BOOT_CAL, &plat_priv->driver_state))
timeout += WLAN_COLD_BOOT_CAL_TIMEOUT;
else
timeout += WLAN_DRIVER_LOAD_TIMEOUT;
timeout += WLAN_MISSION_MODE_TIMEOUT;
mod_timer(&plat_priv->fw_boot_timer,
jiffies + msecs_to_jiffies(timeout));
}