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

Pull pci fix from Bjorn Helgaas:
"Revert the attempt to distribute spare resources to unconfigured
hotplug bridges at boot time.

This fixed some dock hot-add scenarios, but Jonathan Cameron reported
that it broke a topology with a multi-function device where one
function was a Switch Upstream Port and the other was an Endpoint"

* tag 'pci-v6.1-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
Revert "PCI: Distribute available resources for root buses, too"

+1 -61
+1 -61
drivers/pci/setup-bus.c
··· 1768 1768 } 1769 1769 1770 1770 res->end = res->start + new_size - 1; 1771 - 1772 - /* If the resource is part of the add_list remove it now */ 1773 - if (add_list) 1774 - remove_from_list(add_list, res); 1771 + remove_from_list(add_list, res); 1775 1772 } 1776 1773 1777 1774 static void pci_bus_distribute_available_resources(struct pci_bus *bus, ··· 1923 1926 if (!bridge->is_hotplug_bridge) 1924 1927 return; 1925 1928 1926 - pci_dbg(bridge, "distributing available resources\n"); 1927 - 1928 1929 /* Take the initial extra resources from the hotplug port */ 1929 1930 available_io = bridge->resource[PCI_BRIDGE_IO_WINDOW]; 1930 1931 available_mmio = bridge->resource[PCI_BRIDGE_MEM_WINDOW]; ··· 1932 1937 add_list, available_io, 1933 1938 available_mmio, 1934 1939 available_mmio_pref); 1935 - } 1936 - 1937 - static bool pci_bridge_resources_not_assigned(struct pci_dev *dev) 1938 - { 1939 - const struct resource *r; 1940 - 1941 - /* 1942 - * Check the child device's resources and if they are not yet 1943 - * assigned it means we are configuring them (not the boot 1944 - * firmware) so we should be able to extend the upstream 1945 - * bridge's (that's the hotplug downstream PCIe port) resources 1946 - * in the same way we do with the normal hotplug case. 1947 - */ 1948 - r = &dev->resource[PCI_BRIDGE_IO_WINDOW]; 1949 - if (!r->flags || !(r->flags & IORESOURCE_STARTALIGN)) 1950 - return false; 1951 - r = &dev->resource[PCI_BRIDGE_MEM_WINDOW]; 1952 - if (!r->flags || !(r->flags & IORESOURCE_STARTALIGN)) 1953 - return false; 1954 - r = &dev->resource[PCI_BRIDGE_PREF_MEM_WINDOW]; 1955 - if (!r->flags || !(r->flags & IORESOURCE_STARTALIGN)) 1956 - return false; 1957 - 1958 - return true; 1959 - } 1960 - 1961 - static void pci_root_bus_distribute_available_resources(struct pci_bus *bus, 1962 - struct list_head *add_list) 1963 - { 1964 - struct pci_dev *dev, *bridge = bus->self; 1965 - 1966 - for_each_pci_bridge(dev, bus) { 1967 - struct pci_bus *b; 1968 - 1969 - b = dev->subordinate; 1970 - if (!b) 1971 - continue; 1972 - 1973 - /* 1974 - * Need to check "bridge" here too because it is NULL 1975 - * in case of root bus. 1976 - */ 1977 - if (bridge && pci_bridge_resources_not_assigned(dev)) { 1978 - pci_bridge_distribute_available_resources(bridge, add_list); 1979 - /* 1980 - * There is only PCIe upstream port on the bus 1981 - * so we don't need to go futher. 1982 - */ 1983 - return; 1984 - } 1985 - 1986 - pci_root_bus_distribute_available_resources(b, add_list); 1987 - } 1988 1940 } 1989 1941 1990 1942 /* ··· 1972 2030 * Depth first, calculate sizes and alignments of all subordinate buses. 1973 2031 */ 1974 2032 __pci_bus_size_bridges(bus, add_list); 1975 - 1976 - pci_root_bus_distribute_available_resources(bus, add_list); 1977 2033 1978 2034 /* Depth last, allocate resources and update the hardware. */ 1979 2035 __pci_bus_assign_resources(bus, add_list, &fail_head);