From: Alex Elder <elder@riscstar.com>
To: bhelgaas@google.com, robh@google.com, krzk+dt@kernel.org,
conor+dt@kernel.org
Cc: daniel@riscstar.com, mohd.anwar@oss.qualcomm.com,
lorenzo.bianconi@oss.qualcomm.com, linux-pci@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v4 0/2] PCI: of: update endpoint ranges dynamically
Date: Thu, 5 Nov 2026 15:24:10 -0600 [thread overview]
Message-ID: <20261105212412.591931-1-elder@riscstar.com> (raw)
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
next reply other threads:[~2026-11-05 21:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 21:24 Alex Elder [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261105212412.591931-1-elder@riscstar.com \
--to=elder@riscstar.com \
--cc=bhelgaas@google.com \
--cc=conor+dt@kernel.org \
--cc=daniel@riscstar.com \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.bianconi@oss.qualcomm.com \
--cc=mohd.anwar@oss.qualcomm.com \
--cc=robh@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®