net: phylink: add PHY_F_RXC_ALWAYS_ON to PHY dev flags
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tue, 26 Mar 2024 13:32:07 +0000 (14:32 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 29 Mar 2024 02:21:33 +0000 (19:21 -0700)
commit21d9ba5bc5516e1d8a90c4a26de90855a1e4fb59
treee2d38ac6a119dc80fb72acb6d223983bbd899fbe
parentaf352c3b666e2ab74be5db9f168960d8ad48b538
net: phylink: add PHY_F_RXC_ALWAYS_ON to PHY dev flags

Some MAC controllers (e.g. stmmac) require their connected PHY to
continuously provide a receive clock signal. This can cause issues in two
cases:

  1. The clock signal hasn't been started yet by the time the MAC driver
     initializes its hardware. This can make the initialization fail, as in
      the case of the rzn1 GMAC1 driver.
  2. The clock signal is cut during a power saving event. By the time the
     MAC is brought back up, the clock signal is still not active since
     phylink_start hasn't been called yet. This brings us back to case 1.

If a PHY driver reads this flag, it should ensure that the receive clock
signal is started as soon as possible, and that it isn't brought down when
the PHY goes into suspend.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
[rgantois: commit log]
Signed-off-by: Romain Gantois <romain.gantois@bootlin.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20240326-rxc_bugfix-v6-1-24a74e5c761f@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/phylink.c
include/linux/phy.h
include/linux/phylink.h