Re: Tons of issues with xhci

2012-12-12 Thread Alan Stern
On Tue, 11 Dec 2012, Sarah Sharp wrote:

 Hi Alan,
 
 I'm finally revisiting the issue with active transfers when a device
 disconnects.  I'm trying to refresh my memory of the issue.
 
 On Thu, Oct 18, 2012 at 03:54:06PM -0400, Alan Stern wrote:
  Unfortunately the trace isn't termendously helpful.  It shows a bunch
  of reads with a few writes sprinkled among them.  Then for no apparent
  reason, in the middle of a read the device was disconnected.
  
  Oddly, the bulk-IN URB that was in progress when the disconnect
  occurred did not complete immediately with an error.  Instead it timed
  out after 30 seconds and was cancelled.  Sarah, I thought you had fixed
  that?
 
 I don't remember what the fix for this was supposed to be.  I currently
 assume that when a USB device is logically disconnected by the USB core,
 either the driver's disconnect function is called and it should cancel
 all outstanding URBs, or the core goes and cancels all active URBs that
 are in the host queue.  Basically, I assume it's the USB core's job to
 flush out any URBs before destroying the xHCI endpoint rings when the
 struct usb_device is deallocated.  ISTR that this assumption was wrong,
 but I don't remember why.

No, your memory has gotten things mixed up.  The problem is not a 
logical disconnect.

The problem is a physical disconnect.  IIRC, the trace showed that the
root hub's Get-Port-Status reply had the connect status bit clear and
connect-change status bit set.  Nevertheless, the URB that was in
progress did not complete immediately with an error.

If the device is truly disconnected then it cannot send any packets.  
In particular, it can't send handshaking packets (or the USB-3
equivalent).  In the absence of these packets, the host hardware is
supposed to apply the 3-strikes rule and abort the transfer.  But
this didn't happen.  _That_ was the problem.

 I vaguely recall that the fix was for the xHCI driver to not accept URBs
 when it knows a particular device is disconnected.  Is that correct?

No, not even close.

Alan Stern

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Tons of issues with xhci

2012-12-11 Thread Sarah Sharp
Hi Alan,

I'm finally revisiting the issue with active transfers when a device
disconnects.  I'm trying to refresh my memory of the issue.

On Thu, Oct 18, 2012 at 03:54:06PM -0400, Alan Stern wrote:
 Unfortunately the trace isn't termendously helpful.  It shows a bunch
 of reads with a few writes sprinkled among them.  Then for no apparent
 reason, in the middle of a read the device was disconnected.
 
 Oddly, the bulk-IN URB that was in progress when the disconnect
 occurred did not complete immediately with an error.  Instead it timed
 out after 30 seconds and was cancelled.  Sarah, I thought you had fixed
 that?

I don't remember what the fix for this was supposed to be.  I currently
assume that when a USB device is logically disconnected by the USB core,
either the driver's disconnect function is called and it should cancel
all outstanding URBs, or the core goes and cancels all active URBs that
are in the host queue.  Basically, I assume it's the USB core's job to
flush out any URBs before destroying the xHCI endpoint rings when the
struct usb_device is deallocated.  ISTR that this assumption was wrong,
but I don't remember why.

I vaguely recall that the fix was for the xHCI driver to not accept URBs
when it knows a particular device is disconnected.  Is that correct?

Sarah Sharp
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Tons of issues with xhci

