public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* sleeping in dev->tx_timeout?
@ 2003-08-03 18:37 Abraham van der Merwe
  2003-08-03 19:10 ` Zwane Mwaikambo
  0 siblings, 1 reply; 5+ messages in thread
From: Abraham van der Merwe @ 2003-08-03 18:37 UTC (permalink / raw)
  To: Linux Kernel Discussions

Hi!

Is it safe to sleep in tx_timeout (in the networking code), i.e. to call
schedule_timeout and friends from that routine?

-- 

Regards
 Abraham

: How would you disambiguate these situations?

By shooting the person who did the latter.
             -- Larry Wall in <199710290235.SAA02444@wall.org>

___________________________________________________
 Abraham vd Merwe - Frogfoot Networks CC
 9 Kinnaird Court, 33 Main Street, Newlands, 7700
 Phone: +27 21 686 1665 Cell: +27 82 565 4451
 Http: http://www.frogfoot.net/ Email: abz@frogfoot.net


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

* Re: sleeping in dev->tx_timeout?
  2003-08-03 18:37 sleeping in dev->tx_timeout? Abraham van der Merwe
@ 2003-08-03 19:10 ` Zwane Mwaikambo
  2003-08-03 19:37   ` Abraham van der Merwe
  0 siblings, 1 reply; 5+ messages in thread
From: Zwane Mwaikambo @ 2003-08-03 19:10 UTC (permalink / raw)
  To: Abraham van der Merwe; +Cc: Linux Kernel Discussions

On Sun, 3 Aug 2003, Abraham van der Merwe wrote:

> Hi!
> 
> Is it safe to sleep in tx_timeout (in the networking code), i.e. to call
> schedule_timeout and friends from that routine?

No it's called from softirq context and with the dev->xmit_lock held in 
places.

-- 
function.linuxpower.ca

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

* Re: sleeping in dev->tx_timeout?
  2003-08-03 19:10 ` Zwane Mwaikambo
@ 2003-08-03 19:37   ` Abraham van der Merwe
  2003-08-03 19:48     ` Jeff Garzik
  0 siblings, 1 reply; 5+ messages in thread
From: Abraham van der Merwe @ 2003-08-03 19:37 UTC (permalink / raw)
  To: Zwane Mwaikambo; +Cc: Linux Kernel Discussions

Hi Zwane                                         >@2003.08.03_21:10:56_+0200

> > Is it safe to sleep in tx_timeout (in the networking code), i.e. to call
> > schedule_timeout and friends from that routine?
> 
> No it's called from softirq context and with the dev->xmit_lock held in 
> places.

That's what I thought. How are you supposed to wait for long periods from
tx_timeout? My problem is that I have a chip reset which takes around 10ms
(i.e. too long to use mdelay())

-- 

Regards
 Abraham

No problem is insoluble in all conceivable circumstances.

___________________________________________________
 Abraham vd Merwe - Frogfoot Networks CC
 9 Kinnaird Court, 33 Main Street, Newlands, 7700
 Phone: +27 21 686 1665 Cell: +27 82 565 4451
 Http: http://www.frogfoot.net/ Email: abz@frogfoot.net


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

* Re: sleeping in dev->tx_timeout?
  2003-08-03 19:37   ` Abraham van der Merwe
@ 2003-08-03 19:48     ` Jeff Garzik
  2003-08-03 20:54       ` Alan Cox
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Garzik @ 2003-08-03 19:48 UTC (permalink / raw)
  To: Abraham van der Merwe; +Cc: Zwane Mwaikambo, Linux Kernel Discussions

Abraham van der Merwe wrote:
> Hi Zwane                                         >@2003.08.03_21:10:56_+0200
> 
> 
>>>Is it safe to sleep in tx_timeout (in the networking code), i.e. to call
>>>schedule_timeout and friends from that routine?
>>
>>No it's called from softirq context and with the dev->xmit_lock held in 
>>places.
> 
> 
> That's what I thought. How are you supposed to wait for long periods from
> tx_timeout? My problem is that I have a chip reset which takes around 10ms
> (i.e. too long to use mdelay())

Simple answer, don't wait in tx_timeout :)

These days drivers often need quite a while for hardware reset.  I am 
pushing to move this code, long term, into process context.  So, in 
tx_timeout:
* disable NIC and interrupts as best you can, quickly
* schedule_task/schedule_work to schedule the full hardware reset

	Jeff





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

* Re: sleeping in dev->tx_timeout?
  2003-08-03 19:48     ` Jeff Garzik
@ 2003-08-03 20:54       ` Alan Cox
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Cox @ 2003-08-03 20:54 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: Abraham van der Merwe, Zwane Mwaikambo, Linux Kernel Discussions

On Sul, 2003-08-03 at 20:48, Jeff Garzik wrote:
> These days drivers often need quite a while for hardware reset.  I am 
> pushing to move this code, long term, into process context.  So, in 
> tx_timeout:
> * disable NIC and interrupts as best you can, quickly
> * schedule_task/schedule_work to schedule the full hardware reset

And if the hardware is hard to recover or needs messy recovery code take
a look at the PCI layer tricks in -ac


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

end of thread, other threads:[~2003-08-03 20:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-03 18:37 sleeping in dev->tx_timeout? Abraham van der Merwe
2003-08-03 19:10 ` Zwane Mwaikambo
2003-08-03 19:37   ` Abraham van der Merwe
2003-08-03 19:48     ` Jeff Garzik
2003-08-03 20:54       ` Alan Cox

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