summaryrefslogtreecommitdiff
path: root/drivers/pci/controller/dwc/pcie-designware-host.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2020-11-17 22:23:05 +0100
committerLinus Walleij <linus.walleij@linaro.org>2020-11-17 22:23:05 +0100
commitad9a72f9c6fd3998f0080701f1cc1f43a4317b7c (patch)
treedd53a560a1523f5dcd9823b29ae92bdcc0b7da4d /drivers/pci/controller/dwc/pcie-designware-host.c
parentb9bf97105f4b9adc32604d24072147b242564fb3 (diff)
parent09162bc32c880a791c6c0668ce0745cf7958f576 (diff)
Merge tag 'v5.10-rc4' into devel
Linux 5.10-rc4
Diffstat (limited to 'drivers/pci/controller/dwc/pcie-designware-host.c')
-rw-r--r--drivers/pci/controller/dwc/pcie-designware-host.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
index 674f32db85ca..44c2a6572199 100644
--- a/drivers/pci/controller/dwc/pcie-designware-host.c
+++ b/drivers/pci/controller/dwc/pcie-designware-host.c
@@ -586,8 +586,12 @@ void dw_pcie_setup_rc(struct pcie_port *pp)
* ATU, so we should not program the ATU here.
*/
if (pp->bridge->child_ops == &dw_child_pcie_ops) {
- struct resource_entry *entry =
- resource_list_first_type(&pp->bridge->windows, IORESOURCE_MEM);
+ struct resource_entry *tmp, *entry = NULL;
+
+ /* Get last memory resource entry */
+ resource_list_for_each_entry(tmp, &pp->bridge->windows)
+ if (resource_type(tmp->res) == IORESOURCE_MEM)
+ entry = tmp;
dw_pcie_prog_outbound_atu(pci, PCIE_ATU_REGION_INDEX0,
PCIE_ATU_TYPE_MEM, entry->res->start,