Subject: Re: [PATCH 6.6.y] net: usb: lan78xx: program MAC_CR for LAN7801 fixed-PHY link

From: Greg KH <[email-masked]>
Date: Fri, 5 Jun 2026 16:57:35 +0200

On Fri, Jun 05, 2026 at 07:15:35PM +0700, Nguyen Minh Tien wrote:
> While bringing up a LAN7801 wired over RGMII to an MDIO-less switch, I
> hit a link that the fixed PHY reported as "up" but that could not pass a
> single packet: every frame came out corrupted at the switch and no ARP
> reply ever made it back.
> 
> It turned out the MAC_CR speed/duplex bits are never set on this path.
> lan7801_phy_init() registers a fixed PHY at SPEED_1000/DUPLEX_FULL, but
> nothing programs the MAC to match: there is no PHY state machine for a
> fixed link, and lan78xx_reset() only sets the auto speed/duplex bits for
> the 7800.  So the 7801 comes up at 10M/half, clocks RGMII TXC at 2.5 MHz
> instead of 125 MHz, and mangles everything it transmits.
> 
> Fix it by programming MAC_CR to 1G/full in the fixed-PHY branch, to match
> fphy_status.  Only that branch is touched, so boards with a real external
> PHY (and the 7800/7850) are unaffected.
> 
> Mainline fixes this differently via the phylink conversion in v6.16,
> commit e110bc825897 ("net: usb: lan78xx: Convert to PHYLINK for improved
> PHY and MAC management"), which is far too large to backport, so this is
> a small fix for stable only.

Why is that too large?  If we take this, we then diverge and any future
fixes will not apply here :(

Please backport exactly what is in the mainline tree, otherwise odds
are, this one-off fix will be found incorrect (we always get it
wrong...)

thanks,

greg k-h