Re: xhci handling ring expansion

2014-06-24 Thread vichy
hi David:

2014-06-18 22:33 GMT+08:00 David Laight david.lai...@aculab.com:
 From: vichy
 ...
 and I get error message as
 platform-xhci: ERROR Transfer event TRB DMA ptr 483702160 not part of 
 current TD
 platform-xhci: trb_comp_code = 0x1, event status -115, buffer
 1cd4b590, len 100, flags 1038001

 that seems wired.
 complete code is success and not short package.
 Why we still get TRB DMA will not be part of current TD?

 I would trace all the setup requests and responses and then work
 out what is expected and then missing.
i purposely print the dma of 4 parameters when we pass to trb_in_td like below.
I found something wired:
1. when problem happen, the ep_dequeue_trb_dma is increase 0x20 instead of 0x10.
But I trace the source, I cannot find the place where we inc_deq twice
when handling iso trbs.
(ep_dequeue_trb_dma=0x2796e150 == ep_dequeue_trb_dma=0x2796e170 )

ep_dequeue_trb_dma=0x2796e130, end_seg_dma = 0x2796e3f0, suspect_dma=
0x2796e130, end_trb_dma = 0x2796e130
ep_dequeue_trb_dma=0x2796e140, end_seg_dma = 0x2796e3f0, suspect_dma=
0x2796e140, end_trb_dma = 0x2796e140
ep_dequeue_trb_dma=0x2796e150, end_seg_dma = 0x2796e3f0, suspect_dma=
0x2796e150, end_trb_dma = 0x2796e160
ep_dequeue_trb_dma=0x2796e170, end_seg_dma = 0x2796e3f0, suspect_dma=
0x2796e160, end_trb_dma = 0x2796e170
Platform-xhci: event status -115, buffer 2796e160, Dma 2796e160, len
100, flags 1038001
Platform-xhci: ERROR Transfer event TRB DMA ptr 664199520 not part of current TD
Platform-xhci: ERROR Transfer evenourt TRB DMA ptr not part of current TD

appreciate your help,
--
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: xhci handling ring expansion

2014-06-18 Thread David Laight
From: vichy 
 hi david:
...
  From one of the patches (not applied) I sent last November ...
  Include the unknown address when the DMA pointer from an event isn't part
  of the current TD. This will happen if the error code is TRB error.

 do you mean below patch?
 http://markmail.org/message/74qvwz7fhjxqeih3
 it only add debug message instead of fixing it.
 
 appreciate your help,

In my case there was a coding error in one of the other xhci
patches that caused a 'TRB error' report.
The patch to change the tracing was an attempt to make things
less confusing.

If you modify the tracing you might find out where the pointer from
the event came from.

David



Re: xhci handling ring expansion

2014-06-18 Thread vichy
hi David:

2014-06-18 16:45 GMT+08:00 David Laight david.lai...@aculab.com:
 From: vichy
 hi david:
 ...
  From one of the patches (not applied) I sent last November ...
  Include the unknown address when the DMA pointer from an event isn't part
  of the current TD. This will happen if the error code is TRB error.

 do you mean below patch?
 http://markmail.org/message/74qvwz7fhjxqeih3
 it only add debug message instead of fixing it.

 appreciate your help,

 In my case there was a coding error in one of the other xhci
 patches that caused a 'TRB error' report.
 The patch to change the tracing was an attempt to make things
 less confusing.

 If you modify the tracing you might find out where the pointer from
 the event came from.
I modify your patch like below
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 7f76a49..17d5ad0 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -2456,6 +2456,11 @@ static int handle_tx_event(struct xhci_hcd *xhci,
goto cleanup;
}

+   if (status  status != -EINPROGRESS)
+   xhci_dbg(xhci, event status %d, buffer %llx,
len %x, flags %x\n,
+   status,
event-buffer, event-transfer_len,
+   event-flags);
+
do {
/* This TRB should be in the TD at the head of this ring's
 * TD list.
@@ -2522,9 +2527,10 @@ static int handle_tx_event(struct xhci_hcd *xhci,
goto cleanup;
}
/* HC is busted, give up! */
-   xhci_err(xhci,
-   ERROR Transfer event TRB DMA ptr not 
-   part of current TD\n);
+   xhci_err(xhci, ERROR Transfer event
TRB DMA ptr %lld not part of current TD\n,event-buffer);
+   xhci_err(xhci, trb_comp_code = 0x%x,
event status %d, buffer %llx, len %x, flags %x\n,trb_comp_code,
+
status, event-buffer, event-transfer_len,
+   event-flags);
return -ESHUTDOWN;
}

and I get error message as
platform-xhci: ERROR Transfer event TRB DMA ptr 483702160 not part of current TD
platform-xhci: trb_comp_code = 0x1, event status -115, buffer
1cd4b590, len 100, flags 1038001

that seems wired.
complete code is success and not short package.
Why we still get TRB DMA will not be part of current TD?

appreciate your help,
--
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: xhci handling ring expansion

2014-06-18 Thread David Laight
From: vichy
...
 and I get error message as
 platform-xhci: ERROR Transfer event TRB DMA ptr 483702160 not part of current 
 TD
 platform-xhci: trb_comp_code = 0x1, event status -115, buffer
 1cd4b590, len 100, flags 1038001
 
 that seems wired.
 complete code is success and not short package.
 Why we still get TRB DMA will not be part of current TD?

