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

Commit d6945f70 authored by Mohammed Siddiq's avatar Mohammed Siddiq
Browse files

cnss2: Add code to handle idle-restart failure gracefully



During idle-restart failure the platform driver does not complete
the power_up completion event and it eventually results in the
driver timeout. Add code to handle idle-restart failure and
return the value of the failure to the host driver.

Change-Id: I9d80b844429ecb292a6c7e9d35362fbfd3a24adb
Signed-off-by: default avatarMohammed Siddiq <msiddiq@codeaurora.org>
parent 402c8854
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -717,6 +717,14 @@ int cnss_idle_restart(struct device *dev)
	ret = wait_for_completion_timeout(&plat_priv->power_up_complete,
					  msecs_to_jiffies((timeout << 1) +
							   WLAN_WD_TIMEOUT_MS));
	if (plat_priv->power_up_error) {
		ret = plat_priv->power_up_error;
		clear_bit(CNSS_DRIVER_IDLE_RESTART, &plat_priv->driver_state);
		cnss_pr_dbg("Power up error:%d, exiting\n",
			    plat_priv->power_up_error);
		goto out;
	}

	if (!ret) {
		cnss_pr_err("Timeout waiting for idle restart to complete\n");
		ret = -ETIMEDOUT;
+1 −0
Original line number Diff line number Diff line
@@ -406,6 +406,7 @@ struct cnss_plat_data {
	u8 set_wlaon_pwr_ctrl;
	u8 fw_pcie_gen_switch;
	u8 pcie_gen_speed;
	int power_up_error;
};

#ifdef CONFIG_ARCH_QCOM
+3 −0
Original line number Diff line number Diff line
@@ -1505,6 +1505,8 @@ int cnss_pci_call_driver_probe(struct cnss_pci_data *pci_priv)
		if (ret) {
			cnss_pr_err("Failed to idle restart host driver, err = %d\n",
				    ret);
			plat_priv->power_up_error = ret;
			complete_all(&plat_priv->power_up_complete);
			goto out;
		}
		clear_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state);
@@ -1975,6 +1977,7 @@ static int cnss_qca6290_powerup(struct cnss_pci_data *pci_priv)
		cnss_pci_deinit_mhi(pci_priv);
	}

	plat_priv->power_up_error = 0;
retry:
	ret = cnss_power_on_device(plat_priv);
	if (ret) {