lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 13 Jun 2019 08:55:16 +0000
From:   Ioana Ciornei <ioana.ciornei@....com>
To:     Russell King - ARM Linux admin <linux@...linux.org.uk>
CC:     "andrew@...n.ch" <andrew@...n.ch>,
        "f.fainelli@...il.com" <f.fainelli@...il.com>,
        "hkallweit1@...il.com" <hkallweit1@...il.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH] net: phylink: set the autoneg state in phylink_phy_change

> Subject: Re: [PATCH] net: phylink: set the autoneg state in
> phylink_phy_change
> 
> On Thu, Jun 13, 2019 at 09:37:51AM +0300, Ioana Ciornei wrote:
> > The phy_state field of phylink should carry only valid information
> > especially when this can be passed to the .mac_config callback.
> > Update the an_enabled field with the autoneg state in the
> > phylink_phy_change function.
> 
> an_enabled is meaningless to mac_config for PHY mode.  Why do you think
> this is necessary?

Well, it's not necessarily used in PHY mode but, from my opinion, it should be set to the correct value nonetheless.

Just to give you more context, I am working on adding phylink support on NXP's DPAA2 platforms where any interaction between the PHY management layer and the Ethernet devices is made through a firmware.
When the .mac_config callback is invoked, the driver communicates the new configuration to the firmware so that the corresponding net_device can see the correct info.
In this case, the an_enabled field is not used for other purpose than to inform the net_device of the current configuration and nothing more.

--
Ioana


> 
> >
> > Fixes: 9525ae83959b ("phylink: add phylink infrastructure")
> > Signed-off-by: Ioana Ciornei <ioana.ciornei@....com>
> > ---
> >  drivers/net/phy/phylink.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
> > index 5d0af041b8f9..dd1feb7b5472 100644
> > --- a/drivers/net/phy/phylink.c
> > +++ b/drivers/net/phy/phylink.c
> > @@ -688,6 +688,7 @@ static void phylink_phy_change(struct phy_device
> *phydev, bool up,
> >  		pl->phy_state.pause |= MLO_PAUSE_ASYM;
> >  	pl->phy_state.interface = phydev->interface;
> >  	pl->phy_state.link = up;
> > +	pl->phy_state.an_enabled = phydev->autoneg;
> >  	mutex_unlock(&pl->state_mutex);
> >
> >  	phylink_run_resolve(pl);
> > --
> > 1.9.1
> >
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