2012-10-19 Thread Felipe Contreras
On Thu, Oct 18, 2012 at 9:54 PM, Alan Stern st...@rowland.harvard.edu wrote:
 On Thu, 18 Oct 2012, Felipe Contreras wrote:

 On Thu, Oct 18, 2012 at 8:03 PM, Felipe Contreras
 felipe.contre...@gmail.com wrote:
  On Thu, Oct 18, 2012 at 7:26 PM, Alan Stern st...@rowland.harvard.edu 
  wrote:
  On Thu, 18 Oct 2012, Felipe Contreras wrote:
 
  Nope, still fails.
 
  http://felipec.org/dmesg.txt.xz
 
  I had some issues booting, probably not related to your patches, so I
  rebased them on top of 3.6.2.
 
  A usbmon trace (starting from before the non-working device is plugged
  in) might shed some light on the problem.
 
  Here:
  http://felipec.org/dmesg.txt.xz
 
  I simply plugged it in, mounted a fs, checked a directory, waited a
  couple minutes, checked another.

 Sigh
 http://felipec.org/usbmon.txt.xz

 Unfortunately the trace isn't termendously helpful.  It shows a bunch
 of reads with a few writes sprinkled among them.  Then for no apparent
 reason, in the middle of a read the device was disconnected.

 Oddly, the bulk-IN URB that was in progress when the disconnect
 occurred did not complete immediately with an error.  Instead it timed
 out after 30 seconds and was cancelled.  Sarah, I thought you had fixed
 that?

 The drive reconnected, was re-enumerated, and a few seconds later
 disconnected again.  No way to know the reason for these disconnects;
 they could be symptoms of a bad connection, hardware/firmware bugs, or
 even possibly a bug in xhci-hcd.

So I tried everything, eventually updated the firmware, but in the end
it turns out it was the cable. With the bad cable it seems when
operating in USB2 mode it tends to work fine, which explains a lot.

Anyway, I went back to 3.6.2 without the lpm patches and it still works fine :)

Thanks for pointing me in the right direction.

Cheers.

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Tons of issues with xhci

2012-10-19 Thread Adrian Sandu
 So I tried everything, eventually updated the firmware, but in the end
 it turns out it was the cable. With the bad cable it seems when
 operating in USB2 mode it tends to work fine, which explains a lot.

 Anyway, I went back to 3.6.2 without the lpm patches and it still works fine 
 :)

 Thanks for pointing me in the right direction.

 Cheers.

Doesn't this look alot like the problems I had ? :|
Altough I still find weird the fact that the connection to my laptop
worked just fine, but not in the asrock ! :|
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Tons of issues with xhci

2012-10-19 Thread Felipe Contreras
On Fri, Oct 19, 2012 at 11:53 AM, Adrian Sandu dex...@d3xt3r01.tk wrote:
 So I tried everything, eventually updated the firmware, but in the end
 it turns out it was the cable. With the bad cable it seems when
 operating in USB2 mode it tends to work fine, which explains a lot.

 Anyway, I went back to 3.6.2 without the lpm patches and it still works fine 
 :)

 Thanks for pointing me in the right direction.

 Cheers.

 Doesn't this look alot like the problems I had ? :|
 Altough I still find weird the fact that the connection to my laptop
 worked just fine, but not in the asrock ! :|

The same happened to me in another laptop, which only has USB2 ports.
I still see problems on this laptop on the USB2 port though (with that
cable), so it might depend on the hardware whether you see problems
with a bad cable or not.

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Tons of issues with xhci

2012-10-18 Thread Felipe Contreras
On Wed, Oct 17, 2012 at 10:07 PM, Sarah Sharp
sarah.a.sh...@linux.intel.com wrote:
 On Wed, Oct 17, 2012 at 06:38:31AM +0200, Felipe Contreras wrote:
 Hi,

 On Tue, Oct 16, 2012 at 7:24 PM, Sarah Sharp
 sarah.a.sh...@linux.intel.com wrote:
  The 3.5 kernel added USB 3.0 Link Power Management for Intel Panther
  Point xHCI hosts.  We've had some issues with devices not supporting LPM
  properly, and some fixes have been sent to Greg KH.  Can you build a
  kernel from his usb-linus branch and see if your issues are resolved?
 
  http://git.kernel.org/?p=linux/kernel/git/gregkh/usb.git;a=shortlog;h=refs/heads/usb-linus

 I'm trying to boot this kernel, unfortunately it just doesn't, there's
 only a black screen =/

 I've just pushed a branch to kernel.org that's called lpm-fixes.  It's
 the four fixes I think you need, rebased on the 3.6.1 branch.  Try that?

Nope, still fails.

http://felipec.org/dmesg.txt.xz

I had some issues booting, probably not related to your patches, so I
rebased them on top of 3.6.2.

