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

Commit 73299125 authored by Tony Truong's avatar Tony Truong
Browse files

msm: pcie: add additional latency for PCIe switch case



Add the latency PCIe endpoint required before PCI framework scans
bus, when PCIe switch exists.

Change-Id: Ia567ccc217e7060c113b318c1bfb87e36b68cd93
Signed-off-by: default avatarYan He <yanhe@codeaurora.org>
Signed-off-by: default avatarTony Truong <truong@codeaurora.org>
parent e80f64ee
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -4309,6 +4309,12 @@ int msm_pcie_enable(struct msm_pcie_dev_t *dev, u32 options)
	dev->suspending = false;
	dev->link_turned_on_counter++;

	if (dev->bridge_found && dev->ep_latency) {
		PCIE_DBG(dev, "PCIe RC%d add ref clk propagation latency.\n",
			dev->rc_idx);
		usleep_range(dev->ep_latency * 1000, dev->ep_latency * 1000);
	}

	goto out;

link_fail:
@@ -4692,6 +4698,14 @@ int msm_pcie_enumerate(u32 rc_idx)
				return ret;
			}

			if (dev->ep_latency) {
				PCIE_DBG(dev,
					"PCIe RC%d add ref clk propagation latency.\n",
					dev->rc_idx);
				usleep_range(dev->ep_latency * 1000,
					dev->ep_latency * 1000);
			}

			bus = pci_create_root_bus(&dev->pdev->dev, 0,
						&msm_pcie_ops,
						msm_pcie_setup_sys_data(dev),