Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: hongmei.xu@oss.qualcomm.com
Cc: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	sagar.cheluvegowda@oss.qualcomm.com
Subject: Re: [PATCH net-next v3] net: phy: aquantia: Poll global status register for provision ID
Date: Mon, 16 Nov 2026 13:50:34 +0000	[thread overview]
Message-ID: <179483703468.3136.10188755486781063737@kernel.org> (raw)
In-Reply-To: <20261112-aquantia-poll-global-status-register-v3-1-c805647a60b4@oss.qualcomm.com>

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

Critical: 0 · High: 0 · Medium: 1 · Low: 3

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 aqr_wait_reset_complete()
  (drivers/net/phy/aquantia/aquantia_main.c:708-718), the new poll uses…
- [Low] The commit message presents the change as a fix for user-visible
  problems: steady link failures on AQR113, and a possible wrong host…
- [Low] The comment above aqr_wait_reset_complete()
  (aquantia_main.c:684-690) still says 'Use presence of the firmware ID…
- [Low] aqr_wait_reset_complete() now handles MDIO read errors
  inconsistently.

--

net: phy: aquantia: Poll global status register for provision ID

This patch adds a second poll to aqr_wait_reset_complete(). Once the
firmware ID is present, it also waits for the provisioning ID field in
VEND1_GLOBAL_RSVD_STAT1 to become non-zero. On timeout or on a read error
it logs a warning and still returns 0.

> Starting subsequent firmware operations before the provision ID is
> valid leads to steady link failures; this has been observed during
> AQR113 PHY bring-up.

[Severity: Low]
The commit message describes failures that users can see: link failures
on AQR113, and a possible USXGMII vs 10G-QXGMII mismatch on AQR412C with
MUSX firmware. There is no Fixes: tag and no Cc: stable.

The fingerprint-based translation in aqr_translate_interface() was added
by commit a76f26f7a81e ("net: phy: aquantia: support phy-mode =
"10g-qxgmii" on NXP SPF-30841 (AQR412C)"). The FW_ID-only completion check
goes back to commit 43429a0353af ("net: phy: aquantia: report PHY details
like firmware version").

Should one of these be named in a Fixes: tag so the change can reach
stable trees? If this counts as new board bring-up support, the tag may
not be needed.

> diff --git a/drivers/net/phy/aquantia/aquantia_main.c b/drivers/net/phy/aquantia/aquantia_main.c
> index e95d391a6dc23..b90221f1cf41c 100644
> --- a/drivers/net/phy/aquantia/aquantia_main.c
> +++ b/drivers/net/phy/aquantia/aquantia_main.c
> @@ -702,7 +702,22 @@ int aqr_wait_reset_complete(struct phy_device *phydev)
>  		return val;
>  	}
>  
> -	return ret;
> +	if (ret)
> +		return ret;
> +
> +	ret = read_poll_timeout(phy_read_mmd, val,
> +				val < 0 ||
> +				FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_PROV_ID, val),
> +				AQR_FW_WAIT_SLEEP_US, AQR_FW_WAIT_TIMEOUT_US,
> +				false, phydev, MDIO_MMD_VEND1,
> +				VEND1_GLOBAL_RSVD_STAT1);

[Severity: Medium]
What happens here on a PHY whose firmware image reports a provisioning ID
of 0?

VEND1_GLOBAL_RSVD_STAT1_PROV_ID holds the provisioning ID of the loaded
image. It is not a ready bit. The commit message also says "not all PHYs
require a valid provision ID". If 0 is a valid value, the exit condition
can never become true. read_poll_timeout() would then run for the full
AQR_FW_WAIT_TIMEOUT_US (2 s, about 100 MDIO reads) and print the warning
on every call.

The code alone doesn't show whether such images ship. The only in-tree
fingerprint uses prov_id 1, but the commit message suggests they exist.

The poll isn't limited to a particular model or firmware. It is reached
once at probe:

aqr107_probe()->aqr_firmware_load()->aqr_wait_reset_complete()

and on every phy_init_hw() (attach and resume):

phy_init_hw()->aqr_gen{1..4}_config_init()->aqr_gen1_config_init()
    ->aqr_wait_reset_complete()

That covers AQR105/107/AQCS109/AQR111/111B0/112/412/412C/113/113C/114C/
115/115C/AQR813. On multi-port packages each port waits separately.
Before this patch, the function returned on the first FW_ID read once the
firmware was running.

Only AQR412C uses the fingerprint, in aqr_translate_interface(). For the
other models, the "interface mode detection may be incorrect" warning
doesn't apply.

Could the wait be limited to the PHYs that need it, or use a different
completion indicator?

> +	if (val < 0)
> +		phydev_warn(phydev, "Failed to read VEND1_GLOBAL_RSVD_STAT1: %pe\n",
> +			    ERR_PTR(val));

[Severity: Low]
Is it intended that an MDIO read error on VEND1_GLOBAL_RSVD_STAT1 only
produces a warning?

On a read error, the FW_ID poll just above returns the negative errno:

	if (val < 0) {
		phydev_err(phydev, "Failed to read VEND1_GLOBAL_FW_ID: %pe\n",
			   ERR_PTR(val));
		return val;
	}

In the new poll, val < 0 makes the condition true, ret stays 0, and the
function falls through to return 0. In aqr_firmware_load(), the error then
lands in case 0 ("Some firmware is loaded => do nothing"). It never
reaches the default arm, which is commented "PHY read error, propagate it
to the caller".

The practical impact is small. FW_ID was already non-zero, and
aqr_build_fingerprint() reads RSVD_STAT1 again later and propagates a
persistent failure.

The commit message explains why a provisioning timeout is non-fatal.
Should a bus error be handled the same way as the FW_ID read error?

> +	else if (ret)
> +		phydev_warn(phydev, "Firmware provisioning ID not ready; interface mode detection may be incorrect\n");
> +
> +	return 0;
>  }

[Severity: Low]
This isn't a bug, but the comment above aqr_wait_reset_complete() still
says:

 * initialization has completed. Use presence of the firmware ID as
 * indicator for initialization having completed.

With the second poll, the function can now block for up to about 4 s
instead of 2 s. A return value of 0 can also mean the firmware ID is
present but provisioning wasn't confirmed, either because the poll timed
out or because the RSVD_STAT1 read failed.

Should the comment be updated to match?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112-aquantia-poll-global-status-register-v3-1-c805647a60b4%40oss.qualcomm.com

      reply	other threads:[~2026-11-16 13:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12  3:02 [PATCH net-next v3] net: phy: aquantia: Poll global status register for provision ID Hongmei Xu
2026-11-16 13:50 ` 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=179483703468.3136.10188755486781063737@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=hongmei.xu@oss.qualcomm.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sagar.cheluvegowda@oss.qualcomm.com \
    /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