On Thursday 14 March 2013 12:13:59 Ming Lei wrote:
> On Wed, Mar 13, 2013 at 11:15 PM, Oliver Neukum <oneu...@suse.de> wrote:
> > On Wednesday 13 March 2013 23:02:32 Ming Lei wrote:
> >> On Wed, Mar 13, 2013 at 10:55 PM, Oliver Neukum <oneu...@suse.de> wrote:
> >> >
> >> > But it will be run when the next read() call is made. The question is 
> >> > what happens
> >>
> >> When next read() is called, looks it won't be reached if
> >> 'ongoing_read' is set, and
> >> it needn't run without ongoing URBs.
> >
> > If ongoing_read is not set, IO may be started and its completion would
> > not be waited for, as the IO that had been started, but wasn't waited
> > for due to an interrupt, has completed.
> 
> OK, got it, so how about INIT_COMPLETION(&dev->bulk_in_completion)
> in case of !ongoing_read? That means replacing 'if (!dev->processed_urb)'
> with INIT_COMPLETION(&dev->bulk_in_completion).

It is possible, if you also change locking in skel_read_bulk_callback()
and skel_read().
But then it makes no sense and you'd be better of with a waitqueue
instead of a completion.

        Regards
                Oliver



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

Reply via email to