From: Alexander Stein <alexander.stein@ew.tq-group.com>
To: bhelgaas@google.com, robh@google.com, krzk+dt@kernel.org,
conor+dt@kernel.org, linux-pci@vger.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,
Alex Elder <elder@riscstar.com>
Subject: Re: [PATCH v4 0/2] PCI: of: update endpoint ranges dynamically
Date: Fri, 04 Dec 2026 11:58:05 +0100 [thread overview]
Message-ID: <5372347.31r3eYUQgx@steina-w> (raw)
In-Reply-To: <20261105212412.591931-1-elder@riscstar.com>
Hi Alex,
Am Donnerstag, 5. November 2026, 22:24:10 Mitteleuropäische Normalzeit schrieb Alex Elder:
> 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.
Thanks for the series. I've picked your dynamic_ranges-v4 branch and
managed to create DT devices for BARs on a FPGA attached to
an imx8mp, including the dynamic ranges.
But I noticed I had to add my own PCIe fixup regarding
of_pci_make_dev_node for it to take effect. Is this really necessary
or can it be done automatically?
FWIW:
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Best regards,
Alexander
>
> -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
>
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/
next prev parent reply other threads:[~2026-12-04 10:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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
2026-12-04 10:58 ` Alexander Stein [this message]
2026-12-04 13:02 ` [PATCH v4 0/2] PCI: of: update endpoint ranges dynamically 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=5372347.31r3eYUQgx@steina-w \
--to=alexander.stein@ew.tq-group.com \
--cc=bhelgaas@google.com \
--cc=conor+dt@kernel.org \
--cc=daniel@riscstar.com \
--cc=devicetree@vger.kernel.org \
--cc=elder@riscstar.com \
--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