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: <62ee2e75-72d5-43bf-a37f-948692a0e551@intel.com>
Date: Wed, 28 Feb 2024 11:03:51 +0100
From: Wojciech Drewek <wojciech.drewek@...el.com>
To: Horatiu Vultur <horatiu.vultur@...rochip.com>, <andrew@...n.ch>,
	<hkallweit1@...il.com>, <linux@...linux.org.uk>, <davem@...emloft.net>,
	<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>
CC: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<UNGLinuxDriver@...rochip.com>
Subject: Re: [PATCH net-next 2/2] net: phy: micrel: lan8814 cable improvement
 errata



On 28.02.2024 07:28, Horatiu Vultur wrote:
> When the length of the cable is more than 100m and the lan8814 is
> configured to run in 1000Base-T Slave then the register of the device
> needs to be optimized.
> 
> Workaround this by setting the measure time to a value of 0xb. This
> value can be set regardless of the configuration.
> 
> This issue is described in 'LAN8814 Silicon Errata and Data Sheet
> Clarification' and according to that, this will not be corrected in a
> future silicon revision.
> 
> Signed-off-by: Horatiu Vultur <horatiu.vultur@...rochip.com>
> ---
>  drivers/net/phy/micrel.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
> index 5a0cc89eaebdd..1e3b0436e161e 100644
> --- a/drivers/net/phy/micrel.c
> +++ b/drivers/net/phy/micrel.c
> @@ -117,6 +117,10 @@
>  #define LAN8814_EEE_STATE			0x38
>  #define LAN8814_EEE_STATE_MASK2P5P		BIT(10)
>  
> +#define LAN8814_PD_CONTROLS			0x9d
> +#define LAN8814_PD_CONTROLS_PD_MEAS_TIME_MASK_	GENMASK(3, 0)
> +#define LAN8814_PD_CONTROLS_PD_MEAS_TIME_VAL_	0xb
> +
>  /* Represents 1ppm adjustment in 2^32 format with
>   * each nsec contains 4 clock cycles.
>   * The value is calculated as following: (1/1000000)/((2^-32)/4)
> @@ -3302,6 +3306,12 @@ static void lan8814_errata_fixes(struct phy_device *phydev)
>  	val = lanphy_read_page_reg(phydev, 2, LAN8814_EEE_STATE);
>  	val &= ~LAN8814_EEE_STATE_MASK2P5P;
>  	lanphy_write_page_reg(phydev, 2, LAN8814_EEE_STATE, val);
> +
> +	/* Improve cable reach beyond 100m */
> +	val = lanphy_read_page_reg(phydev, 1, LAN8814_PD_CONTROLS);
> +	val &= ~LAN8814_PD_CONTROLS_PD_MEAS_TIME_MASK_;
> +	val |= LAN8814_PD_CONTROLS_PD_MEAS_TIME_VAL_;
> +	lanphy_write_page_reg(phydev, 1, LAN8814_PD_CONTROLS, val);

Ok, now I see that the second fix is also in lan8814_errata_fixes.
I'd suggest to split both fixes to separate functions and name them
in more descriptive way.

>  }
>  
>  static int lan8814_probe(struct phy_device *phydev)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