Re: scheduling work from receive_buf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 17 May 2011 20:50:09 +0530
Pavan Savoy <pavan_savoy@xxxxxxxx> 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.

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux