Re: [PATCH net-next v4 05/10] net: stmmac: qcom-ethqos: add DLL-bypass for PHY-managed RGMII delays

From: Mohd Ayaan Anwar

Date: Sun Nov 22 2026 - 06:32:19 EST


On Fri, Nov 20, 2026 at 11:45:58AM +0000, netdev-bot+sashiko@xxxxxxxxxx wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential
> issue(s) to consider.
>
> Critical: 0 · High: 1 · Medium: 1 · Low: 0
>
> 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).
>
> - [High] In ethqos_set_clk_tx_rate()
> (drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c), the new…
> - [Medium] Speculative: the new RGMII_ID DLL-bypass path returns before
> the POR reset loop in ethqos_fix_mac_speed_rgmii().
>
> --
>
> net: stmmac: qcom-ethqos: add DLL-bypass for PHY-managed RGMII delays
>
> This adds a DLL-bypass programming path for RGMII_ID, where the PHY
> supplies both TX and RX delays. The path is guarded by a new
> phy_managed_delays flag in the platform descriptors. It also changes
> ethqos_set_clk_tx_rate() so the link clock is not doubled at 100M/10M in
> RGMII_ID mode.
>
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> > index f2428f0467bbb..99ea7e0cfb00d 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
>
> [ ... ]
>
> > @@ -189,7 +193,15 @@ static int ethqos_set_clk_tx_rate(void *bsp_priv, struct clk *clk_tx_i,
> > if (rate < 0)
> > return rate;
> >
> > - return clk_set_rate(ethqos->link_clk, rate * 2);
> > + /* Clock Rate Requirements:
> > + * MAC added delay: 250/50/5 MHz for 1G/100M/10M
> > + * No MAC delay (DLL bypass): 250/25/2.5 MHz for 1G/100M/10M
> > + */
> > + if (ethqos->phy_mode != PHY_INTERFACE_MODE_RGMII_ID ||
> > + speed == SPEED_1000)
> > + rate *= 2;
>
> [Severity: High]
> Should this check also look at ethqos->data->phy_managed_delays?
>
> In ethqos_fix_mac_speed_rgmii(), the bypass programming only runs when
> both conditions are true:
>
> if (ethqos->data->phy_managed_delays &&
> ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII_ID) {
>
> The existing descriptors don't set the flag. That covers emac_v2_3_0_data
> (qcs404), emac_v2_1_0_data (sm8150), emac_v3_0_0_data (sc8280xp) and
> emac_v4_0_0_data (sa8775p). With phy-mode "rgmii-id", these still take
> the legacy POR/DLL path and call ethqos_rgmii_macro_init(). That function
> always sets RGMII_CONFIG_DDR_MODE and programs the MAX_SPD_PRG_2/9
> dividers.
>
> The comment above says the MAC-delay setup needs 50/5 MHz. After this
> patch, these boards would get 25/2.5 MHz at 100M/10M. Doesn't that
> contradict this part of the commit message?
>
> "This new programming is guarded by a boolean set by the platform
> descriptors. No change intended on existing platforms."
>
> A later patch in the series, "add QCS615 EMAC support", notes that unlike
> QCS404, the QCS615 RGMII clock source supports the 25 MHz and 2.5 MHz
> rates. So on QCS404 with rgmii-id, this could request rates the clock
> source can't produce.
>
> Another later patch, "set initial RGMII link clock to lowest speed",
> changes the probe-time call to SPEED_10. Non-flagged rgmii-id platforms
> would then also get the halved 2.5 MHz rate at probe. The issue is still
> present at the end of the series.
>
> Would it work to use the same predicate as the bypass path? For example:
>
> if (!(ethqos->data->phy_managed_delays &&
> ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII_ID) ||
> speed == SPEED_1000)
> rate *= 2;
>

While there are no current users of "rgmii-id", I will add this check in
the next revision just to ensure that this new patch is independent of
the legacy RGMII handling.

Ayaan

pw-bot: cr