2017-11-28 14:11:13

by Antoine Tenart

[permalink] [raw]
Subject: Re: [PATCH net] net: phylink: fix link state on phy-connect

Hi Andrew,

On Tue, Nov 28, 2017 at 02:56:10PM +0100, Andrew Lunn wrote:
> > + /* On _disconnect, the phy state machine and phylink resolve
> > + * are stopped before executing full gracefull down/reset state.
> > + * The further _connect starts with incorrect init state. Let's set
> > + * init values here.
> > + */
> > + pl->phy_state.link = false;
> > + pl->link_config.pause = MLO_PAUSE_AN;
> > + pl->link_config.speed = SPEED_UNKNOWN;
> > + pl->link_config.duplex = DUPLEX_UNKNOWN;
>
> Looks sensible. My only comment would be, maybe it makes sense to
> reduce the duplication by adding a little helper which is called here,
> and in phylink_create()?

Yes, it could be better to have a little helper to reset the link config
and state values and avoid duplication.

I'll wait for more comments before sending a v2 though. Maybe Russell
will have good suggestions to do this the good way.

Thanks!
Antoine

--
Antoine T�nart, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

From 1585318438679515612@xxx Tue Nov 28 13:57:58 +0000 2017
X-GM-THRID: 1585316788419333533
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread