public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: rmk+kernel@armlinux.org.uk
Cc: Jakub Kicinski <kuba@kernel.org>,
	andrew+netdev@lunn.ch, alexandre.torgue@foss.st.com,
	hkallweit1@gmail.com, vkoul@kernel.org,
	mohd.anwar@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com,
	andrew@lunn.ch, edumazet@google.com, netdev@vger.kernel.org,
	linux-phy@lists.infradead.org, davem@davemloft.net,
	linux-arm-msm@vger.kernel.org, neil.armstrong@linaro.org,
	linux-arm-kernel@lists.infradead.org, pabeni@redhat.com,
	mcoquelin.stm32@gmail.com,
	linux-stm32@st-md-mailman.stormreply.com
Subject: Re: [net-next,12/14] net: stmmac: add support for reading inband SGMII status
Date: Thu, 15 Jan 2026 18:58:52 -0800	[thread overview]
Message-ID: <20260116025852.354716-1-kuba@kernel.org> (raw)
In-Reply-To: <E1vg4wc-00000003SGl-1dZi@rmk-PC.armlinux.org.uk>

This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.

For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
---
net: stmmac: add support for reading inband SGMII status

This commit adds support for reading link status, speed, and duplex for
SGMII links from the RGSMII status register.

> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.c
> index 73fc56ce5e55..12fc5038d913 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.c

[ ... ]

> @@ -97,7 +107,7 @@ static void dwmac_integrated_pcs_get_state(struct phylink_pcs *pcs,
>  					   struct phylink_link_state *state)
>  {
>  	struct stmmac_pcs *spcs = phylink_pcs_to_stmmac_pcs(pcs);
> -	u32 status, lpa;
> +	u32 status, lpa, rgsmii;
>
>  	status = readl(spcs->base + GMAC_AN_STATUS);
>
> @@ -111,7 +121,35 @@ static void dwmac_integrated_pcs_get_state(struct phylink_pcs *pcs,
>
>  		phylink_mii_c22_pcs_decode_state(state, neg_mode, status, lpa);
>  	} else {
> -		state->link = false;
> +		rgsmii = field_get(spcs->rgsmii_status_mask,
> +				   readl(spcs->rgsmii));
> +		state->link = !!(status & GMAC_RGSMIII_LNKSTS);
                            ^^^^^^

Should this be checking rgsmii instead of status here? The status
variable contains the GMAC_AN_STATUS register which is equivalent to
MII_BMSR according to the comment at line 7. In BMSR, the link status
bit is BMSR_LSTATUS (bit 2), not bit 3.

GMAC_RGSMIII_LNKSTS is defined as BIT(3), which is the correct bit
position for the RGSMII status register (matching GMAC_RGSMIIIS_LNKSTS
in dwmac1000.h), but it appears to be applied to the wrong register
variable.

The code later uses rgsmii correctly for speed and duplex extraction.
Was the intent to use rgsmii for the link status check as well?

> +
> +		if (state->link && neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED) {

[ ... ]

  reply	other threads:[~2026-01-16  2:58 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-14 17:44 [PATCH RFC net-next 00/14] net: stmmac: SerDes, PCS, BASE-X, and inband goodies Russell King (Oracle)
2026-01-14 17:45 ` [PATCH net-next 01/14] net: stmmac: qcom-ethqos: remove mac_base Russell King (Oracle)
2026-01-14 20:48   ` Vladimir Oltean
2026-01-14 17:45 ` [PATCH net-next 02/14] net: stmmac: qcom-ethqos: convert to set_clk_tx_rate() method Russell King (Oracle)
2026-01-14 17:45 ` [PATCH net-next 03/14] phy: qcom-sgmii-eth: add .set_mode() and .validate() methods Russell King (Oracle)
2026-01-14 18:47   ` Vladimir Oltean
2026-01-14 18:55     ` Russell King (Oracle)
2026-01-14 19:02       ` Vladimir Oltean
2026-01-15 10:11   ` kernel test robot
2026-01-15 10:23   ` kernel test robot
2026-01-14 17:45 ` [PATCH net-next 04/14] net: stmmac: wrap phylink's rx_clk_stop functions Russell King (Oracle)
2026-01-15 14:47   ` Maxime Chevallier
2026-01-14 17:45 ` [PATCH net-next 05/14] net: stmmac: add stmmac core serdes support Russell King (Oracle)
2026-01-15 14:48   ` Maxime Chevallier
2026-01-15 15:15     ` Russell King (Oracle)
2026-01-16  2:57   ` [net-next,05/14] " Jakub Kicinski
2026-01-14 17:45 ` [PATCH net-next 06/14] net: stmmac: qcom-ethqos: convert to dwmac generic SerDes support Russell King (Oracle)
2026-01-14 17:45 ` [PATCH net-next 07/14] net: stmmac: move most PCS register definitions to stmmac_pcs.c Russell King (Oracle)
2026-01-14 17:45 ` [PATCH net-next 08/14] net: stmmac: handle integrated PCS phy_intf_sel separately Russell King (Oracle)
2026-01-14 17:45 ` [PATCH net-next 09/14] net: stmmac: add BASE-X support to integrated PCS Russell King (Oracle)
2026-01-14 17:46 ` [PATCH net-next 10/14] net: stmmac: use integrated PCS for BASE-X modes Russell King (Oracle)
2026-01-14 17:46 ` [PATCH net-next 11/14] net: stmmac: add struct stmmac_pcs_info Russell King (Oracle)
2026-01-14 17:46 ` [PATCH net-next 12/14] net: stmmac: add support for reading inband SGMII status Russell King (Oracle)
2026-01-16  2:58   ` Jakub Kicinski [this message]
2026-01-14 17:46 ` [PATCH net-next 13/14] net: stmmac: configure SGMII AN control according to phylink Russell King (Oracle)
2026-01-14 17:46 ` [PATCH net-next 14/14] net: stmmac: report PCS configuration changes Russell King (Oracle)
  -- strict thread matches above, loose matches on Subject: below --
2026-01-19 12:34 [PATCH net-next 12/14] net: stmmac: add support for reading inband SGMII status Russell King (Oracle)
2026-01-19 19:21 ` [net-next,12/14] " Jakub Kicinski

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=20260116025852.354716-1-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mohd.anwar@oss.qualcomm.com \
    --cc=neil.armstrong@linaro.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=vkoul@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