summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2019-02-01 14:02:41 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-02-11 10:37:49 +0100
commit55765b9c1f78e07586624d66d4d4124354d390c7 (patch)
tree88fec5f0a6ba9d1317d100b90d466f7f2768a4c2 /drivers/net
parent1933ab421c3faa5e4355cd4ce20595974e139987 (diff)
downloadbarebox-55765b9c1f78e07586624d66d4d4124354d390c7.tar.gz
barebox-55765b9c1f78e07586624d66d4d4124354d390c7.tar.xz
net: fec_imx: skip fec_halt if the FEC wasn't started
If the FEC driver is enabled, but the ethernet device was never opened due to booting from another source the wait for graceful transmit stop will always fail. This introduces an unnecessary boot delay and prints a distracting warning. As there is no point in trying to shut down the FEC if it was never started, just skip all of fec_halt in that case. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/fec_imx.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index 4823b08340..38a29fc83e 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -395,6 +395,13 @@ static void fec_halt(struct eth_device *dev)
struct fec_priv *fec = (struct fec_priv *)dev->priv;
uint32_t reg;
+ /*
+ * Only halt if fec has been started. Otherwise we would have to wait
+ * for the timeout below.
+ */
+ if (!(readl(fec->regs + FEC_ECNTRL) & FEC_ECNTRL_ETHER_EN))
+ return;
+
/* issue graceful stop command to the FEC transmitter if necessary */
writel(readl(fec->regs + FEC_X_CNTRL) | FEC_ECNTRL_RESET,
fec->regs + FEC_X_CNTRL);