PCI: Resource allocation cleanup for v4.7
Status from this message: I applied these first two patches to pci/resource for v4.7.
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v11 Latest60 patches 25 repliesApplied
- v1059 patches 17 repliesSuperseded
- v960 patches 0 repliesSuperseded
Earlier versions · 8
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v8 | 61 patches | 8 replies | Superseded | |
| v7 | 60 patches | 40 replies | Superseded | |
| v6 | 53 patches | 5 replies | Superseded | |
| v5 | 53 patches | 2 replies | Superseded | |
| v4 | 52 patches | 10 replies | Superseded | |
| v3 | 51 patches | 29 replies | Superseded | |
| v2 | 49 patches | 2 replies | Superseded | |
| v1 | 36 patches | 14 replies | Superseded |
Patches in v11 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/60 | PCI: Fix iomem_is_exclusive() checking in pci_mmap_resource()drivers/ | +3 | 0 replies | |
| 2/60 | alpha/PCI: Only check iomem_is_exclusive() for IORESOURCE_MEM, not IORESOURCE_IOarch/ | +2 | 1 reply | |
| 3/60 | PCI: Add pci_find_bus_resource()drivers/ include/ | +18 | 0 replies | |
| 4/60 | sparc/PCI: Use correct offset for bus address to resourcearch/ arch/ arch/ | +54 | 19 replies | |
| 5/60 | sparc/PCI: Reserve legacy mmio after PCI mmioarch/ arch/ arch/ | +33 | 0 replies | |
| 6/60 | sparc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsingarch/ arch/ | +6 | 0 replies | |
| 7/60 | sparc/PCI: Keep resource idx order with bridge register numberarch/ | +7 | 0 replies | |
| 8/60 | PCI: Kill wrong quirk about M7101drivers/ | +0 | 0 replies | |
| 9/60 | powerpc/PCI: Keep resource idx order with bridge register numberarch/ | +7 | 0 replies | |
| 10/60 | powerpc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsingarch/ | +3 | 0 replies | |
| 11/60 | OF/PCI: Add IORESOURCE_MEM_64 for 64-bit resourcedrivers/ | +3 | 0 replies | |
| 12/60 | PCI: Check pref compatible bit for mem64 resource of PCIe devicearch/ arch/ drivers/ +5 more | +67 | 0 replies | |
| 13/60 | PCI: Only treat non-pref mmio64 as pref if all bridges have MEM_64drivers/ | +29 | 0 replies | |
| 14/60 | PCI: Add has_mem64 for struct host_bridgedrivers/ include/ | +8 | 0 replies | |
| 15/60 | PCI: Only treat non-pref mmio64 as pref if host bridge has mmio64drivers/ | +1 | 0 replies | |
| 16/60 | PCI: Restore pref MMIO allocation logic for host bridge without mmio64drivers/ drivers/ drivers/ | +18 | 0 replies | |
| 17/60 | PCI: Don't release fixed resource for reallocdrivers/ include/ kernel/ | +31 | 0 replies | |
| 18/60 | PCI: Claim fixed resource during remove/rescan pathdrivers/ | +17 | 0 replies | |
| 19/60 | PCI: Set resource to FIXED for LSI devicesdrivers/ drivers/ drivers/ | +25 | 0 replies | |
| 20/60 | PCI: Separate realloc list checking after allocationdrivers/ drivers/ drivers/ | +11 | 0 replies | |
| 21/60 | PCI: Treat optional as required in first try for bridge rescandrivers/ | +14 | 0 replies | |
| 22/60 | PCI: Get new realloc size for bridge for last trydrivers/ | +21 | 0 replies | |
| 23/60 | PCI: Don't release sibling bridge resources during hotplugdrivers/ | +8 | 0 replies | |
| 24/60 | PCI: Cleanup res_to_dev_res() printoutdrivers/ | +20 | 0 replies | |
| 25/60 | PCI: Reuse res_to_dev_res() in reassign_resources_sorted()drivers/ | +1 | 0 replies | |
| 26/60 | PCI: Use correct align for optional only resources during sortingdrivers/ | +42 | 0 replies | |
| 27/60 | PCI: Optimize bus min_align/size calculation during sizingdrivers/ | +157 | 0 replies | |
| 28/60 | PCI: Optimize bus align/size calculation for optional during sizingdrivers/ | +51 | 0 replies | |
| 29/60 | PCI: Don't add too much optional size for hotplug bridge MMIOdrivers/ | +15 | 0 replies | |
| 30/60 | PCI: Reorder resources list for required/optional resourcesdrivers/ | +37 | 0 replies | |
| 31/60 | PCI: Remove duplicated code for resource sortingdrivers/ | +3 | 0 replies | |
| 32/60 | PCI: Rename pdev_sort_resources() to pdev_assign_resources_prepare()drivers/ | +6 | 0 replies | |
| 33/60 | PCI: Treat ROM resource as optional during reallocdrivers/ | +20 | 0 replies | |
| 34/60 | PCI: Add debug printout during releasing partial assigned resourcesdrivers/ | +11 | 0 replies | |
| 35/60 | PCI: Simplify res reference using in __assign_resources_sorted()drivers/ | +16 | 0 replies | |
| 36/60 | PCI: Add __add_to_list()drivers/ | +31 | 0 replies | |
| 37/60 | PCI: Cache window alignment value during bus sizingdrivers/ | +6 | 0 replies | |
| 38/60 | PCI: Check if resource is allocated before trying to assign onedrivers/ | +1 | 0 replies | |
| 39/60 | PCI: Separate out save_resources()/restore_resources()drivers/ | +30 | 0 replies | |
| 40/60 | PCI: Move comment to pci_need_to_release()drivers/ | +15 | 0 replies | |
| 41/60 | PCI: Separate required+optional assigning to another functiondrivers/ | +27 | 0 replies | |
| 42/60 | PCI: Skip required+optional if there is no optionaldrivers/ | +29 | 0 replies | |
| 43/60 | PCI: Move saved required resource list out of required+optional assigningdrivers/ | +16 | 0 replies | |
| 44/60 | PCI: Add alt_size ressource allocation supportdrivers/ | +191 | 3 replies | |
| 45/60 | PCI: Add support for more than two alt_size entries under same bridgedrivers/ | +54 | 0 replies | |
| 46/60 | PCI: Fix size calculation with old_size on rescan pathdrivers/ | +12 | 0 replies | |
| 47/60 | PCI: Don't add too much optional size for hotplug bridge iodrivers/ | +16 | 0 replies | |
| 48/60 | PCI: Move ISA io port align out of calculate_iosize()drivers/ | +27 | 0 replies | |
| 49/60 | PCI: Don't add too much io port for hotplug bridge with old sizedrivers/ | +4 | 0 replies | |
| 50/60 | PCI: Unify calculate_size() for io port and MMIOdrivers/ | +5 | 0 replies | |
| 51/60 | PCI: Allow bridge optional only io port resource required size to be 0drivers/ | +4 | 0 replies | |
| 52/60 | PCI: Unify skip_ioresource_align()arch/ arch/ arch/ +3 more | +15 | 0 replies | |
| 53/60 | PCI: Kill macro checking for bus io port sizingdrivers/ | +7 | 0 replies | |
| 54/60 | resources: Make allocate_resource() return best fit resourcekernel/ | +61 | 0 replies | |
| 55/60 | PCI, x86: Allocate from high in available window for MMIOarch/ drivers/ include/ | +33 | 0 replies | |
| 56/60 | PCI: Add debug print out for min_align and alt_sizedrivers/ | +56 | 0 replies | |
| 57/60 | PCI, x86: Add pci=assign_pref_bars to reallocate pref BARsarch/ arch/ arch/ | +39 | 0 replies | |
| 58/60 | PCI: Introduce resource_disabled()arch/ arch/ arch/ +17 more | +53 | 0 replies | |
| 59/60 | PCI: Don't set flags to 0 when assign resource faildrivers/ drivers/ drivers/ | +26 | 0 replies | |
| 60/60 | PCI: Only try to assign io port only for root bus that support itdrivers/ drivers/ include/ | +16 | 0 replies |
Reviews trailers per patch
2 of 60 patches have a Reviewed-by or Acked-by.
| Patch | Khalid Aziz | Yijing Wang | Thomas Gleixner | Michael Ellerman | TJ | David Ahern |
|---|---|---|---|---|---|---|
| 1/60 | ||||||
| 2/60 | ||||||
| 3/60 | ||||||
| 4/60 | T-b | |||||
| 5/60 | T-b | |||||
| 6/60 | T-b | |||||
| 7/60 | T-b | |||||
| 8/60 | T-b | |||||
| 9/60 | ||||||
| 10/60 | ||||||
| 11/60 | T-b | |||||
| 12/60 | T-b | T-b | T-b | |||
| 13/60 | T-b | |||||
| 14/60 | T-b | |||||
| 15/60 | T-b | |||||
| 16/60 | T-b | |||||
| 17/60 | ||||||
| 18/60 | ||||||
| 19/60 | ||||||
| 20/60 | ||||||
| 21/60 | ||||||
| 22/60 | T-b | |||||
| 23/60 | ||||||
| 24/60 | ||||||
| 25/60 | ||||||
| 26/60 | ||||||
| 27/60 | ||||||
| 28/60 | ||||||
| 29/60 | ||||||
| 30/60 | ||||||
| 31/60 | ||||||
| 32/60 | ||||||
| 33/60 | ||||||
| 34/60 | ||||||
| 35/60 | ||||||
| 36/60 | ||||||
| 37/60 | ||||||
| 38/60 | ||||||
| 39/60 | ||||||
| 40/60 | ||||||
| 41/60 | ||||||
| 42/60 | ||||||
| 43/60 | ||||||
| 44/60 | T-b | |||||
| 45/60 | T-b | |||||
| 46/60 | ||||||
| 47/60 | ||||||
| 48/60 | ||||||
| 49/60 | ||||||
| 50/60 | ||||||
| 51/60 | ||||||
| 52/60 | R-b | A-b | ||||
| 53/60 | ||||||
| 54/60 | ||||||
| 55/60 | ||||||
| 56/60 | ||||||
| 57/60 | ||||||
| 58/60 | A-b | |||||
| 59/60 | ||||||
| 60/60 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.
Cover letter [PATCH v11 00/60] PCI: Resource allocation cleanup for v4.7
Hi Bjorn,
After 5b28541552ef (PCI: Restrict 64-bit prefetchable bridge windows to 64-bit resources), we have several reports on resource allocation failure, and we try to fix the problem with resource clip, and find more problems.
One is realloc fail with two graphics cards above 4G. One is from sparc that have problem with clip as we don't parse mem64 for it.
Other report is about pci remove/rescan does not work on some setup when BIOS tend to allocate small bus size.
This patchset enhance resource allocation to address those problems.
patch 1-11: parse MEM64 for sparc and other system with OF
patch 12-16: MMIO64 allocation enhancement
treat non-pref mmio64 if parent bridges are all pcie. restore old pref allocation logic if hostbridge does not support mmio64.
patch 17-19: FIXED resource handling during realloc
don't realloc resource if device firmware does not support bar change.
patch 20-23: bridge MMIO allocation with hotplug and last try.
treat optional as required on first try when hotplug. MMIO size set to 0 for last try during realloc
patch 24-56: enhancement for mmio resource allocation:
optimize bus mmio alignment calculation.
optimize bus mmio optional alignment calculation.
add support for alt size to prefer small bus size to small bus alignment. treat ROM bar as optional resource.
during allocation, will pick up best fit resource, and allocate near end.
patch 57: add pci=assign_pref_bars to clear and assign pref bars.
patch 58-59: don't clear resource when allocation fails
patch 60: don't try io port allocation if root bus does not have io port.
I put latest copy at:
git://git.kernel.org/pub/scm/linux/kernel/git/yinghai/linux-yinghai.git for-pci-v4.7-next
That is rebased on v4.6-rc2+.
Yijing and Wei Yang both tested the branch, and the patchset fixs rescan problem, and is working well on powerpc setup.
Khalid Aziz tested on some sparc platforms that have different offset to mem space start or support 64bit mmio.
-v11: replace pci_find_root_bus_resource with pci_find_bus_resource
add two patches from Bjorn for checking with pci_mmap. refreshed to current linus tree v4.6-rc2+
Hope at least patch 1-16 could get into v4.7.
Patch 3-16 has been Oracle UEK4 for a while to boot on some sparc platforms as them have 64bt mmio above 4G.
Thanks
Yinghai
Bjorn Helgaas (2):
PCI: Fix iomem_is_exclusive() checking in pci_mmap_resource() alpha/PCI: Only check iomem_is_exclusive() for IORESOURCE_MEM, not IORESOURCE_IO
Yinghai Lu (58):
PCI: Add pci_find_bus_resource()
sparc/PCI: Use correct offset for bus address to resource sparc/PCI: Reserve legacy mmio after PCI mmio
sparc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsing sparc/PCI: Keep resource idx order with bridge register number
PCI: Kill wrong quirk about M7101
powerpc/PCI: Keep resource idx order with bridge register number powerpc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsing OF/PCI: Add IORESOURCE_MEM_64 for 64-bit resource
PCI: Check pref compatible bit for mem64 resource of PCIe device
PCI: Only treat non-pref mmio64 as pref if all bridges have MEM_64
PCI: Add has_mem64 for struct host_bridge
PCI: Only treat non-pref mmio64 as pref if host bridge has mmio64
PCI: Restore pref MMIO allocation logic for host bridge without mmio64
PCI: Don't release fixed resource for realloc
PCI: Claim fixed resource during remove/rescan path
PCI: Set resource to FIXED for LSI devices
PCI: Separate realloc list checking after allocation
PCI: Treat optional as required in first try for bridge rescan
PCI: Get new realloc size for bridge for last try
PCI: Don't release sibling bridge resources during hotplug
PCI: Cleanup res_to_dev_res() printout
PCI: Reuse res_to_dev_res() in reassign_resources_sorted()
PCI: Use correct align for optional only resources during sorting
PCI: Optimize bus min_align/size calculation during sizing
PCI: Optimize bus align/size calculation for optional during sizing
PCI: Don't add too much optional size for hotplug bridge MMIO
PCI: Reorder resources list for required/optional resources
PCI: Remove duplicated code for resource sorting
PCI: Rename pdev_sort_resources() to pdev_assign_resources_prepare()
PCI: Treat ROM resource as optional during realloc
PCI: Add debug printout during releasing partial assigned resources
PCI: Simplify res reference using in __assign_resources_sorted()
PCI: Add __add_to_list()
PCI: Cache window alignment value during bus sizing
PCI: Check if resource is allocated before trying to assign one
PCI: Separate out save_resources()/restore_resources()
PCI: Move comment to pci_need_to_release()
PCI: Separate required+optional assigning to another function
PCI: Skip required+optional if there is no optional
PCI: Move saved required resource list out of required+optional assigning
PCI: Add alt_size ressource allocation support
PCI: Add support for more than two alt_size entries under same bridge
PCI: Fix size calculation with old_size on rescan path
PCI: Don't add too much optional size for hotplug bridge io
PCI: Move ISA io port align out of calculate_iosize()
PCI: Don't add too much io port for hotplug bridge with old size
PCI: Unify calculate_size() for io port and MMIO
PCI: Allow bridge optional only io port resource required size to be 0
PCI: Unify skip_ioresource_align()
PCI: Kill macro checking for bus io port sizing
resources: Make allocate_resource() return best fit resource PCI, x86: Allocate from high in available window for MMIO
PCI: Add debug print out for min_align and alt_size
PCI, x86: Add pci=assign_pref_bars to reallocate pref BARs
PCI: Introduce resource_disabled()
PCI: Don't set flags to 0 when assign resource fail
PCI: Only try to assign io port only for root bus that support it
arch/alpha/kernel/pci-sysfs.c | 4 +- arch/alpha/kernel/pci.c | 2 +- arch/ia64/pci/pci.c | 4 +- arch/microblaze/pci/pci-common.c | 15 +- arch/mn10300/unit-asb2305/pci-asb2305.c | 4 +- arch/mn10300/unit-asb2305/pci.c | 4 +- arch/powerpc/kernel/pci-common.c | 27 +- arch/powerpc/kernel/pci_of_scan.c | 12 +- arch/powerpc/platforms/powernv/pci-ioda.c | 12 +- arch/s390/pci/pci.c | 2 +- arch/sparc/kernel/of_device_32.c | 5 +- arch/sparc/kernel/of_device_64.c | 5 +- arch/sparc/kernel/pci.c | 65 +- arch/sparc/kernel/pci_common.c | 91 +- arch/sparc/kernel/pci_impl.h | 5 + arch/x86/include/asm/pci_x86.h | 2 +- arch/x86/pci/common.c | 7 +- arch/x86/pci/i386.c | 85 +- arch/xtensa/kernel/pci.c | 4 +- drivers/iommu/intel-iommu.c | 3 +- drivers/of/address.c | 4 +- drivers/pci/bus.c | 6 +- drivers/pci/host/pcie-rcar.c | 2 +- drivers/pci/hotplug/acpiphp_glue.c | 1 + drivers/pci/iov.c | 2 +- drivers/pci/pci-sysfs.c | 7 +- drivers/pci/pci.c | 31 +- drivers/pci/pci.h | 4 + drivers/pci/probe.c | 48 +- drivers/pci/quirks.c | 55 +- drivers/pci/rom.c | 2 +- drivers/pci/setup-bus.c | 1316 +++++++++++++++++++++-------- drivers/pci/setup-res.c | 18 +- include/linux/ioport.h | 6 +- include/linux/pci.h | 10 + kernel/resource.c | 104 ++- 36 files changed, 1427 insertions(+), 547 deletions(-)
Signature · 1 line
1.8.4.5