RFC net: stmmac: fix resume failures due to RX clock
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest0 of 5 patches 2 repliesIn review
Patches in v1 No applies recorded yet
None of the 5 patches the cover letter announces are in this archive.
Reviews trailers per patch
| Patch | Andrew Lunn | Jon Hunter |
|---|---|---|
| Series | R-b R-b R-b R-b R-b | T-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH RFC 0/5] net: stmmac: fix resume failures due to RX clock
Hi,
This series is likely dependent on the "net: stmmac: cleanup transmit clock setting" series which was submitted earlier today.
stmmac has a long history of failing to resume due to lack of receive clock. NVidia have reported that as a result of the EEE changes, they see a greater chance of resume failure with those patches applied than before.
The issue is that the DesignWare core requires that the receive clock is running in order to complete software reset, which causes stmmac_reset() and stmmac_hw_setup() to fail.
There are several things that are wrong:
1. Calling phylink_start() early can result in a call to mac_link_up() which will set TE and RE bits before stmmac_hw_setup() has been called. This is evident in the debug logs that NVidia sent while debugging the problem.
This is something I have pointed out in the past, but ithas been claimed to be necessary to do things this way to have the PHY receive clock running. Enabling RE before DMA is setup is against the DesignWare databook documentation.
2. Enabling LPI clock-stop at the PHY (as the driver has done prior to my patch set) allows the PHY to stop its receive clock when the link enters low-power mode. This means the completion of reset is dependent on the current EEE state, which is indeterminable, but is likely to be in low power mode on resume.
We solve (1) by moving the call to phylink_resume() later. This patch on its own probably causes regressions as it may make it more likely that the link will be in low power state, or maybe the PHY driver does not respect the PHY_F_RXC_ALWAYS_ON flag - this needs to be tested on as many different hardware setups that use this driver as possible, and any issues addressed *without* moving phylink_resume() back. If we need some way to resume the PHY early, then we need to work out some way to do that with phylib without calling phy_start() early.
(2) is fixed by introducing phylink_prepare_resume(), which will disable receive clock-stop in LPI mode at the PHY, and we will restore the clock-stop setting in phylink_resume(). It is possible that this solves some of the reason for the early placement of phylink_resume().
phylink_prepare_resume() also provides a convenient site should (1) need further work.
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 27 +++++++-------- drivers/net/phy/phylink.c | 40 ++++++++++++++++++++++- include/linux/phylink.h | 1 + 3 files changed, 51 insertions(+), 17 deletions(-)
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!