Re: [PATCH] usb: host: xhci: fix HALTED endpoint handling

2014-01-23 Thread Mathias Nyman
On 01/23/2014 02:13 AM, Sarah Sharp wrote: If it really matters that a driver be able to get an immediate -EPIPE response back from a device when the endpoint is halted, I can rip the code out of xhci_endpoint_reset() and make the driver manually clean up the ring at the time of the stall, like i

Re: [PATCH] usb: host: xhci: fix HALTED endpoint handling

2014-01-22 Thread Sarah Sharp
On Tue, Jan 21, 2014 at 05:19:13PM -0500, Alan Stern wrote: > On Tue, 21 Jan 2014, Sarah Sharp wrote: > > > Ah, I think I see what's happening. > > > > The xHCI driver is not designed to execute transfers after a stall on a > > non-control endpoint until xhci_endpoint_reset is called and the driv

RE: [PATCH] usb: host: xhci: fix HALTED endpoint handling

2014-01-22 Thread David Laight
From: Sarah Sharp ... > If it really matters that a driver be able to get an immediate -EPIPE > response back from a device when the endpoint is halted, I can rip the > code out of xhci_endpoint_reset() and make the driver manually clean up > the ring at the time of the stall, like it does for cont

Re: [PATCH] usb: host: xhci: fix HALTED endpoint handling

2014-01-21 Thread Alan Stern
On Tue, 21 Jan 2014, Sarah Sharp wrote: > Ah, I think I see what's happening. > > The xHCI driver is not designed to execute transfers after a stall on a > non-control endpoint until xhci_endpoint_reset is called and the driver > fixes up the endpoint ring. That will happen in usb_clear_halt().

Re: [PATCH] usb: host: xhci: fix HALTED endpoint handling

2014-01-21 Thread Sarah Sharp
On Tue, Jan 21, 2014 at 12:11:39PM -0600, Felipe Balbi wrote: > Hi, > > On Tue, Jan 21, 2014 at 01:06:19PM -0500, Alan Stern wrote: > > > You could try to differentiate between an endpoint halt that requires a > > > manual cleanup, and ones that the upper layer should handle, perhaps by > > > addi

Re: [PATCH] usb: host: xhci: fix HALTED endpoint handling

2014-01-21 Thread Alan Stern
On Tue, 21 Jan 2014, Felipe Balbi wrote: > Hi, > > On Tue, Jan 21, 2014 at 01:06:19PM -0500, Alan Stern wrote: > > > You could try to differentiate between an endpoint halt that requires a > > > manual cleanup, and ones that the upper layer should handle, perhaps by > > > adding a new EP_HALTED_M

Re: [PATCH] usb: host: xhci: fix HALTED endpoint handling

2014-01-21 Thread Felipe Balbi
Hi, On Tue, Jan 21, 2014 at 01:06:19PM -0500, Alan Stern wrote: > > You could try to differentiate between an endpoint halt that requires a > > manual cleanup, and ones that the upper layer should handle, perhaps by > > adding a new EP_HALTED_MANUAL flag. The driver could accept URBs for > > the

Re: [PATCH] usb: host: xhci: fix HALTED endpoint handling

2014-01-21 Thread Alan Stern
On Tue, 21 Jan 2014, Sarah Sharp wrote: > On Mon, Jan 20, 2014 at 02:45:11PM -0600, Felipe Balbi wrote: > > If the HW reports the endpoint as Halted, there's > > no need to start any URB for that endpoint, we can > > simply return -EPIPE and this will tell upper layers > > that the endpoint is, in

Re: [PATCH] usb: host: xhci: fix HALTED endpoint handling

2014-01-21 Thread Felipe Balbi
On Tue, Jan 21, 2014 at 09:39:12AM -0800, Sarah Sharp wrote: > On Mon, Jan 20, 2014 at 02:45:11PM -0600, Felipe Balbi wrote: > > If the HW reports the endpoint as Halted, there's > > no need to start any URB for that endpoint, we can > > simply return -EPIPE and this will tell upper layers > > that

Re: [PATCH] usb: host: xhci: fix HALTED endpoint handling

2014-01-21 Thread Sarah Sharp
On Mon, Jan 20, 2014 at 02:45:11PM -0600, Felipe Balbi wrote: > If the HW reports the endpoint as Halted, there's > no need to start any URB for that endpoint, we can > simply return -EPIPE and this will tell upper layers > that the endpoint is, indeed, halted. > > This patch fixes usbtest's set/c

[PATCH] usb: host: xhci: fix HALTED endpoint handling

2014-01-20 Thread Felipe Balbi
If the HW reports the endpoint as Halted, there's no need to start any URB for that endpoint, we can simply return -EPIPE and this will tell upper layers that the endpoint is, indeed, halted. This patch fixes usbtest's set/clear halt test #13 on xHCI-based hosts. Cc: Signed-off-by: Felipe Balbi