On Mon, 2015-09-07 at 18:23 +0200, Mian Yousaf Kaukab wrote:
> urb completion callback is executed in host controllers interrupt
> context. To keep preempt disable time short, add urbs to a list on
> completion and schedule work to process the list.
> 
> Moreover, save timestamp and sof number in the urb completion callback
> to avoid any delays.
> 
> Signed-off-by: Mian Yousaf Kaukab <yousaf.kau...@intel.com>
> ---
> History:
> v1:
>  - Use global work queue instead of creating ordered queue.

1. using a common queue for real-time work is probably not nice for
picture quality
2. it will deadlock under some conditions

The explanation is a bit long

Suppose we have a device with a camera and a storage device,
like an ordinary camera you can use as a video device which also
exports its memory card.

Now we assume that the storage part is suspended.

CPU A                                   CPU B
                                        work item scheduled
entering uvc_uninit_video()
                                        work item executed
                                        work item allocates memory
                                        write to storage interface
                                        storage interface being resumed
flush_work() - waiting for CPU B
                                        DEADLOCK


If you want to use flush_work() you must use a dedicated queue.

        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