Re: [PATCH net-next 3/5] net: cadence: macb: implement EEE TX LPI support
From: <hidden>
Date: 2026-02-23 14:54:38
On 23.2.2026 11:07, Russell King (Oracle) wrote:
On Mon, Feb 23, 2026 at 10:04:10AM +0100, Nicolai Buchwitz wrote:quoted
Implement software-managed TX Low Power Idle (LPI) for the Cadence GEM MAC as part of IEEE 802.3az Energy Efficient Ethernet support. The GEM MAC has no built-in idle timer - the TXLPIEN bit (NCR bit 19) immediately asserts LPI and blocks all TX while set. The MAC does not auto-wake for transmit. Per Microchip GMAC documentation (section 40.6.19): "It is best to use firmware to control LPI." This patch implements a software idle timer using delayed_work: - On TX completion with an empty ring, schedule LPI entry after a configurable idle timeout (default 250ms). The work function verifies all TX queues are truly idle before entering LPI to prevent entering LPI while traffic is still active. - On TX start, wake from LPI by clearing TXLPIEN, cancelling any pending re-entry, and waiting 50us for the PHY to exit LPI (conservative vs IEEE 802.3az Tw_sys of ~17us/~30us) - On link up, check EEE negotiation via phy_init_eee() and defer first LPI entry by 1 second per IEEE 802.3az requirements - On link down, immediately cancel pending work and clear TXLPIEN The timer value is configurable at runtime via ethtool --set-eee tx-timer. The implementation is gated on MACB_CAPS_EEE so platforms must explicitly opt in via their macb_config.In addition to my comments, please check the nipabot status for this patch which can be found at: https://patchwork.kernel.org/project/netdevbpf/patch/20260223090412.44070-4-nb@tipi-net.de/
Thanks. I will have a look at the mentioned patches + feedback from the pipeline and prepare a v2 of this series.
Thanks.
Nicolai