
Hi Andy,
gen10g_startup() had 2 bugs:
- It had a boolean logic error in checking the MMD mask, and
always checked all of them.
Good catch.
- It checked devices which don't actually report link state, which
meant that it would never believe the link was fully up.
Fix the boolean logic, and then mask the MMD mask so only link-reporting devices are checked.
Signed-off-by: Andy Fleming afleming@freescale.com Reported-by: Ed Swarthout Ed.Swarthout@freescale.com
drivers/net/phy/generic_10g.c | 8 ++++++-- include/linux/mdio.h | 8 ++++++++ 2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/generic_10g.c b/drivers/net/phy/generic_10g.c index 315c508..1c3e69e 100644 --- a/drivers/net/phy/generic_10g.c +++ b/drivers/net/phy/generic_10g.c @@ -36,7 +36,7 @@ int gen10g_shutdown(struct phy_device *phydev) int gen10g_startup(struct phy_device *phydev) { int devad, reg;
- u32 mmd_mask = phydev->mmds;
- u32 mmd_mask = phydev->mmds & MDIO_DEVS_LINK;
So we are introducing this new macro, right? I don't see this in Linux - how is this handled there? If we do have to create a new name, can't we use something more self-documenting, e.g. MDIO_DEVS_REPORT_LINK or such?
Cheers Detlev