Skip to content

Commit 416379f

Browse files
Niklas Casselbjorn-helgaas
authored andcommitted
PCI: designware: Check for iATU unroll support after initializing host
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 <chewi@gentoo.org> Signed-off-by: Niklas Cassel <niklas.cassel@axis.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Joao Pinto <jpinto@synopsys.com> Acked-by: Olof Johansson <olof@lixom.net>
1 parent ad11044 commit 416379f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/pci/host/pcie-designware.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,6 @@ int dw_pcie_host_init(struct pcie_port *pp)
637637
}
638638
}
639639

640-
pp->iatu_unroll_enabled = dw_pcie_iatu_unroll_enabled(pp);
641-
642640
if (pp->ops->host_init)
643641
pp->ops->host_init(pp);
644642

@@ -809,6 +807,11 @@ void dw_pcie_setup_rc(struct pcie_port *pp)
809807
{
810808
u32 val;
811809

810+
/* get iATU unroll support */
811+
pp->iatu_unroll_enabled = dw_pcie_iatu_unroll_enabled(pp);
812+
dev_dbg(pp->dev, "iATU unroll: %s\n",
813+
pp->iatu_unroll_enabled ? "enabled" : "disabled");
814+
812815
/* set the number of lanes */
813816
val = dw_pcie_readl_rc(pp, PCIE_PORT_LINK_CONTROL);
814817
val &= ~PORT_LINK_MODE_MASK;

0 commit comments

Comments
 (0)