ARM/ARM64: PCI: PCI_PROBE_ONLY clean-up
Get series with b4
b4 am 20160622230151.GH25485@localhostVersions newest first · linked by author and title
- v3 Latest3 of 4 patches 0 repliesNew
- v11 of 3 patches 0 repliesSuperseded
3 of 4 patches are in this archive. The cover letter announces 4.
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 4/4 | ARM/PCI: remove arch specific pcibios_enable_device() | +0 | 1 reply | |
| 4/4 | ARM/PCI: remove arch specific pcibios_enable_device() | +0 | 1 reply | |
| 4/4 | ARM/PCI: remove arch specific pcibios_enable_device()arch/ | +2 | 1 reply |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | GUAN Xuetao |
|---|---|
| 4/4 | A-b |
| 4/4 | A-b |
| 4/4 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/4] ARM/ARM64: PCI: PCI_PROBE_ONLY clean-up
Quoted 68 lines · Lorenzo Pieralisi
Current arm/arm64 code prevents enabling resources in the respective
pcibios_enable_device()callbacks if thePCI_PROBE_ONLYflag is set, in that on those platforms the resources tree was not validated properly since PCI resources are not currently claimed on arm/arm64PCI_PROBE_ONLYsystems.This is a temporary kludge, in that
PCI_PROBE_ONLYflag is used to describe systems with fixed resources, that can nonetheless be enabled through the standardpci_enable_resources()call present in PCI core code, (ie via the genericpcibios_enable_device()call).To remove the
PCI_PROBE_ONLYflag in arm/arm64pcibios_enable_device()callbacks, the PCI host controllers that can be used withPCI_PROBE_ONLYconfigurations must make sure that devices resources are validated and inserted in the kernel resource tree even onPCI_PROBE_ONLYsystems so that the genericpcibios_enable_device()generic code, while enabling resources (pci_enable_resources()), does not find dangling resources pointers (ie missing parent pointers) that are omens of an incomplete resource tree, causing failures in resources enablement.PCI core code provides interfaces to assign/reassign/reallocate PCI bus resources but it is currently lacking an interface to claim resources for a specific bus. Arches implement resources claiming through ad-hoc code built on top of
pci_claim_resource()API, but that code cannot be leveraged on architectures like arm/arm64 that rely on the generic PCI infrastructure to carry out resources claiming/assignment.Therefore, to clean up the arm/arm64 resources enablement on
PCI_PROBE_ONLYsystems this patchset implements four patches:PATCH 1: Create PCI core code infrastructure to claim bus resources PATCH 2: Leverage the infrastructure in PATCH 1 to claim resources in
the PCI generic host controller onPCI_PROBE_ONLYsystemsPATCH 3: Remove the
PCI_PROBE_ONLYkludge from the arm64 PCI back-end to
complete the clean-up and leverage the PCI genericpcibios_enable_device()implementationPATCH 4: Remove the
PCI_PROBE_ONLYkludge from the arm PCI back-end to
complete the clean-up and leverage the PCI genericpcibios_enable_device()implementationTested on arm/arm64 systems with kvmtool and PCI host generic.
v2 -> v3
- Split patch 3 in two patches so that arm and arm64 are handled in different patches
- Improved commits logs, clarified resource parent assignment
- Rebased against v4.7-rc2v2: https://patchwork.ozlabs.org/patch/590556/
v1 -> v2
- Rewrote patch 1 to recursively claim resources for the whole PCI bus hierarchy
- Updated commits logs/tags
- Rebased against v4.5-rc6v1: https://patchwork.ozlabs.org/patch/545669/
Lorenzo Pieralisi (4):
PCI: add generic code to claim bus resources
PCI: host-generic: claim bus resources onPCI_PROBE_ONLYset-ups ARM64/PCI: remove arch specificpcibios_enable_device()ARM/PCI: remove arch specificpcibios_enable_device()
Quoted 6 lines
arch/arm/kernel/bios32.c | 12 ------- arch/arm64/kernel/pci.c | 13 -------- drivers/pci/host/pci-host-common.c | 27 +++++++++++++-- drivers/pci/setup-bus.c | 68 ++++++++++++++++++++++++++++++++++++++ include/linux/pci.h | 1 + 5 files changed, 94 insertions(+), 27 deletions(-)
I applied these to pci/resource for v4.8, thanks, Lorenzo!
It's awesome to get rid of that PCI_PROBE_ONLY hack.
We might still tweak this a little based on my question about pci_common_init_dev(), so don't build things on top of this yet (good advice in general for my branches: I often rebase and remerge them, so it's best to base things on my "master" branch unless you actually depend on something that's not in there.)