[lkml]   [2000]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRE: catch 22 - porting net driver from 2.2 to 2.4
I tried using the kernel thread as demonstrated in your example and again it
failed (panic - scheduling in interrupt).
The difference is that your code executes the thread from within dev->open,
while my code tries to do that from dev->do_ioctl that has spinlocks around
the entire operation (which apparently sleeps).
If I comment out the spin_lock/unlock it will succeed, but then I can't be
sure I don't get any concurrent Tx/Rx/timer which is a bad idea while the
topology is still being created.

is there any way to do something like firing threads/timers atomically ?


-----Original Message-----
From: Jeff Garzik []
Sent: Monday, November 13, 2000 4:26 PM
To: Hen, Shmulik
Subject: Re: catch 22 - porting net driver from 2.2 to 2.4

"Hen, Shmulik" wrote:
> Where can I find info about that ?
> My first idea was to fire a timer and let the callback routine do the
> but I worry about synchronization and about passing the list of items for
> to handle.
> What is the accepted way of starting a kernel thread and how do I handle
> parameters and sync. ?

Attached is an example. My "8139too" ethernet driver uses a kernel
thread instead of a timer to perform media checking. It illustrates how
to start and stop a kernel thread.

Jeff Garzik |
Building 1024 | The chief enemy of creativity is "good" sense
MandrakeSoft | -- Picasso

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:47    [W:0.042 / U:9.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site