diff options
author | Philippe De Muyter <phdm@macqel.be> | 2006-06-26 23:05:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-27 21:26:37 -0400 |
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 bd6983d1afba..16fc12fe933c 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c | |||
@@ -22,7 +22,7 @@ | |||
22 | * Copyright (c) 2001-2005 Greg Ungerer (gerg@snapgear.com) | 22 | * Copyright (c) 2001-2005 Greg Ungerer (gerg@snapgear.com) |
23 | * | 23 | * |
24 | * Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be) | 24 | * Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be) |
25 | * Copyright (c) 2004-2005 Macq Electronique SA. | 25 | * Copyright (c) 2004-2006 Macq Electronique SA. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include <linux/config.h> | 28 | #include <linux/config.h> |
@@ -2420,9 +2420,16 @@ fec_stop(struct net_device *dev) | |||
2420 | fep = netdev_priv(dev); | 2420 | fep = netdev_priv(dev); |
2421 | fecp = fep->hwp; | 2421 | fecp = fep->hwp; |
2422 | 2422 | ||
2423 | fecp->fec_x_cntrl = 0x01; /* Graceful transmit stop */ | 2423 | /* |
2424 | 2424 | ** We cannot expect a graceful transmit stop without link !!! | |
2425 | while(!(fecp->fec_ievent & FEC_ENET_GRA)); | 2425 | */ |
2426 | if (fep->link) | ||
2427 | { | ||
2428 | fecp->fec_x_cntrl = 0x01; /* Graceful transmit stop */ | ||
2429 | udelay(10); | ||
2430 | if (!(fecp->fec_ievent & FEC_ENET_GRA)) | ||
2431 | printk("fec_stop : Graceful transmit stop did not complete !\n"); | ||
2432 | } | ||
2426 | 2433 | ||
2427 | /* Whack a reset. We should wait for this. | 2434 | /* Whack a reset. We should wait for this. |
2428 | */ | 2435 | */ |