From: netdev-bot+sashiko@kernel.org
To: james.hilliard1@gmail.com
Cc: richard.genoud@bootlin.com, maxime.chevallier@bootlin.com,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, wens@kernel.org,
jernej.skrabec@gmail.com, samuel@sholland.org,
mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com,
clabbe.montjoie@gmail.com, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, peppe.cavallaro@st.com,
joabreu@synopsys.com, alastair@d-silva.org, mripard@kernel.org,
netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev,
linux-stm32@st-md-mailman.stormreply.com,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
andre.przywara@arm.com
Subject: Re: [PATCH net-next v6 3/3] net: stmmac: sun8i: add support for Allwinner H616 EMAC1
Date: Tue, 29 Sep 2026 03:49:12 +0000 [thread overview]
Message-ID: <179065375273.434549.1903316827628045110@kernel.org> (raw)
In-Reply-To: <20260927-submit-h616-emac1-v1-v6-3-e64971f4e414@gmail.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The new H616 EMAC1 variant (`emac_variant_h616_emac1` in
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c) is meant to be…
--
net: stmmac: sun8i: add support for Allwinner H616 EMAC1
This adds an emac_variant for the H616 secondary EMAC. The variant uses a
dedicated syscon register at 0x34 and is described as RMII-only at 10/100
Mbps. It is wired internally to the co-packaged AC200/AC300 EPHY.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
> index 5691da796454d..47954537b29e4 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
[ ... ]
> @@ -143,6 +150,13 @@ static const struct emac_variant emac_variant_h6 = {
> .tx_delay_max = 7,
> };
>
> +static const struct emac_variant emac_variant_h616_emac1 = {
> + .syscon_field = &sun8i_syscon_reg_field_emac1,
> + /* The co-packaged AC200/AC300 PHY does not use the H3 PHY controls. */
> + .soc_has_internal_phy = false,
> + .support_rmii = true,
> +};
[Severity: Low]
Does anything actually restrict this variant to RMII?
The only place support_mii, support_rmii and support_rgmii appear is in
dwmac-sun8i.c: the kernel-doc, the struct emac_variant definition and the
variant initializers. Nothing reads them.
sun8i_dwmac_set_syscon() picks the register value from plat->phy_interface
and does it the same way for every variant:
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c:sun8i_dwmac_set_syscon() {
...
switch (plat->phy_interface) {
case PHY_INTERFACE_MODE_MII:
/* default */
break;
case PHY_INTERFACE_MODE_RGMII:
case PHY_INTERFACE_MODE_RGMII_ID:
case PHY_INTERFACE_MODE_RGMII_RXID:
case PHY_INTERFACE_MODE_RGMII_TXID:
reg |= SYSCON_EPIT | SYSCON_ETCS_INT_GMII;
break;
case PHY_INTERFACE_MODE_RMII:
reg |= SYSCON_RMII_EN | SYSCON_ETCS_EXT_GMII;
break;
...
regmap_field_write(gmac->regmap_field, reg);
...
}
Suppose a DT node with "allwinner,sun50i-h616-emac1" sets phy-mode to "mii"
or "rgmii*". Probe would still succeed, and a value without SYSCON_RMII_EN
would be written to the new register at 0x34. This MAC has no external pins.
dwmac-sun8i has no get_interfaces callback, so stmmac_phylink_setup() adds
the DT-supplied mode to supported_interfaces as is:
if (phy_interface_empty(config->supported_interfaces))
__set_bit(priv->plat->phy_interface,
config->supported_interfaces);
sun8i_dwmac_setup() also always advertises MAC_10 | MAC_100 | MAC_1000 in
mac->link.caps. With a non-RMII phy-mode, phylink could then allow gigabit
on a 10/100-only MAC.
The commit message says:
Add an EMAC1 variant using the dedicated register and enable only RMII.
There is also no in-tree binding for "allwinner,sun50i-h616-emac1" yet. As
far as I can tell, only a correct DT enforces the RMII-only restriction.
Older variants such as emac_variant_v3s have the same unchecked flags, but
this new variant's RMII-only behaviour depends on them. Would it make sense
to reject unsupported phy_interface values in sun8i_dwmac_set_syscon() or at
probe? Another option is a get_interfaces callback built from the support_*
flags. If neither fits, the commit message could say the restriction comes
only from the DT.
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260927-submit-h616-emac1-v1-v6-0-e64971f4e414%40gmail.com
prev parent reply other threads:[~2026-09-29 3:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-27 18:52 [PATCH net-next v6 0/3] net: stmmac: add Allwinner H616 EMAC1 support James Hilliard
2026-09-27 18:52 ` [PATCH net-next v6 1/3] net: stmmac: sun8i: reset the MAC after PHY initialization James Hilliard
2026-09-29 3:49 ` netdev-bot+sashiko
2026-09-27 18:52 ` [PATCH net-next v6 2/3] dt-bindings: net: allwinner: add H616 EMAC1 James Hilliard
2026-09-27 18:52 ` [PATCH net-next v6 3/3] net: stmmac: sun8i: add support for Allwinner " James Hilliard
2026-09-29 3:49 ` netdev-bot+sashiko [this message]
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=179065375273.434549.1903316827628045110@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=alastair@d-silva.org \
--cc=alexandre.torgue@foss.st.com \
--cc=andre.przywara@arm.com \
--cc=andrew+netdev@lunn.ch \
--cc=clabbe.montjoie@gmail.com \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=james.hilliard1@gmail.com \
--cc=jernej.skrabec@gmail.com \
--cc=joabreu@synopsys.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux-sunxi@lists.linux.dev \
--cc=maxime.chevallier@bootlin.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=mripard@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=peppe.cavallaro@st.com \
--cc=richard.genoud@bootlin.com \
--cc=robh@kernel.org \
--cc=samuel@sholland.org \
--cc=wens@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®