Subject: Re: [PATCH 3/5] net: cadence: macb: implement EEE TX LPI support

From: Théo Lebrun <[email-masked]>
Date: Thu, 26 Feb 2026 10:52:42 +0100

On Wed Feb 25, 2026 at 6:50 PM CET, Russell King (Oracle) wrote:
> On Wed, Feb 25, 2026 at 06:42:08PM +0100, Théo Lebrun wrote:
>> On Wed Feb 25, 2026 at 10:15 AM CET, Nicolai Buchwitz wrote:
>> > @@ -2349,6 +2454,8 @@ static netdev_tx_t macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
>> >  	netdev_tx_sent_queue(netdev_get_tx_queue(bp->dev, queue_index),
>> >  			     skb->len);
>> >  
>> > +	macb_tx_lpi_wake(bp);
>> 
>> Should this be protected by a bp->eee_active condition? It could go
>> in macb_tx_lpi_wake(). We avoid a spinlock acquire per xmit for most
>> platforms. Probably negligeable though.
>
> It will read the register, find the bit clear, and then return if
> EEE is already disabled.

Yes I agree with your sentence, sorry my point was unclear. I was not
describing a bug but rather a performance optimisation.

We would look up bp->eee_active to know if we can avoid calling
macb_tx_lpi_set(), to avoid grabbing bp->lock once per xmit.
That spinlock is interface-wide.

Thanks,

--
Théo Lebrun, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com