Subject: Re: Regression: mv88e6xxx packet loss after 4.18's PHYLINK merge

From: Andrew Lunn <[email-masked]>
Date: Mon, 21 Jan 2019 18:52:37 +0100

> Hi Andrew,
> 
> I've debugged the issue further by dumping all the values inside
> phylink_resolve to get a better understand how the link state behaves.
> 
> As this is a fixed link the link_state structure is populated by
> phylink_get_fixed_state(), but in our case neither get_fixed_state callback
> or GPIO is used. This means the link_state comes straight from the
> link_config, meaning link_state.link will always be 1. On the other hand the
> pl->phy_state seems to never change and the phy_state.link stays 0 even
> when the link is up and functional.
> 
> This makes it impossible to use these variables for deciding if
> phylink_mac_config needs to be run, and this got me thinking: do we even need
> to reconfigure the link? The phylink_mac_config() is already called from
> phylink_start and fixed links shouldn't change(?).

Fixed links do change, they can read a GPIO to tell you if the link is
up/down, and there is a callback which can be used to indicate if the
link is up or down. If you remove that call as suggested, you break a
number of boards.

The state tracking has to be made to work, so that
phylink_mac_config() is called once on state change, and not more.

     Andrew