Cheers.

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Tons of issues with xhci

2012-10-18 Thread Felipe Contreras
On Thu, Oct 18, 2012 at 11:58 AM, Felipe Contreras
felipe.contre...@gmail.com wrote:
 On Wed, Oct 17, 2012 at 10:07 PM, Sarah Sharp
 sarah.a.sh...@linux.intel.com wrote:
 On Wed, Oct 17, 2012 at 06:38:31AM +0200, Felipe Contreras wrote:
 Hi,

 On Tue, Oct 16, 2012 at 7:24 PM, Sarah Sharp
 sarah.a.sh...@linux.intel.com wrote:
  The 3.5 kernel added USB 3.0 Link Power Management for Intel Panther
  Point xHCI hosts.  We've had some issues with devices not supporting LPM
  properly, and some fixes have been sent to Greg KH.  Can you build a
  kernel from his usb-linus branch and see if your issues are resolved?
 
  http://git.kernel.org/?p=linux/kernel/git/gregkh/usb.git;a=shortlog;h=refs/heads/usb-linus

 I'm trying to boot this kernel, unfortunately it just doesn't, there's
 only a black screen =/

 I've just pushed a branch to kernel.org that's called lpm-fixes.  It's
 the four fixes I think you need, rebased on the 3.6.1 branch.  Try that?

 Nope, still fails.

 http://felipec.org/dmesg.txt.xz

 I had some issues booting, probably not related to your patches, so I
 rebased them on top of 3.6.2.

BTW, I went as back as 3.4.14 to see if I could find a point where
this drive worked, but it didn't, so I maybe it has never worked on
this hw.

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Tons of issues with xhci

2012-10-18 Thread Alan Stern
On Thu, 18 Oct 2012, Felipe Contreras wrote:

 Nope, still fails.
 
 http://felipec.org/dmesg.txt.xz
 
 I had some issues booting, probably not related to your patches, so I
 rebased them on top of 3.6.2.

A usbmon trace (starting from before the non-working device is plugged
in) might shed some light on the problem.

Alan Stern

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Tons of issues with xhci

2012-10-18 Thread Alan Stern
On Thu, 18 Oct 2012, Felipe Contreras wrote:

 On Thu, Oct 18, 2012 at 8:03 PM, Felipe Contreras
 felipe.contre...@gmail.com wrote:
  On Thu, Oct 18, 2012 at 7:26 PM, Alan Stern st...@rowland.harvard.edu 
  wrote:
  On Thu, 18 Oct 2012, Felipe Contreras wrote:
 
  Nope, still fails.
 
  http://felipec.org/dmesg.txt.xz
 
  I had some issues booting, probably not related to your patches, so I
  rebased them on top of 3.6.2.
 
  A usbmon trace (starting from before the non-working device is plugged
  in) might shed some light on the problem.
 
  Here:
  http://felipec.org/dmesg.txt.xz
 
  I simply plugged it in, mounted a fs, checked a directory, waited a
  couple minutes, checked another.
 
 Sigh
 http://felipec.org/usbmon.txt.xz

Unfortunately the trace isn't termendously helpful.  It shows a bunch
of reads with a few writes sprinkled among them.  Then for no apparent
reason, in the middle of a read the device was disconnected.

Oddly, the bulk-IN URB that was in progress when the disconnect
occurred did not complete immediately with an error.  Instead it timed
out after 30 seconds and was cancelled.  Sarah, I thought you had fixed
that?

The drive reconnected, was re-enumerated, and a few seconds later
disconnected again.  No way to know the reason for these disconnects;  
they could be symptoms of a bad connection, hardware/firmware bugs, or 
even possibly a bug in xhci-hcd.

Alan Stern

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Tons of issues with xhci

