diff options
author | Philippe De Muyter <phdm@macqel.be> | 2006-06-27 13:05:33 +1000 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-27 18:26:37 -0700 |
commit | 677177c5319f7079c22d04926c23b31166d7d405 (patch) | |
tree | 52fcf3e4c656dcbc6b2a1b0856ad8aaffb084f40 /drivers | |
parent | 67bdd9842430f946213d0482862aae1ed8fd3ad0 (diff) |
[PATCH] m68knommu: avoid fec driver hang when link disappears
Avoid requesting a `Graceful Transmit Stop' when link has disappeared,
because that request cannot complete without link.
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/fec.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index bd6983d1afb..16fc12fe933 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c @@ -22,7 +22,7 @@ * Copyright (c) 2001-2005 Greg Ungerer (gerg@snapgear.com) * * Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be) - * Copyright (c) 2004-2005 Macq Electronique SA. + * Copyright (c) 2004-2006 Macq Electronique SA. */ #include <linux/config.h> @@ -2420,9 +2420,16 @@ fec_stop(struct net_device *dev) fep = netdev_priv(dev); fecp = fep->hwp; - fecp->fec_x_cntrl = 0x01; /* Graceful transmit stop */ - - while(!(fecp->fec_ievent & FEC_ENET_GRA)); + /* + ** We cannot expect a graceful transmit stop without link !!! + */ + if (fep->link) + { + fecp->fec_x_cntrl = 0x01; /* Graceful transmit stop */ + udelay(10); + if (!(fecp->fec_ievent & FEC_ENET_GRA)) + printk("fec_stop : Graceful transmit stop did not complete !\n"); + } /* Whack a reset. We should wait for this. */ |