]>
Commit | Line | Data |
---|---|---|
a7de27ff | 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
2445fd08 TL |
2 | From: Thomas Lamprecht <t.lamprecht@proxmox.com> |
3 | Date: Mon, 27 Sep 2021 11:28:39 +0200 | |
a7de27ff | 4 | Subject: [PATCH] Revert "PCI: Coalesce host bridge contiguous apertures" |
4fce1205 TL |
5 | MIME-Version: 1.0 |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
a7de27ff | 8 | |
2445fd08 | 9 | This reverts commit ab20e43b20b60f5cc8e2ea3763ffa388158469ac. |
a7de27ff FG |
10 | |
11 | was reverted upstream because of reports similar to | |
12 | ||
13 | Link: https://bugzilla.proxmox.com/show_bug.cgi?id=3552 | |
14 | Link: https://lore.kernel.org/r/20210709231529.GA3270116@roeck-us.net | |
15 | Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> | |
2445fd08 | 16 | Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com> |
a7de27ff | 17 | --- |
0a77aa18 TL |
18 | drivers/pci/probe.c | 50 ++++----------------------------------------- |
19 | 1 file changed, 4 insertions(+), 46 deletions(-) | |
a7de27ff FG |
20 | |
21 | diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c | |
0a77aa18 | 22 | index cb70d2605e97..258350f80f6c 100644 |
a7de27ff FG |
23 | --- a/drivers/pci/probe.c |
24 | +++ b/drivers/pci/probe.c | |
7ffd90ef | 25 | @@ -20,7 +20,6 @@ |
a7de27ff FG |
26 | #include <linux/irqdomain.h> |
27 | #include <linux/pm_runtime.h> | |
74962917 | 28 | #include <linux/bitfield.h> |
a7de27ff FG |
29 | -#include <linux/list_sort.h> |
30 | #include "pci.h" | |
31 | ||
32 | #define CARDBUS_LATENCY_TIMER 176 /* secondary latency timer */ | |
7ffd90ef | 33 | @@ -881,31 +880,14 @@ static void pci_set_bus_msi_domain(struct pci_bus *bus) |
a7de27ff FG |
34 | dev_set_msi_domain(&bus->dev, d); |
35 | } | |
36 | ||
2445fd08 TL |
37 | -static int res_cmp(void *priv, const struct list_head *a, |
38 | - const struct list_head *b) | |
a7de27ff FG |
39 | -{ |
40 | - struct resource_entry *entry1, *entry2; | |
41 | - | |
42 | - entry1 = container_of(a, struct resource_entry, node); | |
43 | - entry2 = container_of(b, struct resource_entry, node); | |
44 | - | |
45 | - if (entry1->res->flags != entry2->res->flags) | |
46 | - return entry1->res->flags > entry2->res->flags; | |
47 | - | |
48 | - if (entry1->offset != entry2->offset) | |
49 | - return entry1->offset > entry2->offset; | |
50 | - | |
51 | - return entry1->res->start > entry2->res->start; | |
52 | -} | |
53 | - | |
54 | static int pci_register_host_bridge(struct pci_host_bridge *bridge) | |
55 | { | |
56 | struct device *parent = bridge->dev.parent; | |
57 | - struct resource_entry *window, *next, *n; | |
58 | + struct resource_entry *window, *n; | |
59 | struct pci_bus *bus, *b; | |
60 | - resource_size_t offset, next_offset; | |
61 | + resource_size_t offset; | |
62 | LIST_HEAD(resources); | |
63 | - struct resource *res, *next_res; | |
64 | + struct resource *res; | |
65 | char addr[64], *fmt; | |
66 | const char *name; | |
67 | int err; | |
7ffd90ef | 68 | @@ -988,35 +970,11 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge) |
a7de27ff FG |
69 | if (nr_node_ids > 1 && pcibus_to_node(bus) == NUMA_NO_NODE) |
70 | dev_warn(&bus->dev, "Unknown NUMA node; performance will be reduced\n"); | |
71 | ||
72 | - /* Sort and coalesce contiguous windows */ | |
73 | - list_sort(NULL, &resources, res_cmp); | |
74 | - resource_list_for_each_entry_safe(window, n, &resources) { | |
75 | - if (list_is_last(&window->node, &resources)) | |
76 | - break; | |
77 | - | |
78 | - next = list_next_entry(window, node); | |
79 | - offset = window->offset; | |
80 | - res = window->res; | |
81 | - next_offset = next->offset; | |
82 | - next_res = next->res; | |
83 | - | |
84 | - if (res->flags != next_res->flags || offset != next_offset) | |
85 | - continue; | |
86 | - | |
87 | - if (res->end + 1 == next_res->start) { | |
88 | - next_res->start = res->start; | |
89 | - res->flags = res->start = res->end = 0; | |
90 | - } | |
91 | - } | |
92 | - | |
93 | /* Add initial resources to the bus */ | |
94 | resource_list_for_each_entry_safe(window, n, &resources) { | |
0a77aa18 TL |
95 | + list_move_tail(&window->node, &bridge->windows); |
96 | offset = window->offset; | |
97 | res = window->res; | |
a7de27ff FG |
98 | - if (!res->end) |
99 | - continue; | |
100 | - | |
0a77aa18 | 101 | - list_move_tail(&window->node, &bridge->windows); |
a7de27ff FG |
102 | |
103 | if (res->flags & IORESOURCE_BUS) | |
104 | pci_bus_insert_busn_res(bus, bus->number, res->end); |