]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
net: fec: stop the phy before shutting down the MAC
authorRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 7 Jul 2014 23:23:04 +0000 (00:23 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 8 Jul 2014 04:21:22 +0000 (21:21 -0700)
commitd76cfae9674f325de35ff23ab07ff9c7d809de4a
treecdd379790314c82a2c556603ee0fda5c0286a16f
parent0b146ca8d467c1dc6ad50628089d183608a47e40
net: fec: stop the phy before shutting down the MAC

When the network interface goes down, stop the phy to prevent further
link up status changes before taking the MAC or netif sections down.
This prevents further reception of link up events which could
potentially call fec_restart().

Since phy_stop() takes the mutex which adjust_link() runs under, we
also ensure that adjust_link() will not already be processing a link
up event.

We also need to do this when suspending as well - we don't want a
mis-timed phy state change to restart the MAC after we have stopped
it for suspend, and thus need to restart the phy when resuming.

Acked-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec_main.c