Thread (25 messages) flat view 25 messages, 4 authors, 2026-03-06

Re: [PATCH net-next v2 1/3] net: macb: fix SGMII with inband aneg disabled

From: Conor Dooley <conor@kernel.org>
Date: 2026-03-06 16:24:36
Also in: lkml

On Thu, Mar 05, 2026 at 02:28:08PM +0000, Russell King (Oracle) wrote:
I suggest something like the following in vitesse.c for this PHY:

#define VSC8662_EXT_CON1		0x17
#define VSC8662_EXT_CON_MAC_AN		BIT(13)

#define VSC8662_MAC_AN			0x1b
#define VSC8662_MAC_AN_BYPASS		BIT(13)

static unsigned int vsc8662_inband_caps(struct phy_device *phydev,
					phy_interface_t interface)
{
	if (interface == PHY_INTERFACE_MODE_SGMII)
		return LINK_INBAND_DISABLE | LINK_INBAND_ENABLE |
		       LINK_INBAND_BYPASS;

	return 0;
}

static int vsc8662_config_inband(struct phy_device *phydev, unsigned int modes)
{
	bool changed = false;
	u16 mask;
	int ret;

	mask = VSC8662_EXT_CON_MAC_AN;
	ret = phy_modify_changed(phydev, VSC8662_EXT_CON1, mask,
				 modes & (LINK_INBAND_ENABLE |
				 	  LINK_INBAND_BYPASS) ? mask : 0);
	if (ret > 0)
		changed = true;
FYI, clang warns that changed is set but not used.
	else if (ret < 0)
		return ret;

	mask = VSC8662_MAC_AN_BYPASS;
	ret = phy_modify(phydev, VSC8662_MAC_AN, mask,
			 modes & LINK_INBAND_BYPASS ? mask : 0);
	if (ret < 0)
		return ret;

	return genphy_soft_reset(phydev);
}

and the appropriate initialisers in the phy_driver struct.
I tested this, on top of the failing next that I found the problem on,
and it seems to make things work. Thanks for coming up with it.

Could you please make this a patch, I don't understand why this is the
correct way to fix the problem, or the impact on users of the 8662 other
than me, so I wouldn't be able to write a suitable commit message.

Cheers,
Conor.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help