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

Commit 1a820eb3 authored by Yan He's avatar Yan He
Browse files

msm: pcie: check link status before access



Add the checking of link status before access PCIe registers.

Change-Id: I8a975a652910c6a5f4ad4b26b82088bf7329d277
CRs-fixed: 610256
Signed-off-by: default avatarYan He <yanhe@codeaurora.org>
parent 8cc29b8b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -282,6 +282,15 @@ static inline int msm_pcie_oper_conf(struct pci_bus *bus, u32 devfn, int oper,
		goto unlock;
	}

	if (dev->link_status != MSM_PCIE_LINK_ENABLED) {
		PCIE_DBG(
			"Access to RC%d %d:0x%02x + 0x%04x[%d] is denied because link is down\n",
			rc_idx, bus->number, devfn, where, size);
		*val = ~0;
		rv = PCIBIOS_DEVICE_NOT_FOUND;
		goto unlock;
	}

	/* check if the link is up for endpoint */
	if (!rc && !msm_pcie_is_link_up(dev)) {
			pr_err("RC%d %s fail, link down - bus %d devfn %d\n",