Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Commit

Permalink
Merge "cnss2: Only assert for remap window register when link is not …
Browse files Browse the repository at this point in the history
…down"
  • Loading branch information
qctecmdr authored and Gerrit - the friendly Code Review server committed Oct 6, 2022
2 parents c2625a5 + a835fec commit 28bc812
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions drivers/net/wireless/cnss2/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 28bc812

Please sign in to comment.