]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: phylink: add phylink_prepare_resume()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thu, 20 Mar 2025 22:11:07 +0000 (22:11 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 25 Mar 2025 14:58:03 +0000 (07:58 -0700)
commit367f1854d442b33c4a0305b068ae40d67ccd7d6a
tree534deb51cc9cecfdd6c21276f095846ece82271b
parent2374621058824a99106ed7a0155260720190e8c4
net: phylink: add phylink_prepare_resume()

When the system is suspended, the PHY may be placed in low-power mode
by setting the BMCR 0.11 Power down bit. IEEE 802.3 states that the
behaviour of the PHY in this state is implementation specific, and
the PHY is not required to meet the RX_CLK and TX_CLK requirements.
Essentially, this means that a PHY may stop the clocks that it is
generating while in power down state.

However, MACs exist which require the clocks from the PHY to be running
in order to properly resume. phylink_prepare_resume() provides them
with a way to clear the Power down bit early.

Note, however, that IEEE 802.3 gives PHYs up to 500ms grace before the
transmit and receive clocks meet the requirements after clearing the
power down bit.

Add a resume preparation function, which will ensure that the receive
clock from the PHY is appropriately configured while resuming.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1tvO6V-008Vjb-AP@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/phylink.c
include/linux/phylink.h