mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: mohd.anwar@oss.qualcomm.com
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
	kuba@kernel.org, pabeni@redhat.com, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org, afd@ti.com,
	andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk,
	richardcochran@gmail.com, andersson@kernel.org,
	konradybcio@kernel.org, alexandre.torgue@foss.st.com,
	peppe.cavallaro@st.com, joabreu@synopsys.com,
	maxime.chevallier@bootlin.com, mcoquelin.stm32@gmail.com,
	lorenzo.bianconi@oss.qualcomm.com, netdev@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH net-next v4 09/10] net: stmmac: qcom-ethqos: add Shikra EMAC support
Date: Fri, 20 Nov 2026 11:46:01 +0000	[thread overview]
Message-ID: <179517516121.3136.6880108744896327095@kernel.org> (raw)
In-Reply-To: <20261117-shikra_ethernet-v4-9-c41902e5f2fa@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 2 (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).

- [Medium] On Shikra, the DLL-bypass path is only used for phy-mode
  "rgmii-id", but nothing stops a DT from using another RGMII mode, and…
- [Medium] Putting "stmmaceth" in shikra_noc_clk_names (dwmac-qcom-
  ethqos.c:335-340) puts the stmmac-core-owned clock under OPP rate and…

Pre-existing issues:
- [Medium] This problem wasn't introduced by this patch, but by the
  earlier commit in this series "net: stmmac: qcom-ethqos: add DLL-…

--

net: stmmac: qcom-ethqos: add Shikra EMAC support

This adds the qcom,shikra-ethqos compatible and a new shikra_data
descriptor. The descriptor enables three NOC clocks whose rates are set
through an OPP table, sets a 36-bit DMA address width, and sets
phy_managed_delays so rgmii-id uses the DLL-bypass sequence.

> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> index 15385750b3e6e..a7fdba73da2ba 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> @@ -332,6 +332,24 @@ static const struct ethqos_emac_driver_data emac_v4_0_0_scmi_data = {
>  	.setup = ethqos_scmi_setup,
>  };
>  
> +static const char * const shikra_noc_clk_names[] = {
> +	"stmmaceth",

[Severity: Medium]
Putting "stmmaceth" in this list places a clock that the stmmac core owns
under OPP rate and VDD_CX control. Is the enable ordering on resume safe?

ethqos_clks_config(false) drops the vote with dev_pm_opp_set_rate(dev, 0).
In drivers/opp/core.c, _set_opp() with a NULL opp goes to
_disable_opp_table(). That removes the bandwidth, level and required-opps
votes, but it never lowers the clock rates. So stmmaceth stays at its OPP
maximum rate after the CX vote is gone.

On resume, stmmac_bus_clks_config() enables that same clock before the
glue callback puts the vote back:

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:stmmac_bus_clks_config() {
    ...
		ret = clk_prepare_enable(plat_dat->stmmac_clk);
    ...
		ret = clk_prepare_enable(plat_dat->pclk);
    ...
		if (plat_dat->clks_config) {
			ret = plat_dat->clks_config(plat_dat->bsp_priv, enabled);
    ...
}

ethqos_clks_config()->qcom_ethqos_set_opp() only runs after that. At
probe, stmmac_probe_config_dt() also enables stmmaceth before
ethqos_hlos_setup() votes.

The commit message says this is safe because "VDD_CX only needs to be
voted while DMA traffic is ongoing". However, the OPP required-opps
describe the CX corner a given clock frequency needs, whether or not
traffic is running.

Could stmmaceth be ungated at its OPP fmax while CX is at a lower corner?

For axi-noc and pcie-tile-axi-noc, the glue driver applies the vote
before enabling the clocks. Would it be better to do one of these
instead?

  - keep stmmaceth out of the OPP-managed set
  - lower its rate before dropping the vote
  - make sure the vote is in place before the core enables stmmac_clk

> +	"axi-noc",
> +	"pcie-tile-axi-noc",
> +	NULL,
> +};
> +
> +static const struct ethqos_emac_driver_data shikra_data = {
> +	.dma_addr_width = 36,
> +	.has_emac_ge_3 = true,
> +	.noc_clk_names = shikra_noc_clk_names,
> +	.num_noc_clks = ARRAY_SIZE(shikra_noc_clk_names) - 1,
> +	.rgmii_config_loopback_en = false,
> +	.phy_managed_delays = true,

[Severity: Medium]
This descriptor has phy_managed_delays but no rgmii_por table. What
happens if a Shikra DT uses phy-mode "rgmii", "rgmii-rxid" or
"rgmii-txid"?

ethqos_fix_mac_speed_rgmii() only takes the bypass for RGMII_ID:

	if (ethqos->data->phy_managed_delays &&
	    ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII_ID) {
		ethqos_configure_rgmii_id(ethqos, speed);
		return;
	}

Nothing limits Shikra to that mode:

  - qcom_ethqos_probe() accepts all four RGMII variants for every
    compatible.
  - ethqos_hlos_setup() installs ethqos_fix_mac_speed_rgmii() for all
    four.
  - The qcom,shikra-ethqos block in qcom,ethqos.yaml does not constrain
    phy-mode.

In those modes the generic DLL/IO-macro sequence runs. Its reset loop
does nothing, because num_rgmii_por is 0:

	/* Reset to POR values and enable clk */
	for (i = 0; i < ethqos->data->num_rgmii_por; i++)
		rgmii_writel(ethqos, ethqos->data->rgmii_por[i].value,
			     ethqos->data->rgmii_por[i].offset);

Every other HLOS RGMII descriptor has a 6-entry POR table. The
read-modify-write steps that follow depend on that reset:

  - ethqos_rgmii_macro_init() sets SDCC_DDR_CONFIG_EXT_PRG_RCLK_DLY and
    SDCC_DDR_CONFIG_EXT_PRG_RCLK_DLY_EN at 10/100M, and
    SDCC_DDR_CONFIG_PRG_DLY_EN at 1G. Neither path clears the other's
    bits.
  - ethqos_dll_configure() sets DLL_EN/CDR_EN/CDR_EXT_EN at 1G, and the
    10/100 path does not clear them.

After a speed renegotiation, can both RX delay mechanisms end up enabled,
so the result depends on link-speed history?

The 1G prg_rclk_dly value of 115 also assumes a TCXO_CYCLES_CNT that
comes from the v3/v4 POR value 0x80040800. Shikra never writes that
value.

The commit message says "No POR table is needed for this intended bypass
operation", but neither the binding nor the driver enforces rgmii-id.
Would one of these be appropriate?

  - constrain phy-mode to rgmii-id for qcom,shikra-ethqos in the binding
  - reject the non-ID RGMII modes in the driver for descriptors without
    a POR table
  - add a Shikra POR table

The later patch in this series, "net: stmmac: qcom-ethqos: add QCS615
EMAC support", uses the same pattern for qcs615_data.

[Severity: Medium]
This is a pre-existing issue and was not introduced by this patch. It
comes from the earlier commit in this series, "net: stmmac: qcom-ethqos:
add DLL-bypass for PHY-managed RGMII delays".

ethqos_set_clk_tx_rate() picks the link clock rate from phy_mode alone:

	if (ethqos->phy_mode != PHY_INTERFACE_MODE_RGMII_ID ||
	    speed == SPEED_1000)
		rate *= 2;

ethqos_fix_mac_speed_rgmii() also requires data->phy_managed_delays
before it takes the bypass. Take a descriptor without phy_managed_delays
(emac_v2_1_0, v2_3_0, v3_0_0, v4_0_0) and phy-mode "rgmii-id". At
100M/10M, doesn't the MAC-delay sequence then run with a 25/2.5 MHz link
clock instead of the 50/5 MHz it expects?

That would not match "No change intended on existing platforms" in the
earlier commit. No in-tree qcom DT uses rgmii-id with these compatibles
today. Shikra sets phy_managed_delays, so this patch is consistent with
the clock-rate logic. Checking ethqos->data->phy_managed_delays in
ethqos_set_clk_tx_rate() would probably belong in the earlier commit.

> +	.dwmac4_addrs = &ethqos_dwmac4_addrs,
> +	.setup = ethqos_hlos_setup,
> +};

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117-shikra_ethernet-v4-0-c41902e5f2fa%40oss.qualcomm.com

  parent reply	other threads:[~2026-11-20 11:46 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17  8:45 [PATCH net-next v4 00/10] " Mohd Ayaan Anwar
2026-11-17  8:45 ` [PATCH net-next v4 01/10] dt-bindings: net: ti,dp83867: add supply properties Mohd Ayaan Anwar
2026-11-18 18:58   ` Rob Herring (Arm)
2026-11-17  8:45 ` [PATCH net-next v4 02/10] net: phy: dp83867: add regulator supply management Mohd Ayaan Anwar
2026-11-20 11:45   ` netdev-bot+sashiko
2026-11-17  8:45 ` [PATCH net-next v4 03/10] dt-bindings: net: qcom,ethqos: add qcom,shikra-ethqos compatible Mohd Ayaan Anwar
2026-11-18 19:07   ` Rob Herring
2026-11-20 11:45   ` netdev-bot+sashiko
2026-11-17  8:45 ` [PATCH net-next v4 04/10] net: stmmac: qcom-ethqos: convert ethqos_rgmii_macro_init() to void Mohd Ayaan Anwar
2026-11-17  8:45 ` [PATCH net-next v4 05/10] net: stmmac: qcom-ethqos: add DLL-bypass for PHY-managed RGMII delays Mohd Ayaan Anwar
2026-11-20 11:45   ` netdev-bot+sashiko
2026-11-17  8:45 ` [PATCH net-next v4 06/10] net: stmmac: qcom-ethqos: set initial RGMII link clock to lowest speed Mohd Ayaan Anwar
2026-11-18  9:13   ` Lorenzo Bianconi
2026-11-17  8:45 ` [PATCH net-next v4 07/10] net: stmmac: qcom-ethqos: share common GMAC4 address table Mohd Ayaan Anwar
2026-11-17  8:45 ` [PATCH net-next v4 08/10] net: stmmac: qcom-ethqos: add per-platform NOC clock voting Mohd Ayaan Anwar
2026-11-18  9:40   ` Lorenzo Bianconi
2026-11-17  8:45 ` [PATCH net-next v4 09/10] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
2026-11-18  9:43   ` Lorenzo Bianconi
2026-11-20 11:46   ` netdev-bot+sashiko [this message]
2026-11-17  8:45 ` [PATCH net-next v4 10/10] net: stmmac: qcom-ethqos: add QCS615 " Mohd Ayaan Anwar
2026-11-18  9:44   ` Lorenzo Bianconi
2026-11-20 11:46   ` netdev-bot+sashiko

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=179517516121.3136.6880108744896327095@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=afd@ti.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andersson@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=joabreu@synopsys.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux@armlinux.org.uk \
    --cc=lorenzo.bianconi@oss.qualcomm.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mohd.anwar@oss.qualcomm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.com \
    --cc=richardcochran@gmail.com \
    --cc=robh@kernel.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

all inboxes | Powered by JetHome®