* [PATCH] PCI: rcar-gen4: Set SRIS mode in rcar_gen4_pcie_common_init()
@ 2026-11-29 15:40 Marek Vasut
2026-11-30 8:34 ` Koichiro Den
2026-11-30 20:22 ` Niklas Cassel
0 siblings, 2 replies; 8+ messages in thread
From: Marek Vasut @ 2026-11-29 15:40 UTC (permalink / raw)
To: linux-pci
Cc: Marek Vasut, Krzysztof Wilczyński, Bjorn Helgaas,
Geert Uytterhoeven, Koichiro Den, Lorenzo Pieralisi, Magnus Damm,
Manivannan Sadhasivam, Rob Herring, Yoshihiro Shimoda,
linux-renesas-soc
Except for R-Car S4 variant of this controller, all other variants of
this PCIe controller set PCIEMSR0 APP_SRIS_MODE bit as part of their
.link_up callback. Simplify this, introduce .sris_mode flag in driver
data and set it for all but R-Car S4 controller, and then set PCIEMSR0
APP_SRIS_MODE bit based on this flag in rcar_gen4_pcie_common_init()
already. Removes one read-modify-write round. No functional change.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
Cc: "Krzysztof Wilczyński" <kwilczynski@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Koichiro Den <den@valinux.co.jp>
Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>
Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: Manivannan Sadhasivam <mani@kernel.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: linux-pci@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org
---
drivers/pci/controller/dwc/pcie-rcar-gen4.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-rcar-gen4.c b/drivers/pci/controller/dwc/pcie-rcar-gen4.c
index 2e640110e3910..6fd745099103c 100644
--- a/drivers/pci/controller/dwc/pcie-rcar-gen4.c
+++ b/drivers/pci/controller/dwc/pcie-rcar-gen4.c
@@ -100,6 +100,7 @@ struct rcar_gen4_pcie_drvdata {
int (*speed_control)(struct rcar_gen4_pcie *rcar);
enum dw_pcie_device_mode mode;
bool mrrs_256b_limit;
+ bool sris_mode;
};
struct rcar_gen4_pcie {
@@ -265,6 +266,9 @@ static int rcar_gen4_pcie_common_init(struct rcar_gen4_pcie *rcar)
if (dw->num_lanes < 4)
val |= BIFUR_MOD_SET_ON;
+ if (rcar->drvdata->sris_mode)
+ val |= APP_SRIS_MODE;
+
writel(val, rcar->base + PCIEMSR0);
ret = reset_control_deassert(dw->core_rsts[DW_PCIE_PWR_RST].rstc);
@@ -1070,10 +1074,6 @@ static int rcar_gen4_pcie_ltssm_control(struct rcar_gen4_pcie *rcar, bool enable
val |= PORT_FORCE_LINK_DDFS;
dw_pcie_writel_dbi(dw, PORT_FORCE_LINK, val);
- val = readl(rcar->base + PCIEMSR0);
- val |= APP_SRIS_MODE;
- writel(val, rcar->base + PCIEMSR0);
-
/*
* The R-Car Gen4 datasheet doesn't describe the PHY registers' name.
* But, the initialization procedure describes these offsets. So,
@@ -1157,6 +1157,7 @@ static struct rcar_gen4_pcie_drvdata drvdata_rcar_gen4_pcie = {
.speed_control = rcar_gen4_pcie_speed_control,
.mode = DW_PCIE_RC_TYPE,
.mrrs_256b_limit = true,
+ .sris_mode = true,
};
static struct rcar_gen4_pcie_drvdata drvdata_rcar_gen4_pcie_ep = {
@@ -1166,6 +1167,7 @@ static struct rcar_gen4_pcie_drvdata drvdata_rcar_gen4_pcie_ep = {
.speed_control = rcar_gen4_pcie_speed_control,
.mode = DW_PCIE_EP_TYPE,
.mrrs_256b_limit = true,
+ .sris_mode = true,
};
static struct rcar_gen4_pcie_drvdata drvdata_rcar_gen5_pcie = {
@@ -1174,6 +1176,7 @@ static struct rcar_gen4_pcie_drvdata drvdata_rcar_gen5_pcie = {
.ltssm_control = rcar_gen5_pcie_ltssm_control,
.speed_control = rcar_gen5_pcie_speed_control,
.mode = DW_PCIE_RC_TYPE,
+ .sris_mode = true,
};
static const struct of_device_id rcar_gen4_pcie_of_match[] = {
--
2.53.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH] PCI: rcar-gen4: Set SRIS mode in rcar_gen4_pcie_common_init()
2026-11-29 15:40 [PATCH] PCI: rcar-gen4: Set SRIS mode in rcar_gen4_pcie_common_init() Marek Vasut
@ 2026-11-30 8:34 ` Koichiro Den
2026-12-02 3:10 ` Marek Vasut
2026-11-30 20:22 ` Niklas Cassel
1 sibling, 1 reply; 8+ messages in thread
From: Koichiro Den @ 2026-11-30 8:34 UTC (permalink / raw)
To: Marek Vasut
Cc: linux-pci, Krzysztof Wilczyński, Bjorn Helgaas,
Geert Uytterhoeven, Lorenzo Pieralisi, Magnus Damm,
Manivannan Sadhasivam, Rob Herring, Yoshihiro Shimoda,
linux-renesas-soc
Hi Marek, thanks for informing me via cc.
On Sun, Nov 29, 2026 at 04:40:52PM +0100, Marek Vasut wrote:
> Except for R-Car S4 variant of this controller, all other variants of
> this PCIe controller set PCIEMSR0 APP_SRIS_MODE bit as part of their
> .link_up callback. Simplify this, introduce .sris_mode flag in driver
^^^^^^^^
nit: is this a typo for .ltssm_control?
> data and set it for all but R-Car S4 controller, and then set PCIEMSR0
> APP_SRIS_MODE bit based on this flag in rcar_gen4_pcie_common_init()
> already. Removes one read-modify-write round. No functional change.
For R-Car Gen5 PCIe4, is this really no functional change? If not, would it be
better to split the Gen5 change into a separate patch?
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
> ---
> Cc: "Krzysztof Wilczyński" <kwilczynski@kernel.org>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Koichiro Den <den@valinux.co.jp>
> Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>
> Cc: Magnus Damm <magnus.damm@gmail.com>
> Cc: Manivannan Sadhasivam <mani@kernel.org>
> Cc: Rob Herring <robh@kernel.org>
> Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-renesas-soc@vger.kernel.org
> ---
I'm not sure if everyone involved except me already knows, but is this patch
meant to go on top of the three patches below? (no functional dependency but.)
- https://lore.kernel.org/r/20261028172133.20903-1-marek.vasut+renesas@mailbox.org/
- https://lore.kernel.org/r/20261028172133.20903-2-marek.vasut+renesas@mailbox.org/
- https://lore.kernel.org/r/20261028172208.20948-1-marek.vasut+renesas@mailbox.org/
Best regards,
Koichiro Den
> drivers/pci/controller/dwc/pcie-rcar-gen4.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/pcie-rcar-gen4.c b/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> index 2e640110e3910..6fd745099103c 100644
> --- a/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> +++ b/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> @@ -100,6 +100,7 @@ struct rcar_gen4_pcie_drvdata {
> int (*speed_control)(struct rcar_gen4_pcie *rcar);
> enum dw_pcie_device_mode mode;
> bool mrrs_256b_limit;
> + bool sris_mode;
> };
>
> struct rcar_gen4_pcie {
> @@ -265,6 +266,9 @@ static int rcar_gen4_pcie_common_init(struct rcar_gen4_pcie *rcar)
> if (dw->num_lanes < 4)
> val |= BIFUR_MOD_SET_ON;
>
> + if (rcar->drvdata->sris_mode)
> + val |= APP_SRIS_MODE;
> +
> writel(val, rcar->base + PCIEMSR0);
>
> ret = reset_control_deassert(dw->core_rsts[DW_PCIE_PWR_RST].rstc);
> @@ -1070,10 +1074,6 @@ static int rcar_gen4_pcie_ltssm_control(struct rcar_gen4_pcie *rcar, bool enable
> val |= PORT_FORCE_LINK_DDFS;
> dw_pcie_writel_dbi(dw, PORT_FORCE_LINK, val);
>
> - val = readl(rcar->base + PCIEMSR0);
> - val |= APP_SRIS_MODE;
> - writel(val, rcar->base + PCIEMSR0);
> -
> /*
> * The R-Car Gen4 datasheet doesn't describe the PHY registers' name.
> * But, the initialization procedure describes these offsets. So,
> @@ -1157,6 +1157,7 @@ static struct rcar_gen4_pcie_drvdata drvdata_rcar_gen4_pcie = {
> .speed_control = rcar_gen4_pcie_speed_control,
> .mode = DW_PCIE_RC_TYPE,
> .mrrs_256b_limit = true,
> + .sris_mode = true,
> };
>
> static struct rcar_gen4_pcie_drvdata drvdata_rcar_gen4_pcie_ep = {
> @@ -1166,6 +1167,7 @@ static struct rcar_gen4_pcie_drvdata drvdata_rcar_gen4_pcie_ep = {
> .speed_control = rcar_gen4_pcie_speed_control,
> .mode = DW_PCIE_EP_TYPE,
> .mrrs_256b_limit = true,
> + .sris_mode = true,
> };
>
> static struct rcar_gen4_pcie_drvdata drvdata_rcar_gen5_pcie = {
> @@ -1174,6 +1176,7 @@ static struct rcar_gen4_pcie_drvdata drvdata_rcar_gen5_pcie = {
> .ltssm_control = rcar_gen5_pcie_ltssm_control,
> .speed_control = rcar_gen5_pcie_speed_control,
> .mode = DW_PCIE_RC_TYPE,
> + .sris_mode = true,
> };
>
> static const struct of_device_id rcar_gen4_pcie_of_match[] = {
> --
> 2.53.0
>
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] PCI: rcar-gen4: Set SRIS mode in rcar_gen4_pcie_common_init()
2026-11-30 8:34 ` Koichiro Den
@ 2026-12-02 3:10 ` Marek Vasut
2026-12-02 14:54 ` Koichiro Den
0 siblings, 1 reply; 8+ messages in thread
From: Marek Vasut @ 2026-12-02 3:10 UTC (permalink / raw)
To: Koichiro Den
Cc: linux-pci, Krzysztof Wilczyński, Bjorn Helgaas,
Geert Uytterhoeven, Lorenzo Pieralisi, Magnus Damm,
Manivannan Sadhasivam, Rob Herring, Yoshihiro Shimoda,
linux-renesas-soc
On 11/30/26 9:34 AM, Koichiro Den wrote:
> Hi Marek, thanks for informing me via cc.
Hello Den-san, gladly, thank you for your good feedback.
> On Sun, Nov 29, 2026 at 04:40:52PM +0100, Marek Vasut wrote:
>> Except for R-Car S4 variant of this controller, all other variants of
>> this PCIe controller set PCIEMSR0 APP_SRIS_MODE bit as part of their
>> .link_up callback. Simplify this, introduce .sris_mode flag in driver
> ^^^^^^^^
> nit: is this a typo for .ltssm_control?
This should have been .start_link , which yes, invokes ->ltssm_control .
>> data and set it for all but R-Car S4 controller, and then set PCIEMSR0
>> APP_SRIS_MODE bit based on this flag in rcar_gen4_pcie_common_init()
>> already. Removes one read-modify-write round. No functional change.
>
> For R-Car Gen5 PCIe4, is this really no functional change? If not, would it be
> better to split the Gen5 change into a separate patch?
Looking at the input from Niklas, I think this entire patch will be
superseded by something even better.
--
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] PCI: rcar-gen4: Set SRIS mode in rcar_gen4_pcie_common_init()
2026-12-02 3:10 ` Marek Vasut
@ 2026-12-02 14:54 ` Koichiro Den
2026-12-02 20:12 ` Marek Vasut
0 siblings, 1 reply; 8+ messages in thread
From: Koichiro Den @ 2026-12-02 14:54 UTC (permalink / raw)
To: Marek Vasut
Cc: linux-pci, Krzysztof Wilczyński, Bjorn Helgaas,
Geert Uytterhoeven, Lorenzo Pieralisi, Magnus Damm,
Manivannan Sadhasivam, Rob Herring, Yoshihiro Shimoda,
linux-renesas-soc
On Wed, Dec 02, 2026 at 04:10:57AM +0100, Marek Vasut wrote:
> On 11/30/26 9:34 AM, Koichiro Den wrote:
> > Hi Marek, thanks for informing me via cc.
>
> Hello Den-san, gladly, thank you for your good feedback.
>
> > On Sun, Nov 29, 2026 at 04:40:52PM +0100, Marek Vasut wrote:
> > > Except for R-Car S4 variant of this controller, all other variants of
> > > this PCIe controller set PCIEMSR0 APP_SRIS_MODE bit as part of their
> > > .link_up callback. Simplify this, introduce .sris_mode flag in driver
> > ^^^^^^^^
> > nit: is this a typo for .ltssm_control?
>
> This should have been .start_link , which yes, invokes ->ltssm_control .
>
> > > data and set it for all but R-Car S4 controller, and then set PCIEMSR0
> > > APP_SRIS_MODE bit based on this flag in rcar_gen4_pcie_common_init()
> > > already. Removes one read-modify-write round. No functional change.
> >
> > For R-Car Gen5 PCIe4, is this really no functional change? If not, would it be
> > better to split the Gen5 change into a separate patch?
> Looking at the input from Niklas, I think this entire patch will be
> superseded by something even better.
Since I believe this was meant as a clean-up, I agree we can wait for the
generic binding to settle. Thanks!
P.S. Just thinking out loud about S4 and Niklas's RFC v2...
As you might remember, I've got two Spiders connected at a remote site, one as
RC and the other as EP. Going by the schematic (around R377/R378 marked "Do not
stuff"), I'd expect each board to use its own REFCLK in the stock configuration.
The link still comes up with the S4 driver effectively following the "Common
REFCLK" branch in Figure 104.5 of the S4 UM. The same figure shows a single
"Separate REFCLK" branch for both SRNS and SRIS. The host can supply REFCLK at
the OcuLink connector (pls see c588e1c9846b for the GPIO control). Since a
different endpoint may use that clock, I'd imagine we'd leave refclk-mode
unspecified in the stock Spider host DTS with the binding as proposed in v2.
Best regards,
Koichiro Den
>
> --
> Best regards,
> Marek Vasut
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] PCI: rcar-gen4: Set SRIS mode in rcar_gen4_pcie_common_init()
2026-12-02 14:54 ` Koichiro Den
@ 2026-12-02 20:12 ` Marek Vasut
2026-12-03 4:57 ` Koichiro Den
0 siblings, 1 reply; 8+ messages in thread
From: Marek Vasut @ 2026-12-02 20:12 UTC (permalink / raw)
To: Koichiro Den
Cc: linux-pci, Krzysztof Wilczyński, Bjorn Helgaas,
Geert Uytterhoeven, Lorenzo Pieralisi, Magnus Damm,
Manivannan Sadhasivam, Rob Herring, Yoshihiro Shimoda,
linux-renesas-soc
On 12/2/26 3:54 PM, Koichiro Den wrote:
> On Wed, Dec 02, 2026 at 04:10:57AM +0100, Marek Vasut wrote:
>> On 11/30/26 9:34 AM, Koichiro Den wrote:
>>> Hi Marek, thanks for informing me via cc.
>>
>> Hello Den-san, gladly, thank you for your good feedback.
>>
>>> On Sun, Nov 29, 2026 at 04:40:52PM +0100, Marek Vasut wrote:
>>>> Except for R-Car S4 variant of this controller, all other variants of
>>>> this PCIe controller set PCIEMSR0 APP_SRIS_MODE bit as part of their
>>>> .link_up callback. Simplify this, introduce .sris_mode flag in driver
>>> ^^^^^^^^
>>> nit: is this a typo for .ltssm_control?
>>
>> This should have been .start_link , which yes, invokes ->ltssm_control .
>>
>>>> data and set it for all but R-Car S4 controller, and then set PCIEMSR0
>>>> APP_SRIS_MODE bit based on this flag in rcar_gen4_pcie_common_init()
>>>> already. Removes one read-modify-write round. No functional change.
>>>
>>> For R-Car Gen5 PCIe4, is this really no functional change? If not, would it be
>>> better to split the Gen5 change into a separate patch?
>> Looking at the input from Niklas, I think this entire patch will be
>> superseded by something even better.
>
> Since I believe this was meant as a clean-up, I agree we can wait for the
> generic binding to settle. Thanks!
Likewise, thank you for keeping an eye on these patches!
> P.S. Just thinking out loud about S4 and Niklas's RFC v2...
> As you might remember, I've got two Spiders connected at a remote site, one as
> RC and the other as EP. Going by the schematic (around R377/R378 marked "Do not
> stuff"), I'd expect each board to use its own REFCLK in the stock configuration.
I was always wondering whether you modified those S4 Spiders somehow, or
whether you simply connected them with an Oculink cable. I have multiple
M.2-to-Oculink adapters here now, but I never got around to figuring out
what to do about the clock lane, especially on the EP end.
> The link still comes up with the S4 driver effectively following the "Common
> REFCLK" branch in Figure 104.5 of the S4 UM. The same figure shows a single
> "Separate REFCLK" branch for both SRNS and SRIS. The host can supply REFCLK at
> the OcuLink connector (pls see c588e1c9846b for the GPIO control). Since a
> different endpoint may use that clock, I'd imagine we'd leave refclk-mode
> unspecified in the stock Spider host DTS with the binding as proposed in v2.
For Spider, I agree. Also, I think we might need to model the oculink
connector in DT, with its clock (control) property to enable/disable the
PCIe clock on the connector ?
[...]
--
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] PCI: rcar-gen4: Set SRIS mode in rcar_gen4_pcie_common_init()
2026-12-02 20:12 ` Marek Vasut
@ 2026-12-03 4:57 ` Koichiro Den
0 siblings, 0 replies; 8+ messages in thread
From: Koichiro Den @ 2026-12-03 4:57 UTC (permalink / raw)
To: Marek Vasut
Cc: linux-pci, Krzysztof Wilczyński, Bjorn Helgaas,
Geert Uytterhoeven, Lorenzo Pieralisi, Magnus Damm,
Manivannan Sadhasivam, Rob Herring, Yoshihiro Shimoda,
linux-renesas-soc
On Wed, Dec 02, 2026 at 09:12:41PM +0100, Marek Vasut wrote:
> On 12/2/26 3:54 PM, Koichiro Den wrote:
> > On Wed, Dec 02, 2026 at 04:10:57AM +0100, Marek Vasut wrote:
> > > On 11/30/26 9:34 AM, Koichiro Den wrote:
> > > > Hi Marek, thanks for informing me via cc.
> > >
> > > Hello Den-san, gladly, thank you for your good feedback.
> > >
> > > > On Sun, Nov 29, 2026 at 04:40:52PM +0100, Marek Vasut wrote:
> > > > > Except for R-Car S4 variant of this controller, all other variants of
> > > > > this PCIe controller set PCIEMSR0 APP_SRIS_MODE bit as part of their
> > > > > .link_up callback. Simplify this, introduce .sris_mode flag in driver
> > > > ^^^^^^^^
> > > > nit: is this a typo for .ltssm_control?
> > >
> > > This should have been .start_link , which yes, invokes ->ltssm_control .
> > >
> > > > > data and set it for all but R-Car S4 controller, and then set PCIEMSR0
> > > > > APP_SRIS_MODE bit based on this flag in rcar_gen4_pcie_common_init()
> > > > > already. Removes one read-modify-write round. No functional change.
> > > >
> > > > For R-Car Gen5 PCIe4, is this really no functional change? If not, would it be
> > > > better to split the Gen5 change into a separate patch?
> > > Looking at the input from Niklas, I think this entire patch will be
> > > superseded by something even better.
> >
> > Since I believe this was meant as a clean-up, I agree we can wait for the
> > generic binding to settle. Thanks!
>
> Likewise, thank you for keeping an eye on these patches!
>
> > P.S. Just thinking out loud about S4 and Niklas's RFC v2...
> > As you might remember, I've got two Spiders connected at a remote site, one as
> > RC and the other as EP. Going by the schematic (around R377/R378 marked "Do not
> > stuff"), I'd expect each board to use its own REFCLK in the stock configuration.
>
> I was always wondering whether you modified those S4 Spiders somehow, or
> whether you simply connected them with an Oculink cable.
Just the cable in my case. The two Spiders connected directly with a LINKUP
OCuLink cable. I was told this cable had already been tested with two Spiders.
(I suspect it's an Internal crossover cable, but I haven't checked the
plug-to-plug wiring myself.)
The boards weren't supplied as EP-only boards, and I'm not aware of any rework
around CN16 (including R377/R378). Per the schematic, OUT4 of U36 (the clock
generator) feeds the local PCIe0 PHY and OUT5 goes to CN16 on both boards.
So I'd expect the endpoint Spider to use its own REFCLK even when the host
supplies one at CN16. The link comes up fine in this setup.
> I have multiple
> M.2-to-Oculink adapters here now, but I never got around to figuring out
> what to do about the clock lane, especially on the EP end.
I was thinking of separate clocks for a two-board setup, but were you thinking
of having the endpoint take REFCLK from the host through the adapter? I've had a
quick glance at the White/Sparrow Hawk schematics, and the Sparrow Hawk one
appears to spell out which 0-ohm links to change for what.
I'm sure I'm not telling you anything new here. Also, I don't have either Hawk
to try it.
>
> > The link still comes up with the S4 driver effectively following the "Common
> > REFCLK" branch in Figure 104.5 of the S4 UM. The same figure shows a single
> > "Separate REFCLK" branch for both SRNS and SRIS. The host can supply REFCLK at
> > the OcuLink connector (pls see c588e1c9846b for the GPIO control). Since a
> > different endpoint may use that clock, I'd imagine we'd leave refclk-mode
> > unspecified in the stock Spider host DTS with the binding as proposed in v2.
>
> For Spider, I agree. Also, I think we might need to model the oculink
> connector in DT, with its clock (control) property to enable/disable the
> PCIe clock on the connector ?
I'm not sure what that would look like on Spider. Do you have a particular use
case in mind for controlling the clock at CN16? E.g. leaving it off at boot in a
fixed setup where we know the peer EP uses its own REFCLK? I'd appreciate it if
you could elaborate a bit, maybe with a rough DTS snippet.
Thanks for taking your time to discuss with me.
Best regards,
Koichiro Den
>
> [...]
>
> --
> Best regards,
> Marek Vasut
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] PCI: rcar-gen4: Set SRIS mode in rcar_gen4_pcie_common_init()
2026-11-29 15:40 [PATCH] PCI: rcar-gen4: Set SRIS mode in rcar_gen4_pcie_common_init() Marek Vasut
2026-11-30 8:34 ` Koichiro Den
@ 2026-11-30 20:22 ` Niklas Cassel
2026-12-02 20:15 ` Marek Vasut
1 sibling, 1 reply; 8+ messages in thread
From: Niklas Cassel @ 2026-11-30 20:22 UTC (permalink / raw)
To: Marek Vasut, Rob Herring, Vincent Guittot, Krzysztof Kozlowski,
Conor Dooley, devicetree
Cc: linux-pci, Krzysztof Wilczyński, Bjorn Helgaas,
Geert Uytterhoeven, Koichiro Den, Lorenzo Pieralisi, Magnus Damm,
Manivannan Sadhasivam, Yoshihiro Shimoda, linux-renesas-soc
Hello Marek,
On Sun, Nov 29, 2026 at 04:40:52PM +0100, Marek Vasut wrote:
> Except for R-Car S4 variant of this controller, all other variants of
> this PCIe controller set PCIEMSR0 APP_SRIS_MODE bit as part of their
> .link_up callback. Simplify this, introduce .sris_mode flag in driver
> data and set it for all but R-Car S4 controller, and then set PCIEMSR0
> APP_SRIS_MODE bit based on this flag in rcar_gen4_pcie_common_init()
> already. Removes one read-modify-write round. No functional change.
Which clocking modes a controller supports is a property of the SoC,
but which mode (Common Clock, SRNS or SRIS) should actually be used is
a property of the board, i.e. it depends on how the board provides the
reference clock (from the slot, or from an on-board clock generator,
and in the latter case, with or without SSC).
So I don't think that per-compatible driver data is the right place to
decide this.
This is even more apparent in endpoint mode, where whether the refclk
is sourced from the PCIe slot or from an on-board clock generator is
entirely up to the board design.
We have discussed this a few times before, see:
https://lore.kernel.org/linux-pci/aCQ9ge1eROhh9RVE@ryzen/
https://lore.kernel.org/linux-pci/aMp0hNnBUwTV5cbp@ryzen/
In the first thread, Rob agreed that this information is needed in DT
(although he suggested to describe the clock source using the clock
binding, with SSC described separately):
https://lore.kernel.org/linux-pci/20250519145636.GA2090206-robh@kernel.org/
In the second thread, the S32G driver dropped its vendor specific
"nxp,phy-mode" property "until we agreed on a generic binding", and
simply uses CRNS for now:
https://lore.kernel.org/linux-pci/20251121164920.2008569-1-vincent.guittot@linaro.org/
So rather than adding more per-SoC hardcoding, I would much prefer if
we could finally agree on a generic DT property for this. At least
Tegra, Qcom, Rockchip and S32G would benefit from such a property as
well.
Kind regards,
Niklas
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] PCI: rcar-gen4: Set SRIS mode in rcar_gen4_pcie_common_init()
2026-11-30 20:22 ` Niklas Cassel
@ 2026-12-02 20:15 ` Marek Vasut
0 siblings, 0 replies; 8+ messages in thread
From: Marek Vasut @ 2026-12-02 20:15 UTC (permalink / raw)
To: Niklas Cassel, Rob Herring, Vincent Guittot, Krzysztof Kozlowski,
Conor Dooley, devicetree
Cc: linux-pci, Krzysztof Wilczyński, Bjorn Helgaas,
Geert Uytterhoeven, Koichiro Den, Lorenzo Pieralisi, Magnus Damm,
Manivannan Sadhasivam, Yoshihiro Shimoda, linux-renesas-soc
On 11/30/26 9:22 PM, Niklas Cassel wrote:
Hello Niklas,
> On Sun, Nov 29, 2026 at 04:40:52PM +0100, Marek Vasut wrote:
>> Except for R-Car S4 variant of this controller, all other variants of
>> this PCIe controller set PCIEMSR0 APP_SRIS_MODE bit as part of their
>> .link_up callback. Simplify this, introduce .sris_mode flag in driver
>> data and set it for all but R-Car S4 controller, and then set PCIEMSR0
>> APP_SRIS_MODE bit based on this flag in rcar_gen4_pcie_common_init()
>> already. Removes one read-modify-write round. No functional change.
>
> Which clocking modes a controller supports is a property of the SoC,
> but which mode (Common Clock, SRNS or SRIS) should actually be used is
> a property of the board, i.e. it depends on how the board provides the
> reference clock (from the slot, or from an on-board clock generator,
> and in the latter case, with or without SSC).
>
> So I don't think that per-compatible driver data is the right place to
> decide this.
I agree with this.
> This is even more apparent in endpoint mode, where whether the refclk
> is sourced from the PCIe slot or from an on-board clock generator is
> entirely up to the board design.
>
> We have discussed this a few times before, see:
> https://lore.kernel.org/linux-pci/aCQ9ge1eROhh9RVE@ryzen/
> https://lore.kernel.org/linux-pci/aMp0hNnBUwTV5cbp@ryzen/
>
> In the first thread, Rob agreed that this information is needed in DT
> (although he suggested to describe the clock source using the clock
> binding, with SSC described separately):
> https://lore.kernel.org/linux-pci/20250519145636.GA2090206-robh@kernel.org/
>
> In the second thread, the S32G driver dropped its vendor specific
> "nxp,phy-mode" property "until we agreed on a generic binding", and
> simply uses CRNS for now:
> https://lore.kernel.org/linux-pci/20251121164920.2008569-1-vincent.guittot@linaro.org/
>
> So rather than adding more per-SoC hardcoding, I would much prefer if
> we could finally agree on a generic DT property for this. At least
> Tegra, Qcom, Rockchip and S32G would benefit from such a property as
> well.
I agree with this as well. I think "[RFC PATCH v2 0/3] PCI: Describe the
reference clock architecture of a Link" is the proposal ?
(I need to catch up on all the threads yet)
--
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-12-03 4:57 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29 15:40 [PATCH] PCI: rcar-gen4: Set SRIS mode in rcar_gen4_pcie_common_init() Marek Vasut
2026-11-30 8:34 ` Koichiro Den
2026-12-02 3:10 ` Marek Vasut
2026-12-02 14:54 ` Koichiro Den
2026-12-02 20:12 ` Marek Vasut
2026-12-03 4:57 ` Koichiro Den
2026-11-30 20:22 ` Niklas Cassel
2026-12-02 20:15 ` Marek Vasut
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox