cnss2: pci: Trigger link down recovery if link fails to enter L0

In case if link fails to transition to L0 trigger inferred link
down recovery to collect RDDM dump.

Change-Id: I43326af34744501c542a1a1e22d6a9b5378c7289
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
This commit is contained in:
Hemant Kumar 2020-11-20 18:30:37 -08:00 • committed by Yue Ma
commit a73babdb3e

View file

@ -892,6 +892,7 @@ int cnss_pci_prevent_l1(struct device *dev)
{
struct pci_dev *pci_dev = to_pci_dev(dev);
struct cnss_pci_data *pci_priv = cnss_get_pci_priv(pci_dev);
int ret;
if (!pci_priv) {
cnss_pr_err("pci_priv is NULL\n");
@ -908,7 +909,13 @@ int cnss_pci_prevent_l1(struct device *dev)
return -EIO;
}
return msm_pcie_prevent_l1(pci_dev);
ret = msm_pcie_prevent_l1(pci_dev);
if (ret) {
cnss_pr_err("Failed to prevent PCIe L1, considered as link down\n");
cnss_pci_link_down(dev);
}
return ret;
}
EXPORT_SYMBOL(cnss_pci_prevent_l1);