mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4 0/2] PCI: of: update endpoint ranges dynamically
@ 2026-11-05 21:24 Alex Elder
  2026-11-05 21:24 ` [PATCH v4 1/2] PCI: of: introduce of_pci_build_prop_ranges() Alex Elder
  2026-11-05 21:24 ` [PATCH v4 2/2] PCI: of: introduce of_pci_update_endpoint_node_ranges() Alex Elder
  0 siblings, 2 replies; 3+ messages in thread
From: Alex Elder @ 2026-11-05 21:24 UTC (permalink / raw)
  To: bhelgaas, robh, krzk+dt, conor+dt
  Cc: daniel, mohd.anwar, lorenzo.bianconi, linux-pci, devicetree,
	linux-kernel

This series fixes a bug in PCI devicetree handling code.

If a PCI endpoint function is represented in devicetree, and it
implements a PCI endpoint bus, its ranges property must be created
dynamically.  This is because the PCI function's BAR addresses are
assigned during PCI enumeration, and a static ranges property cannot
assume a particular static BAR address matches what was assigned.

The solution is to dynamically generate a ranges property for PCI
functions defined in devicetree that implement a PCI endpoint bus.

					-Alex

Note: this series depends on the patch "PCI: of: drop the reg_num
argument to of_pci_set_address()" found in this series:
  https://lore.kernel.org/lkml/20261105153801.435566-5-elder@riscstar.com/

The entire series (based on v7.4-rc1 and including that series as
prerequisite) is available here:
  https://github.com/riscstar/linux/tree/outgoing/dynamic_ranges-v4

Version 3 is available here:
  https://lore.kernel.org/lkml/20260924222444.1351466-1-elder@riscstar.com/

Between version 3 and version 4:
- Dramatically simplified the description in this cover letter.  See
  earlier versions for a more lengthy explanation.
- Dropped the first patch, which allowed a null pointer for the flags
  argument to of_pci_get_addr_flags().  This wasn't really necessary
  and didn't really add value.
- Indicated clearly that Andrea della Porta has tested this series on
  the Raspberry Pi 5, which uses PCI endpoint bus for its RP1 chip.
  The current statically-defined ranges property works for this system,
  and when the necessary PCI quirk is enabled, the dynamically generated
  ranges property works correctly as well.

Between version 2 and version 3:
- The ranges property for a PCI endpoint with an existing devicetree node
  is only updated if its ranges property has an empty value (i.e., it is
  "ranges;", or is not defined)

Version 2 is available here:
  https://lore.kernel.org/lkml/20260910021919.3421449-1-elder@riscstar.com/

Between version 1 and version 2:
- Included the first patch (which was previously posted in a different
  series)
- Modified the last patch so the ranges property is updated only for
  PCI endpoints having at least one "pci-ep-bus" node
- Rebased on v7.3-rc2 (and the prerequisite series)

Version 1 is available here:
  https://lore.kernel.org/lkml/20260813220717.1394644-1-elder@riscstar.com/



Alex Elder (2):
  PCI: of: introduce of_pci_build_prop_ranges()
  PCI: of: introduce of_pci_update_endpoint_node_ranges()

 drivers/pci/of.c          |  97 ++++++++++++++++++++++++++---
 drivers/pci/of_property.c | 126 +++++++++++++++++++++++++-------------
 drivers/pci/pci.h         |   1 +
 3 files changed, 173 insertions(+), 51 deletions(-)


base-commit: 8c786803613eb0d3352417509611d1db877c65af
-- 
2.53.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-05 21:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-05 21:24 [PATCH v4 0/2] PCI: of: update endpoint ranges dynamically Alex Elder
2026-11-05 21:24 ` [PATCH v4 1/2] PCI: of: introduce of_pci_build_prop_ranges() Alex Elder
2026-11-05 21:24 ` [PATCH v4 2/2] PCI: of: introduce of_pci_update_endpoint_node_ranges() Alex Elder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®