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: <95f514f6-7445-41ee-a18b-ce558ee15849@denx.de>
Date: Wed, 21 Aug 2024 05:54:48 +0200
From: Marek Vasut <marex@...x.de>
To: Sava Jakovljev <sjakovljev@...look.com>
Cc: savaj@...ersound.com, Andrew Lunn <andrew@...n.ch>,
 Heiner Kallweit <hkallweit1@...il.com>, Russell King
 <linux@...linux.org.uk>, "David S. Miller" <davem@...emloft.net>,
 Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
 Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: phy: realtek: Fix setting of PHY LEDs Mode B bit on
 RTL8211F

On 8/21/24 4:16 AM, Sava Jakovljev wrote:
> From: Sava Jakovljev <savaj@...ersound.com>
> 
> The current implementation incorrectly sets the mode bit of the PHY chip.
> Bit 15 (RTL8211F_LEDCR_MODE) should not be shifted together with the
> configuration nibble of a LED- it should be set independently of the
> index of the LED being configured.
> As a consequence, the RTL8211F LED control is actually operating in Mode A.
> Fix the error by or-ing final register value to write with a const-value of
> RTL8211F_LEDCR_MODE, thus setting Mode bit explicitly.
> 
> Fixes: 17784801d888 ("net: phy: realtek: Add support for PHY LEDs on RTL8211F")
> 
> Signed-off-by: Sava Jakovljev <savaj@...ersound.com>
> ---
>   drivers/net/phy/realtek.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
> index 87865918dab6..25e5bfbb6f89 100644
> --- a/drivers/net/phy/realtek.c
> +++ b/drivers/net/phy/realtek.c
> @@ -555,7 +555,7 @@ static int rtl8211f_led_hw_control_set(struct phy_device *phydev, u8 index,
>   				       unsigned long rules)
>   {
>   	const u16 mask = RTL8211F_LEDCR_MASK << (RTL8211F_LEDCR_SHIFT * index);
> -	u16 reg = RTL8211F_LEDCR_MODE;	/* Mode B */
> +	u16 reg = 0;
>   
>   	if (index >= RTL8211F_LED_COUNT)
>   		return -EINVAL;
> @@ -575,6 +575,7 @@ static int rtl8211f_led_hw_control_set(struct phy_device *phydev, u8 index,
>   	}
>   
>   	reg <<= RTL8211F_LEDCR_SHIFT * index;
> +	reg |= RTL8211F_LEDCR_MODE;	 /* Mode B */

Nice find, thanks !

Reviewed-by: Marek Vasut <marex@...x.de>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