RE: [RFC net-next 6/8] net: phylink: Configure MAC/PCS when link is up without PHY

From: Jose Abreu
Date: Mon Jan 27 2020 - 07:51:01 EST


From: Russell King - ARM Linux admin <linux@xxxxxxxxxxxxxxx>
Date: Jan/27/2020, 11:46:00 (UTC+00:00)

> On Mon, Jan 27, 2020 at 11:38:05AM +0000, Jose Abreu wrote:
> > From: Russell King - ARM Linux admin <linux@xxxxxxxxxxxxxxx>
> > Date: Jan/27/2020, 11:21:02 (UTC+00:00)
> >
> > > On Mon, Jan 27, 2020 at 12:09:11PM +0100, Jose Abreu wrote:
> > > > When we don't have any real PHY driver connected and we get link up from
> > > > PCS we shall configure MAC and PCS for the desired speed and also
> > > > resolve the flow control settings from MAC side.
> > >
> > > This is certainly the wrong place for it. Please hold off on this patch
> > > for the time being. Thanks.
> >
> > This is actually the change that makes everything work ...
> >
> > I need to configure PCS before Aneg is complete and then I need to
> > configure MAC once Aneg is done and link is up with the outcome speed and
> > flow control.
>
> Yes, I realise that, but it comes with the expense of potentially
> breaking mvneta and mvpp2, where the settings are automatically
> passed between the PCS and MAC in hardware. I also believe DSA
> works around this, and I need to look at that.

OK so there is one alternative solution for this that's just saving the
last link status on stmmac internal structure (if applicable ofc,
something like an_complete is true and link is true) and then just use
that info in mac_link_up() callback to configure the MAC when PCS is in
use.

This patch could then be dropped.

---
Thanks,
Jose Miguel Abreu