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

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

Merge "msm: pcie : Extend link recovery for config space access failure"

parents d94bc76a 813ce455
Loading
Loading
Loading
Loading
+13 −10
Original line number Diff line number Diff line
@@ -3219,23 +3219,15 @@ static inline int msm_pcie_oper_conf(struct pci_bus *bus, u32 devfn, int oper,

		if (dev->shadow_en) {
			if (rd_val == PCIE_LINK_DOWN &&
			   (readl_relaxed(config_base) == PCIE_LINK_DOWN)) {
			   (readl_relaxed(config_base) == PCIE_LINK_DOWN))
				PCIE_ERR(dev,
					"Read of RC%d %d:0x%02x + 0x%04x[%d] is all FFs\n",
					rc_idx, bus->number, devfn,
					where, size);
				if (dev->config_recovery) {
					PCIE_ERR(dev,
						"RC%d link recovery schedule\n",
						rc_idx);
					dev->cfg_access = false;
					schedule_work(&dev->link_recover_wq);
				}
			} else {
			else
				msm_pcie_save_shadow(dev, word_offset, wr_val,
					bdf, rc);
		}
		}

		PCIE_DBG3(dev,
			"RC%d %d:0x%02x + 0x%04x[%d] <- 0x%08x; rd 0x%08x val 0x%08x\n",
@@ -3243,6 +3235,17 @@ static inline int msm_pcie_oper_conf(struct pci_bus *bus, u32 devfn, int oper,
			wr_val, rd_val, *val);
	}

	if (rd_val == PCIE_LINK_DOWN &&
	   (readl_relaxed(config_base) == PCIE_LINK_DOWN)) {
		if (dev->config_recovery) {
			PCIE_ERR(dev,
				"RC%d link recovery schedule\n",
				rc_idx);
			dev->cfg_access = false;
			schedule_work(&dev->link_recover_wq);
		}
	}

unlock:
	spin_unlock_irqrestore(&dev->cfg_lock, dev->irqsave_flags);
out: