lkml.org 
[lkml]   [2015]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Synchronization mechanism between wait_for_completion_interruptible_timeout() & complete()
On Fri 06-03-15 14:04:53, Naveen Kumar Parna wrote:
> Thanks Michal.
>
> Now I am clearing x->done to zero before
> wait_for_completion_interruptible_timeout.

You shouldn't touch this internal thing. Why would you want that
anyway? If x->done > 0 then there has been something completed.

> On Thu, Mar 5, 2015 at 6:53 PM, Michal Hocko <mhocko@suse.cz> wrote:
> > On Wed 04-03-15 18:46:43, Naveen Kumar Parna wrote:
> >> Hello,
> >>
> >> I have a question regarding the synchronization mechanism between
> >> wait_for_completion_interruptible_timeout() & complete(). I used
> >> complete() API in the ISR Tx interrupt path and
> >> wait_for_completion_interruptible_timeout() in struct file_operations
> >> .write method.
> >>
> >> Let assume a scenario in which Tx interrupt occurred and ISR called
> >> complete() API before any process actually blocked at write method on
> >> wait_for_completion_interruptible_timeout().
> >>
> >> After a few milli seconds, a process called write() API. Does it gets
> >> blocked on wait_for_completion_interruptible_timeout() for completion
> >> of a specific task to be signaled from new Tx interrupt?
> >
> > No, see do_wait_for_common resp. complete and x->done handling.
> >
> > --
> > Michal Hocko
> > SUSE Labs

--
Michal Hocko
SUSE Labs


\
 
 \ /
  Last update: 2015-03-06 10:01    [W:0.419 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site