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

Commit 4ba8167c authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ep_pcie: Avoid polling for ltssm state if perst is asserted"

parents 3a4f3d20 b2b584fe
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -393,6 +393,7 @@ struct ep_pcie_dev_t {
	ulong                        wake_counter;
	ulong                        msi_counter;
	ulong                        global_irq_counter;
	ulong                        perst_ast_in_enum_counter;

	bool                         dump_conf;
	bool                         config_mmio_init;
+11 −2
Original line number Diff line number Diff line
@@ -1681,6 +1681,7 @@ int ep_pcie_core_enable_endpoint(enum ep_pcie_options opt)
	u32 val = 0;
	u32 retries = 0;
	u32 bme = 0;
	bool perst = true;
	bool ltssm_en = false;
	struct ep_pcie_dev_t *dev = &ep_pcie_dev;

@@ -1921,11 +1922,19 @@ int ep_pcie_core_enable_endpoint(enum ep_pcie_options opt)
		if (retries % 100 == 0)
			EP_PCIE_DBG(dev, "PCIe V%d: LTSSM_STATE:0x%x\n",
					dev->rev, (val >> 0xC) & 0x3f);
		perst = atomic_read(&dev->perst_deast) ? 1 : 0;
	} while ((!(val & XMLH_LINK_UP) ||
		!ep_pcie_confirm_linkup(dev, false))
		&& (retries < LINK_UP_CHECK_MAX_COUNT));
		&& (retries < LINK_UP_CHECK_MAX_COUNT) && perst);

	if (retries == LINK_UP_CHECK_MAX_COUNT) {
	if (!perst) {
		dev->perst_ast_in_enum_counter++;
		EP_PCIE_ERR(dev,
				"PCIe V%d: Perst asserted No. %ld while waiting for link to be up\n",
				dev->rev, dev->perst_ast_in_enum_counter);
		ret = EP_PCIE_ERROR;
		goto link_fail;
	} else if (retries == LINK_UP_CHECK_MAX_COUNT) {
		EP_PCIE_ERR(dev, "PCIe V%d: link initialization failed\n",
			dev->rev);
		ret = EP_PCIE_ERROR;