Re: [PATCH] net: mdio: force deassert MDIO reset signal

From: Andrew Lunn
Date: Tue Jan 17 2023 - 09:14:02 EST


> > > I think part of the problem is that for C45 there are a few other fields
> > > that get populated by the ID detection, such as devices_in_package and
> > > mmds_present. Is this something we can do after running the PHY drivers
> > > probe function? Or is it too late at that point?
> > As i hinted, it needs somebody to actually debug this and figure out
> > why it does not work.
> >
> > I think what i did above is part of the solution. You need to actually
> > read the ID from the DT, which if you never call fwnode_get_phy_id()
> > you never do.
> >
> > You then need to look at phy_bus_match() and probably remove the
> >
> > return 0;
> > } else {
> >
> > so that C22 style ID matching is performed if matching via
> > c45_ids.device_ids fails.
>
> Sorry, I've should have been more clear. I did try your proposed change a
> while ago. The problem why it does not work is that there are other fields
> in the phy data structure that get initialized when reading the IDs for C45.
> Such as which MMD addresses are valid.

So lets take this one step at a time.

Does this change at least get the driver loaded?

There is some code in phy-c45.c which needs
phydev->c45_ids.mmds_present. So maybe after the driver has probed,
and the device should be accessible, we need to call get_phy_c45_ids()
to fill in the missing IDs?

Andrew