mbox series

[net,0/5] Fix missing PHY-to-MAC RX clock

Message ID 20240103142827.168321-1-romain.gantois@bootlin.com (mailing list archive)
Headers show
Series Fix missing PHY-to-MAC RX clock | expand

Message

Romain Gantois Jan. 3, 2024, 2:28 p.m. UTC
Hello everyone,

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(-)

Comments

Jakub Kicinski Jan. 3, 2024, 9:28 p.m. UTC | #1
On Wed,  3 Jan 2024 15:28:20 +0100 Romain Gantois wrote:
> 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/

If those stmmac/PHY combinations never worked upstream please tag 
as [PATCH net-next], we should consider this work to be a be a new
feature / HW support. If they used to work - we'll need some Fixes
tags.
Romain Gantois Jan. 4, 2024, 8:01 a.m. UTC | #2
Hello Jakub,

On Wed, 3 Jan 2024, Jakub Kicinski wrote:

> On Wed,  3 Jan 2024 15:28:20 +0100 Romain Gantois wrote:
> > 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/
> 
> If those stmmac/PHY combinations never worked upstream please tag 
> as [PATCH net-next], we should consider this work to be a be a new
> feature / HW support. If they used to work - we'll need some Fixes
> tags.

These never worked properly upstream so I'll send it to net-next.

Best Regards,