2012-10-17 Thread Sarah Sharp
On Wed, Oct 17, 2012 at 06:38:31AM +0200, Felipe Contreras wrote:
 Hi,
 
 On Tue, Oct 16, 2012 at 7:24 PM, Sarah Sharp
 sarah.a.sh...@linux.intel.com wrote:
  The 3.5 kernel added USB 3.0 Link Power Management for Intel Panther
  Point xHCI hosts.  We've had some issues with devices not supporting LPM
  properly, and some fixes have been sent to Greg KH.  Can you build a
  kernel from his usb-linus branch and see if your issues are resolved?
 
  http://git.kernel.org/?p=linux/kernel/git/gregkh/usb.git;a=shortlog;h=refs/heads/usb-linus
 
 I'm trying to boot this kernel, unfortunately it just doesn't, there's
 only a black screen =/

I've just pushed a branch to kernel.org that's called lpm-fixes.  It's
the four fixes I think you need, rebased on the 3.6.1 branch.  Try that?

Sarah Sharp
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Tons of issues with xhci

2012-10-16 Thread Sarah Sharp
Hi Felipe,

The 3.5 kernel added USB 3.0 Link Power Management for Intel Panther
Point xHCI hosts.  We've had some issues with devices not supporting LPM
properly, and some fixes have been sent to Greg KH.  Can you build a
kernel from his usb-linus branch and see if your issues are resolved?

http://git.kernel.org/?p=linux/kernel/git/gregkh/usb.git;a=shortlog;h=refs/heads/usb-linus

Sarah Sharp

