linux-phy.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* c22/c45 descision in phy_restart_aneg()
@ 2025-08-29  7:39 markus.stockhausen
  2025-08-29 10:13 ` Russell King (Oracle)
  0 siblings, 1 reply; 2+ messages in thread
From: markus.stockhausen @ 2025-08-29  7:39 UTC (permalink / raw)
  To: rmk+kernel; +Cc: linux-phy, jan, 'Chris Packham'

Hi Russel,

once again some interesting finding from the limitations in the Realtek 
mdio driver. Remember it can only run in c22 or in c45. This time in
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 BIT(0) means MDIO_DEVS_C22PRESENT. This basically 
uses c22 for c45 PHYs if c22 presence is detected. So in our case 
it fails as soon as the bus has been switched to c45. Of course 
stupid but it is as it is. I see two options to fix the issue.

- Mask the c22 presence in the bus for all PHYs if running in c45
- Or drop the c22 condition check in above function

Any advise?

Thanks in advance.

Markus


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

end of thread, other threads:[~2025-08-29 14:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-29  7:39 c22/c45 descision in phy_restart_aneg() markus.stockhausen
2025-08-29 10:13 ` Russell King (Oracle)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).