Skip to contentSkip to conversation

Backport of a 2.6.x USB driver to 2.4.32 - help needed

DISCUSSION Robert Hancock 2 participants 2 messages Jun 7, 2006 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 8 lines · Jesper Juhl
Quoted 7 lines · Heiko Gerstung

Hi!

Short Version (tm): I try to backport a USB driver (rtl8150.c) from 2.6.15.x to 2.4.32 and have no idea how to substitue two functions:
in_atomic() and schedule_timeout_uninterruptible() ... I really would appreciate any help, because I am no kernel hacker at all ...

Quoted 4 lines

in_atomic() is used to test if the kernel is in a state where sleeping is allowed or not. The 2.4.x kernel is not preemptive and has quite coarse grained SMP support (the BKL "Big Kernel Lock"), it didin't need in_atomic() in the same way as 2.6.x does.

There's little difference in the need for it, 2.4 just doesn't have it. I don't see a call to that function in that driver's code though?

Quoted 3 lines

schedule_timeout_uninterruptible() is used to sleep on a wait-queue, which 2.4.x does not have.

Huh? 2.4 did have wait queues, but that call has nothing to do with them. You should be able to replace it with:

set_current_state( TASK_UNINTERRUPTIBLE );
schedule_timeout( timeout );

Signature · 3 lines
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from [email protected]
Home Page: http://www.roberthancock.com/
#3 lore raw
Quoted 9 lines · Robert Hancock
Quoted 8 lines · Jesper Juhl
Quoted 7 lines · Heiko Gerstung

Hi!

Short Version (tm): I try to backport a USB driver (rtl8150.c) from 2.6.15.x to 2.4.32 and have no idea how to substitue two functions:
in_atomic() and schedule_timeout_uninterruptible() ... I really would appreciate any help, because I am no kernel hacker at all ...

Quoted 7 lines
Quoted 4 lines

in_atomic() is used to test if the kernel is in a state where sleeping is allowed or not. The 2.4.x kernel is not preemptive and has quite coarse grained SMP support (the BKL "Big Kernel Lock"), it didin't need in_atomic() in the same way as 2.6.x does.

There's little difference in the need for it, 2.4 just doesn't have it. I don't see a call to that function in that driver's code though?

It is in the modified version. In the long version of my post I wrote that the maintainer of the driver was so kind to modify the 2.6 driver code for me, because using such an interface in a bonding configuration always leads to kernel crashes in 2.4 kernels (I tested 2.4.20 and 2.4.32). Backporting the unmodified 2.6 driver did not change that and it seems that the crashes are caused by the way the bonding code is accessing the interface (in combination with the buggy driver, of course).

Quoted 8 lines
Quoted 2 lines

schedule_timeout_uninterruptible() is used to sleep on a wait-queue, which 2.4.x does not have.

Huh? 2.4 did have wait queues, but that call has nothing to do with them. You should be able to replace it with:

set_current_state( TASK_UNINTERRUPTIBLE );
schedule_timeout( timeout );

Thanks for the tip!

I will take a look into the differences between the 2.4 and 2.6 bonding code and will come back here with questions (that one is for sure!).

Kind regards,
Heiko

Signature · 13 lines
------------------------------------------------------------------------

*MEINBERG Funkuhren GmbH & Co. KG*
Auf der Landwehr 22
D-31812 Bad Pyrmont, Germany
Tel.: ++49 (0)5281 9309-25
Fax: ++49 (0)5281 9309-30
eMail: [email protected] <mailto:[email protected]>
Internet: www.meinberg.de <http://www.meinberg.de/>

------------------------------------------------------------------------

Meinberg radio clocks: 25 years of accurate time worldwide