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

Commit 14c4d155 authored by Yue Ma's avatar Yue Ma Committed by Gerrit - the friendly Code Review server
Browse files

cnss2: Increase boot timer for calibration mode



Boot time for calibration mode may take longer than what it
expects. Hence increase the boot timer accordingly. Ignore
calibration failure as well since it is not critical to
block mission mode.

Change-Id: I20894ae2eeaa4912f8c0d895e45453eba1bcd1cf
Signed-off-by: default avatarYue Ma <yuem@codeaurora.org>
parent 60638232
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -1594,6 +1594,8 @@ static int cnss_qca6290_powerup(struct cnss_pci_data *pci_priv)
		if (ret)
			goto stop_mhi;
	} else if (timeout) {
		if (test_bit(CNSS_COLD_BOOT_CAL, &plat_priv->driver_state))
			timeout = timeout << 1;
		mod_timer(&plat_priv->fw_boot_timer,
			  jiffies + msecs_to_jiffies(timeout << 1));
	}
@@ -1861,7 +1863,7 @@ int cnss_wlan_register_driver(struct cnss_wlan_driver *driver_ops)

	timeout = cnss_get_boot_timeout(&pci_priv->pci_dev->dev);
	ret = wait_for_completion_timeout(&plat_priv->cal_complete,
					  msecs_to_jiffies(timeout));
					  msecs_to_jiffies(timeout) << 2);
	if (!ret) {
		cnss_pr_err("Timeout waiting for calibration to complete\n");
		cal_info->cal_status = CNSS_CAL_TIMEOUT;
@@ -2900,11 +2902,22 @@ static void cnss_pci_free_m3_mem(struct cnss_pci_data *pci_priv)

void cnss_pci_fw_boot_timeout_hdlr(struct cnss_pci_data *pci_priv)
{
	struct cnss_plat_data *plat_priv;

	if (!pci_priv)
		return;

	cnss_fatal_err("Timeout waiting for FW ready indication\n");

	plat_priv = pci_priv->plat_priv;
	if (!plat_priv)
		return;

	if (test_bit(CNSS_COLD_BOOT_CAL, &plat_priv->driver_state)) {
		cnss_pr_dbg("Ignore FW ready timeout for calibration mode\n");
		return;
	}

	cnss_schedule_recovery(&pci_priv->pci_dev->dev,
			       CNSS_REASON_TIMEOUT);
}