devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Niklas Cassel <cassel@kernel.org>
Cc: "Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Abraham I" <kishon@kernel.org>,
	dlemoal@kernel.org, linux-pci@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH] dt-bindings: PCI: pci-ep: Add ref-clk-mode
Date: Mon, 12 May 2025 08:59:09 -0500	[thread overview]
Message-ID: <20250512135909.GA3177343-robh@kernel.org> (raw)
In-Reply-To: <aB8ysBuQysAR-Zcp@ryzen>

On Sat, May 10, 2025 at 01:04:16PM +0200, Niklas Cassel wrote:
> On Sat, May 10, 2025 at 01:01:51AM +0530, Manivannan Sadhasivam wrote:
> > On Fri, May 09, 2025 at 01:18:27PM -0500, Rob Herring wrote:
> > > > > > 
> > > > > > > +    description: Reference clocking architechture
> > > > > > > +    enum:
> > > > > > > +      - common-clk        # Common Reference Clock (provided by RC side)
> > > > > > 
> > > > > > Can we use 'common-clk-host' so that it is explicit that the clock is coming
> > > > > > from the host side?
> > > > > 
> > > > > Sure.
> > > > > 
> > > > > I take it that you prefer 'common-clk-host' over 'common-clk-rc' ?
> > > > > 
> > > > 
> > > > That's what I intended previously, but thinking more, I feel that we should
> > > > stick to '-rc'i, as that's what the PCIe spec uses.
> > > 
> > > Couldn't this apply to any link, not just a RC? Is there PCIe 
> > > terminology for upstream and downstream ends of a link?
> > > 
> > 
> > Usually, the refclk comes from the host machine to the endpoint, but doesn't
> > necessarily from the root complex. Since the refclk source could very well be
> > from the motherboard or the host system PCB, controlled by the host software.
> > 
> > > The 'common-clk' part seems redundant to me with '-rc' or whatever we 
> > > end up with added.
> > > 
> > 
> > No. It could be the other way around. We can drop the '-rc' suffix if it seem
> > redundant. Maybe that is a valid argument also since root complex doesn't
> > necessarily provide refclk and the common refclk usually comes from the host.
> 
> When the RC and EP uses a common clock (rather than separate clocks),
> the clock can either be provided by the host side or the EP side.
> 
> The most common by far (if using a common clock) is that it the common
> clock is provided by the host side. That is why my patch just named it
> 'common-clk' instead of 'common-clk-host' or 'common-clk-rc'.
> 
> I can use whatever name we agree on. I indend to send out V2 of this
> patch as part of a series that adds SRIS support to the dw-rockchip
> driver, in order to address Krzysztof's comment.
> 
> 
> > 
> > > Finally, this[1] seems related. Figure out a common solution.
> 
> I don't see the connection.
> 
> https://lore.kernel.org/all/20250406144822.21784-2-marek.vasut+renesas@mailbox.org/
> 
> does specify a reference clock, but that is in a host side DT binding.
> 
> 
> This patch adds a refclk-mode property to an endpoint side DT binding.

If we are dealing with the same property of the link, it doesn't matter 
which side. What we don't need is 2 different solutions.

> This property is needed such that the endpoint can configure the bits
> in its own PCIe Link Control Register before starting the link.
> 
> Perhaps the host side could also make use of a similar property, but I'm not
> sure, you don't know from the host side which endpoint will be plugged in.
> 
> >From the EP side, you do know if your SoC only supports common-clock or
> SRNS/SRIS, since that depends on if the board can source the clock from
> the PCIe slot or not (of all the DWC based drivers, only Qcom and Tegra
> can do so, rest uses SRNS/SRIS), so this property definitely makes sense
> in an EP side DT binding.

I don't understand why we need this in DT in the first place. Seems like 
needing to specify this breaks discoverability? Perhaps this information 
is only relevant after initial link is up and the host can read the EP 
registers?

Rob

  reply	other threads:[~2025-05-12 13:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-25  9:20 [PATCH] dt-bindings: PCI: pci-ep: Add ref-clk-mode Niklas Cassel
2025-04-30  7:05 ` Manivannan Sadhasivam
2025-04-30  7:16   ` Niklas Cassel
2025-04-30  7:53     ` Manivannan Sadhasivam
2025-05-09 18:18       ` Rob Herring
2025-05-09 19:31         ` Manivannan Sadhasivam
2025-05-10 11:04           ` Niklas Cassel
2025-05-12 13:59             ` Rob Herring [this message]
2025-05-13 17:25               ` Niklas Cassel
2025-05-14  6:51                 ` Niklas Cassel
2025-05-19 14:56                 ` Rob Herring
2025-04-30  7:18   ` Krzysztof Kozlowski

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=20250512135909.GA3177343-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=cassel@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=kishon@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.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).