On Tue, Oct 16, 2012 at 04:21:57AM +0200, Felipe Contreras wrote:
 Hi,
 
 I'm having a lot of issues regarding xhci my new laptop. I have had
 speed issues before with this drive (never really got the full speed),
 but right now I'm only trying to get it to work.
 
 I'm using 3.6.2 right now, and quite often the device just stops
 working and resets. It works perfectly fine in another laptop.
 
 Any idea?
 
 I will not mention the other issues because they happened on older kernels.
 
 Oct 16 04:12:22 nysa kernel: [ 3234.606767] usb 4-1: Successful
 evaluate context command
 Oct 16 04:12:22 nysa kernel: [ 3234.708104] usb 4-1: reset SuperSpeed
 USB device number 3 using xhci_hcd
 Oct 16 04:12:22 nysa kernel: [ 3234.719284] xhci_hcd :00:14.0:
 xHCI xhci_drop_endpoint called with disabled ep 88011524df80
 Oct 16 04:12:22 nysa kernel: [ 3234.719293] xhci_hcd :00:14.0:
 xHCI xhci_drop_endpoint called with disabled ep 88011524dfc0
 Oct 16 04:12:22 nysa kernel: [ 3234.719369] usb 4-1: Successful
 Endpoint Configure command
 Oct 16 04:12:22 nysa kernel: [ 3234.719454] usb 4-1: Successful
 evaluate context command
 Oct 16 04:12:22 nysa kernel: [ 3234.719587] usb 4-1: Successful
 evaluate context command
 Oct 16 04:12:22 nysa kernel: [ 3234.996380] usb 4-1: Successful
 evaluate context command
 Oct 16 04:12:22 nysa kernel: [ 3235.097617] usb 4-1: reset SuperSpeed
 USB device number 3 using xhci_hcd
 Oct 16 04:12:22 nysa kernel: [ 3235.108936] xhci_hcd :00:14.0:
 xHCI xhci_drop_endpoint called with disabled ep 88011524df80
 Oct 16 04:12:22 nysa kernel: [ 3235.108940] xhci_hcd :00:14.0:
 xHCI xhci_drop_endpoint called with disabled ep 88011524dfc0
 Oct 16 04:12:22 nysa kernel: [ 3235.109079] usb 4-1: Successful
 Endpoint Configure command
 Oct 16 04:12:22 nysa kernel: [ 3235.109157] usb 4-1: Successful
 evaluate context command
 Oct 16 04:12:22 nysa kernel: [ 3235.109286] usb 4-1: Successful
 evaluate context command
 Oct 16 04:12:22 nysa kernel: [ 3235.173923] usb 4-1: Successful
 evaluate context command
 Oct 16 04:12:22 nysa kernel: [ 3235.275336] usb 4-1: reset SuperSpeed
 USB device number 3 using xhci_hcd
 Oct 16 04:12:22 nysa kernel: [ 3235.286528] xhci_hcd :00:14.0:
 xHCI xhci_drop_endpoint called with disabled ep 88011524df80
 Oct 16 04:12:22 nysa kernel: [ 3235.286533] xhci_hcd :00:14.0:
 xHCI xhci_drop_endpoint called with disabled ep 88011524dfc0
 Oct 16 04:12:22 nysa kernel: [ 3235.286600] usb 4-1: Successful
 Endpoint Configure command
 Oct 16 04:12:22 nysa kernel: [ 3235.286679] usb 4-1: Successful
 evaluate context command
 Oct 16 04:12:22 nysa kernel: [ 3235.286801] usb 4-1: Successful
 evaluate context command
 Oct 16 04:12:23 nysa kernel: [ 3235.351186] usb 4-1: Successful
 evaluate context command
 Oct 16 04:12:23 nysa kernel: [ 3235.453138] usb 4-1: reset SuperSpeed
 USB device number 3 using xhci_hcd
 Oct 16 04:12:23 nysa kernel: [ 3235.464190] xhci_hcd :00:14.0:
 xHCI xhci_drop_endpoint called with disabled ep 88011524df80
 Oct 16 04:12:23 nysa kernel: [ 3235.464196] xhci_hcd :00:14.0:
 xHCI xhci_drop_endpoint called with disabled ep 88011524dfc0
 Oct 16 04:12:23 nysa kernel: [ 3235.464264] usb 4-1: Successful
 Endpoint Configure command
 Oct 16 04:12:23 nysa kernel: [ 3235.464343] usb 4-1: Successful
 evaluate context command
 Oct 16 04:12:23 nysa kernel: [ 3235.464461] usb 4-1: Successful
 evaluate context command
 Oct 16 04:12:29 nysa kernel: [ 3242.174809] usb 4-1: Successful
 evaluate context command
 Oct 16 04:12:29 nysa kernel: [ 3242.276802] usb 4-1: reset SuperSpeed
 USB device number 3 using xhci_hcd
 Oct 16 04:12:30 nysa kernel: [ 3242.287945] xhci_hcd :00:14.0:
 xHCI xhci_drop_endpoint called with disabled ep 88011524df80
 Oct 16 04:12:30 nysa kernel: [ 3242.287951] xhci_hcd :00:14.0:
 xHCI xhci_drop_endpoint called with disabled ep 88011524dfc0
 Oct 16 04:12:30 nysa kernel: [ 3242.288017] usb 4-1: Successful
 Endpoint Configure command
 Oct 16 04:12:30 nysa kernel: [ 3242.288096] usb 4-1: Successful
 evaluate context command
 Oct 16 04:12:30 nysa kernel: [ 3242.288216] usb 4-1: Successful
 evaluate context command
 Oct 16 04:12:32 nysa kernel: [ 3244.972263] usb 4-1: Successful
 evaluate context command
 Oct 16 04:12:32 nysa kernel: [ 3245.073638] usb 4-1: reset SuperSpeed
 USB device number 3 using xhci_hcd
 Oct 16 04:12:32 nysa kernel: [ 3245.084765] xhci_hcd :00:14.0:
 xHCI xhci_drop_endpoint called with disabled ep 88011524df80
 Oct 16 04:12:32 nysa kernel: [ 3245.084772] xhci_hcd :00:14.0:
 

Re: Tons of issues with xhci

2012-10-16 Thread Felipe Contreras
Hi,

On Tue, Oct 16, 2012 at 7:24 PM, Sarah Sharp
sarah.a.sh...@linux.intel.com wrote:
 The 3.5 kernel added USB 3.0 Link Power Management for Intel Panther
 Point xHCI hosts.  We've had some issues with devices not supporting LPM
 properly, and some fixes have been sent to Greg KH.  Can you build a
 kernel from his usb-linus branch and see if your issues are resolved?

 http://git.kernel.org/?p=linux/kernel/git/gregkh/usb.git;a=shortlog;h=refs/heads/usb-linus

I'm trying to boot this kernel, unfortunately it just doesn't, there's
only a black screen =/

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html