[0/1] net: stmmac: do not stop RX_CLK in Rx LPI state for qcs404 SoC

Message ID 20230126213539.166298-1-andrey.konovalov@linaro.org
Headers
Series net: stmmac: do not stop RX_CLK in Rx LPI state for qcs404 SoC |

Message

Andrey Konovalov Jan. 26, 2023, 9:35 p.m. UTC
  This is a different, for one SoC only solution to the issue described below
vs a generic one submitted earlier [1].

On my qcs404 based board the ethernet MAC has issues with handling
Rx LPI exit / Rx LPI entry interrupts.

When in LPI mode the "refresh transmission" is received, the driver may
see both "Rx LPI exit", and "Rx LPI entry" bits set in the single read from
GMAC4_LPI_CTRL_STATUS register (vs "Rx LPI exit" first, and "Rx LPI entry"
then). In this case an interrupt storm happens: the LPI interrupt is
triggered every few microseconds - with all the status bits in the
GMAC4_LPI_CTRL_STATUS register being read as zeros. This interrupt storm
continues until a normal non-zero status is read from GMAC4_LPI_CTRL_STATUS
register (single "Rx LPI exit", or "Tx LPI exit").

The reason seems to be in the hardware not being able to properly clear
the "Rx LPI exit" interrupt if GMAC4_LPI_CTRL_STATUS register is read
after Rx LPI mode is entered again.

The current driver unconditionally sets the "Clock-stop enable" bit
(bit 10 in PHY's PCS Control 1 register) when calling phy_init_eee().
Not setting this bit - so that the PHY continues to provide RX_CLK
to the ethernet controller during Rx LPI state - prevents the LPI
interrupt storm.

Until this bug is confirmed by the SoC and the ethernet IP vendors,
and until we get the information of what IP versions are affected,
the solution could be to keep RX_CLK running in Rx LPI state for qcs404
SoC - for the moment, the only SoC which is known to have this issue.

[1] https://www.spinics.net/lists/netdev/msg875806.html

Andrey Konovalov (1):
  net: stmmac: do not stop RX_CLK in Rx LPI state for qcs404 SoC

 drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 2 ++
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c       | 3 ++-
 include/linux/stmmac.h                                  | 1 +
 3 files changed, 5 insertions(+), 1 deletion(-)
  

Comments

patchwork-bot+netdevbpf@kernel.org Jan. 30, 2023, 7:30 a.m. UTC | #1
Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Fri, 27 Jan 2023 00:35:38 +0300 you wrote:
> This is a different, for one SoC only solution to the issue described below
> vs a generic one submitted earlier [1].
> 
> On my qcs404 based board the ethernet MAC has issues with handling
> Rx LPI exit / Rx LPI entry interrupts.
> 
> When in LPI mode the "refresh transmission" is received, the driver may
> see both "Rx LPI exit", and "Rx LPI entry" bits set in the single read from
> GMAC4_LPI_CTRL_STATUS register (vs "Rx LPI exit" first, and "Rx LPI entry"
> then). In this case an interrupt storm happens: the LPI interrupt is
> triggered every few microseconds - with all the status bits in the
> GMAC4_LPI_CTRL_STATUS register being read as zeros. This interrupt storm
> continues until a normal non-zero status is read from GMAC4_LPI_CTRL_STATUS
> register (single "Rx LPI exit", or "Tx LPI exit").
> 
> [...]

Here is the summary with links:
  - [1/1] net: stmmac: do not stop RX_CLK in Rx LPI state for qcs404 SoC
    https://git.kernel.org/netdev/net/c/54aa39a513db

You are awesome, thank you!