linux-stable/drivers
Nicholas Johnson f924c26e4e PCI: Consider alignment of hot-added bridges when assigning resources
Change pci_bus_distribute_available_resources() to better handle bridges
with different resource alignment requirements.

The arguments io, mmio and mmio_pref represent the start and end
addresses of resource, into which we must fit the current bridge window.

The steps taken by pci_bus_distribute_available_resources():

  - For io, mmio and mmio_pref, increase .start to align with the alignment
    of the current bridge window (otherwise the current bridge window may
    not fit within the available range).

  - For io, mmio and mmio_pref, adjust the current bridge window to the
    size after the above.

  - Count the number of hotplug bridges and normal bridges on this bus.

  - If the total number of bridges is one, give that bridge all of the
    resources and return.

  - If there are no hotplug bridges, return.

  - For io, mmio and mmio_pref, increase .start by the amount required for
    each bridge resource on the bus for non hotplug bridges, giving extra
    room to make up for alignment of those resources.

  - For io, mmio and mmio_pref, calculate the resource size per hotplug
    bridge which is available after the previous steps.

  - For io, mmio and mmio_pref, distribute the resources to each hotplug
    bridge, with the sizes calculated above.

The motivation for fixing this is enabling devices that require greater
than 1MB alignment. This fixes the case where the user hot-adds devices
with BAR alignment >1MB and Linux fails to assign resources to it.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=199581
Link: https://lore.kernel.org/r/PSXP216MB0438C2BFD0FD3691ED9C83F4803C0@PSXP216MB0438.KORP216.PROD.OUTLOOK.COM
Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Nicholas Johnson <nicholas.johnson-opensource@outlook.com.au>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2020-01-29 16:57:28 -06:00
..
accessibility
acpi Additional ACPI updates for 5.5-rc1 2019-12-04 10:56:35 -08:00
amba
android compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
ata pci-v5.5-changes 2019-12-03 13:58:22 -08:00
atm
auxdisplay auxdisplay: charlcd: deduplicate simple_strtoul() 2019-12-04 19:44:12 -08:00
base ARM: SoC-related driver updates 2019-12-05 11:43:31 -08:00
bcma
block xen: branch for v5.5-rc1 2019-12-07 14:49:20 -08:00
bluetooth Bluetooth: btbcm: Use the BDADDR_PROPERTY quirk 2019-11-22 13:35:20 +01:00
bus Few ti-sysc related fixes for v5.5 merge window 2019-12-06 08:26:50 -08:00
cdrom cdrom: respect device capabilities during opening action 2019-11-26 13:02:24 -07:00
char drm msm + fixes for 5.5-rc1 2019-12-06 10:28:09 -08:00
clk ARM: SoC platform updates 2019-12-05 11:38:40 -08:00
clocksource Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-12-03 12:20:25 -08:00
connector
counter
cpufreq cpufreq: tegra: Changes for v5.5-rc1 2019-12-06 08:28:13 -08:00
cpuidle cpuidle: minor Kconfig help text fixes 2019-11-29 11:49:32 +01:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2019-12-02 17:23:21 -08:00
dax libnvdimm for 5.5 2019-12-01 18:43:25 -08:00
dca
devfreq PM / devfreq: Add missing locking while setting suspend_freq 2019-11-29 12:50:34 +01:00
dio
dma dmaengine: Fix Kconfig indentation 2019-11-22 11:16:26 +05:30
dma-buf compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
edac EDAC/altera: Use the Altera System Manager driver 2019-11-22 10:18:29 +01:00
eisa
extcon Char/Misc driver patches for 5.5-rc1 2019-11-27 10:53:50 -08:00
firewire FireWire (IEEE 1394) subsystem updates: 2019-12-02 14:13:00 -08:00
firmware ARM: SoC fixes 2019-12-06 14:19:37 -08:00
fpga
fsi
gnss
gpio gpio: pca953x: tighten up indentation 2019-12-04 19:44:14 -08:00
gpu drm msm + fixes for 5.5-rc1 2019-12-06 10:28:09 -08:00
greybus
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid 2019-12-01 18:20:54 -08:00
hsi
hv Merge branch 'akpm' (patches from Andrew) 2019-12-01 20:36:41 -08:00
hwmon compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
hwspinlock
hwtracing compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
i2c Merge branch 'i2c/for-5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2019-12-01 18:29:36 -08:00
i3c
ide compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
idle cpuidle: Drop disabled field from struct cpuidle_state 2019-11-29 11:48:39 +01:00
iio chrome platform changes for v5.5 2019-12-03 14:37:12 -08:00
infiniband net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup 2019-12-04 12:27:13 -08:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2019-12-07 18:33:01 -08:00
interconnect
iommu pci-v5.5-changes 2019-12-03 13:58:22 -08:00
ipack
irqchip pci-v5.5-changes 2019-12-03 13:58:22 -08:00
isdn compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
leds Merge tag 'leds-5.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds 2019-12-01 16:09:28 -08:00
lightnvm
macintosh powerpc updates for 5.5 2019-11-30 14:35:43 -08:00
mailbox mailbox changes for v5.5 2019-12-01 18:42:02 -08:00
mcb
md block: don't handle bio based drivers in blk_revalidate_disk_zones 2019-12-03 08:51:25 -07:00
media compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
memory memory: tegra: Fixes for v5.5-rc1 2019-12-06 08:28:51 -08:00
memstick pci-v5.5-changes 2019-12-03 13:58:22 -08:00
message
mfd chrome platform changes for v5.5 2019-12-03 14:37:12 -08:00
misc lib/genalloc.c: rename addr_in_gen_pool to gen_pool_has_addr 2019-12-04 19:44:13 -08:00
mmc Driver core patches for 5.5-rc1 2019-11-27 11:06:20 -08:00
mtd TTY/Serial patches for 5.5-rc1 2019-12-03 14:09:14 -08:00
mux
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-08 13:28:11 -08:00
nfc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-11-22 16:27:24 -08:00
ntb Add Hygon Device ID to the AMD NTB device driver 2019-12-07 18:38:17 -08:00
nubus
nvdimm libnvdimm for 5.5 2019-12-01 18:43:25 -08:00
nvme pci-v5.5-changes 2019-12-03 13:58:22 -08:00
nvmem ARM: SoC-related driver updates 2019-12-05 11:43:31 -08:00
of Devicetree updates for v5.5: 2019-12-02 11:41:35 -08:00
opp
oprofile Printk changes for 5.5 2019-11-25 19:40:40 -08:00
parisc
parport
pci PCI: Consider alignment of hot-added bridges when assigning resources 2020-01-29 16:57:28 -06:00
pcmcia pcmcia: remove unused dprintk definition 2019-11-22 07:03:45 +01:00
perf
phy ARM: SoC-related driver updates 2019-12-05 11:43:31 -08:00
pinctrl Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-12-03 09:29:50 -08:00
platform chrome platform changes for v5.5 2019-12-03 14:37:12 -08:00
pnp
power Additional power management updates for 5.5-rc1 2019-12-04 10:48:09 -08:00
powercap
pps
ps3
ptp
pwm pwm: Changes for v5.5-rc1 2019-12-05 11:28:14 -08:00
rapidio drivers/rapidio/rio-access.c: fix missing include of <linux/rio_drv.h> 2019-12-04 19:44:13 -08:00
ras
regulator Merge branch 'regulator-5.5' into regulator-next 2019-11-22 19:56:20 +00:00
remoteproc
reset ARM: SoC-related driver updates 2019-12-05 11:43:31 -08:00
rpmsg rpmsg updates for v5.5 2019-12-01 18:39:24 -08:00
rtc RTC for 5.5 2019-12-03 13:31:08 -08:00
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-08 13:28:11 -08:00
sbus
scsi SCSI misc on 20191207 2019-12-08 12:23:42 -08:00
sfi
sh
siox
slimbus
soc ARM: SoC fixes 2019-12-06 14:19:37 -08:00
soundwire
spi Merge branch 'spi-5.5' into spi-next 2019-11-22 19:56:35 +00:00
spmi
ssb
staging pci-v5.5-changes 2019-12-03 13:58:22 -08:00
target SCSI misc on 20191130 2019-12-02 13:37:02 -08:00
tc
tee Merge mainline/master into arm/fixes 2019-12-05 13:18:54 -08:00
thermal Merge branch 'thermal/next' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux 2019-12-05 11:21:24 -08:00
thunderbolt
tty TTY/Serial patches for 5.5-rc1 2019-12-03 14:09:14 -08:00
uio
usb usb, kcov: collect coverage from hub_event 2019-12-04 19:44:14 -08:00
vfio VFIO updates for v5.5-rc1 2019-12-07 14:51:04 -08:00
vhost Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-08 13:28:11 -08:00
video pci-v5.5-changes 2019-12-03 13:58:22 -08:00
virt compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
virtio
visorbus
vlynq
vme
w1
watchdog linux-watchdog 5.5-rc1 tag 2019-12-01 18:01:03 -08:00
xen xen: branch for v5.5-rc1 2019-12-07 14:49:20 -08:00
zorro
Kconfig
Makefile