netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/7] Fix missing PHY-to-MAC RX clock
@ 2024-01-30  9:28 Romain Gantois
  2024-01-30  9:28 ` [PATCH net-next v2 1/7] net: phy: add PHY_F_RXC_ALWAYS_ON to PHY dev flags Romain Gantois
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: Romain Gantois @ 2024-01-30  9:28 UTC (permalink / raw)
  To: Russell King, Andrew Lunn, Heiner Kallweit, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexandre Torgue,
	Jose Abreu, Maxime Coquelin, Clément Léger
  Cc: Maxime Chevallier, Miquel Raynal, Thomas Petazzoni, netdev,
	linux-stm32, linux-arm-kernel, linux-renesas-soc, Romain Gantois,
	Clark Wang

Hello everyone,

This is version two of my series that addresses the issue with some MAC/PHY
combinations. Version one was sent on net, not net-next.

Notable changes in v2:
  - Introduced a pcs op for initializing hardware required for MAC
    initialization, instead of using phylink_validate() for this purpose.
  - Refactored stmmac to use a generic PCS reference in mac_device_info
    instead of a model-specific field.

There is an issue with some stmmac/PHY combinations that has been reported
some time ago in a couple of different series:

Clark Wang's report:
https://lore.kernel.org/all/20230202081559.3553637-1-xiaoning.wang@nxp.com/
Clément Léger's report:
https://lore.kernel.org/linux-arm-kernel/20230116103926.276869-4-clement.leger@bootlin.com/

Stmmac controllers require an RX clock signal from the MII bus to perform
their hardware initialization successfully. This causes issues with some
PHY/PCS devices. If these devices do not bring the clock signal up before
the MAC driver initializes its hardware, then said initialization will
fail. This can happen at probe time or when the system wakes up from a
suspended state.

This series introduces new flags for phy_device and phylink_pcs. These
flags allow MAC drivers to signal to PHY/PCS drivers that the RX clock
signal should be enabled as soon as possible, and that it should always
stay enabled.

I have included specific uses of these flags that fix the RZN1 GMAC1 stmmac
driver that I am currently working on and that is not yet upstream. I have
also included changes to the at803x PHY driver that should fix the issue
that Clark Wang was having.

Clark, could you please confirm that this series fixes your issue with the
at803x PHY?

Best Regards,

Romain

Romain Gantois (2):
  net: phy: add rxc_always_on flag to phylink_pcs
  net: pcs: rzn1-miic: Init RX clock early if MAC requires it

Russell King (3):
  net: phy: add PHY_F_RXC_ALWAYS_ON to PHY dev flags
  net: stmmac: Signal to PHY/PCS drivers to keep RX clock on
  net: phy: at803x: Avoid hibernating if MAC requires RX clock

 .../net/ethernet/stmicro/stmmac/stmmac_main.c  |  5 +++++
 drivers/net/pcs/pcs-rzn1-miic.c                | 18 +++++++++++++-----
 drivers/net/phy/at803x.c                       |  3 ++-
 drivers/net/phy/phylink.c                      | 13 ++++++++++++-
 include/linux/phy.h                            |  1 +
 include/linux/phylink.h                        |  9 +++++++++
 6 files changed, 42 insertions(+), 7 deletions(-)

--
2.43.0

---
Maxime Chevallier (1):
      net: stmmac: don't rely on lynx_pcs presence to check for a PHY

Romain Gantois (4):
      net: phy: add rxc_always_on flag to phylink_pcs
      net: stmmac: Support a generic PCS field in mac_device_info
      net: stmmac: Signal to PHY/PCS drivers to keep RX clock on
      net: pcs: rzn1-miic: Init RX clock early if MAC requires it

Russell King (2):
      net: phy: add PHY_F_RXC_ALWAYS_ON to PHY dev flags
      net: phy: at803x: Avoid hibernating if MAC requires RX clock

 drivers/net/ethernet/stmicro/stmmac/common.h       |  2 +-
 .../net/ethernet/stmicro/stmmac/dwmac-socfpga.c    |  8 ++++----
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  | 15 ++++++++------
 drivers/net/pcs/pcs-rzn1-miic.c                    | 16 +++++++++++++++
 drivers/net/phy/at803x.c                           |  3 ++-
 drivers/net/phy/phylink.c                          | 24 +++++++++++++++++++++-
 include/linux/phy.h                                |  1 +
 include/linux/phylink.h                            | 15 ++++++++++++++
 8 files changed, 71 insertions(+), 13 deletions(-)
---
base-commit: 795a7dfbc3d95e4c7c09569f319f026f8c7f5a9c
change-id: 20240126-rxc_bugfix-d47b3b1a374f

Best regards,
-- 
Romain Gantois <romain.gantois@bootlin.com>


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-01-31 13:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-30  9:28 [PATCH net-next v2 0/7] Fix missing PHY-to-MAC RX clock Romain Gantois
2024-01-30  9:28 ` [PATCH net-next v2 1/7] net: phy: add PHY_F_RXC_ALWAYS_ON to PHY dev flags Romain Gantois
2024-01-30  9:57   ` Russell King (Oracle)
2024-01-30 13:55   ` Andrew Lunn
2024-01-30 14:02     ` Russell King (Oracle)
2024-01-31 13:53       ` Andrew Lunn
2024-01-30  9:28 ` [PATCH net-next v2 2/7] net: phy: add rxc_always_on flag to phylink_pcs Romain Gantois
2024-01-30 10:11   ` Russell King (Oracle)
2024-01-30 13:40     ` Romain Gantois
2024-01-30  9:28 ` [PATCH net-next v2 3/7] net: stmmac: don't rely on lynx_pcs presence to check for a PHY Romain Gantois
2024-01-30  9:28 ` [PATCH net-next v2 4/7] net: stmmac: Support a generic PCS field in mac_device_info Romain Gantois
2024-01-30  9:28 ` [PATCH net-next v2 5/7] net: stmmac: Signal to PHY/PCS drivers to keep RX clock on Romain Gantois
2024-01-30  9:28 ` [PATCH net-next v2 6/7] net: phy: at803x: Avoid hibernating if MAC requires RX clock Romain Gantois
2024-01-30  9:28 ` [PATCH net-next v2 7/7] net: pcs: rzn1-miic: Init RX clock early if MAC requires it Romain Gantois
2024-01-30  9:58 ` [PATCH net-next v2 0/7] Fix missing PHY-to-MAC RX clock Maxime Chevallier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).