Re: [PATCH v1] net: phy: dp83867: Disable EEE support as not implemented
From: Andrew Lunn
Date: Mon Oct 27 2025 - 15:37:57 EST
> Your placement is the only possible location as the code currently
> stands, but I would like to suggest that of_set_phy_eee_broken()
> should _not_ be calling linkmode_zero(modes), and we should be able
> to set phydev->eee_disabled_modes in the .get_features() method.
>
> Andrew, would you agree?
I dug back through the git history. Originally, the code would read a
value from DT which was literally used as a mask against the value in
MDIO_MMD_AN. If the mask was not zero, it was applied. That later got
converted to a collection of Boolean DT properties, one per link
speed, and the mask was created as a collection of |= statements, with
the initial value being 0, and the result assigned to
phydev->eee_broken_modes. It would of been possible at that stage to
do phydev->eee_broken_modes |=, but it guess a local variable was used
to keep the lines shorter. The u32 then got converted to a linux
bitmap, with the initial = 0; replaced with a linkmode_zero().
I don't see anything in any of the commit messages to indicate there
was a reason to initialise phydev->eee_broken_modes to 0 before
parsing the DT properties.
So i think it should be O.K. to remove the linkmode_zero(). For broken
PHYs like this, the earlier we mask out the broken behaviour the
better.
Andrew