Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1627961
| From | Yinghai Lu <yinghai@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 06/13] powerpc/PCI: Keep resource idx order with bridge register number |
| Date | 2017-04-21 07:10 +0200 |
| Message-ID | <tyyZs-1MT-19@gated-at.bofh.it> (permalink) |
| References | <tyyZr-1MT-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Same as sparc version.
Make resource with consistent sequence
like other arch or directly from pci_read_bridge_bases(),
even when non-pref mmio is missing, or out of ordering in firmware reporting.
Just hold i = 1 for non pref mmio, and i = 2 for pref mmio.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: linuxppc-dev@lists.ozlabs.org
---
arch/powerpc/kernel/pci_of_scan.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c
index ea3d981..9581e00 100644
--- a/arch/powerpc/kernel/pci_of_scan.c
+++ b/arch/powerpc/kernel/pci_of_scan.c
@@ -252,7 +252,7 @@ void of_scan_pci_bridge(struct pci_dev *dev)
bus->resource[i] = res;
++res;
}
- i = 1;
+ i = 3;
for (; len >= 32; len -= 32, ranges += 8) {
flags = pci_parse_of_flags(of_read_number(ranges, 1), 1);
size = of_read_number(&ranges[6], 2);
@@ -265,6 +265,12 @@ void of_scan_pci_bridge(struct pci_dev *dev)
" for bridge %s\n", node->full_name);
continue;
}
+ } else if ((flags & IORESOURCE_PREFETCH) &&
+ !bus->resource[2]->flags) {
+ res = bus->resource[2];
+ } else if (((flags & (IORESOURCE_MEM | IORESOURCE_PREFETCH)) ==
+ IORESOURCE_MEM) && !bus->resource[1]->flags) {
+ res = bus->resource[1];
} else {
if (i >= PCI_NUM_RESOURCES - PCI_BRIDGE_RESOURCES) {
printk(KERN_ERR "PCI: too many memory ranges"
--
2.9.3
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/13] PCI: sparc related 64bit resource fixup Yinghai Lu <yinghai@kernel.org> - 2017-04-21 07:10 +0200 [PATCH 11/13] PCI: Add has_mem64 for struct host_bridge Yinghai Lu <yinghai@kernel.org> - 2017-04-21 07:10 +0200 [PATCH 12/13] PCI: Only treat non-pref mmio64 as pref if host bridge has mmio64 Yinghai Lu <yinghai@kernel.org> - 2017-04-21 07:10 +0200 [PATCH 05/13] sparc/PCI: Keep resource idx order with bridge register number Yinghai Lu <yinghai@kernel.org> - 2017-04-21 07:10 +0200 [PATCH 09/13] PCI: Check pref compatible bit for mem64 resource of PCIe device Yinghai Lu <yinghai@kernel.org> - 2017-04-21 07:10 +0200 [PATCH 06/13] powerpc/PCI: Keep resource idx order with bridge register number Yinghai Lu <yinghai@kernel.org> - 2017-04-21 07:10 +0200 [PATCH 07/13] powerpc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsing Yinghai Lu <yinghai@kernel.org> - 2017-04-21 07:10 +0200 [PATCH 02/13] PCI: Add pci_find_bus_resource() Yinghai Lu <yinghai@kernel.org> - 2017-04-21 07:10 +0200 [PATCH 10/13] PCI: Only treat non-pref mmio64 as pref if all bridges have MEM_64 Yinghai Lu <yinghai@kernel.org> - 2017-04-21 07:10 +0200 [PATCH 01/13] sparc/PCI: Use correct offset for bus address to resource Yinghai Lu <yinghai@kernel.org> - 2017-04-21 07:10 +0200 [PATCH 03/13] sparc/PCI: Reserve legacy mmio after PCI mmio Yinghai Lu <yinghai@kernel.org> - 2017-04-21 07:10 +0200 [PATCH 13/13] PCI: Restore pref MMIO allocation logic for host bridge without mmio64 Yinghai Lu <yinghai@kernel.org> - 2017-04-21 07:10 +0200
csiph-web