Skip to content

Commit

Permalink
PCI: designware: Check for iATU unroll support after initializing host
Browse files Browse the repository at this point in the history
dw_pcie_iatu_unroll_enabled() reads a dbi_base register.  Reading any
dbi_base register before pp->ops->host_init has been called causes
"imprecise external abort" on platforms like ARTPEC-6, where the PCIe
module is disabled at boot and first enabled in pp->ops->host_init.  Move
dw_pcie_iatu_unroll_enabled() to dw_pcie_setup_rc(), since it is after
pp->ops->host_init, but before pp->iatu_unroll_enabled is actually used.

Fixes: a0601a4 ("PCI: designware: Add iATU Unroll feature")
Tested-by: James Le Cuirot <[email protected]>
Signed-off-by: Niklas Cassel <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
Acked-by: Joao Pinto <[email protected]>
Acked-by: Olof Johansson <[email protected]>
  • Loading branch information
Niklas Cassel authored and bjorn-helgaas committed Nov 4, 2016
1 parent ad11044 commit 416379f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/pci/host/pcie-designware.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,6 @@ int dw_pcie_host_init(struct pcie_port *pp)
}
}

pp->iatu_unroll_enabled = dw_pcie_iatu_unroll_enabled(pp);

if (pp->ops->host_init)
pp->ops->host_init(pp);

Expand Down Expand Up @@ -809,6 +807,11 @@ void dw_pcie_setup_rc(struct pcie_port *pp)
{
u32 val;

/* get iATU unroll support */
pp->iatu_unroll_enabled = dw_pcie_iatu_unroll_enabled(pp);
dev_dbg(pp->dev, "iATU unroll: %s\n",
pp->iatu_unroll_enabled ? "enabled" : "disabled");

/* set the number of lanes */
val = dw_pcie_readl_rc(pp, PCIE_PORT_LINK_CONTROL);
val &= ~PORT_LINK_MODE_MASK;
Expand Down

0 comments on commit 416379f

Please sign in to comment.