🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #16906

Re: [PATCH net-next v21 13/13] ax88796b: Add support for AX88772D, AX88179A and AX88279

#16906
From: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 02:07
257 lines
16952 bytes
Thank you for your contribution! Sashiko AI review found 5 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 2 · 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] The three new PHY IDs (AX88772D 0x003b772d, AX88179A
  0x003b179a, AX88279 0x003b2790) are added only to the C driver…
- [Medium] In asix_ax88279_read_status(), the 2500baseT_Full bit in
  phydev->lp_advertising is cleared and recomputed only after the `if…
- [Low] In asix_ax88772D_get_features() (drivers/net/phy/ax88796b.c, line
  215-216), `phydev->c45_ids.mmds_present |= MDIO_DEVS_PMAPMD |…
- [Low] asix_ax88279_read_status() always sets `phydev->duplex =
  DUPLEX_FULL` (line 142) with the comment "Only supports full duplex".
- [Low] asix_ax88772D_get_features() removes
  1000baseT_Full/1000baseT_Half/1000baseX_Full from phydev->supported…

--

ax88796b: Add support for AX88772D, AX88179A and AX88279

This adds PHY IDs and driver entries for the internal PHYs of the ASIX
AX88772D, AX88179A and AX88279 USB Ethernet controllers. The AX88279 gets
its own get_features, config_aneg, read_status and config_init callbacks.
They handle 2.5G advertisement, read the speed from a vendor register, and
switch the interface between SGMII and 2500BASE-X.

> diff --git a/drivers/net/phy/ax88796b.c b/drivers/net/phy/ax88796b.c
> index f20ddf6491499..0df44e0e236ab 100644
> --- a/drivers/net/phy/ax88796b.c
> +++ b/drivers/net/phy/ax88796b.c

[ ... ]

> @@ -83,6 +96,107 @@ static int asix_ax88772a_read_status(struct phy_device *phydev)
>  	return 0;
>  }
>  
> +static int asix_ax88279_read_status(struct phy_device *phydev)
> +{
> +	int ret, val;
> +
> +	ret = genphy_read_status(phydev);
> +	if (ret)
> +		return ret;
> +
> +	if (!phydev->link)
> +		return 0;

[ ... ]

> +	linkmode_clear_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, phydev->lp_advertising);
> +	val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_10GBT_STAT);
> +	if (val >= 0 && val & MDIO_AN_10GBT_STAT_REMOK) {
> +		linkmode_mod_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT,
> +				 phydev->lp_advertising,
> +				 phydev->speed == SPEED_2500);
> +	}

[Severity: Medium]
Can the 2500baseT_Full bit that is set here stay in lp_advertising after
the link goes down?

This is the only place in asix_ax88279_read_status() that clears it, and
it comes after the early return on !phydev->link.

When a 2.5G link drops, genphy_read_status()->genphy_read_lpa() runs with
autoneg_complete false. That path only clears the C22 and 1000BASE-T
partner bits:

drivers/net/phy/phy_device.c:genphy_read_lpa() {
    ...
		if (!phydev->autoneg_complete) {
			mii_stat1000_mod_linkmode_lpa_t(phydev->lp_advertising,
							0);
			mii_lpa_mod_linkmode_lpa_t(phydev->lp_advertising, 0);
			return 0;
		}
    ...
}

The driver then returns before it gets to this linkmode_clear_bit(). As a
result, ethtool would show the link partner advertising 2500baseT/Full
while the link is down.

On the next link-up, phy_resolve_aneg_linkmode() also runs with the stale
bit still set. The AX_CTRL_STATUS read afterwards does correct the final
speed.

Should the bit be cleared before the !phydev->link check?

> +	/* Only supports full duplex */
> +	phydev->duplex = DUPLEX_FULL;

[ ... ]

> +static int asix_ax88279_get_features(struct phy_device *phydev)
> +{
> +	int ret;
> +
> +	/* MDIO_DEVS1/2 empty, so set mmds_present bits to allow reading abilities */
> +	phydev->c45_ids.mmds_present |= MDIO_DEVS_PMAPMD | MDIO_DEVS_AN;
> +
> +	linkmode_set_bit_array(phy_basic_ports_array, ARRAY_SIZE(phy_basic_ports_array),
> +			       phydev->supported);
> +
> +	ret = genphy_c45_pma_read_abilities(phydev);
> +	if (ret < 0)
> +		return ret;
> +
> +	/* AX88279 does not support reported 100baseT-half duplex mode */
> +	linkmode_clear_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT, phydev->supported);

