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: Fri, 8 Mar 2024 07:39:00 +0000
From: Suman Ghosh <sumang@...vell.com>
To: Heiner Kallweit <hkallweit1@...il.com>,
        Russell King - ARM Linux
	<linux@...linux.org.uk>,
        Andrew Lunn <andrew@...n.ch>, Paolo Abeni
	<pabeni@...hat.com>,
        Eric Dumazet <edumazet@...gle.com>,
        David Miller
	<davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [EXTERNAL] [PATCH net-next] net: phy: simplify a check in
 phy_check_link_status

Hi Heiner,

To me it looks like both patches,
r8169: switch to new function phy_support_eee and net: phy: simplify a check in phy_check_link_status is related and can be pushed as a series. This will make change more harmonic. Because, you are moving setting of enable_tx_lpi in one patch and removing from the other one.

Regards,
Suman

>-----Original Message-----
>From: Heiner Kallweit <hkallweit1@...il.com>
>Sent: Friday, March 8, 2024 2:46 AM
>To: Russell King - ARM Linux <linux@...linux.org.uk>; Andrew Lunn
><andrew@...n.ch>; Paolo Abeni <pabeni@...hat.com>; Eric Dumazet
><edumazet@...gle.com>; David Miller <davem@...emloft.net>; Jakub
>Kicinski <kuba@...nel.org>
>Cc: netdev@...r.kernel.org
>Subject: [EXTERNAL] [PATCH net-next] net: phy: simplify a check in
>phy_check_link_status
>
>Handling case err == 0 in the other branch allows to simplify the code.
>In addition I assume in "err & phydev->eee_cfg.tx_lpi_enabled"
>it should have been a logical and operator. It works as expected also
>with the bitwise and, but using a bitwise and with a bool value looks
>ugly to me.
>
>Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>
>---
> drivers/net/phy/phy.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index
>c3a0a5ee5..c4236564c 100644
>--- a/drivers/net/phy/phy.c
>+++ b/drivers/net/phy/phy.c
>@@ -985,10 +985,10 @@ static int phy_check_link_status(struct phy_device
>*phydev)
> 		phydev->state = PHY_RUNNING;
> 		err = genphy_c45_eee_is_active(phydev,
> 					       NULL, NULL, NULL);
>-		if (err < 0)
>+		if (err <= 0)
> 			phydev->enable_tx_lpi = false;
> 		else
>-			phydev->enable_tx_lpi = (err & phydev-
>>eee_cfg.tx_lpi_enabled);
>+			phydev->enable_tx_lpi = phydev->eee_cfg.tx_lpi_enabled;
>
> 		phy_link_up(phydev);
> 	} else if (!phydev->link && phydev->state != PHY_NOLINK) {
>--
>2.44.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