Netdev List
 help / color / mirror / Atom feed
* C22/C45 decision in phy_restart_aneg()
@ 2025-08-31  7:45 markus.stockhausen
  2025-08-31 10:08 ` Russell King (Oracle)
  0 siblings, 1 reply; 3+ messages in thread
From: markus.stockhausen @ 2025-08-31  7:45 UTC (permalink / raw)
  To: andrew, hkallweit1, linux, davem, edumazet, kuba, pabeni, netdev
  Cc: jan, 'Chris Packham'

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-31 15:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-31  7:45 C22/C45 decision in phy_restart_aneg() markus.stockhausen
2025-08-31 10:08 ` Russell King (Oracle)
2025-08-31 15:35   ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox