linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/4] net: stmmac: fix setting RE and TE inappropriately
@ 2025-05-02 13:35 Russell King (Oracle)
  2025-05-02 13:35 ` [PATCH net-next v2 1/4] net: phylink: add ability to block carrier up Russell King (Oracle)
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Russell King (Oracle) @ 2025-05-02 13:35 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: Alexandre Torgue, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Jon Hunter, linux-arm-kernel, linux-stm32,
	Maxime Coquelin, netdev, Paolo Abeni, Thierry Reding

Hi,

This series addresses inappropriate setting of the receive and transmit
enables in the GMAC control register identified back in
https://lore.kernel.org/r/Z8BboX9RxZBSXRr1@shell.armlinux.org.uk

The databook is clear for the receive enable, that this should not be
set until the initialisation of the MAC and DMA has been completed.
The previous RFC patch series ("net: stmmac: fix resume failures due to
RX clock") which moves phylink_resume() solves that, but we are left
with these enables being set when the link is down. This is not correct.

Sadly, when XDP support was added, new calls to netif_carrier_on() and
netif_carrier_off() were added, which are incorrect in drivers that
make use of phylink - by doing so, the driver has no guarantee that
the .mac_link_up() and .mac_link_down() methods will be called in
sequence anymore. This is fixed in patch 1.

We remove manipulation of the RE and TE bits from the start_tx(),
stop_tx(), start_rx() and stop_rx() methods for each core.

Finally, we remove the stmmac_mac_set() call from stmmac_hw_setup().

v2: add phylink_carrier_*() functions and use these instead to avoid
calling phy_stop()/phy_start(), which may bounce the physical link.

 drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c   |  8 ----
 drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c | 12 ------
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  | 23 +++++-----
 drivers/net/phy/phylink.c                          | 50 ++++++++++++++++++++++
 include/linux/phylink.h                            |  3 ++
 5 files changed, 65 insertions(+), 31 deletions(-)

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!


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

end of thread, other threads:[~2025-05-06 19:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-02 13:35 [PATCH net-next v2 0/4] net: stmmac: fix setting RE and TE inappropriately Russell King (Oracle)
2025-05-02 13:35 ` [PATCH net-next v2 1/4] net: phylink: add ability to block carrier up Russell King (Oracle)
2025-05-02 15:12   ` Andrew Lunn
2025-05-02 13:35 ` [PATCH net-next v2 2/4] net: stmmac: call phylink_carrier_*() in XDP functions Russell King (Oracle)
2025-05-02 15:29   ` Andrew Lunn
2025-05-02 17:54     ` Russell King (Oracle)
2025-05-06  8:36       ` Russell King (Oracle)
2025-05-06  8:40         ` Russell King (Oracle)
2025-05-06 15:25           ` Jakub Kicinski
2025-05-02 13:35 ` [PATCH net-next v2 3/4] net: stmmac: remove _RE and _TE in (start|stop)_(tx|rx)() methods Russell King (Oracle)
2025-05-02 13:35 ` [PATCH net-next v2 4/4] net: stmmac: leave enabling _RE and _TE to stmmac_mac_link_up() Russell King (Oracle)

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