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