diff options
| author | Niklas Cassel <niklas.cassel@axis.com> | 2016-10-14 17:54:55 -0400 |
|---|---|---|
| committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-11-04 16:28:55 -0400 |
| commit | 416379f9ebded501eda882e6af0a7aafc1866700 (patch) | |
| tree | 7354377d7649f6e9d3bb5104593deddb9fc1ad92 | |
| parent | ad110449e285c75eb53357e87419a73c96ccb1b9 (diff) | |
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: a0601a470537 ("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>
| -rw-r--r-- | drivers/pci/host/pcie-designware.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c index 035f50c03281..bed19994c1e9 100644 --- a/drivers/pci/host/pcie-designware.c +++ b/drivers/pci/host/pcie-designware.c | |||
| @@ -637,8 +637,6 @@ int dw_pcie_host_init(struct pcie_port *pp) | |||
| 637 | } | 637 | } |
| 638 | } | 638 | } |
| 639 | 639 | ||
| 640 | pp->iatu_unroll_enabled = dw_pcie_iatu_unroll_enabled(pp); | ||
| 641 | |||
| 642 | if (pp->ops->host_init) | 640 | if (pp->ops->host_init) |
| 643 | pp->ops->host_init(pp); | 641 | pp->ops->host_init(pp); |
| 644 | 642 | ||
| @@ -809,6 +807,11 @@ void dw_pcie_setup_rc(struct pcie_port *pp) | |||
| 809 | { | 807 | { |
| 810 | u32 val; | 808 | u32 val; |
| 811 | 809 | ||
| 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 | |||
| 812 | /* set the number of lanes */ | 815 | /* set the number of lanes */ |
| 813 | val = dw_pcie_readl_rc(pp, PCIE_PORT_LINK_CONTROL); | 816 | val = dw_pcie_readl_rc(pp, PCIE_PORT_LINK_CONTROL); |
| 814 | val &= ~PORT_LINK_MODE_MASK; | 817 | val &= ~PORT_LINK_MODE_MASK; |
