linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 0/5] net: stmmac: fix setting RE and TE inappropriately
@ 2025-02-27 15:00 Russell King (Oracle)
  2025-02-27 15:05 ` [PATCH RFC net-next 1/5] net: stmmac: call phylink_start() and phylink_stop() in XDP functions Russell King (Oracle)
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Russell King (Oracle) @ 2025-02-27 15:00 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,

Note: this series depends on "net: stmmac: fix resume failures due to
RX clock".

This series addresses inappropriate setting of the receive and transmit
enables in the GMAC control register.

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.

Solving this requires a number of changes. First, fixing XDP to call
into phylink to bring the link down. This removes a source of
phylink method de-sync mentioned above.

Then we remove the racy teardown in the driver's remove method -
nothing should be torn down while userspace still has access to the
netdev.

Then we remove an unnecessary call to disable the enable bits in
the .ndo_stop() method.

Finally, we remove manipulation of the RE and TE bits from the
start_tx(), stop_tx(), start_rx() and stop_rx() methods.

 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  | 22 ++++++----------------
 3 files changed, 6 insertions(+), 36 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] 18+ messages in thread

end of thread, other threads:[~2025-02-28 14:55 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-27 15:00 [PATCH RFC 0/5] net: stmmac: fix setting RE and TE inappropriately Russell King (Oracle)
2025-02-27 15:05 ` [PATCH RFC net-next 1/5] net: stmmac: call phylink_start() and phylink_stop() in XDP functions Russell King (Oracle)
2025-02-27 22:27   ` Andrew Lunn
2025-02-28  0:02     ` Russell King (Oracle)
2025-02-28  7:31   ` Furong Xu
2025-02-28 13:14     ` Andrew Lunn
2025-02-28 14:38       ` Russell King (Oracle)
2025-02-27 15:05 ` [PATCH RFC net-next 2/5] net: stmmac: remove redundant racy tear-down in stmmac_dvr_remove() Russell King (Oracle)
2025-02-27 22:16   ` Andrew Lunn
2025-02-28  3:28   ` Furong Xu
2025-02-27 15:05 ` [PATCH RFC net-next 3/5] net: stmmac: remove unnecessary stmmac_mac_set() in stmmac_release() Russell King (Oracle)
2025-02-27 22:17   ` Andrew Lunn
2025-02-28  2:51   ` Furong Xu
2025-02-27 15:05 ` [PATCH RFC net-next 4/5] net: stmmac: remove _RE and _TE in (start|stop)_(tx|rx)() methods Russell King (Oracle)
2025-02-27 22:25   ` Andrew Lunn
2025-02-28  2:52   ` Furong Xu
2025-02-27 15:05 ` [PATCH RFC net-next 5/5] net: stmmac: leave enabling RE and TE to stmmac_mac_link_up() Russell King (Oracle)
2025-02-28  2:52   ` Furong Xu

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