[Severity: Low]
Should 10baseT_Half be cleared here too?

genphy_c45_pma_read_ext_abilities() sets both 10baseT_Full and
10baseT_Half from the single MDIO_PMA_EXTABLE_10BT bit. 10M also looks
supported, since asix_ax88279_read_status() decodes
AX_CTRL_STATUS_SPEED_10.

However, asix_ax88279_read_status() always reports full duplex:

	/* Only supports full duplex */
	phydev->duplex = DUPLEX_FULL;

If 10baseT_Half ends up in advertising, genphy_config_advert() writes
ADVERTISE_10HALF. A partner that only does 10M half duplex would then
resolve to 10/half while the driver reports full duplex.

The in-tree consumer, ax88179a_phylink_setup() in
drivers/net/usb/ax88179a_devices.c, does not give the AX88279 MAC_10.
phylink_bringup_phy() also replaces the PHY advertising with the validated
mask. So this cannot be hit through that driver today, but the supported
mask still disagrees with what read_status reports.

> +
> +	return 0;
> +}

[ ... ]

> @@ -94,6 +208,25 @@ static void asix_ax88772a_link_change_notify(struct phy_device *phydev)
>  	}
>  }
>  
> +static int asix_ax88772D_get_features(struct phy_device *phydev)
> +{
> +	int ret;
> +
> +	/* MDIO_DEVS1/2 empty, so set mmds_present bits to allow reading abilities */
> +	phydev->c45_ids.mmds_present |= MDIO_DEVS_PMAPMD | MDIO_DEVS_AN;
> +
> +	ret = genphy_read_abilities(phydev);

[Severity: Low]
This isn't a bug, but is the mmds_present assignment needed here?

genphy_read_abilities() is the C22 helper and never reads mmds_present.
In the tree, mmds_present is only read by genphy_c45_pma_read_abilities(),
genphy_c45_read_link() and phylink's C45 ioctl emulation. None of those
are on the AX88772D path.

It looks copied from asix_ax88279_get_features(), which does call
genphy_c45_pma_read_abilities(). Here the comment does not match what the
code does.

> +	if (ret < 0)
> +		return ret;
> +
> +	/* AX88772D does not support (possibly) reported 1000baseT modes */
> +	linkmode_clear_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, phydev->supported);
> +	linkmode_clear_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, phydev->supported);
> +	linkmode_clear_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT, phydev->supported);

[Severity: Low]
Can supported_eee keep 1000baseT_Full after these bits are cleared?

genphy_read_abilities() has already called
genphy_c45_read_eee_abilities(). That masks supported_eee against
supported as supported was at that point:

drivers/net/phy/phy-c45.c:genphy_c45_read_eee_cap1() {
    ...
	linkmode_and(phydev->supported_eee, phydev->supported_eee,
		     phydev->supported);
    ...
}

If ESTATUS reported 1000BT, that mask still includes 1000baseT_Full.
Nothing trims supported_eee again afterwards, and phy_probe() only ANDs
advertising_eee with supported_eee.

With ax88179a_phylink_setup() no lpi_capabilities are set for AX88772D, so
phylink calls phy_disable_eee() and this does not show up today. Would it
make sense to also clear the 1000BASE-T EEE modes from supported_eee here?

> +
> +	return 0;
> +}

[ ... ]

> @@ -124,6 +286,9 @@ static const struct mdio_device_id __maybe_unused asix_tbl[] = {
>  	{ PHY_ID_MATCH_EXACT(PHY_ID_ASIX_AX88772A) },
>  	{ PHY_ID_MATCH_EXACT(PHY_ID_ASIX_AX88772C) },
>  	{ PHY_ID_MATCH_MODEL(PHY_ID_ASIX_AX88796B) },
> +	{ PHY_ID_MATCH_EXACT(PHY_ID_ASIX_AX88772D) },
> +	{ PHY_ID_MATCH_EXACT(PHY_ID_ASIX_AX88179A) },
> +	{ PHY_ID_MATCH_EXACT(PHY_ID_ASIX_AX88279) },
>  	{ }
>  };

