]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: stmmac: combine stmmac_enable_eee_mode()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Mon, 13 Jan 2025 11:46:15 +0000 (11:46 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 15 Jan 2025 02:22:04 +0000 (18:22 -0800)
commitec8553673b1f441fa7503662679b93d0dd533985
tree8a38a1f7d1d527c5bb8dd098221c968de49e9147
parentaf5dc22bdb5fe5a20ba0cdb18b90a995ba694a54
net: stmmac: combine stmmac_enable_eee_mode()

Combine stmmac_enable_eee_mode() with stmmac_try_to_start_sw_lpi()
which makes the code easier to read and the flow more logical. We
can now trivially see that if the transmit queues are busy, we
(re-)start the eee_ctrl_timer. Otherwise, if the transmit path is
not already in LPI mode, we ask the hardware to enter LPI mode.

I believe that now we can see better what is going on here, this
shows that there is a bug with the software LPI timer implementation.

The LPI timer is supposed to define how long after the last
transmittion completed before we start signalling LPI. However,
this code structure shows that if all transmit queues are empty,
and stmmac_try_to_start_sw_lpi() is called immediately after cleaning
the transmit queue, we will instruct the hardware to start signalling
LPI immediately.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1tXItb-000MBa-OU@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c