On Thu, Mar 14, 2013 at 5:04 PM, Oliver Neukum <oneukum@xxxxxxx> wrote: >> >> 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(). Yes, the local variable of 'ongoing_io' can be removed and just check dev->ongoing_read with lock, and do the below with lock too. INIT_COMPLETION(&dev->bulk_in_completion). Also 'complete(&dev->bulk_in_completion);' need to hold lock inside skel_read_bulk_callback. IMO, the patch is really a bug fix, so it is worthy of doing it. Du Xing, could you integrate the above change into your patch v1? > But then it makes no sense and you'd be better of with a waitqueue > instead of a completion. Maybe we can do it in another patch. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html