public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* mdelay causes BUG, please use udelay
@ 2002-08-20 23:50 Troy Wilson
  2002-08-21  1:00 ` Jeff Garzik
  0 siblings, 1 reply; 12+ messages in thread
From: Troy Wilson @ 2002-08-20 23:50 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-kernel, Martin.Bligh, tcw

Hi Jeff,

  We probably shouldn't be doing this, but we can at least avoid the BUG
caused by doing an mdelay in interrupt context if we change to udelay.

Thanks,

- Troy


diff -urN linux-2.5.31/drivers/net/e1000/e1000_hw.c linux-2.5.31.udelay/drivers/net/e1000/e1000_hw.c
--- linux-2.5.31/drivers/net/e1000/e1000_hw.c	Sat Aug 10 20:41:28 2002
+++ linux-2.5.31.udelay/drivers/net/e1000/e1000_hw.c	Tue Aug 20 18:12:20 2002
@@ -134,7 +134,7 @@
     /* Delay to allow any outstanding PCI transactions to complete before
      * resetting the device
      */ 
-    msec_delay(10);
+    usec_delay(10000);
 
     /* Issue a global reset to the MAC.  This will reset the chip's
      * transmit, receive, DMA, and link units.  It will not effect

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: mdelay causes BUG, please use udelay
@ 2002-08-21  0:20 Feldman, Scott
  2002-08-21  0:27 ` Benjamin LaHaise
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Feldman, Scott @ 2002-08-21  0:20 UTC (permalink / raw)
  To: 'Troy Wilson', Jeff Garzik; +Cc: linux-kernel, Martin.Bligh, tcw

>   We probably shouldn't be doing this, but we can at least 
> avoid the BUG caused by doing an mdelay in interrupt context 
> if we change to udelay.

That's BUG is my fault.  I put that in there so no one would tempted to call
msec_delay in the interrupt context.  As you've discovered, I missed one
case where msec_delay is called in interrupt context: tx_timeout.  Dangit!

> -    msec_delay(10);
> +    usec_delay(10000);

Jeff, 10000 seems on the border of what's OK.  If it's acceptable, then
let's go for that.  Otherwise, we're going to have to chain several
mod_timer callbacks together to do a controller reset.

-scott

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: mdelay causes BUG, please use udelay
@ 2002-08-21  0:59 Feldman, Scott
  0 siblings, 0 replies; 12+ messages in thread
From: Feldman, Scott @ 2002-08-21  0:59 UTC (permalink / raw)
  To: 'Alan Cox'
  Cc: 'Troy Wilson', Jeff Garzik, linux-kernel, Martin.Bligh,
	tcw


> > Jeff, 10000 seems on the border of what's OK.  If it's acceptable, 
> > then let's go for that.  Otherwise, we're going to have to chain 
> > several mod_timer callbacks together to do a controller reset.
> 
> For some telco and embedded apps 10000 in an IRQ is 
> borderline. One day the timer stuff will be needed - how hard 
> is it to fix right first time ?

Ok, ok, 10000 is bad, even when reseting the part, no problem.  It's not to
hard to fix the right way; I'll work on a patch to give to Jeff.

-scott

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2002-08-21 17:18 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-20 23:50 mdelay causes BUG, please use udelay Troy Wilson
2002-08-21  1:00 ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2002-08-21  0:20 Feldman, Scott
2002-08-21  0:27 ` Benjamin LaHaise
2002-08-21  0:28 ` H. Peter Anvin
2002-08-21  0:28 ` Alan Cox
2002-08-21  0:59 ` Jeff Garzik
2002-08-21 16:04 ` Martin J. Bligh
2002-08-21 16:45   ` Chris Friesen
2002-08-21 16:56     ` Martin J. Bligh
2002-08-21 17:21   ` Dave Hansen
2002-08-21  0:59 Feldman, Scott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox