Re: Protecting uvcvideo againt USB device disconnect [Was: Re: Protecting usb_set_interface() against device removal]

2020-08-20 Thread Guenter Roeck
On 8/20/20 3:15 AM, Laurent Pinchart wrote: [ ... ] >> usb_set_interface() should not be called anymore after uvc_disconnect(), >> or at east I think so (is that documented anywhere ?). >> Yet, that obviously happens, and it happens completely outside lock >> control. And this is just one

Re: Protecting uvcvideo againt USB device disconnect [Was: Re: Protecting usb_set_interface() against device removal]

2020-08-20 Thread Laurent Pinchart
Hi Guenter, On Wed, Aug 19, 2020 at 04:08:51PM -0700, Guenter Roeck wrote: > On Wed, Aug 19, 2020 at 04:30:02AM +0300, Laurent Pinchart wrote: > > On Mon, Aug 17, 2020 at 01:00:49PM +0200, Hans Verkuil wrote: > > > On 17/08/2020 01:51, Laurent Pinchart wrote: > > > > On Sun, Aug 16, 2020 at

Re: Protecting uvcvideo againt USB device disconnect [Was: Re: Protecting usb_set_interface() against device removal]

2020-08-19 Thread Alan Stern
On Wed, Aug 19, 2020 at 04:08:51PM -0700, Guenter Roeck wrote: > usb_set_interface() should not be called anymore after uvc_disconnect(), > or at east I think so (is that documented anywhere ?). It may be documented somewhere, but basically it goes without saying. A main feature of the device

Re: Protecting uvcvideo againt USB device disconnect [Was: Re: Protecting usb_set_interface() against device removal]

2020-08-19 Thread Guenter Roeck
On Wed, Aug 19, 2020 at 04:30:02AM +0300, Laurent Pinchart wrote: > Hi Hans, > > On Mon, Aug 17, 2020 at 01:00:49PM +0200, Hans Verkuil wrote: > > On 17/08/2020 01:51, Laurent Pinchart wrote: > > > On Sun, Aug 16, 2020 at 08:54:18AM -0700, Guenter Roeck wrote: > > >> On 8/16/20 5:18 AM, Laurent

Re: Protecting uvcvideo againt USB device disconnect [Was: Re: Protecting usb_set_interface() against device removal]

2020-08-19 Thread Laurent Pinchart
Hi Hans, On Wed, Aug 19, 2020 at 09:27:05AM +0200, Hans Verkuil wrote: > On 19/08/2020 03:30, Laurent Pinchart wrote: > > On Mon, Aug 17, 2020 at 01:00:49PM +0200, Hans Verkuil wrote: > >> On 17/08/2020 01:51, Laurent Pinchart wrote: > >>> On Sun, Aug 16, 2020 at 08:54:18AM -0700, Guenter Roeck

Re: Protecting uvcvideo againt USB device disconnect [Was: Re: Protecting usb_set_interface() against device removal]

2020-08-19 Thread Hans Verkuil
On 19/08/2020 03:30, Laurent Pinchart wrote: > Hi Hans, > > On Mon, Aug 17, 2020 at 01:00:49PM +0200, Hans Verkuil wrote: >> On 17/08/2020 01:51, Laurent Pinchart wrote: >>> On Sun, Aug 16, 2020 at 08:54:18AM -0700, Guenter Roeck wrote: On 8/16/20 5:18 AM, Laurent Pinchart wrote: >

Re: Protecting uvcvideo againt USB device disconnect [Was: Re: Protecting usb_set_interface() against device removal]

2020-08-18 Thread Laurent Pinchart
Hi Hans, On Mon, Aug 17, 2020 at 01:00:49PM +0200, Hans Verkuil wrote: > On 17/08/2020 01:51, Laurent Pinchart wrote: > > On Sun, Aug 16, 2020 at 08:54:18AM -0700, Guenter Roeck wrote: > >> On 8/16/20 5:18 AM, Laurent Pinchart wrote: > >>> CC'ing Hans Verkuil and Sakari Ailus for the discussion