[Severity: Medium]
What happens to these PHYs when CONFIG_AX88796B_RUST_PHY=y?

drivers/net/phy/Makefile builds only one of the two drivers:

ifdef CONFIG_AX88796B_RUST_PHY
  obj-$(CONFIG_AX88796B_PHY)	+= ax88796b_rust.o
else
  obj-$(CONFIG_AX88796B_PHY)	+= ax88796b.o
endif

drivers/net/phy/ax88796b_rust.rs still registers only:

    drivers: [PhyAX88772A, PhyAX88772C, PhyAX88796B],

In that configuration, the IDs reported by ax88179_mdiobus_read() in
drivers/net/usb/ax88179a_devices.c would bind to the Generic PHY driver.
The AX88279 would then lose:

  - the C45 2.5G ability read
  - the AX_ADVERTISE_2500 write
  - the AX_CTRL_STATUS speed decoding
  - the SGMII/2500BASE-X interface switching

The AX88796B_RUST_PHY help text in drivers/net/phy/Kconfig also still
says:

	  The features are equivalent. It supports the Asix Electronics PHY
	  found in the X-Surf 100 AX88796B package.

The AX88796B_PHY help text still describes only the X-Surf 100 AX88796B
PHY.

Should the Rust driver get matching entries, or should Kconfig be updated
to reflect the difference?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261114-ax88179a-v21-0-c2d34410bcbe%40birger-koblitz.de
Technical Details
Message-ID: <179479483039.3136.9639531602178863442@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363997-linux-kernel-netdev=dewy.ru
References: <20261114-ax88179a-v21-13-c2d34410bcbe@birger-koblitz.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363997-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v21 13/13] ax88796b: Add support for AX88772D, AX88179A and AX88279
Date: Mon, 16 Nov 2026 02:07:10 +0000
Organization: Usenet Network
Message-ID: <179479483039.3136.9639531602178863442@kernel.org>
References: <20261114-ax88179a-v21-13-c2d34410bcbe@birger-koblitz.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="1956701"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:8h0WGqgpcavPYDcQklbpXn319F4= sha256:v4v46/uNwOPaTW9U9UheBIbx/jlWbXA+WAkvBOGTxag= sha1:PIdudTr5Lpcncj28R138120Mweo= sha256:nVWWS4ZcV9i1TH+NhHSbKJ8KphT/nwiDiyvdapSrtaU=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id E17C6114AF9; Mon, 16 Nov 2026 05:08:56 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AGz1Cn0qFRMo; Mon, 16 Nov 2026 05:08:53 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-363997-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id CAAB2114AF1; Mon, 16 Nov 2026 05:08:44 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id B57F938FE5; Mon, 16 Nov 2026 02:07:32 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794794837; b=TyxOdjj8W8p/vzKeC+CjRGmBoZYBXE8wL7+qDydyXI3fn5iVQMtgdxkWCJOD5d4VsSVJ NyQVnlSzG9+RO0ApPP+skFZq3VbU0ey0Q3wVj/sq3ne2w92MVroufAF8wYyQBUexiM5tO dlRkrlfe1B1tDe/AK6nI69hr2wsevD4SGHmyvAS6FH7/G0GEdsd9qF0w63cWN3FDyIy8Z ISnpa0PK4FcDdYxKn8DWlHX/R9Lba2+uUqifJs4/d/kAQm1wPykAeLX+0Hx+xcKfEdbHX uunOfrG63HPrpiZgX5auBJKJWXNFCBdOXqTGjQ4ET1BWjJ/cXTSgYWpj30ufza2KJGg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794794837; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=jd41p17RQC6/oN5+mEJT46P4PwFp+oPBriyl8PP+p2o=; b=UYro+fjy7hqa+SoyQkMfDJxmpqd/m/Gh5vYilwKdpJkhvs+e9dKPiOnqd1Y7YXpBQeN7 BdTXvNMAr4SllVfuekctsknkU/R8aFfeWzCa+y8M6r7TcE8VHEzCCFSxp1OvPiE4A1XiZ pvTaMnGlx6qFzHgAkxNcjtM7T/iG9Pb5iCu6tONr00Uj+EzCnr3HYOJvgwMd9PPLGII5S BkX9kVSysctSbfHR6iSlQDX7CKbWTZwkE68IN8+O/WeU2KUUfFeme/B4vjg7umGA2FUS7 3TtHwwlALH2usKLAHBzP8lgg5WMBPhAUB8NUCPG8Muu0Vere+lk79h2uLdZkakoENWg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Ji11LXTQ; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C28EE606A334; Mon, 16 Nov 2026 02:07:17 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Ji11LXTQ
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794794832; b=5gSsgvnUjBBzOpChM/ijwpB39katfoMt6yY3R3+J2F/qHcm/3MhTiD3UTqryc+H7q12M rfxn8uy4+ESqOd5vhDajF1p75W1DiZGOvyFxjVit0IDLMgGmCTDOiHEKz7no2/qEUIaCj +GoqGCOQmXkAnMliuKHfXvqHNKYgaIfhkMEaniqeL/BkxWVu0Wc9Nu8sWwQQgJL6u/alK BrDqxFIOshVsgvp2zCAW+RQJRoIruE7pCl1QITCHIH9AbqG4f/WEfd+wjCzQSvqr1VYms wm0u7GrD78X8d5Oy/qIfUUBuaz8gGNM6OwvpmLVzFWOZjBiA9Xdr1Lrp/udPf7ILFOQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794794832; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=jd41p17RQC6/oN5+mEJT46P4PwFp+oPBriyl8PP+p2o=; b=GFWakNfAfOg2dHfUbjomIJ4C+vBxHXlB02H336Ufo79TuWlGkt4+enykCFdu+qxXlYTx F/I/EgCm5ENfUp+fj3CAVchr9tjJkziBSUmFEzYFcSMN6NRkjeyGGFqX1qi1DqrvcL/CO qasiul0M8cP7upUHtBuNuy6NrnW333vc42lBZkrxxJAXLi8VuGiu4s+/SKcS+f1NsmAy8 x4FCJtn3Bs7Bqrn1/Z9zqt/7wG3RR+uuZc9io+mHIWlMmGoA5OqZPIq3jiPbLWVA0zs1T azKT4MCiOdxRzWgSV3r4lY5P4mqexncPY5rnOM38LaWBCcoKGsdXnUjdcxT9urK916A==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Ji11LXTQ; arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E2AAA60A2609; Mon, 16 Nov 2026 02:07:11 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D147D1F000CA; Mon, 16 Nov 2026 02:07:10 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794794831; bh=jd41p17RQC6/oN5+mEJT46P4PwFp+oPBriyl8PP+p2o=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Ji11LXTQpcOfi2uOdhif1RECePgcTyuUUsmmn13MuvStIZd3v0iLhfgHMV53ggS3W 0XVp0CLp1hc2A0/8aaCdljNAn1jOBzm29hHNMSXlaXRQ3cAVKCV3NkZoB5BWJtqV03 w0tp69lojywMdfqba3fEgSt/WQG5YSxjqAcCo0HcAy+MsRoznRthKtFMNG1sYEYUxa TVI+oxjicrHJC0Zwnn58UBd8QwvbYpjniMDjMWd46lNOgsBNlXmMeNu7sbWx50JSsY i8rrLoVM48wHYJtqoRnbwQa8l8nzflG1YAapDwYo3gJaCDNmoUMcJ0njKdiZFH4ce0 5gQ/XBFjeN/uw==
X-Cc: andrew+netdev@lunn.ch, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, linux@armlinux.org.uk, andrew@lunn.ch, hkallweit1@gmail.com, chenhuacai@kernel.org, kernel@xen0n.name, edumazet@kernel.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, neuromoments@gmail.com, beganovic.emir@gmail.com
X-In-Reply-To: <20261114-ax88179a-v21-13-c2d34410bcbe@birger-koblitz.de>
X-sashiko-severity: Medium
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-Received-Bytes: 16666