Skip to contentSkip to conversation

c22/c45 descision in phy_restart_aneg()

DISCUSSION [email protected] 2 participants 2 messages Aug 29, 2025 Generic PHY framework

lore
Share & tools
lore
#0 lore raw

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

Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
#1 lore raw
Quoted 1 line · On Fri, Aug 29, 2025 at 09:39:46AM +0200, [email protected] wrote:

Hi Russel,

1. It's "Russell" please.
2. [email protected] is not the correct list to be discussing phylib issues.
3. You haven't Cc'd the other phylib maintainers.

Please resend to the correct audience. Thanks.

Signature · 7 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy