diff options
Diffstat (limited to 'drivers/pci/setup-bus.c')
-rw-r--r-- | drivers/pci/setup-bus.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index d533102b2788..ee5be219dd41 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c | |||
@@ -1866,16 +1866,6 @@ static void pci_bus_distribute_available_resources(struct pci_bus *bus, | |||
1866 | available_mmio_pref); | 1866 | available_mmio_pref); |
1867 | 1867 | ||
1868 | /* | 1868 | /* |
1869 | * Calculate the total amount of extra resource space we can | ||
1870 | * pass to bridges below this one. This is basically the | ||
1871 | * extra space reduced by the minimal required space for the | ||
1872 | * non-hotplug bridges. | ||
1873 | */ | ||
1874 | remaining_io = available_io; | ||
1875 | remaining_mmio = available_mmio; | ||
1876 | remaining_mmio_pref = available_mmio_pref; | ||
1877 | |||
1878 | /* | ||
1879 | * Calculate how many hotplug bridges and normal bridges there | 1869 | * Calculate how many hotplug bridges and normal bridges there |
1880 | * are on this bus. We will distribute the additional available | 1870 | * are on this bus. We will distribute the additional available |
1881 | * resources between hotplug bridges. | 1871 | * resources between hotplug bridges. |
@@ -1887,6 +1877,31 @@ static void pci_bus_distribute_available_resources(struct pci_bus *bus, | |||
1887 | normal_bridges++; | 1877 | normal_bridges++; |
1888 | } | 1878 | } |
1889 | 1879 | ||
1880 | /* | ||
1881 | * There is only one bridge on the bus so it gets all available | ||
1882 | * resources which it can then distribute to the possible hotplug | ||
1883 | * bridges below. | ||
1884 | */ | ||
1885 | if (hotplug_bridges + normal_bridges == 1) { | ||
1886 | dev = list_first_entry(&bus->devices, struct pci_dev, bus_list); | ||
1887 | if (dev->subordinate) { | ||
1888 | pci_bus_distribute_available_resources(dev->subordinate, | ||
1889 | add_list, available_io, available_mmio, | ||
1890 | available_mmio_pref); | ||
1891 | } | ||
1892 | return; | ||
1893 | } | ||
1894 | |||
1895 | /* | ||
1896 | * Calculate the total amount of extra resource space we can | ||
1897 | * pass to bridges below this one. This is basically the | ||
1898 | * extra space reduced by the minimal required space for the | ||
1899 | * non-hotplug bridges. | ||
1900 | */ | ||
1901 | remaining_io = available_io; | ||
1902 | remaining_mmio = available_mmio; | ||
1903 | remaining_mmio_pref = available_mmio_pref; | ||
1904 | |||
1890 | for_each_pci_bridge(dev, bus) { | 1905 | for_each_pci_bridge(dev, bus) { |
1891 | const struct resource *res; | 1906 | const struct resource *res; |
1892 | 1907 | ||
@@ -1911,21 +1926,6 @@ static void pci_bus_distribute_available_resources(struct pci_bus *bus, | |||
1911 | } | 1926 | } |
1912 | 1927 | ||
1913 | /* | 1928 | /* |
1914 | * There is only one bridge on the bus so it gets all available | ||
1915 | * resources which it can then distribute to the possible hotplug | ||
1916 | * bridges below. | ||
1917 | */ | ||
1918 | if (hotplug_bridges + normal_bridges == 1) { | ||
1919 | dev = list_first_entry(&bus->devices, struct pci_dev, bus_list); | ||
1920 | if (dev->subordinate) { | ||
1921 | pci_bus_distribute_available_resources(dev->subordinate, | ||
1922 | add_list, available_io, available_mmio, | ||
1923 | available_mmio_pref); | ||
1924 | } | ||
1925 | return; | ||
1926 | } | ||
1927 | |||
1928 | /* | ||
1929 | * Go over devices on this bus and distribute the remaining | 1929 | * Go over devices on this bus and distribute the remaining |
1930 | * resource space between hotplug bridges. | 1930 | * resource space between hotplug bridges. |
1931 | */ | 1931 | */ |