[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <009a01dc1a4b$45452120$cfcf6360$@gmx.de>
Date: Sun, 31 Aug 2025 09:45:46 +0200
From: <markus.stockhausen@....de>
To: <andrew@...n.ch>,
<hkallweit1@...il.com>,
<linux@...linux.org.uk>,
<davem@...emloft.net>,
<edumazet@...gle.com>,
<kuba@...nel.org>,
<pabeni@...hat.com>,
<netdev@...r.kernel.org>
Cc: <jan@....eu>,
"'Chris Packham'" <chris.packham@...iedtelesis.co.nz>
Subject: C22/C45 decision in phy_restart_aneg()
Hi,
@Russell: Sorry for the inconvenience of my first mail. After a lengthy
analysis session, I focused too much on the initial C45 enhancement
of the below function that you wrote. I sent it off too hastily.
So, once again, here is some interesting finding regarding the
limitations of the Realtek MDIO driver. Remember that it can only run
in either C22 or C45. This time it is about autonegotiation restart.
int phy_restart_aneg(struct phy_device *phydev) {
int ret;
if (phydev->is_c45 && !(phydev->c45_ids.devices_in_package & BIT(0))
ret = genphy_c45_restart_aneg(phydev);
else
ret = genphy_restart_aneg(phydev);
return ret;
}
I assume that BIT(0) means MDIO_DEVS_C22_PRESENT. As I understand it,
this basically uses C22 commands for C45 PHYs if C22 support is detected.
Currently, I have no reasonable explanation for this additional check.
In our case, this function fails for C45 PHYs because the bus and PHY are
locked down to this single mode. It's stupid, of course, but that's how
it is. I see two options for fixing the issue:
1) Mask the C22 presence in the bus for all PHYs when running in C45.
2) Drop the C22 condition check in the above function.
Any advice?
Thanks in advance.
Markus
Powered by blists - more mailing lists