cnss2: Skip PCIe link suspend if link has already been suspended

If wlan is loaded but without any activity for a period, wlan will
enter into shutdown status, which will suspend PCIe link.

Then if wlan unloading is issued, unloading process should skip
link suspend.

Change-Id: Id366401c656102cac5c5432a5b9a9a77e429cbbc
Signed-off-by: Kai Liu <kaliu@codeaurora.org>
This commit is contained in:
Kai Liu 2018-07-25 11:26:43 +08:00
parent a71e8433d7
commit 03dc844d91

View file

@ -131,6 +131,7 @@ int cnss_suspend_pci_link(struct cnss_pci_data *pci_priv)
cnss_pr_dbg("Suspending PCI link\n");
if (!pci_priv->pci_link_state) {
cnss_pr_info("PCI link is already suspended!\n");
ret = -EINVAL;
goto out;
}
@ -393,8 +394,10 @@ static int cnss_qca6174_shutdown(struct cnss_pci_data *pci_priv)
cnss_pci_set_auto_suspended(pci_priv, 0);
ret = cnss_suspend_pci_link(pci_priv);
if (ret)
if (ret) {
cnss_pr_err("Failed to suspend PCI link, err = %d\n", ret);
return -EINVAL;
}
cnss_power_off_device(plat_priv);