Hi,
This series generalizes resource placement algorithm. The commit
9036bd0efcb6 ("PCI: Align head space better") special cased one
composite resource remainder case to fix a regression (in a long chain
of regression fixes). Unfortunately, it introduced another regression
(or a few, to be more accurate).
Instead of building more special tricks, generalize the PCI resource
placement algorithm so it returns placements that gives better chances
for the greedy assignment algorithm to find suitable space for
subsequent assignments.
In short words, the new approach tries to find a placement for the
current resource that blocks as little of the free space range as
possible, considering both alignment and continuous free span of the
remaining free space.
In addition, the series corrects composite resource sizing to account
for gaps that have to be added due to alignment constaints and
remainder space not fully connecting (filling space all the way to
the bridge window align).
More detailed explanations in the patches themselves.
Unfortunately, this also causes yet another regression due to shuffling
resources around, even if the resulting arrangement seems just as valid
as any other (see the workaround quirk in the patch 5 for more details).
Ilpo Järvinen (5):
resource: Mark free space assigned
PCI: Fix nesting windows with remainder at the left edge
PCI: Place resources to either edge of the window
PCI: Fix composite resource sizing
PCI/quirks: Avoid certain BAR 0 address with igb
drivers/pci/pci.h | 4 +
drivers/pci/quirks.c | 56 +++++++++++
drivers/pci/setup-bus.c | 83 ++++++++++++++--
drivers/pci/setup-res.c | 207 +++++++++++++++++++++++++++++++++++-----
kernel/resource.c | 1 +
5 files changed, 322 insertions(+), 29 deletions(-)
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
--
2.47.3