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]
Message-ID: <20190426214631.GV4041@lunn.ch>
Date:   Fri, 26 Apr 2019 23:46:31 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Serge Semin <fancer.lancer@...il.com>
Cc:     Florian Fainelli <f.fainelli@...il.com>,
        Heiner Kallweit <hkallweit1@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Serge Semin <Sergey.Semin@...latforms.ru>,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] net: phy: realtek: Change TX-delay setting for
 RGMII modes only

On Sat, Apr 27, 2019 at 12:21:12AM +0300, Serge Semin wrote:
> It's prone to problems if delay is cleared out for other than RGMII
> modes. So lets set/clear the TX-delay in the config register only
> if actually RGMII-like interface mode is requested.
> 
> Signed-off-by: Serge Semin <fancer.lancer@...il.com>
> 
> ---
>  drivers/net/phy/realtek.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
> index ab567a1923ad..a18cb01158f9 100644
> --- a/drivers/net/phy/realtek.c
> +++ b/drivers/net/phy/realtek.c
> @@ -163,16 +163,24 @@ static int rtl8211c_config_init(struct phy_device *phydev)
>  static int rtl8211f_config_init(struct phy_device *phydev)
>  {
>  	int ret;
> -	u16 val = 0;
> +	u16 val;
>  
>  	ret = genphy_config_init(phydev);
>  	if (ret < 0)
>  		return ret;
>  
> -	/* enable TX-delay for rgmii-id and rgmii-txid, otherwise disable it */
> -	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
> -	    phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)
> +	/* enable TX-delay for rgmii-id/rgmii-txid, and disable it for rgmii */
> +	switch (phydev->interface) {
> +	case PHY_INTERFACE_MODE_RGMII:
> +		val = 0;
> +		break;
> +	case PHY_INTERFACE_MODE_RGMII_ID:
> +	case PHY_INTERFACE_MODE_RGMII_TXID:
>  		val = RTL8211F_TX_DELAY;
> +		break;
> +	default: /* the rest of the modes imply leaving delay as is. */
> +		return 0;
> +	}

So there is no control of the RX delay?

That means PHY_INTERFACE_MODE_RGMII_ID and
PHY_INTERFACE_MODE_RGMII_RXID are not supported, and you should return
-EINVAL.

This is where we get into interesting backwards compatibility
issues. Are there any broken DT blobs with rgmii-id or rgmii-rxid,
which will break with such a change?

	Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