Linux USB
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: mail@birger-koblitz.de
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
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	[thread overview]
Message-ID: <179479483039.3136.9639531602178863442@kernel.org> (raw)
In-Reply-To: <20261114-ax88179a-v21-13-c2d34410bcbe@birger-koblitz.de>

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

      parent reply	other threads:[~2026-11-16  2:07 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14 10:50 [PATCH net-next v21 00/13] ax88179_178a: Add support for AX88179A-based chips Birger Koblitz
2026-11-14 10:50 ` [PATCH net-next v21 01/13] phylink: Add phylink_mac_interrupt Birger Koblitz
2026-11-15 10:51   ` sashiko-bot
2026-11-16  2:06   ` netdev-bot+sashiko
2026-11-14 10:50 ` [PATCH net-next v21 02/13] phylib: Add support for PHYs with broken forced mode Birger Koblitz
2026-11-15 10:51   ` sashiko-bot
2026-11-16  2:06   ` netdev-bot+sashiko
2026-11-14 10:50 ` [PATCH net-next v21 03/13] ax88179_178a: Split driver into library and device specific code Birger Koblitz
2026-11-15 10:51   ` sashiko-bot
2026-11-16  2:06   ` netdev-bot+sashiko
2026-11-14 10:51 ` [PATCH net-next v21 04/13] ax88179_178a: Add HW support for AX179A-based chips Birger Koblitz
2026-11-15 10:51   ` sashiko-bot
2026-11-16  2:06   ` netdev-bot+sashiko
2026-11-14 10:51 ` [PATCH net-next v21 05/13] ax88179_178a: Add EEE configuration support for AX88179A MACs Birger Koblitz
2026-11-15 10:51   ` sashiko-bot
2026-11-14 10:51 ` [PATCH net-next v21 06/13] ax88179_178a: Add EEE configuration support for AX88179A PHYs Birger Koblitz
2026-11-15 10:51   ` sashiko-bot
2026-11-16  2:06   ` netdev-bot+sashiko
2026-11-14 10:51 ` [PATCH net-next v21 07/13] ax88179_178a: Add VLAN offload support for AX88179A Birger Koblitz
2026-11-15 10:51   ` sashiko-bot
2026-11-16  2:07   ` netdev-bot+sashiko
2026-11-14 10:51 ` [PATCH net-next v21 08/13] ax88179_178a: Add AX179A/AX279 multicast configuration Birger Koblitz
2026-11-15 10:51   ` sashiko-bot
2026-11-16  2:07   ` netdev-bot+sashiko
2026-11-14 10:51 ` [PATCH net-next v21 09/13] ax88179_178a: Add Suspend/resume support for AX88179A/772D/279 Birger Koblitz
2026-11-15 10:51   ` sashiko-bot
2026-11-16  2:07   ` netdev-bot+sashiko
2026-11-14 10:51 ` [PATCH net-next v21 10/13] ax88179_178a: Add ethtool get_drvinfo Birger Koblitz
2026-11-15 10:51   ` sashiko-bot
2026-11-16  2:07   ` netdev-bot+sashiko
2026-11-14 10:51 ` [PATCH net-next v21 11/13] ax88179_178a: Update driver name and information Birger Koblitz
2026-11-15 10:51   ` sashiko-bot
2026-11-16  2:07   ` netdev-bot+sashiko
2026-11-14 10:51 ` [PATCH net-next v21 12/13] ax88179_178a: Add support for AX88179A/772D/279 EEPROM access Birger Koblitz
2026-11-15 10:51   ` sashiko-bot
2026-11-16  2:07   ` netdev-bot+sashiko
2026-11-14 10:51 ` [PATCH net-next v21 13/13] ax88796b: Add support for AX88772D, AX88179A and AX88279 Birger Koblitz
2026-11-15 10:51   ` sashiko-bot
2026-11-16  2:07   ` 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=179479483039.3136.9639531602178863442@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=beganovic.emir@gmail.com \
    --cc=chenhuacai@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=kernel@xen0n.name \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=loongarch@lists.linux.dev \
    --cc=mail@birger-koblitz.de \
    --cc=netdev@vger.kernel.org \
    --cc=neuromoments@gmail.com \
    --cc=pabeni@redhat.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