diff options
author | Grant Grundler <grundler@parisc-linux.org> | 2008-03-08 20:33:16 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-03-17 08:11:31 -0400 |
commit | 69cac988f2d8506d0b479c5ae7903b9067d7641d (patch) | |
tree | 0b20d0f51ea0f297777758c911c927050ba507d7 /drivers/net/tulip/de2104x.c | |
parent | 3b446c3e1592287dae117e03e61af0aa09adba6f (diff) |
2.6.25-rc4 de_stop_rxtx polling wrong
This untested patch _should_ fix:
"(net de2104x) Kernel panic with de2104x tulip driver on boot"
http://bugzilla.kernel.org/show_bug.cgi?id=3156
But the bug submitter isn't responding. Same fix has been applied
to tulip.c (several years ago) and uli526x.c (Feb 2008) drivers.
[ The panic reported in the bug report was removed in a recently
(march 2008) accepted patch from Ondrej Zary. ]
Signed-off-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/tulip/de2104x.c')
-rw-r--r-- | drivers/net/tulip/de2104x.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index 567c62757e9d..1b5edd646a8c 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c | |||
@@ -842,7 +842,7 @@ static inline int de_is_running (struct de_private *de) | |||
842 | static void de_stop_rxtx (struct de_private *de) | 842 | static void de_stop_rxtx (struct de_private *de) |
843 | { | 843 | { |
844 | u32 macmode; | 844 | u32 macmode; |
845 | unsigned int work = 1000; | 845 | unsigned int i = 1300/100; |
846 | 846 | ||
847 | macmode = dr32(MacMode); | 847 | macmode = dr32(MacMode); |
848 | if (macmode & RxTx) { | 848 | if (macmode & RxTx) { |
@@ -850,10 +850,14 @@ static void de_stop_rxtx (struct de_private *de) | |||
850 | dr32(MacMode); | 850 | dr32(MacMode); |
851 | } | 851 | } |
852 | 852 | ||
853 | while (--work > 0) { | 853 | /* wait until in-flight frame completes. |
854 | * Max time @ 10BT: 1500*8b/10Mbps == 1200us (+ 100us margin) | ||
855 | * Typically expect this loop to end in < 50 us on 100BT. | ||
856 | */ | ||
857 | while (--i) { | ||
854 | if (!de_is_running(de)) | 858 | if (!de_is_running(de)) |
855 | return; | 859 | return; |
856 | cpu_relax(); | 860 | udelay(100); |
857 | } | 861 | } |
858 | 862 | ||
859 | printk(KERN_WARNING "%s: timeout expired stopping DMA\n", de->dev->name); | 863 | printk(KERN_WARNING "%s: timeout expired stopping DMA\n", de->dev->name); |