I would trace all the setup requests and responses and then work
out what is expected and then missing.

David



Re: xhci handling ring expansion

2014-06-17 Thread Greg KH
On Tue, Jun 17, 2014 at 10:07:38PM +0800, vichy wrote:
 hi all:
 I use kernel 3.8.0

That's a very old, and unsupported kernel version.  I suggest you update
to something more modern, especially for xhci issues as loads of them
have been fixed since 3.8 was released.  If you are stuck with 3.8 due
to a vendor requiring it, please get support from them.

Best of luck,

greg k-h
--
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: xhci handling ring expansion

2014-06-17 Thread vichy
hi Greg:


2014-06-17 22:25 GMT+08:00 Greg KH gre...@linuxfoundation.org:
 On Tue, Jun 17, 2014 at 10:07:38PM +0800, vichy wrote:
 hi all:
 I use kernel 3.8.0

 That's a very old, and unsupported kernel version.  I suggest you update
Yes. it is pretty old kernel.
But i have git diff the xhci-mem.c there is no log about  Transfer
event TRB DMA ptr not
part of current TD
I have no idea whether it is hardware issue.
I just want to know any one bump the same problem before?
appreciate your help,
--
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: xhci handling ring expansion

2014-06-17 Thread David Laight
From: vichy
 hi all:
 I use kernel 3.8.0
 And when I plug in webcam in my platform xhci host, I get below message:
 
 platform-xhci platform-xhci.0: ERROR no room on ep ring, try ring expansion
  platform-xhci platform-xhci.0: ring expansion succeed, now has 4 segments
 platform-xhci platform-xhci.0: ERROR Transfer event TRB DMA ptr not
 part of current TD
 
 under what circumstance the controller will return TRB DMA which is
 not part of TD?

When the event TRB contains a pointer to something other than a data
buffer.
This is true for one of the error events.
Not that they should happen either.

David

 Is it possible to workaround this issue by modifying xhci-mem.c for
 extending segments?
 
 appreciate your help in advance,
 --
 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: xhci handling ring expansion

2014-06-17 Thread vichy
hi david:

 platform-xhci platform-xhci.0: ERROR no room on ep ring, try ring expansion
  platform-xhci platform-xhci.0: ring expansion succeed, now has 4 segments
 platform-xhci platform-xhci.0: ERROR Transfer event TRB DMA ptr not
 part of current TD

 under what circumstance the controller will return TRB DMA which is
 not part of TD?

 When the event TRB contains a pointer to something other than a data
 buffer.
after tracing the xhci driver, the message shows up because transfer
event TRB DMA is not located in current TD.

 This is true for one of the error events.
 Not that they should happen either.
do you mean this is one of error event trb we will get? But I cannot
find the error trb type in spec.
or it means something wrong in hardware?

Appreciate your help,
--
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: xhci handling ring expansion

2014-06-17 Thread David Laight
From: vichy 
 hi david:
 
  platform-xhci platform-xhci.0: ERROR no room on ep ring, try ring expansion
   platform-xhci platform-xhci.0: ring expansion succeed, now has 4 segments
  platform-xhci platform-xhci.0: ERROR Transfer event TRB DMA ptr not
  part of current TD
 
  under what circumstance the controller will return TRB DMA which is
  not part of TD?
 
  When the event TRB contains a pointer to something other than a data
  buffer.
 after tracing the xhci driver, the message shows up because transfer
 event TRB DMA is not located in current TD.
 
  This is true for one of the error events.
  Not that they should happen either.
 do you mean this is one of error event trb we will get? But I cannot
 find the error trb type in spec.
 or it means something wrong in hardware?

From one of the patches (not applied) I sent last November ...
Include the unknown address when the DMA pointer from an event isn't part
of the current TD. This will happen if the error code is TRB error.

David


Re: xhci handling ring expansion

2014-06-17 Thread vichy
hi david:

2014-06-17 23:50 GMT+08:00 David Laight david.lai...@aculab.com:
 From: vichy
 hi david:

  platform-xhci platform-xhci.0: ERROR no room on ep ring, try ring 
  expansion
   platform-xhci platform-xhci.0: ring expansion succeed, now has 4 segments
  platform-xhci platform-xhci.0: ERROR Transfer event TRB DMA ptr not
  part of current TD
 
  under what circumstance the controller will return TRB DMA which is
  not part of TD?
 
  When the event TRB contains a pointer to something other than a data
  buffer.
 after tracing the xhci driver, the message shows up because transfer
 event TRB DMA is not located in current TD.

  This is true for one of the error events.
  Not that they should happen either.
 do you mean this is one of error event trb we will get? But I cannot
 find the error trb type in spec.
 or it means something wrong in hardware?

 From one of the patches (not applied) I sent last November ...
 Include the unknown address when the DMA pointer from an event isn't part
 of the current TD. This will happen if the error code is TRB error.
do you mean below patch?
http://markmail.org/message/74qvwz7fhjxqeih3
it only add debug message instead of fixing it.

appreciate your help,
--
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