Skip to content

Commit

Permalink
drivers: pcie-brcmstb: add best-effort workaround for QoS bug on bcm2712
Browse files Browse the repository at this point in the history
If a set of read requests are issued by an endpoint, they are streamed
into a resynchronisation FIFO prior to exiting the RC. This FIFO has an
edge case where it can drop QoS for a request to 0 if there's a single
outstanding read request in the FIFO, and another is pushed when the
FIFO is popped. Requests with a QoS of 0 can take hundreds of
microseconds to complete.

By adding an experimentally-determined amount of backpressure on the pop
side, the critical level transition can largely be avoided.

Signed-off-by: Jonathan Bell <[email protected]>
  • Loading branch information
P33M authored and pelwell committed May 22, 2024
1 parent 55faf2e commit 0a19b52
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/pci/controller/pcie-brcmstb.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,18 @@ static void brcm_pcie_set_tc_qos(struct brcm_pcie *pcie)
AXI_DIS_QOS_GATING_IN_MASTER;
writel(reg, pcie->base + PCIE_MISC_AXI_INTF_CTRL);

/*
* If the QOS_UPDATE_TIMING_FIX bit is Reserved-0, then this is a
* 2712C1 chip, or a single-lane RC. Use the best-effort alternative
* which is to partially throttle AXI requests in-flight to the SDC.
*/
reg = readl(pcie->base + PCIE_MISC_AXI_INTF_CTRL);
if (!(reg & AXI_EN_QOS_UPDATE_TIMING_FIX)) {
reg &= ~AXI_MASTER_MAX_OUTSTANDING_REQUESTS_MASK;
reg |= 15;
writel(reg, pcie->base + PCIE_MISC_AXI_INTF_CTRL);
}

/* Disable VDM reception by default - QoS map defaults to 0 */
reg = readl(pcie->base + PCIE_MISC_CTRL_1);
reg &= ~PCIE_MISC_CTRL_1_EN_VDM_QOS_CONTROL_MASK;
Expand Down

0 comments on commit 0a19b52

Please sign in to comment.