diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2025-03-10 15:31:25 +0300 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2025-03-17 23:36:20 +0300 |
commit | 180fa8d0a2cb4c1b0f60cc28ce481407c3c44ffb (patch) | |
tree | bf6d72a8db6f2be2cd1109812a2855af04a64637 /net/lapb/lapb_subr.c | |
parent | 35b862eac9099bb492229627c44e541633fb5938 (diff) | |
download | linux-180fa8d0a2cb4c1b0f60cc28ce481407c3c44ffb.tar.xz |
net: stmmac: remove redundant racy tear-down in stmmac_dvr_remove()
While the network device is registered, it is published to userspace,
and thus userspace can change its state. This means calling
functions such as stmmac_stop_all_dma() and stmmac_mac_set() are
racy.
Moreover, unregister_netdev() will unpublish the network device, and
then if appropriate call the .ndo_stop() method, which is
stmmac_release(). This will first call phylink_stop() which will
synchronously take the link down, resulting in stmmac_mac_link_down()
and stmmac_mac_set(, false) being called.
stmmac_release() will also call stmmac_stop_all_dma().
Consequently, neither of these two functions need to called prior
to unregister_netdev() as that will safely call paths that will
result in this work being done if necessary.
Remove these redundant racy calls.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Furong Xu <0x1207@gmail.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1trcI1-005rn2-CZ@rmk-PC.armlinux.org.uk
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/lapb/lapb_subr.c')
0 files changed, 0 insertions, 0 deletions