Re: [PATCH 02/20] usb: host: xhci: check DYING state earlier

2018-05-02 Thread Alan Stern
On Wed, 2 May 2018, Felipe Balbi wrote: > >> Look at the result. With this change we don't need to take a lock, > >> allocate memory, search for endpoint index, search for endpoint > >> state. All of those are needed for proper operation of the function, but > >> if the controller has already died

Re: [PATCH 02/20] usb: host: xhci: check DYING state earlier

2018-05-02 Thread Mathias Nyman
On 02.05.2018 14:46, Felipe Balbi wrote: Hi, Mathias Nyman writes: On 17.04.2018 10:07, Felipe Balbi wrote: Hi, Mathias Nyman writes: On 16.04.2018 15:29, Felipe Balbi wrote: Instead of allocating urb priv and, maybe, bail out due to xhci being in DYING state, we can move the check earl

Re: [PATCH 02/20] usb: host: xhci: check DYING state earlier

2018-05-02 Thread Felipe Balbi
Hi, Mathias Nyman writes: > On 17.04.2018 10:07, Felipe Balbi wrote: >> >> Hi, >> >> Mathias Nyman writes: >>> On 16.04.2018 15:29, Felipe Balbi wrote: Instead of allocating urb priv and, maybe, bail out due to xhci being in DYING state, we can move the check earlier and avoid the m

Re: [PATCH 02/20] usb: host: xhci: check DYING state earlier

2018-05-02 Thread Mathias Nyman
On 17.04.2018 10:07, Felipe Balbi wrote: Hi, Mathias Nyman writes: On 16.04.2018 15:29, Felipe Balbi wrote: Instead of allocating urb priv and, maybe, bail out due to xhci being in DYING state, we can move the check earlier and avoid the memory allocation altogether. This also moves checki

Re: [PATCH 02/20] usb: host: xhci: check DYING state earlier

2018-04-17 Thread Felipe Balbi
Hi, Mathias Nyman writes: > On 16.04.2018 15:29, Felipe Balbi wrote: >> Instead of allocating urb priv and, maybe, bail out due to xhci being >> in DYING state, we can move the check earlier and avoid the memory >> allocation altogether. > > This also moves checking for DYING outside the lock. >

Re: [PATCH 02/20] usb: host: xhci: check DYING state earlier

2018-04-16 Thread Mathias Nyman
On 16.04.2018 15:29, Felipe Balbi wrote: Instead of allocating urb priv and, maybe, bail out due to xhci being in DYING state, we can move the check earlier and avoid the memory allocation altogether. This also moves checking for DYING outside the lock. Most cases set DYING with lock held, so