* [PATCH v5 0/4] PCI: rockchip: 5.0 GT/s speed discouraged by Rockchip
@ 2026-02-28 0:54 Geraldo Nascimento
2026-02-28 0:55 ` [PATCH v5 1/4] PCI: rockchip-ep: do not attempt 5.0 GT/s retraining Geraldo Nascimento
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Geraldo Nascimento @ 2026-02-28 0:54 UTC (permalink / raw)
To: Shawn Lin, Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, Heiko Stuebner,
Geraldo Nascimento, Dragan Simic
Cc: linux-rockchip, linux-pci, linux-arm-kernel, linux-kernel
Dragan Simic already had warned me of potential issues with 5.0 GT/s
speed operation in Rockchip PCIe. However, in recent interactions
with Shawn Lin from Rockchip it came to my attention there's grave
danger in the unknown errata regarding 5.0 GT/s operational speed
of their PCIe core.
Drop all code related to 5.0 GT/s operational speed from this driver.
Endpoint Mode driver was not tested.
---
Changes in v5:
- Changed commit order to not break builds and adjusted copy pasted
commit message. (thanks Charalampos!)
- Reintroduced behavior to force 2.5 GT/s in case there's something
non-default in the DT. (thanks Dragan!)
- Link to v4: https://lore.kernel.org/linux-rockchip/cover.1772169998.git.geraldogabriel@gmail.com/T/
Changes in v4:
- Incorporate suggestion by Bjorn and refined by Dragan to drop the
"catastrophic" code
- Link to v3: https://lore.kernel.org/linux-rockchip/cover.1772057799.git.geraldogabriel@gmail.com/T/
Changes in v3:
- Clarify warning message even though Rockchip won't disclose details
- Drop DT changes as they were applied as subset by Heiko
- Link to v2: https://lore.kernel.org/all/cover.1763415705.git.geraldogabriel@gmail.com/T/
Changes in v2:
- hard limit to 2.5 GT/s, not just warn
- add Reported-by: and Reviewed-by: Dragan Simic
- remove redundant declaration of max-link-speed from helios64 dts
- fix Link: of helios64 patch
- simplify RC mode comment
- Link to v1: https://lore.kernel.org/all/aRhR79u5BPtRRFw3@geday/T/
---
Geraldo Nascimento (4):
PCI: rockchip-ep: do not attempt 5.0 GT/s retraining
PCI: rockchip-host: do not attempt 5.0 GT/s retraining
PCI: rockchip: drive at 2.5 GT/s, error other speeds
PCI: rockchip: drop 5.0 GT/s defines
drivers/pci/controller/pcie-rockchip-ep.c | 13 -------------
drivers/pci/controller/pcie-rockchip-host.c | 20 --------------------
drivers/pci/controller/pcie-rockchip.c | 15 +++++++++------
drivers/pci/controller/pcie-rockchip.h | 3 ---
4 files changed, 9 insertions(+), 42 deletions(-)
--
2.52.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v5 1/4] PCI: rockchip-ep: do not attempt 5.0 GT/s retraining
2026-02-28 0:54 [PATCH v5 0/4] PCI: rockchip: 5.0 GT/s speed discouraged by Rockchip Geraldo Nascimento
@ 2026-02-28 0:55 ` Geraldo Nascimento
2026-02-28 0:55 ` [PATCH v5 2/4] PCI: rockchip-host: " Geraldo Nascimento
` (2 subsequent siblings)
3 siblings, 0 replies; 10+ messages in thread
From: Geraldo Nascimento @ 2026-02-28 0:55 UTC (permalink / raw)
To: Shawn Lin, Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, Heiko Stuebner,
Geraldo Nascimento, Dragan Simic
Cc: linux-rockchip, linux-pci, linux-arm-kernel, linux-kernel
Drop the 5.0 GT/s Link Speed retraining code block from Rockchip PCIe
EP driver. The reason is that Shawn Lin from Rockchip has reiterated
that there may be danger of "catastrophic failure" in using their PCIe
with 5.0 GT/s speeds.
While Rockchip has done so informally without issuing a proper errata,
and the particulars are thus unknown, this may cause data loss or
worse.
This change is corroborated by RK3399 official datasheet [1], which
states maximum link speed for this platform is 2.5 GT/s.
[1] https://opensource.rock-chips.com/images/d/d7/Rockchip_RK3399_Datasheet_V2.1-20200323.pdf
Link: https://lore.kernel.org/all/ffd05070-9879-4468-94e3-b88968b4c21b@rock-chips.com/
Cc: stable@vger.kernel.org
Reported-by: Dragan Simic <dsimic@manjaro.org>
Reported-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Geraldo Nascimento <geraldogabriel@gmail.com>
---
drivers/pci/controller/pcie-rockchip-ep.c | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/drivers/pci/controller/pcie-rockchip-ep.c b/drivers/pci/controller/pcie-rockchip-ep.c
index 799461335762..9ebc227a1ef8 100644
--- a/drivers/pci/controller/pcie-rockchip-ep.c
+++ b/drivers/pci/controller/pcie-rockchip-ep.c
@@ -553,19 +553,6 @@ static void rockchip_pcie_ep_link_training(struct work_struct *work)
if (ret)
goto again;
- /*
- * Check the current speed: if gen2 speed was requested and we are not
- * at gen2 speed yet, retrain again for gen2.
- */
- val = rockchip_pcie_read(rockchip, PCIE_CORE_CTRL);
- if (!PCIE_LINK_IS_GEN2(val) && rockchip->link_gen == 2) {
- /* Enable retrain for gen2 */
- rockchip_pcie_ep_retrain_link(rockchip);
- readl_poll_timeout(rockchip->apb_base + PCIE_CORE_CTRL,
- val, PCIE_LINK_IS_GEN2(val), 50,
- LINK_TRAIN_TIMEOUT);
- }
-
/* Check again that the link is up */
if (!rockchip_pcie_ep_link_up(rockchip))
goto again;
--
2.52.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v5 2/4] PCI: rockchip-host: do not attempt 5.0 GT/s retraining
2026-02-28 0:54 [PATCH v5 0/4] PCI: rockchip: 5.0 GT/s speed discouraged by Rockchip Geraldo Nascimento
2026-02-28 0:55 ` [PATCH v5 1/4] PCI: rockchip-ep: do not attempt 5.0 GT/s retraining Geraldo Nascimento
@ 2026-02-28 0:55 ` Geraldo Nascimento
2026-02-28 0:55 ` [PATCH v5 3/4] PCI: rockchip: drive at 2.5 GT/s, error other speeds Geraldo Nascimento
2026-02-28 0:55 ` [PATCH v5 4/4] PCI: rockchip: drop 5.0 GT/s defines Geraldo Nascimento
3 siblings, 0 replies; 10+ messages in thread
From: Geraldo Nascimento @ 2026-02-28 0:55 UTC (permalink / raw)
To: Shawn Lin, Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, Heiko Stuebner,
Geraldo Nascimento, Dragan Simic
Cc: linux-rockchip, linux-pci, linux-arm-kernel, linux-kernel
Drop the 5.0 GT/s Link Speed retraining from Rockchip PCIe Root
Complex Mode Operation, so called host driver.
The reason is that Shawn Lin from Rockchip has reiterated that there
may be danger of "catastrophic failure" in using their PCIe with
5.0GT/s speeds.
While Rockchip has done so informally without issuing a proper errata,
and the particulars are thus unknown, this may cause data loss or
worse.
This change is corroborated by RK3399 official datasheet [1], which
states maximum link speed for this platform is 2.5 GT/s.
[1] https://opensource.rock-chips.com/images/d/d7/Rockchip_RK3399_Datasheet_V2.1-20200323.pdf
Link: https://lore.kernel.org/all/ffd05070-9879-4468-94e3-b88968b4c21b@rock-chips.com/
Cc: stable@vger.kernel.org
Reported-by: Dragan Simic <dsimic@manjaro.org>
Reported-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Geraldo Nascimento <geraldogabriel@gmail.com>
---
drivers/pci/controller/pcie-rockchip-host.c | 20 --------------------
1 file changed, 20 deletions(-)
diff --git a/drivers/pci/controller/pcie-rockchip-host.c b/drivers/pci/controller/pcie-rockchip-host.c
index ee1822ca01db..1374a2c92b56 100644
--- a/drivers/pci/controller/pcie-rockchip-host.c
+++ b/drivers/pci/controller/pcie-rockchip-host.c
@@ -328,26 +328,6 @@ static int rockchip_pcie_host_init_port(struct rockchip_pcie *rockchip)
goto err_power_off_phy;
}
- if (rockchip->link_gen == 2) {
- /*
- * Enable retrain for gen2. This should be configured only after
- * gen1 finished.
- */
- status = rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCTL2);
- status &= ~PCI_EXP_LNKCTL2_TLS;
- status |= PCI_EXP_LNKCTL2_TLS_5_0GT;
- rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCTL2);
- status = rockchip_pcie_read(rockchip, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCTL);
- status |= PCI_EXP_LNKCTL_RL;
- rockchip_pcie_write(rockchip, status, PCIE_RC_CONFIG_CR + PCI_EXP_LNKCTL);
-
- err = readl_poll_timeout(rockchip->apb_base + PCIE_CORE_CTRL,
- status, PCIE_LINK_IS_GEN2(status), 20,
- 500 * USEC_PER_MSEC);
- if (err)
- dev_dbg(dev, "PCIe link training gen2 timeout, fall back to gen1!\n");
- }
-
/* Check the final link width from negotiated lane counter from MGMT */
status = rockchip_pcie_read(rockchip, PCIE_CORE_CTRL);
status = 0x1 << ((status & PCIE_CORE_PL_CONF_LANE_MASK) >>
--
2.52.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v5 3/4] PCI: rockchip: drive at 2.5 GT/s, error other speeds
2026-02-28 0:54 [PATCH v5 0/4] PCI: rockchip: 5.0 GT/s speed discouraged by Rockchip Geraldo Nascimento
2026-02-28 0:55 ` [PATCH v5 1/4] PCI: rockchip-ep: do not attempt 5.0 GT/s retraining Geraldo Nascimento
2026-02-28 0:55 ` [PATCH v5 2/4] PCI: rockchip-host: " Geraldo Nascimento
@ 2026-02-28 0:55 ` Geraldo Nascimento
2026-02-28 6:16 ` Dragan Simic
2026-02-28 0:55 ` [PATCH v5 4/4] PCI: rockchip: drop 5.0 GT/s defines Geraldo Nascimento
3 siblings, 1 reply; 10+ messages in thread
From: Geraldo Nascimento @ 2026-02-28 0:55 UTC (permalink / raw)
To: Shawn Lin, Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, Heiko Stuebner,
Geraldo Nascimento, Dragan Simic
Cc: linux-rockchip, linux-pci, linux-arm-kernel, linux-kernel
Configure the core to be driven at 2.5 GT/s Link Speed and ignore
any other speed with a warning. The reason is that Shawn Lin from
Rockchip has reiterated that there may be danger of "catastrophic
failure" in using their PCIe with 5.0 GT/s speeds.
While Rockchip has done so informally without issuing a proper errata,
and the particulars are thus unknown, this may cause data loss or
worse.
This change is corroborated by RK3399 official datasheet [1], which
states maximum link speed for this platform is 2.5 GT/s.
[1] https://opensource.rock-chips.com/images/d/d7/Rockchip_RK3399_Datasheet_V2.1-20200323.pdf
Fixes: 956cd99b35a8 ("PCI: rockchip: Separate common code from RC driver")
Link: https://lore.kernel.org/all/ffd05070-9879-4468-94e3-b88968b4c21b@rock-chips.com/
Cc: stable@vger.kernel.org
Reported-by: Dragan Simic <dsimic@manjaro.org>
Reported-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Geraldo Nascimento <geraldogabriel@gmail.com>
---
drivers/pci/controller/pcie-rockchip.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/pci/controller/pcie-rockchip.c b/drivers/pci/controller/pcie-rockchip.c
index 0f88da378805..2f211d1f4c7c 100644
--- a/drivers/pci/controller/pcie-rockchip.c
+++ b/drivers/pci/controller/pcie-rockchip.c
@@ -66,8 +66,10 @@ int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip)
}
rockchip->link_gen = of_pci_get_max_link_speed(node);
- if (rockchip->link_gen < 0 || rockchip->link_gen > 2)
- rockchip->link_gen = 2;
+ if (rockchip->link_gen < 0 || rockchip->link_gen >= 2) {
+ rockchip->link_gen = 1;
+ dev_warn(dev, "invalid max-link-speed, fix your DT\n");
+ }
for (i = 0; i < ROCKCHIP_NUM_PM_RSTS; i++)
rockchip->pm_rsts[i].id = rockchip_pci_pm_rsts[i];
@@ -147,12 +149,13 @@ int rockchip_pcie_init_port(struct rockchip_pcie *rockchip)
goto err_exit_phy;
}
- if (rockchip->link_gen == 2)
- rockchip_pcie_write(rockchip, PCIE_CLIENT_GEN_SEL_2,
- PCIE_CLIENT_CONFIG);
- else
+ if (rockchip->link_gen == 2) {
+ /* 5.0 GT/s may cause catastrophic failure for this core */
+ dev_warn(dev, "5.0 GT/s may cause data loss or worse\n");
+ } else {
rockchip_pcie_write(rockchip, PCIE_CLIENT_GEN_SEL_1,
PCIE_CLIENT_CONFIG);
+ }
regs = PCIE_CLIENT_ARI_ENABLE |
PCIE_CLIENT_CONF_LANE_NUM(rockchip->lanes);
--
2.52.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v5 4/4] PCI: rockchip: drop 5.0 GT/s defines
2026-02-28 0:54 [PATCH v5 0/4] PCI: rockchip: 5.0 GT/s speed discouraged by Rockchip Geraldo Nascimento
` (2 preceding siblings ...)
2026-02-28 0:55 ` [PATCH v5 3/4] PCI: rockchip: drive at 2.5 GT/s, error other speeds Geraldo Nascimento
@ 2026-02-28 0:55 ` Geraldo Nascimento
3 siblings, 0 replies; 10+ messages in thread
From: Geraldo Nascimento @ 2026-02-28 0:55 UTC (permalink / raw)
To: Shawn Lin, Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, Heiko Stuebner,
Geraldo Nascimento, Dragan Simic
Cc: linux-rockchip, linux-pci, linux-arm-kernel, linux-kernel
Drop the 5.0 GT/s Link Speed defines from Rockchip PCIe header.
The reason is that Shawn Lin from Rockchip has reiterated that there
may be danger of "catastrophic failure" in using their PCIe with
5.0 GT/s speeds.
While Rockchip has done so informally without issuing a proper errata,
and the particulars are thus unknown, this may cause data loss or
worse.
This change is corroborated by RK3399 official datasheet [1], which
states maximum link speed for this platform is 2.5 GT/s.
[1] https://opensource.rock-chips.com/images/d/d7/Rockchip_RK3399_Datasheet_V2.1-20200323.pdf
Fixes: 956cd99b35a8 ("PCI: rockchip: Separate common code from RC driver")
Link: https://lore.kernel.org/all/ffd05070-9879-4468-94e3-b88968b4c21b@rock-chips.com/
Cc: stable@vger.kernel.org
Reported-by: Dragan Simic <dsimic@manjaro.org>
Reported-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Geraldo Nascimento <geraldogabriel@gmail.com>
---
drivers/pci/controller/pcie-rockchip.h | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/pci/controller/pcie-rockchip.h b/drivers/pci/controller/pcie-rockchip.h
index 3e82a69b9c00..b5da15601b58 100644
--- a/drivers/pci/controller/pcie-rockchip.h
+++ b/drivers/pci/controller/pcie-rockchip.h
@@ -42,7 +42,6 @@
#define PCIE_CLIENT_MODE_RC HWORD_SET_BIT(0x0040)
#define PCIE_CLIENT_MODE_EP HWORD_CLR_BIT(0x0040)
#define PCIE_CLIENT_GEN_SEL_1 HWORD_CLR_BIT(0x0080)
-#define PCIE_CLIENT_GEN_SEL_2 HWORD_SET_BIT(0x0080)
#define PCIE_CLIENT_LEGACY_INT_CTRL (PCIE_CLIENT_BASE + 0x0c)
#define PCIE_CLIENT_INT_IN_ASSERT HWORD_SET_BIT(0x0002)
#define PCIE_CLIENT_INT_IN_DEASSERT HWORD_CLR_BIT(0x0002)
@@ -197,8 +196,6 @@
(((x) & PCIE_CORE_PL_CONF_LS_MASK) == PCIE_CORE_PL_CONF_LS_READY)
#define PCIE_LINK_UP(x) \
(((x) & PCIE_CLIENT_LINK_STATUS_MASK) == PCIE_CLIENT_LINK_STATUS_UP)
-#define PCIE_LINK_IS_GEN2(x) \
- (((x) & PCIE_CORE_PL_CONF_SPEED_MASK) == PCIE_CORE_PL_CONF_SPEED_5G)
#define RC_REGION_0_ADDR_TRANS_H 0x00000000
#define RC_REGION_0_ADDR_TRANS_L 0x00000000
--
2.52.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v5 3/4] PCI: rockchip: drive at 2.5 GT/s, error other speeds
2026-02-28 0:55 ` [PATCH v5 3/4] PCI: rockchip: drive at 2.5 GT/s, error other speeds Geraldo Nascimento
@ 2026-02-28 6:16 ` Dragan Simic
2026-03-05 4:19 ` Geraldo Nascimento
2026-03-05 4:48 ` Manivannan Sadhasivam
0 siblings, 2 replies; 10+ messages in thread
From: Dragan Simic @ 2026-02-28 6:16 UTC (permalink / raw)
To: Geraldo Nascimento
Cc: Shawn Lin, Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, Heiko Stuebner,
linux-rockchip, linux-pci, linux-arm-kernel, linux-kernel
Hello Geraldo,
On Saturday, February 28, 2026 01:55 CET, Geraldo Nascimento <geraldogabriel@gmail.com> wrote:
> Configure the core to be driven at 2.5 GT/s Link Speed and ignore
> any other speed with a warning. The reason is that Shawn Lin from
> Rockchip has reiterated that there may be danger of "catastrophic
> failure" in using their PCIe with 5.0 GT/s speeds.
>
> While Rockchip has done so informally without issuing a proper errata,
> and the particulars are thus unknown, this may cause data loss or
> worse.
>
> This change is corroborated by RK3399 official datasheet [1], which
> states maximum link speed for this platform is 2.5 GT/s.
>
> [1] https://opensource.rock-chips.com/images/d/d7/Rockchip_RK3399_Datasheet_V2.1-20200323.pdf
>
> Fixes: 956cd99b35a8 ("PCI: rockchip: Separate common code from RC driver")
> Link: https://lore.kernel.org/all/ffd05070-9879-4468-94e3-b88968b4c21b@rock-chips.com/
> Cc: stable@vger.kernel.org
> Reported-by: Dragan Simic <dsimic@manjaro.org>
> Reported-by: Shawn Lin <shawn.lin@rock-chips.com>
> Signed-off-by: Geraldo Nascimento <geraldogabriel@gmail.com>
> ---
> drivers/pci/controller/pcie-rockchip.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/pci/controller/pcie-rockchip.c b/drivers/pci/controller/pcie-rockchip.c
> index 0f88da378805..2f211d1f4c7c 100644
> --- a/drivers/pci/controller/pcie-rockchip.c
> +++ b/drivers/pci/controller/pcie-rockchip.c
> @@ -66,8 +66,10 @@ int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip)
> }
>
> rockchip->link_gen = of_pci_get_max_link_speed(node);
> - if (rockchip->link_gen < 0 || rockchip->link_gen > 2)
> - rockchip->link_gen = 2;
> + if (rockchip->link_gen < 0 || rockchip->link_gen >= 2) {
> + rockchip->link_gen = 1;
> + dev_warn(dev, "invalid max-link-speed, fix your DT\n");
> + }
I'd suggest using a bit more formal message here, like the one below,
which would also avoid addressing the user directly:
"Invalid max-link-speed found, limited to Gen1 to avoid data corruption"
> for (i = 0; i < ROCKCHIP_NUM_PM_RSTS; i++)
> rockchip->pm_rsts[i].id = rockchip_pci_pm_rsts[i];
> @@ -147,12 +149,13 @@ int rockchip_pcie_init_port(struct rockchip_pcie *rockchip)
> goto err_exit_phy;
> }
>
> - if (rockchip->link_gen == 2)
> - rockchip_pcie_write(rockchip, PCIE_CLIENT_GEN_SEL_2,
> - PCIE_CLIENT_CONFIG);
> - else
> + if (rockchip->link_gen == 2) {
> + /* 5.0 GT/s may cause catastrophic failure for this core */
> + dev_warn(dev, "5.0 GT/s may cause data loss or worse\n");
> + } else {
> rockchip_pcie_write(rockchip, PCIE_CLIENT_GEN_SEL_1,
> PCIE_CLIENT_CONFIG);
> + }
I don't think we need to emit a warning here, because, as we've already
established through earlier discussions, the rockchip_pcie_init_port()
function should never receive an invalid speed value.
> regs = PCIE_CLIENT_ARI_ENABLE |
> PCIE_CLIENT_CONF_LANE_NUM(rockchip->lanes);
It would make most sense to squash all three patches in this series
into a single patch, because they all form a single logical unit, which
introduces changes that are just going to be harder to track down later
if it's all scattered into multiple separate patches.
The only possible issue with the squashing comes from the inability to
have different patch subject prefixes for different driver changes, but
I think that's actually not an issue. The long-term benefits of having
everything as a single patch outweighs the benefits of having different
patch subjects with separate patches.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v5 3/4] PCI: rockchip: drive at 2.5 GT/s, error other speeds
2026-02-28 6:16 ` Dragan Simic
@ 2026-03-05 4:19 ` Geraldo Nascimento
2026-03-05 6:54 ` Dragan Simic
2026-03-05 4:48 ` Manivannan Sadhasivam
1 sibling, 1 reply; 10+ messages in thread
From: Geraldo Nascimento @ 2026-03-05 4:19 UTC (permalink / raw)
To: Dragan Simic
Cc: Shawn Lin, Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, Heiko Stuebner,
linux-rockchip, linux-pci, linux-arm-kernel, linux-kernel
On Sat, Feb 28, 2026 at 07:16:41AM +0100, Dragan Simic wrote:
> Hello Geraldo,
Hi Dragan,
>
> On Saturday, February 28, 2026 01:55 CET, Geraldo Nascimento <geraldogabriel@gmail.com> wrote:
> > Configure the core to be driven at 2.5 GT/s Link Speed and ignore
> > any other speed with a warning. The reason is that Shawn Lin from
> > Rockchip has reiterated that there may be danger of "catastrophic
> > failure" in using their PCIe with 5.0 GT/s speeds.
> >
> > While Rockchip has done so informally without issuing a proper errata,
> > and the particulars are thus unknown, this may cause data loss or
> > worse.
> >
> > This change is corroborated by RK3399 official datasheet [1], which
> > states maximum link speed for this platform is 2.5 GT/s.
> >
> > [1] https://opensource.rock-chips.com/images/d/d7/Rockchip_RK3399_Datasheet_V2.1-20200323.pdf
> >
> > Fixes: 956cd99b35a8 ("PCI: rockchip: Separate common code from RC driver")
> > Link: https://lore.kernel.org/all/ffd05070-9879-4468-94e3-b88968b4c21b@rock-chips.com/
> > Cc: stable@vger.kernel.org
> > Reported-by: Dragan Simic <dsimic@manjaro.org>
> > Reported-by: Shawn Lin <shawn.lin@rock-chips.com>
> > Signed-off-by: Geraldo Nascimento <geraldogabriel@gmail.com>
> > ---
> > drivers/pci/controller/pcie-rockchip.c | 15 +++++++++------
> > 1 file changed, 9 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/pci/controller/pcie-rockchip.c b/drivers/pci/controller/pcie-rockchip.c
> > index 0f88da378805..2f211d1f4c7c 100644
> > --- a/drivers/pci/controller/pcie-rockchip.c
> > +++ b/drivers/pci/controller/pcie-rockchip.c
> > @@ -66,8 +66,10 @@ int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip)
> > }
> >
> > rockchip->link_gen = of_pci_get_max_link_speed(node);
> > - if (rockchip->link_gen < 0 || rockchip->link_gen > 2)
> > - rockchip->link_gen = 2;
> > + if (rockchip->link_gen < 0 || rockchip->link_gen >= 2) {
> > + rockchip->link_gen = 1;
> > + dev_warn(dev, "invalid max-link-speed, fix your DT\n");
> > + }
>
> I'd suggest using a bit more formal message here, like the one below,
> which would also avoid addressing the user directly:
>
> "Invalid max-link-speed found, limited to Gen1 to avoid data corruption"
We really should spare on characters here, but I see your point and will
try to cook up a better way.
>
> > for (i = 0; i < ROCKCHIP_NUM_PM_RSTS; i++)
> > rockchip->pm_rsts[i].id = rockchip_pci_pm_rsts[i];
> > @@ -147,12 +149,13 @@ int rockchip_pcie_init_port(struct rockchip_pcie *rockchip)
> > goto err_exit_phy;
> > }
> >
> > - if (rockchip->link_gen == 2)
> > - rockchip_pcie_write(rockchip, PCIE_CLIENT_GEN_SEL_2,
> > - PCIE_CLIENT_CONFIG);
> > - else
> > + if (rockchip->link_gen == 2) {
> > + /* 5.0 GT/s may cause catastrophic failure for this core */
> > + dev_warn(dev, "5.0 GT/s may cause data loss or worse\n");
> > + } else {
> > rockchip_pcie_write(rockchip, PCIE_CLIENT_GEN_SEL_1,
> > PCIE_CLIENT_CONFIG);
> > + }
>
> I don't think we need to emit a warning here, because, as we've already
> established through earlier discussions, the rockchip_pcie_init_port()
> function should never receive an invalid speed value.
Just as a lame excuse, those messages were everywhere in the mid of my
development, this is one that escaped deletion, will drop.
>
> > regs = PCIE_CLIENT_ARI_ENABLE |
> > PCIE_CLIENT_CONF_LANE_NUM(rockchip->lanes);
>
> It would make most sense to squash all three patches in this series
> into a single patch, because they all form a single logical unit, which
> introduces changes that are just going to be harder to track down later
> if it's all scattered into multiple separate patches.
I agree, having all drops in one big patch is the better tactic here.
>
> The only possible issue with the squashing comes from the inability to
> have different patch subject prefixes for different driver changes, but
> I think that's actually not an issue. The long-term benefits of having
> everything as a single patch outweighs the benefits of having different
> patch subjects with separate patches.
>
Sure, will do so for v6.
Many thanks,
Geraldo Nascimento
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v5 3/4] PCI: rockchip: drive at 2.5 GT/s, error other speeds
2026-02-28 6:16 ` Dragan Simic
2026-03-05 4:19 ` Geraldo Nascimento
@ 2026-03-05 4:48 ` Manivannan Sadhasivam
2026-03-05 5:07 ` Geraldo Nascimento
1 sibling, 1 reply; 10+ messages in thread
From: Manivannan Sadhasivam @ 2026-03-05 4:48 UTC (permalink / raw)
To: Dragan Simic
Cc: Geraldo Nascimento, Shawn Lin, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Heiko Stuebner, linux-rockchip, linux-pci, linux-arm-kernel,
linux-kernel
On Sat, Feb 28, 2026 at 07:16:41AM +0100, Dragan Simic wrote:
> Hello Geraldo,
>
> On Saturday, February 28, 2026 01:55 CET, Geraldo Nascimento <geraldogabriel@gmail.com> wrote:
> > Configure the core to be driven at 2.5 GT/s Link Speed and ignore
> > any other speed with a warning. The reason is that Shawn Lin from
> > Rockchip has reiterated that there may be danger of "catastrophic
> > failure" in using their PCIe with 5.0 GT/s speeds.
> >
> > While Rockchip has done so informally without issuing a proper errata,
> > and the particulars are thus unknown, this may cause data loss or
> > worse.
> >
> > This change is corroborated by RK3399 official datasheet [1], which
> > states maximum link speed for this platform is 2.5 GT/s.
> >
> > [1] https://opensource.rock-chips.com/images/d/d7/Rockchip_RK3399_Datasheet_V2.1-20200323.pdf
> >
> > Fixes: 956cd99b35a8 ("PCI: rockchip: Separate common code from RC driver")
> > Link: https://lore.kernel.org/all/ffd05070-9879-4468-94e3-b88968b4c21b@rock-chips.com/
> > Cc: stable@vger.kernel.org
> > Reported-by: Dragan Simic <dsimic@manjaro.org>
> > Reported-by: Shawn Lin <shawn.lin@rock-chips.com>
> > Signed-off-by: Geraldo Nascimento <geraldogabriel@gmail.com>
> > ---
> > drivers/pci/controller/pcie-rockchip.c | 15 +++++++++------
> > 1 file changed, 9 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/pci/controller/pcie-rockchip.c b/drivers/pci/controller/pcie-rockchip.c
> > index 0f88da378805..2f211d1f4c7c 100644
> > --- a/drivers/pci/controller/pcie-rockchip.c
> > +++ b/drivers/pci/controller/pcie-rockchip.c
> > @@ -66,8 +66,10 @@ int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip)
> > }
> >
> > rockchip->link_gen = of_pci_get_max_link_speed(node);
> > - if (rockchip->link_gen < 0 || rockchip->link_gen > 2)
> > - rockchip->link_gen = 2;
> > + if (rockchip->link_gen < 0 || rockchip->link_gen >= 2) {
> > + rockchip->link_gen = 1;
> > + dev_warn(dev, "invalid max-link-speed, fix your DT\n");
> > + }
>
> I'd suggest using a bit more formal message here, like the one below,
> which would also avoid addressing the user directly:
>
> "Invalid max-link-speed found, limited to Gen1 to avoid data corruption"
>
> > for (i = 0; i < ROCKCHIP_NUM_PM_RSTS; i++)
> > rockchip->pm_rsts[i].id = rockchip_pci_pm_rsts[i];
> > @@ -147,12 +149,13 @@ int rockchip_pcie_init_port(struct rockchip_pcie *rockchip)
> > goto err_exit_phy;
> > }
> >
> > - if (rockchip->link_gen == 2)
> > - rockchip_pcie_write(rockchip, PCIE_CLIENT_GEN_SEL_2,
> > - PCIE_CLIENT_CONFIG);
> > - else
> > + if (rockchip->link_gen == 2) {
> > + /* 5.0 GT/s may cause catastrophic failure for this core */
> > + dev_warn(dev, "5.0 GT/s may cause data loss or worse\n");
> > + } else {
> > rockchip_pcie_write(rockchip, PCIE_CLIENT_GEN_SEL_1,
> > PCIE_CLIENT_CONFIG);
> > + }
>
> I don't think we need to emit a warning here, because, as we've already
> established through earlier discussions, the rockchip_pcie_init_port()
> function should never receive an invalid speed value.
>
> > regs = PCIE_CLIENT_ARI_ENABLE |
> > PCIE_CLIENT_CONF_LANE_NUM(rockchip->lanes);
>
> It would make most sense to squash all three patches in this series
> into a single patch, because they all form a single logical unit, which
> introduces changes that are just going to be harder to track down later
> if it's all scattered into multiple separate patches.
>
> The only possible issue with the squashing comes from the inability to
> have different patch subject prefixes for different driver changes, but
> I think that's actually not an issue. The long-term benefits of having
> everything as a single patch outweighs the benefits of having different
> patch subjects with separate patches.
>
Patches 3&4 can be squashed together, but the rest should be in separate patches
as they target different drivers. If we were to revert any of these in the
future, it becomes easy.
- Mani
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v5 3/4] PCI: rockchip: drive at 2.5 GT/s, error other speeds
2026-03-05 4:48 ` Manivannan Sadhasivam
@ 2026-03-05 5:07 ` Geraldo Nascimento
0 siblings, 0 replies; 10+ messages in thread
From: Geraldo Nascimento @ 2026-03-05 5:07 UTC (permalink / raw)
To: Manivannan Sadhasivam
Cc: Dragan Simic, Shawn Lin, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Heiko Stuebner, linux-rockchip, linux-pci, linux-arm-kernel,
linux-kernel
On Thu, Mar 05, 2026 at 10:18:34AM +0530, Manivannan Sadhasivam wrote:
> Patches 3&4 can be squashed together, but the rest should be in separate patches
> as they target different drivers. If we were to revert any of these in the
> future, it becomes easy.
Ah, OK, Mani, thanks for the clarification.
Geraldo Nascimento
>
> - Mani
>
> --
> மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v5 3/4] PCI: rockchip: drive at 2.5 GT/s, error other speeds
2026-03-05 4:19 ` Geraldo Nascimento
@ 2026-03-05 6:54 ` Dragan Simic
0 siblings, 0 replies; 10+ messages in thread
From: Dragan Simic @ 2026-03-05 6:54 UTC (permalink / raw)
To: Geraldo Nascimento
Cc: Shawn Lin, Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, Heiko Stuebner,
linux-rockchip, linux-pci, linux-arm-kernel, linux-kernel
Hello Geraldo,
On Thursday, March 05, 2026 05:19 CET, Geraldo Nascimento <geraldogabriel@gmail.com> wrote:
> On Sat, Feb 28, 2026 at 07:16:41AM +0100, Dragan Simic wrote:
> > On Saturday, February 28, 2026 01:55 CET, Geraldo Nascimento <geraldogabriel@gmail.com> wrote:
> > > Configure the core to be driven at 2.5 GT/s Link Speed and ignore
> > > any other speed with a warning. The reason is that Shawn Lin from
> > > Rockchip has reiterated that there may be danger of "catastrophic
> > > failure" in using their PCIe with 5.0 GT/s speeds.
> > >
> > > While Rockchip has done so informally without issuing a proper errata,
> > > and the particulars are thus unknown, this may cause data loss or
> > > worse.
> > >
> > > This change is corroborated by RK3399 official datasheet [1], which
> > > states maximum link speed for this platform is 2.5 GT/s.
> > >
> > > [1] https://opensource.rock-chips.com/images/d/d7/Rockchip_RK3399_Datasheet_V2.1-20200323.pdf
> > >
> > > Fixes: 956cd99b35a8 ("PCI: rockchip: Separate common code from RC driver")
> > > Link: https://lore.kernel.org/all/ffd05070-9879-4468-94e3-b88968b4c21b@rock-chips.com/
> > > Cc: stable@vger.kernel.org
> > > Reported-by: Dragan Simic <dsimic@manjaro.org>
> > > Reported-by: Shawn Lin <shawn.lin@rock-chips.com>
> > > Signed-off-by: Geraldo Nascimento <geraldogabriel@gmail.com>
> > > ---
> > > drivers/pci/controller/pcie-rockchip.c | 15 +++++++++------
> > > 1 file changed, 9 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/drivers/pci/controller/pcie-rockchip.c b/drivers/pci/controller/pcie-rockchip.c
> > > index 0f88da378805..2f211d1f4c7c 100644
> > > --- a/drivers/pci/controller/pcie-rockchip.c
> > > +++ b/drivers/pci/controller/pcie-rockchip.c
> > > @@ -66,8 +66,10 @@ int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip)
> > > }
> > >
> > > rockchip->link_gen = of_pci_get_max_link_speed(node);
> > > - if (rockchip->link_gen < 0 || rockchip->link_gen > 2)
> > > - rockchip->link_gen = 2;
> > > + if (rockchip->link_gen < 0 || rockchip->link_gen >= 2) {
> > > + rockchip->link_gen = 1;
> > > + dev_warn(dev, "invalid max-link-speed, fix your DT\n");
> > > + }
> >
> > I'd suggest using a bit more formal message here, like the one below,
> > which would also avoid addressing the user directly:
> >
> > "Invalid max-link-speed found, limited to Gen1 to avoid data corruption"
>
> We really should spare on characters here, but I see your point and will
> try to cook up a better way.
Makes sense, so perhaps just "Limited to Gen1 to avoid data corruption"
should be fine for the purpose, because anyone attempting to get rid
of that warning should search for what emitted it in the kernel source,
which would provide them with further information.
> > > for (i = 0; i < ROCKCHIP_NUM_PM_RSTS; i++)
> > > rockchip->pm_rsts[i].id = rockchip_pci_pm_rsts[i];
> > > @@ -147,12 +149,13 @@ int rockchip_pcie_init_port(struct rockchip_pcie *rockchip)
> > > goto err_exit_phy;
> > > }
> > >
> > > - if (rockchip->link_gen == 2)
> > > - rockchip_pcie_write(rockchip, PCIE_CLIENT_GEN_SEL_2,
> > > - PCIE_CLIENT_CONFIG);
> > > - else
> > > + if (rockchip->link_gen == 2) {
> > > + /* 5.0 GT/s may cause catastrophic failure for this core */
> > > + dev_warn(dev, "5.0 GT/s may cause data loss or worse\n");
> > > + } else {
> > > rockchip_pcie_write(rockchip, PCIE_CLIENT_GEN_SEL_1,
> > > PCIE_CLIENT_CONFIG);
> > > + }
> >
> > I don't think we need to emit a warning here, because, as we've already
> > established through earlier discussions, the rockchip_pcie_init_port()
> > function should never receive an invalid speed value.
>
> Just as a lame excuse, those messages were everywhere in the mid of my
> development, this is one that escaped deletion, will drop.
Thanks.
> > > regs = PCIE_CLIENT_ARI_ENABLE |
> > > PCIE_CLIENT_CONF_LANE_NUM(rockchip->lanes);
> >
> > It would make most sense to squash all three patches in this series
> > into a single patch, because they all form a single logical unit, which
> > introduces changes that are just going to be harder to track down later
> > if it's all scattered into multiple separate patches.
>
> I agree, having all drops in one big patch is the better tactic here.
>
> > The only possible issue with the squashing comes from the inability to
> > have different patch subject prefixes for different driver changes, but
> > I think that's actually not an issue. The long-term benefits of having
> > everything as a single patch outweighs the benefits of having different
> > patch subjects with separate patches.
>
> Sure, will do so for v6.
Thanks, but as Manivannan pointed out, having the changes split across
a couple of patches actually comes with benefits.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2026-03-05 6:54 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-28 0:54 [PATCH v5 0/4] PCI: rockchip: 5.0 GT/s speed discouraged by Rockchip Geraldo Nascimento
2026-02-28 0:55 ` [PATCH v5 1/4] PCI: rockchip-ep: do not attempt 5.0 GT/s retraining Geraldo Nascimento
2026-02-28 0:55 ` [PATCH v5 2/4] PCI: rockchip-host: " Geraldo Nascimento
2026-02-28 0:55 ` [PATCH v5 3/4] PCI: rockchip: drive at 2.5 GT/s, error other speeds Geraldo Nascimento
2026-02-28 6:16 ` Dragan Simic
2026-03-05 4:19 ` Geraldo Nascimento
2026-03-05 6:54 ` Dragan Simic
2026-03-05 4:48 ` Manivannan Sadhasivam
2026-03-05 5:07 ` Geraldo Nascimento
2026-02-28 0:55 ` [PATCH v5 4/4] PCI: rockchip: drop 5.0 GT/s defines Geraldo Nascimento
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox