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:   Wed, 9 May 2018 15:58:26 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Dan Murphy <dmurphy@...com>
Cc:     f.fainelli@...il.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: phy: DP83TC811: Introduce support for the DP83TC811
 phy

On Wed, May 09, 2018 at 08:50:58AM -0500, Dan Murphy wrote:
> Andrew
> 
> Thanks for the review
> 
> On 05/09/2018 08:43 AM, Andrew Lunn wrote:
> >> +static int dp83811_config_aneg(struct phy_device *phydev)
> >> +{
> >> +	int err;
> >> +	int value;
> >> +
> >> +	value = phy_read(phydev, MII_DP83811_SGMII_CTRL);
> >> +	if (phydev->autoneg == AUTONEG_ENABLE) {
> >> +		err = phy_write(phydev, MII_DP83811_SGMII_CTRL,
> >> +				(DP83811_SGMII_AUTO_NEG_EN | value));
> >> +		if (err < 0)
> >> +			return err;
> >> +	} else {
> >> +		err = phy_write(phydev, MII_DP83811_SGMII_CTRL,
> >> +				(~DP83811_SGMII_AUTO_NEG_EN & value));
> >> +		if (err < 0)
> >> +			return err;
> >> +	}
> >> +
> > 
> > Hi Dan
> > 
> > You say SGMII is unreliable on one of these devices. Should you check
> > phydev->interface before enabling SGMII autoneg?
> 
> 
> If SGMII enable bit(12) is not set in the device then setting auto neg has no affect on the device.

Ah, O.K. Maybe add a comment about this.

> >> +
> >> +static int dp83811_config_init(struct phy_device *phydev)
> >> +{
> >> +	int err;
> >> +	int value;
> >> +
> >> +	err = genphy_config_init(phydev);
> >> +	if (err < 0)
> >> +		return err;
> >> +
> >> +	if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
> >> +		value = phy_read(phydev, MII_DP83811_SGMII_CTRL);
> >> +		if (!(value & DP83811_SGMII_EN)) {
> >> +			err = phy_write(phydev, MII_DP83811_SGMII_CTRL,
> >> +					(DP83811_SGMII_EN | value));
> >> +			if (err < 0)
> >> +				return err;
> >> +		} else {
> >> +			err = phy_write(phydev, MII_DP83811_SGMII_CTRL,
> >> +				(~DP83811_SGMII_EN & value));
> >> +			if (err < 0)
> >> +				return err;
> >> +		}
> > 
> > This looks to be a duplicate of dp83811_config_aneg()?
> 
> It is almost the same but this function sets bit 12 and aneg function sets bit 13.
> We can have SGMII with or without auto neg.

Yep, i missed the difference.

     Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