Re: Protecting uvcvideo againt USB device disconnect [Was: Re: Protecting usb_set_interface() against device removal]

2020-08-17 Thread Hans Verkuil
On 17/08/2020 01:51, Laurent Pinchart wrote: > Hi Guenter, > > On Sun, Aug 16, 2020 at 08:54:18AM -0700, Guenter Roeck wrote: >> On 8/16/20 5:18 AM, Laurent Pinchart wrote: >>> Hi Guenter, >>> >>> CC'ing Hans Verkuil and Sakari Ailus for the discussion about handling >>> file operations and

Re: Protecting uvcvideo againt USB device disconnect [Was: Re: Protecting usb_set_interface() against device removal]

2020-08-16 Thread Laurent Pinchart
Hi Guenter, On Sun, Aug 16, 2020 at 08:54:18AM -0700, Guenter Roeck wrote: > On 8/16/20 5:18 AM, Laurent Pinchart wrote: > > Hi Guenter, > > > > CC'ing Hans Verkuil and Sakari Ailus for the discussion about handling > > file operations and disconnect in V4L2. > > > > On Sat, Aug 15, 2020 at

Re: Protecting uvcvideo againt USB device disconnect [Was: Re: Protecting usb_set_interface() against device removal]

2020-08-16 Thread Guenter Roeck
On 8/16/20 5:18 AM, Laurent Pinchart wrote: > Hi Guenter, > > CC'ing Hans Verkuil and Sakari Ailus for the discussion about handling > file operations and disconnect in V4L2. > > On Sat, Aug 15, 2020 at 05:33:15PM -0700, Guenter Roeck wrote: >> + linux-uvc-de...@lists.sourceforge.net >> +

Re: Protecting uvcvideo againt USB device disconnect [Was: Re: Protecting usb_set_interface() against device removal]

2020-08-16 Thread Laurent Pinchart
Hi Guenter, CC'ing Hans Verkuil and Sakari Ailus for the discussion about handling file operations and disconnect in V4L2. On Sat, Aug 15, 2020 at 05:33:15PM -0700, Guenter Roeck wrote: > + linux-uvc-de...@lists.sourceforge.net > + linux-me...@vger.kernel.org > +

Protecting uvcvideo againt USB device disconnect [Was: Re: Protecting usb_set_interface() against device removal]

2020-08-15 Thread Guenter Roeck
+ linux-uvc-de...@lists.sourceforge.net + linux-me...@vger.kernel.org + laurent.pinch...@ideasonboard.com and changed subject On Fri, Aug 14, 2020 at 10:07:39PM -0400, Alan Stern wrote: > On Fri, Aug 14, 2020 at 04:07:03PM -0700, Guenter Roeck wrote: > > Hi all, > > > > over time, there have

Re: Protecting usb_set_interface() against device removal

2020-08-15 Thread Alan Stern
On Fri, Aug 14, 2020 at 04:07:03PM -0700, Guenter Roeck wrote: > Hi all, > > over time, there have been a number of reports of crashes in > usb_ifnum_to_if(), > called from usb_hcd_alloc_bandwidth, which is in turn called from > usb_set_interface(). > Examples are [1] [2] [3]. A typical

Re: Protecting usb_set_interface() against device removal

2020-08-15 Thread Guenter Roeck
On 8/14/20 7:07 PM, Alan Stern wrote: > On Fri, Aug 14, 2020 at 04:07:03PM -0700, Guenter Roeck wrote: >> Hi all, >> >> over time, there have been a number of reports of crashes in >> usb_ifnum_to_if(), >> called from usb_hcd_alloc_bandwidth, which is in turn called from >> usb_set_interface().

Protecting usb_set_interface() against device removal

2020-08-14 Thread Guenter Roeck
Hi all, over time, there have been a number of reports of crashes in usb_ifnum_to_if(), called from usb_hcd_alloc_bandwidth, which is in turn called from usb_set_interface(). Examples are [1] [2] [3]. A typical backtrace is: <3>[ 3489.445468] intel_sst_acpi 808622A8:00: sst: Busy wait failed,