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

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

Merge "cnss2: Only assert for remap window register when link is not down"

parents c2625a51 a835fec6
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -426,15 +426,25 @@ int cnss_pci_check_link_status(struct cnss_pci_data *pci_priv)
static void cnss_pci_select_window(struct cnss_pci_data *pci_priv, u32 offset)
{
	u32 window = (offset >> WINDOW_SHIFT) & WINDOW_VALUE_MASK;
	u32 window_enable = WINDOW_ENABLE_BIT | window;
	u32 val;

	writel_relaxed(WINDOW_ENABLE_BIT | window,
		       QCA6390_PCIE_REMAP_BAR_CTRL_OFFSET +
		       pci_priv->bar);
	writel_relaxed(window_enable, pci_priv->bar +
		       QCA6390_PCIE_REMAP_BAR_CTRL_OFFSET);

	if (window != pci_priv->remap_window) {
		pci_priv->remap_window = window;
		cnss_pr_dbg("Config PCIe remap window register to 0x%x\n",
			    WINDOW_ENABLE_BIT | window);
			    window_enable);
	}

	/* Read it back to make sure the write has taken effect */
	val = readl_relaxed(pci_priv->bar + QCA6390_PCIE_REMAP_BAR_CTRL_OFFSET);
	if (val != window_enable) {
		cnss_pr_err("Failed to config window register to 0x%x, current value: 0x%x\n",
			    window_enable, val);
		if (!cnss_pci_check_link_status(pci_priv))
			CNSS_ASSERT(0);
	}
}