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

Commit e65b033e authored by Yue Ma's avatar Yue Ma
Browse files

cnss2: Check PCIe link status before dumping registers



There is a chance that PCIe link is not accessible because
either it went into bad state or suspended by the driver.
Check link status before dumping any registers to avoid
unnecessary link access.

Change-Id: Ia2eed5177ff98b3bdf2ebbc0a7ab7d9f8ec3af72
Signed-off-by: default avatarYue Ma <yuem@codeaurora.org>
parent 8bde9d7a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -357,6 +357,11 @@ static int cnss_pci_check_link_status(struct cnss_pci_data *pci_priv)
{
	u16 device_id;

	if (pci_priv->pci_link_state == PCI_LINK_DOWN) {
		cnss_pr_dbg("PCIe link is suspended\n");
		return -EIO;
	}

	if (pci_priv->pci_link_down_ind) {
		cnss_pr_err("PCIe link is down\n");
		return -EIO;
@@ -2159,6 +2164,9 @@ void cnss_pci_collect_dump_info(struct cnss_pci_data *pci_priv, bool in_panic)
		return;
	}

	if (cnss_pci_check_link_status(pci_priv))
		return;

	cnss_pci_dump_qdss_reg(pci_priv);

	ret = mhi_download_rddm_img(pci_priv->mhi_ctrl, in_panic);