pci-v5.14-fixes-1

-----BEGIN PGP SIGNATURE-----
 
 iQJIBAABCgAyFiEEgMe7l+5h9hnxdsnuWYigwDrT+vwFAmDo4z0UHGJoZWxnYWFz
 QGdvb2dsZS5jb20ACgkQWYigwDrT+vxjuBAAoqQAxO4XXTnd3TWJ3CUKD6mziHxA
 58jTRJ8YtaOTKFXBmN/6ILWbWsNQmVjBQFE5tDhQneXdeLxyBqSwD7ZCKEEbmoUV
 C1OVf7ao5RBOqwLnWDpNyDQ0fpGtRJ+u+vTKtcOJwNGvIpxAVvlH7fdJBp1lUipV
 zdvTF6CjU+/M4xxzgQqWBj6l+y59lph2Dli/N3RTaWJGt1ehv2rdwXoFodV/sdjz
 iQ4Go+LBPumy1p2kHPDXYnvhpUo7Ze4tj3MzopG0qtQ+FzrwMDwMe9icC8lbUSq4
 JRccAvlFTHoUxur9Now4Q/BSOpoxVkZwSuzyhftMv5xA+zwsXRTG+8HtcoQT7VEC
 8eHyTCO0NlVYF+GEUpWuyUwvf9VxdG3iHQd7FVXCR3PV/Zy0AV0BasG1MiwTu6nt
 jGE092GztSM0ffocoJsglFftYZHNS66w3JgYVjaU6Cy1i5QcGIdgliX8W3bwOPKD
 ingGOiN4YOHhlVy+4pfGw1r3DGoduaeClxq50e4juVteFaUBrodebPVTWw2JZyfv
 +tAjWY4pU3A1CzG3/MHOhpHWf5RJYiihC17Gpoq5JOlTnUwaWjdohBK00bVNzaPr
 RNpxNjEDH5ksrKLFb59DqY4x64dwifRB0nmTYVFfFa5eEnJtF7vyWsjFkwuHJX4/
 3gonyKOwdu+g6Co=
 =qFea
 -----END PGP SIGNATURE-----

Merge tag 'pci-v5.14-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci

Pull pci fix from Bjorn Helgaas:
 "Revert host bridge window patch that fixed HP EliteDesk 805 G6, but
  broke ppc:sam460ex (Bjorn Helgaas)"

* tag 'pci-v5.14-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
  Revert "PCI: Coalesce host bridge contiguous apertures"
This commit is contained in:
Linus Torvalds 2021-07-10 11:57:57 -07:00
commit 67d8d36564

View File

@ -19,7 +19,6 @@
#include <linux/hypervisor.h>
#include <linux/irqdomain.h>
#include <linux/pm_runtime.h>
#include <linux/list_sort.h>
#include "pci.h"
#define CARDBUS_LATENCY_TIMER 176 /* secondary latency timer */
@ -875,31 +874,14 @@ static void pci_set_bus_msi_domain(struct pci_bus *bus)
dev_set_msi_domain(&bus->dev, d);
}
static int res_cmp(void *priv, const struct list_head *a,
const struct list_head *b)
{
struct resource_entry *entry1, *entry2;
entry1 = container_of(a, struct resource_entry, node);
entry2 = container_of(b, struct resource_entry, node);
if (entry1->res->flags != entry2->res->flags)
return entry1->res->flags > entry2->res->flags;
if (entry1->offset != entry2->offset)
return entry1->offset > entry2->offset;
return entry1->res->start > entry2->res->start;
}
static int pci_register_host_bridge(struct pci_host_bridge *bridge)
{
struct device *parent = bridge->dev.parent;
struct resource_entry *window, *next, *n;
struct resource_entry *window, *n;
struct pci_bus *bus, *b;
resource_size_t offset, next_offset;
resource_size_t offset;
LIST_HEAD(resources);
struct resource *res, *next_res;
struct resource *res;
char addr[64], *fmt;
const char *name;
int err;
@ -979,35 +961,11 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge)
if (nr_node_ids > 1 && pcibus_to_node(bus) == NUMA_NO_NODE)
dev_warn(&bus->dev, "Unknown NUMA node; performance will be reduced\n");
/* Sort and coalesce contiguous windows */
list_sort(NULL, &resources, res_cmp);
resource_list_for_each_entry_safe(window, n, &resources) {
if (list_is_last(&window->node, &resources))
break;
next = list_next_entry(window, node);
offset = window->offset;
res = window->res;
next_offset = next->offset;
next_res = next->res;
if (res->flags != next_res->flags || offset != next_offset)
continue;
if (res->end + 1 == next_res->start) {
next_res->start = res->start;
res->flags = res->start = res->end = 0;
}
}
/* Add initial resources to the bus */
resource_list_for_each_entry_safe(window, n, &resources) {
list_move_tail(&window->node, &bridge->windows);
offset = window->offset;
res = window->res;
if (!res->end)
continue;
list_move_tail(&window->node, &bridge->windows);
if (res->flags & IORESOURCE_BUS)
pci_bus_insert_busn_res(bus, bus->number, res->end);