]> git.proxmox.com Git - pve-kernel.git/blame - patches/kernel/0006-Revert-PCI-Coalesce-host-bridge-contiguous-apertures.patch
update submodule to Ubuntu-5.15.0-48.54 and rebase patches
[pve-kernel.git] / patches / kernel / 0006-Revert-PCI-Coalesce-host-bridge-contiguous-apertures.patch
CommitLineData
a7de27ff 1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2445fd08
TL
2From: Thomas Lamprecht <t.lamprecht@proxmox.com>
3Date: Mon, 27 Sep 2021 11:28:39 +0200
a7de27ff 4Subject: [PATCH] Revert "PCI: Coalesce host bridge contiguous apertures"
4fce1205
TL
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
a7de27ff 8
2445fd08 9This reverts commit ab20e43b20b60f5cc8e2ea3763ffa388158469ac.
a7de27ff
FG
10
11was reverted upstream because of reports similar to
12
13Link: https://bugzilla.proxmox.com/show_bug.cgi?id=3552
14Link: https://lore.kernel.org/r/20210709231529.GA3270116@roeck-us.net
15Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2445fd08 16Signed-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
21diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
96f7973c 22index 4f26c222f5f2..c0abe906b84e 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);