Re: [PATCH v1] media: uvcvideo: handle urb completion in a work queue

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

 



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.kaukab@xxxxxxxxx>
> ---
> 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux