linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* scheduling work from receive_buf
@ 2011-05-17 15:20 Pavan Savoy
  2011-05-18 15:08 ` Alan Cox
  0 siblings, 1 reply; 2+ messages in thread
From: Pavan Savoy @ 2011-05-17 15:20 UTC (permalink / raw)
  To: linux-serial

currently in my line discipline driver - I've implemented a
receive_buf function inside which upon receiving a particular byte of
data, I need to
send a bunch of data and wait for its reception (which happens to
accumulate in receive_buf).

for this I implemented a work struct which I schedule into the default
work queue by doing a schedule_work inside my receive_buf function
when I receive such byte.
However I can't seem to do a wait_for_completion inside my work
handler. This completion is completed upon reception inside the
receive_buf function.

wait_for_completion inside the worker thread doesn't seem to allow the
receive_buf to be called.
Please suggest how best I can implement something like this ?

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

* Re: scheduling work from receive_buf
  2011-05-17 15:20 scheduling work from receive_buf Pavan Savoy
@ 2011-05-18 15:08 ` Alan Cox
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2011-05-18 15:08 UTC (permalink / raw)
  To: Pavan Savoy; +Cc: linux-serial

On Tue, 17 May 2011 20:50:09 +0530
Pavan Savoy <pavan_savoy@sify.com> wrote:

> currently in my line discipline driver - I've implemented a
> receive_buf function inside which upon receiving a particular byte of
> data, I need to
> send a bunch of data and wait for its reception (which happens to
> accumulate in receive_buf).
> 
> for this I implemented a work struct which I schedule into the default
> work queue by doing a schedule_work inside my receive_buf function
> when I receive such byte.
> However I can't seem to do a wait_for_completion inside my work
> handler. This completion is completed upon reception inside the
> receive_buf function.
> 
> wait_for_completion inside the worker thread doesn't seem to allow the
> receive_buf to be called.
> Please suggest how best I can implement something like this ?

I think by not waiting in the first place. Personally I would write that
kind of code as a state machine and instead of blocking for stuff just
trigger actions as states are reached.


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

end of thread, other threads:[~2011-05-18 15:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-17 15:20 scheduling work from receive_buf Pavan Savoy
2011-05-18 15:08 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).