Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f208ce10 authored by Russell King's avatar Russell King Committed by David S. Miller
Browse files

net: fec: quiesce packet processing when taking link down in fec_enet_adjust_link()



When the link goes down, the adjust_link method will be called, but
there is no synchronisation to ensure that we won't be processing some
last remaining packets via the NAPI handlers while performing a reset of
the device.

Add the necessary synchronisation to ensure that packet processing
is complete before we stop and reset the FEC.

Acked-by: default avatarFugang Duan <B38611@freescale.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8506fa1d
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -1530,7 +1530,11 @@ static void fec_enet_adjust_link(struct net_device *ndev)
		}
		}
	} else {
	} else {
		if (fep->link) {
		if (fep->link) {
			napi_disable(&fep->napi);
			netif_tx_lock_bh(ndev);
			fec_stop(ndev);
			fec_stop(ndev);
			netif_tx_unlock_bh(ndev);
			napi_enable(&fep->napi);
			fep->link = phy_dev->link;
			fep->link = phy_dev->link;
			status_change = 1;
			status_change = 1;
		}
		}