PCI: pci_resource_alignment() improvement + cleanups
Status from this message: Applied to pci/resource for v7.2, thanks!
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/11 | PCI: Log all resource claimsdrivers/ | +2 | 0 replies | |
| 2/11 | PCI: Rename added to add_listdrivers/ drivers/ | +14 | 0 replies | |
| 3/11 | PCI: Consolidate add_list (aka realloc_head) empty sanity checksdrivers/ | +17 | 0 replies | |
| 4/11 | PCI: Remove const removal castdrivers/ | +2 | 0 replies | |
| 5/11 | resource: Make resource_alignment() input const resourceinclude/ kernel/ | +2 | 0 replies | |
| 6/11 | powerpc/pseries: Make pseries_get_iov_fw_value() & pnv_iov_get() pci_dev constarch/ arch/ | +3 | 0 replies | |
| 7/11 | PCI: Make pci_sriov_resource_alignment() pci_dev constarch/ arch/ arch/ +5 more | +19 | 0 replies | |
| 8/11 | PCI: Convert pci_resource_alignment() input parameters to constdrivers/ drivers/ | +5 | 0 replies | |
| 9/11 | PCI: Move pci_resource_alignment() to setup-res.c filedrivers/ drivers/ | +14 | 0 replies | |
| 10/11 | PCI: Lower bound bridge window alignmentdrivers/ | +11 | 2 replies | |
| 11/11 | PCI: Return valid alignment for assigned resourcesdrivers/ | +13 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 00/11] PCI: pci_resource_alignment() improvement + cleanups
pci_resource_alignment() returns 0 when resource is already assigned and in case of disabled bridge windows. This has caused problems to calculations relying on pci_resource_alignment():
This series reworks pci_resource_alignment() interface to return always non-zero alignment if the resource exists. For assigned bridge windows, the calculation is using heuristic based on size and start address alignment as calculating the alignment again is costly (would require sizing the entire sub-hierarchy).
As pci_resource_alignment() is becoming more complicated, it's also moved to setup-res.c. While moving pci_resource_alignment()'s arguments are converted into const to tell compiler it can rely on resource remaining the same across the call.
This was intended to be part of a larger series that addresses some shortcomings in pci=realloc. The pci=realloc changes will recalculate bridge window sizes considering also assigned resources which required making these changes to pci_resource_alignment().
As this also relates to the issue linked above, I'm sending it already now without pci=realloc changes that are still incomplete. The first patches originate from the large pci=realloc work but seem generally useful even if independent of the alignment improvements so I've included them here without reorganizing the series to contain only alignment related changes.
Ilpo Järvinen (11):
PCI: Log all resource claims
PCI: Rename added to add_list
PCI: Consolidate add_list (aka realloc_head) empty sanity checks
PCI: Remove const removal cast
resource: Make resource_alignment() input const resource powerpc/pseries: Make pseries_get_iov_fw_value() & pnv_iov_get()
pci_dev const
PCI: Make pci_sriov_resource_alignment() pci_dev const
PCI: Convert pci_resource_alignment() input parameters to const
PCI: Move pci_resource_alignment() to setup-res.c file
PCI: Lower bound bridge windown alignment
PCI: Return valid alignment for assigned resources
arch/powerpc/include/asm/machdep.h | 2 +- arch/powerpc/kernel/pci-common.c | 2 +- arch/powerpc/platforms/powernv/pci-sriov.c | 4 +- arch/powerpc/platforms/powernv/pci.h | 5 ++- arch/powerpc/platforms/pseries/setup.c | 5 ++- drivers/pci/iov.c | 7 +-- drivers/pci/pci.h | 24 ++++------- drivers/pci/setup-bus.c | 50 ++++++++++++---------- drivers/pci/setup-cardbus.c | 2 +- drivers/pci/setup-res.c | 37 ++++++++++++++++ include/linux/ioport.h | 2 +- include/linux/pci.h | 8 ++-- kernel/resource.c | 2 +- 13 files changed, 94 insertions(+), 56 deletions(-)
base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
Signature · 1 line
2.39.5