Re: [PATCH v2] uvcvideo: Fix open/close race condition

2013-05-15 Thread Shawn Nematbakhsh
ould result in the status URB being submitted multiple times. >> >> Use a mutex to protect the users count and serialize access to the >> status start and stop operations. >> >> Reported-by: Shawn Nematbakhsh >> Signed-off-by: Laurent Pinchart >> -

Re: [PATCH] [media] uvcvideo: Retry usb_submit_urb on -EPERM return

2013-05-03 Thread Shawn Nematbakhsh
Hi Laurent, Thanks for the changes! I agree that your synchronization logic is correct. Just two small comments: On Mon, Apr 29, 2013 at 1:34 PM, Laurent Pinchart wrote: > Hi Shawn, > > Thank you for the patch. > > On Tuesday 23 April 2013 17:42:32 Shawn Nematbakhsh wrote: >&g

[PATCH] [media] uvcvideo: Retry usb_submit_urb on -EPERM return

2013-04-23 Thread Shawn Nematbakhsh
adds a retry / timeout when uvc_status_open / usb_submit_urb returns -EPERM. This usually means that usb_kill_urb is in progress, and we just need to wait a while. Signed-off-by: Shawn Nematbakhsh --- drivers/media/usb/uvc/uvc_v4l2.c | 10 +- drivers/media/usb/uvc/uvcvideo.h | 1 + 2

[PATCH] [media] uvcvideo: Retry usb_submit_urb on -EPERM return

2013-04-23 Thread Shawn Nematbakhsh
From: Shawn Nematbakhsh While usb_kill_urb is in progress, calls to usb_submit_urb will fail with -EPERM (documented in Documentation/usb/URB.txt). The UVC driver does not correctly handle this case -- there is no synchronization between uvc_v4l2_open / uvc_status_start and uvc_v4l2_release