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: <Z4tWpxvwDG9u4MwJ@pengutronix.de>
Date: Sat, 18 Jan 2025 08:22:15 +0100
From: Oleksij Rempel <o.rempel@...gutronix.de>
To: "Russell King (Oracle)" <linux@...linux.org.uk>
Cc: Andrew Lunn <andrew@...n.ch>, "David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Woojung Huh <woojung.huh@...rochip.com>,
	Andrew Lunn <andrew+netdev@...n.ch>, kernel@...gutronix.de,
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
	UNGLinuxDriver@...rochip.com, Phil Elwell <phil@...pberrypi.org>
Subject: Re: [PATCH net-next v1 7/7] net: usb: lan78xx: Enable EEE support
 with phylink integration

On Fri, Jan 17, 2025 at 04:23:52PM +0000, Russell King (Oracle) wrote:
> I'm unsure about many DSA drivers. mt753x:
> 
>         u32 set, mask = LPI_THRESH_MASK | LPI_MODE_EN;
> 
>         if (e->tx_lpi_timer > 0xFFF)
>                 return -EINVAL;
> 
>         set = LPI_THRESH_SET(e->tx_lpi_timer);
>         if (!e->tx_lpi_enabled)
>                 /* Force LPI Mode without a delay */
>                 set |= LPI_MODE_EN;
>         mt7530_rmw(priv, MT753X_PMEEECR_P(port), mask, set);
> 
> Why force LPI *without* a delay if tx_lpi_enabled is false? This
> seems to go against the documented API:
> 
>  * @tx_lpi_enabled: Whether the interface should assert its tx lpi, given
>  *      that eee was negotiated.

According to MT7531 manual, I would say, the code is not correct:
https://repo.librerouter.org/misc/lr2/MT7531_switch_Reference_Manual_for_Development_Board.pdf

The LPI_MODE_EN_Px bit has following meaning:

When there is no packet to be transmitted, and the idle time is greater
than P2_LPI_THRESHOLD, the TXMAC will automatically enter LPI (Low
Power Idle) mode and send EEE LPI frame to the link partner.
0: LPI mode depends on the P2_LPI_THRESHOLD.
1: Let the system enter the LPI mode immediately and send EEE LPI frame
   to the link partner.

This chip seems to not have support for tx_lpi_enabled != eee_enabled
configuration.

> qca8k_set_mac_eee() sets the LPI enabled based off eee->eee_enabled.
> It doesn't seem to change the register on link up/down, so I wonder
> how the autoneg resolution is handled. Maybe it isn't, so maybe it's
> buggy.

The QCA8K_REG_EEE_CTRL_LPI_EN() bit is supported only for ports with
integrated PHYs. There seems to be no validation for this case.
Other problem with the code, lpi_en bit can be removed only one time.
Executing tx_lpi off and tx_lpi on in a sequence will not work.

My chip documentation do not provide any information about LPI_EN bit
functionality. I can't say for sure how it works.

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