Re: [PATCH net-next v3 1/2] dt-bindings: net: rockchip-dwmac: Add RK3572
From: netdev-bot+sashiko
Date: Wed Nov 18 2026 - 05:41:36 EST
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 1
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] In rockchip-dwmac.yaml, this patch adds an allOf block that
sets `rx_delay: false` and `tx_delay: false` for rockchip,rk3572-gmac.
- [Low] Under the subject "Add RK3572", the patch adds `deprecated: true`
to the top-level tx_delay and rx_delay definitions in rockchip-…
--
dt-bindings: net: rockchip-dwmac: Add RK3572
This adds the rockchip,rk3572-gmac compatible, with snps,dwmac-4.20a as
the fallback, and requires rockchip,php-grf for it. It also marks
tx_delay and rx_delay as deprecated and disallows them for RK3572.
> diff --git a/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml b/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml
> index e8dda1961ab31..d7b7bb0082357 100644
> --- a/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml
[ ... ]
> @@ -112,6 +114,7 @@ properties:
> minimum: 0
> maximum: 0x7F
> default: 0x30
> + deprecated: true
>
> rx_delay:
> description: Delay value for RXD timing.
> @@ -119,6 +122,7 @@ properties:
> minimum: 0
> maximum: 0x7F
> default: 0x10
> + deprecated: true
[Severity: Low]
These deprecated: true lines are on the top-level tx_delay and rx_delay
definitions. Doesn't that deprecate them for every Rockchip GMAC compatible
(px30, rk3128 through rk3588, rv1108, rv1126), and not only for RK3572?
The binding doesn't name a replacement. dwmac-rk.c also doesn't read any
standard alternative such as rx-internal-delay-ps or tx-internal-delay-ps.
On the older SoCs, a board that needs MAC-side RGMII delay has no
non-deprecated way to describe it.
If a DT leaves the properties out, rk_gmac_setup() logs errors and falls
back to hidden defaults:
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c:rk_gmac_setup() {
...
ret = of_property_read_u32(dev->of_node, "tx_delay", &value);
if (ret) {
bsp_priv->tx_delay = 0x30;
dev_err(dev, "Can not read property: tx_delay.");
...
}
Could this binding-wide deprecation go in a separate patch with a rationale
and a successor that the driver supports? Alternatively, could it be limited
to compatibles where a replacement exists?
> @@ -141,11 +145,22 @@ required:
> allOf:
> - $ref: snps,dwmac.yaml#
>
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: rockchip,rk3572-gmac
> + then:
> + properties:
> + rx_delay: false
> + tx_delay: false
[Severity: Medium]
With rx_delay and tx_delay set to false, how does an RK3572 board control
the MAC-side RGMII delay? phy-mode isn't restricted, so "rgmii",
"rgmii-rxid" and "rgmii-txid" still pass validation.
The companion commit "net: stmmac: dwmac-rk: Add RK3572 support" binds
rockchip,rk3572-gmac to rk3572_ops. That uses the shared rk_gmac_setup()
and rk_gmac_powerup() paths. rk_gmac_setup() always reads both properties.
On a valid RK3572 DT they are always missing, so it falls back to 0x30/0x10:
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c:rk_gmac_setup() {
...
ret = of_property_read_u32(dev->of_node, "tx_delay", &value);
if (ret) {
bsp_priv->tx_delay = 0x30;
dev_err(dev, "Can not read property: tx_delay.");
dev_err(dev, "set tx_delay to 0x%x\n",
bsp_priv->tx_delay);
...
ret = of_property_read_u32(dev->of_node, "rx_delay", &value);
if (ret) {
bsp_priv->rx_delay = 0x10;
...
}
That gives four dev_err() lines on every probe of every RK3572 GMAC,
rgmii-id included.
Then the set_mode switch in rk_gmac_powerup() passes those fallbacks into
ops->set_to_rgmii():
case PHY_INTERFACE_MODE_RGMII:
...
bsp_priv->ops->set_to_rgmii(bsp_priv,
bsp_priv->tx_delay,
bsp_priv->rx_delay);
...
case PHY_INTERFACE_MODE_RGMII_RXID:
...
bsp_priv->tx_delay, 0);
...
case PHY_INTERFACE_MODE_RGMII_TXID:
...
0, bsp_priv->rx_delay);
In the companion commit, rk3572_set_to_rgmii() does:
u32 val = GRF_FIELD(14, 8, rx_delay) | GRF_FIELD(6, 0, tx_delay) |
GRF_FIELD(15, 15, !!rx_delay) | GRF_FIELD(7, 7, !!tx_delay);
So the non-zero fallbacks switch on the php_grf IOC delay lines. The delay
values are fixed, and the DT can't tune them or turn them off. Before this
change, tx_delay = <0> was how to turn the delay off, and the schema now
rejects that. Only phy-mode = "rgmii-id" ends up with zero MAC delay.
The commit message says the goal is "so new designs do not use the legacy
delay properties". The schema does that, but the driver still applies
legacy delay values through its hidden defaults.
The standard tx-internal-delay-ps and rx-internal-delay-ps properties
validate through snps,dwmac.yaml and ethernet-controller.yaml. But
dwmac-rk.c never reads them, so setting them does nothing and gives no
error.
Would it make sense to either restrict RK3572 to rgmii-id (with the driver
skipping the reads and dev_err() calls for RK3572), or to add driver
support for tx-internal-delay-ps and rx-internal-delay-ps before banning
the legacy properties?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116-add-board-ok3572-c-net-v3-0-a957fdcd9c7a%40qq.com