2004-11-24 12:29:23

by Hendrik Wiese

[permalink] [raw]
Subject: Difference wait_event_interruptible and interruptible_wait_on

Hello,

I'm porting a device driver from 2.2.14 to 2.6.7 and I got some problems
doing this...

one of them is the following:
I know that a call to interruptible_wait_on puts a process into sleep
state and that wait_event_interruptible does the same. But the
difference is that wait_event_interruptible needs a condition to pass to
wake up the processes. I do not need that mechanism since I wake up the
processes at other places inside my driver with wake_up_interruptible
calls. So how do I get a function similar to interruptible_wait_on where
no condition is needed using kernel 2.6?

Thanks a lot and please CC me, 'cos I haven't subscribed to the LKML yet.

Kind regards,
Hendrik


2004-11-24 14:13:03

by Davide Rossetti

[permalink] [raw]
Subject: Re: Difference wait_event_interruptible and interruptible_wait_on

Hendrik Wiese wrote:

> Hello,
>
> I'm porting a device driver from 2.2.14 to 2.6.7 and I got some
> problems doing this...
>
> one of them is the following:
> I know that a call to interruptible_wait_on puts a process into sleep
> state and that wait_event_interruptible does the same. But the
> difference is that wait_event_interruptible needs a condition to pass
> to wake up the processes. I do not need that mechanism since I wake up
> the processes at other places inside my driver with
> wake_up_interruptible calls. So how do I get a function similar to
> interruptible_wait_on where no condition is needed using kernel 2.6?

I did not check, so maybe I'm wrong, anyway the condition
wait_event_interruptible is used to avoid the race window between the
time you decide to call it and the time the process is actually made to
sleep and ready to be woken up.
regards

2004-11-24 14:19:05

by Hendrik Wiese

[permalink] [raw]
Subject: Re: Difference wait_event_interruptible and interruptible_wait_on

Davide Rossetti wrote:

> Hendrik Wiese wrote:
>
>> Hello,
>>
>> I'm porting a device driver from 2.2.14 to 2.6.7 and I got some
>> problems doing this...
>>
>> one of them is the following:
>> I know that a call to interruptible_wait_on puts a process into sleep
>> state and that wait_event_interruptible does the same. But the
>> difference is that wait_event_interruptible needs a condition to pass
>> to wake up the processes. I do not need that mechanism since I wake
>> up the processes at other places inside my driver with
>> wake_up_interruptible calls. So how do I get a function similar to
>> interruptible_wait_on where no condition is needed using kernel 2.6?
>
>
> I did not check, so maybe I'm wrong, anyway the condition
> wait_event_interruptible is used to avoid the race window between the
> time you decide to call it and the time the process is actually made
> to sleep and ready to be woken up.
> regards
>
>
Thanks for your reply.

So what should such a condition be? What should be put there?

2004-11-24 14:28:27

by Arjan van de Ven

[permalink] [raw]
Subject: Re: Difference wait_event_interruptible and interruptible_wait_on

On Wed, 2004-11-24 at 14:42 +0100, Hendrik Wiese wrote:

>
> So what should such a condition be? What should be put there?

depends on your code.. do you have an URL to your driver source so that
people can see what you're asking ?


2004-11-25 09:36:04

by Hendrik Wiese

[permalink] [raw]
Subject: Re: Difference wait_event_interruptible and interruptible_wait_on

Arjan van de Ven wrote:

>On Wed, 2004-11-24 at 14:42 +0100, Hendrik Wiese wrote:
>
>
>
>>So what should such a condition be? What should be put there?
>>
>>
>
>depends on your code.. do you have an URL to your driver source so that
>people can see what you're asking ?
>
>
>
>
>
It is a proprietary driver developed for access to passive and active
modules inside a vme-rack. Active modules can communicate with each
other over an IP layer created by the driver on top of the VME
architecture (dual port ram, Tundra Universe II PCI-VME Bridge) and on
the other hand a device for communication between active and passive
modules. I don't know if I may make the source code public, 'cos it is
property of my employer. I have to communicate this. I know there is
something called GPL and I also know what it means, but I fear my
oppinion won't be heard by my employer. Well... it's worth a try.