linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Mayank Rana <mayank.rana@oss.qualcomm.com>
Cc: linux-pci@vger.kernel.org, will@kernel.org,
	lpieralisi@kernel.org, kw@linux.com, robh@kernel.org,
	bhelgaas@google.com, andersson@kernel.org, mani@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
	devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	quic_ramkri@quicinc.com, quic_shazhuss@quicinc.com,
	quic_msarkar@quicinc.com, quic_nitegupt@quicinc.com,
	Rob Herring <robh+dt@kernel.org>
Subject: Re: [PATCH v5 3/4] dt-bindings: PCI: qcom,pcie-sa8255p: Document ECAM compliant PCIe root complex
Date: Tue, 1 Jul 2025 16:26:04 -0500	[thread overview]
Message-ID: <20250701212604.GA1850816@bhelgaas> (raw)
In-Reply-To: <89ded76a-8bd7-43b5-932d-f139f4154320@oss.qualcomm.com>

[+cc Rob]

On Tue, Jul 01, 2025 at 01:21:29PM -0700, Mayank Rana wrote:
> On 7/1/2025 9:52 AM, Bjorn Helgaas wrote:
> > On Mon, Jun 16, 2025 at 03:42:58PM -0700, Mayank Rana wrote:
> > > Document the required configuration to enable the PCIe root complex on
> > > SA8255p, which is managed by firmware using power-domain based handling
> > > and configured as ECAM compliant.
> > 
> > > +    soc {
> > > +        #address-cells = <2>;
> > > +        #size-cells = <2>;
> > > +
> > > +        pci@1c00000 {
> > > +           compatible = "qcom,pcie-sa8255p";
> > > +           reg = <0x4 0x00000000 0 0x10000000>;
> > > +           device_type = "pci";
> > > +           #address-cells = <3>;
> > > +           #size-cells = <2>;
> > > +           ranges = <0x02000000 0x0 0x40100000 0x0 0x40100000 0x0 0x1ff00000>,
> > > +                    <0x43000000 0x4 0x10100000 0x4 0x10100000 0x0 0x40000000>;
> > > +           bus-range = <0x00 0xff>;
> > > +           dma-coherent;
> > > +           linux,pci-domain = <0>;
> > > ...
> > 
> > > +           pcie@0 {
> > > +                   device_type = "pci";
> > > +                   reg = <0x0 0x0 0x0 0x0 0x0>;
> > > +                   bus-range = <0x01 0xff>;
> > 
> > This is a Root Port, right?  Why do we need bus-range here?  I assume
> > that even without this, the PCI core can detect and manage the bus
> > range using PCI_SECONDARY_BUS and PCI_SUBORDINATE_BUS.
>
> On Qualcomm SOCs, root complex based root host bridge is connected to single
> PCIe bridge
> with single root port. I have added bus-range based on discussion on this
> thread https://lore.kernel.org/all/20240321-pcie-qcom-bridge-dts-
> 2-0-1eb790c53e43@linaro.org/

I think you mean
https://lore.kernel.org/all/20240321-pcie-qcom-bridge-dts-v2-0-1eb790c53e43@linaro.org/
so I assume you're looking at the conversation at
https://lore.kernel.org/all/20250103210531.GA3252@bhelgaas/t/#u.

So I guess the answer to my question is basically "to shut up DTC
check":

  Some DT for qcom,pcie-sa8255p might describe an Endpoint below this
  Root Port, and the Endpoint's 'reg' property includes a bus number
  determined by the Root Port configuration.

  DTC check validates the Endpoint's bus number by comparing it with
  the parent's 'bus-range', so it complains unless the Root Port
  includes a 'bus-range' property.

This might be the best we can do for now, but it's incomplete because
the Root Port's secondary bus number is programmable, and Linux can
assign whatever it wants.  We currently assume the secondary bus
number is 1, i.e., the root bus number plus 1, which generally
"should" be true.

But it all falls apart if we have multiple Root Ports because there's
no obvious secondary bus number for the second, third, etc., Root
Ports.

Bjorn

  reply	other threads:[~2025-07-01 21:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-16 22:42 [PATCH v5 0/4] Add Qualcomm SA8255p based firmware managed PCIe root complex Mayank Rana
2025-06-16 22:42 ` [PATCH v5 1/4] PCI: dwc: Export dwc MSI controller related APIs Mayank Rana
2025-06-16 22:42 ` [PATCH v5 2/4] PCI: host-generic: Rename and export gen_pci_init() to allow ECAM creation Mayank Rana
2025-06-16 22:42 ` [PATCH v5 3/4] dt-bindings: PCI: qcom,pcie-sa8255p: Document ECAM compliant PCIe root complex Mayank Rana
2025-07-01 16:52   ` Bjorn Helgaas
2025-07-01 20:21     ` Mayank Rana
2025-07-01 21:26       ` Bjorn Helgaas [this message]
2025-07-15 21:41         ` Rob Herring
2025-07-15 18:16   ` Bjorn Helgaas
2025-07-15 20:43     ` Mayank Rana
2025-06-16 22:42 ` [PATCH v5 4/4] PCI: qcom: Add support for Qualcomm SA8255p based " Mayank Rana
2025-07-01 13:48 ` [PATCH v5 0/4] Add Qualcomm SA8255p based firmware managed " Manivannan Sadhasivam

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=20250701212604.GA1850816@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=andersson@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kw@linux.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=mayank.rana@oss.qualcomm.com \
    --cc=quic_msarkar@quicinc.com \
    --cc=quic_nitegupt@quicinc.com \
    --cc=quic_ramkri@quicinc.com \
    --cc=quic_shazhuss@quicinc.com \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=will@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).