Re: [PATCH] usb: misc: usbtest: fix pattern tests for scatterlists.

2016-05-04 Thread Mathias Nyman
On 03.05.2016 17:37, Alan Stern wrote: On Tue, 3 May 2016, Felipe Balbi wrote: Hi, Alan Stern writes: On Mon, 2 May 2016, Mathias Nyman wrote: The current implemenentation restart the sent pattern for each entry in the sg list. The receiving end expects a continuous pattern, and test will

Re: xhci_handle_command_timeout and wait_for_completion

2016-05-09 Thread Mathias Nyman
On 06.05.2016 23:32, Joe Lawrence wrote: Hello Mathias, In c311e391a7ef "xhci: rework command timeout and cancellation," xHCI command timeouts were refactored to flow through xhci_handle_command_timeout. We've seen a few instances of hangs/crashes with upstream and RHEL7.2 kernels where someone

Re: xhci_handle_command_timeout and wait_for_completion

2016-05-11 Thread Mathias Nyman
On 10.05.2016 17:04, Joe Lawrence wrote: On 05/09/2016 06:18 AM, Mathias Nyman wrote: On 06.05.2016 23:32, Joe Lawrence wrote: ...snip... Given that the default command timeout is 5 seconds, it seems strange to hit a 120 second hung task warning in this instance. I can only think that maybe

[RFT PATCH] xhci: Fix handling timeouted commands on hosts in weird states.

2016-05-12 Thread Mathias Nyman
uld cleanup pending commands. Add a check that clears all pending commands in case host is removed, or we are stuck timeouting on the same command. Also restart the command timeout timer when stopping the command ring to ensure we recive an ring stop/abort event. Cc: stable Signed-off-by: Mathias Ny

Re: xhci DWC3 flavor problem

2016-05-19 Thread Mathias Nyman
On 19.05.2016 14:23, Joao Pinto wrote: Hi Felipe, On 5/19/2016 11:32 AM, Felipe Balbi wrote: Hi, Note that we really did get a command timeout. Can you add a little extra debugging to try and figure out why that command failed? After instrumenting and capturing FPGA signals, the driver co

Re: USB 3.1 Gen 2 - 4.6 mainline broken

2016-05-20 Thread Mathias Nyman
Hi I'm adding the mailing list to this reply (removed your contact info) USB 3.1 Gen 2 in 4.6 is not broken just because device is not seen as SuperSpeedPlus 10Gbps device. On 20.05.2016 02:04, Everett Wenzel wrote: Hello, I noticed that an FPGA was used to develop most of the USB3.1 Gen2 cod

Re: xhci DWC3 flavor problem

2016-05-20 Thread Mathias Nyman
On 19.05.2016 18:42, Joao Pinto wrote: After a few moments the schedule problem happen again: # INFO: task kworker/0:1:349 blocked for more than 120 seconds. Not tainted 4.6.0-rc5 #9 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. kworker/0:1 D ff8008086

[RFC PATCH 6/6] xhci: TD-fragment, align the unsplittable case with a bounce buffer

2016-05-26 Thread Mathias Nyman
original sg list, and finally unmap it Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-mem.c | 76 ++--- drivers/usb/host/xhci-ring.c | 113 ++- drivers/usb/host/xhci.c | 5 +- drivers/usb/host/xhci.h | 11 - 4

[RFC PATCH 1/6] xhci: rename ep_ring variable in queue_bulk_tx(), no functional change

2016-05-26 Thread Mathias Nyman
Tiny change, a bit more readable. The real reason for this change is that the coming td fragment work had several over 80 lines character lines split just because of a few extra characters in variable names. no functional changes Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c

[RFC PATCH 0/6] xhci: conform with xhci td fragment constraints

2016-05-26 Thread Mathias Nyman
n option that can be implemented later after driver cleanup. The first 4 patches are more generic cleanups and reworks needed for the two last patches that actually makes sure data is aligned. Mathias Nyman (6): xhci: rename ep_ring variable in queue_bulk_tx(), no functional change xhci: properly

[RFC PATCH 5/6] xhci: align the last trb before link if it is easily splittable.

2016-05-26 Thread Mathias Nyman
then just split the trb at the boundary. If not, then just print a debug message and continue as we have always done, hoping for the best Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/drivers/usb/host

[RFC PATCH 3/6] xhci: use boolean to indicate last trb in td remainder calculation

2016-05-26 Thread Mathias Nyman
omply with data alignment requirements in xhci specs section 4.11.7.1. Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 15dd226..f74ac1c 1

[RFC PATCH 2/6] xhci: properly prepare zero packet TD after normal bulk TD.

2016-05-26 Thread Mathias Nyman
TD is enqueued instead. It sets these pointers correctly. This change also simplifies unnecessary complexity related to keeping track of the last trb when enqueuing trbs. Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 38 +++--- 1 file changed, 15 inse

[RFC PATCH 4/6] xhci: don't rely on precalculated value of needed trbs in the enqueue loop

2016-05-26 Thread Mathias Nyman
in advance all together. It's an unnecessary extra walk through the scatterlist. This change also allows some bulk queue function simplifications Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 75 +--- 1 file changed, 29 insertions(+

Re: [RFC PATCH 6/6] xhci: TD-fragment, align the unsplittable case with a bounce buffer

2016-05-26 Thread Mathias Nyman
On 26.05.2016 14:32, Felipe Balbi wrote: Hi, Mathias Nyman writes: @@ -3098,24 +3136,66 @@ static u32 xhci_td_remainder(struct xhci_hcd *xhci, int transferred, return (total_packet_count - ((transferred + trb_buff_len) / maxp)); } + } + *trb_buff_len = new_buff_len

[RFC PATCH v2 1/6] xhci: rename ep_ring variable in queue_bulk_tx(), no functional change

2016-05-26 Thread Mathias Nyman
Tiny change, a bit more readable. The real reason for this change is that the coming td fragment work had several over 80 lines character lines split just because of a few extra characters in variable names. no functional changes Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c

[RFC PATCH v2 0/6] xhci: conform with xhci td fragment constraints

2016-05-26 Thread Mathias Nyman
n option that can be implemented later after driver cleanup. The first 4 patches are more generic cleanups and reworks needed for the two last patches that actually makes sure data is aligned. changes since v1: cleanup code comments used during development. Mathias Nyman (6): xhci: rename

[RFC PATCH v2 4/6] xhci: don't rely on precalculated value of needed trbs in the enqueue loop

2016-05-26 Thread Mathias Nyman
in advance all together. It's an unnecessary extra walk through the scatterlist. This change also allows some bulk queue function simplifications Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 75 +--- 1 file changed, 29 insertions(+

[RFC PATCH v2 2/6] xhci: properly prepare zero packet TD after normal bulk TD.

2016-05-26 Thread Mathias Nyman
TD is enqueued instead. It sets these pointers correctly. This change also simplifies unnecessary complexity related to keeping track of the last trb when enqueuing trbs. Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 38 +++--- 1 file changed, 15 inse

[RFC PATCH v2 6/6] xhci: TD-fragment, align the unsplittable case with a bounce buffer

2016-05-26 Thread Mathias Nyman
original sg list, and finally unmap it Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-mem.c | 74 ++--- drivers/usb/host/xhci-ring.c | 111 ++- drivers/usb/host/xhci.c | 5 +- drivers/usb/host/xhci.h | 11 - 4

[RFC PATCH v2 5/6] xhci: align the last trb before link if it is easily splittable.

2016-05-26 Thread Mathias Nyman
then just split the trb at the boundary. If not, then just print a debug message and continue as we have always done, hoping for the best Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/drivers/usb/host

[RFC PATCH v2 3/6] xhci: use boolean to indicate last trb in td remainder calculation

2016-05-26 Thread Mathias Nyman
omply with data alignment requirements in xhci specs section 4.11.7.1. Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 15dd226..f74ac1c 1

Re: [RFC PATCH v2 5/6] xhci: align the last trb before link if it is easily splittable.

2016-05-26 Thread Mathias Nyman
On 26.05.2016 15:08, Mathias Nyman wrote: TD fragments section 4.11.7.1 in xhci specs have additional requirements on how trbs in TDs must be organized. TD fragments shall not span transfer ring segments and TD fragments must be packet aligned. Normally we don't care about TD fragments,

[RFC PATCH v3 0/6] xhci: conform with xhci td fragment constraints

2016-05-26 Thread Mathias Nyman
ments in the correct patches Mathias Nyman (6): xhci: rename ep_ring variable in queue_bulk_tx(), no functional change xhci: properly prepare zero packet TD after normal bulk TD. xhci: use boolean to indicate last trb in td remainder calculation xhci: don't rely on precalculated va

[RFC PATCH v3 1/6] xhci: rename ep_ring variable in queue_bulk_tx(), no functional change

2016-05-26 Thread Mathias Nyman
Tiny change, a bit more readable. The real reason for this change is that the coming td fragment work had several over 80 lines character lines split just because of a few extra characters in variable names. no functional changes Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c

[RFC PATCH v3 2/6] xhci: properly prepare zero packet TD after normal bulk TD.

2016-05-26 Thread Mathias Nyman
TD is enqueued instead. It sets these pointers correctly. This change also simplifies unnecessary complexity related to keeping track of the last trb when enqueuing trbs. Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 38 +++--- 1 file changed, 15 inse

[RFC PATCH v3 4/6] xhci: don't rely on precalculated value of needed trbs in the enqueue loop

2016-05-26 Thread Mathias Nyman
in advance all together. It's an unnecessary extra walk through the scatterlist. This change also allows some bulk queue function simplifications Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 75 +--- 1 file changed, 29 insertions(+

[RFC PATCH v3 6/6] xhci: TD-fragment, align the unsplittable case with a bounce buffer

2016-05-26 Thread Mathias Nyman
original sg list, and finally unmap it Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-mem.c | 74 ++ drivers/usb/host/xhci-ring.c | 106 +++ drivers/usb/host/xhci.c | 5 +- drivers/usb/host/xhci.h | 10 +++- 4

[RFC PATCH v3 5/6] xhci: align the last trb before link if it is easily splittable.

2016-05-26 Thread Mathias Nyman
then just split the trb at the boundary. If not, then just print a debug message and continue as we have always done, hoping for the best Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/drivers/usb/host

[RFC PATCH v3 3/6] xhci: use boolean to indicate last trb in td remainder calculation

2016-05-26 Thread Mathias Nyman
omply with data alignment requirements in xhci specs section 4.11.7.1. Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 15dd226..f74ac1c 1

Re: Support for Pravega USB3 controller

2016-05-30 Thread Mathias Nyman
On 30.05.2016 11:31, Mason wrote: Hello Felipe, On 30/05/2016 08:58, Felipe Balbi wrote: Mason writes: I'm working on a SoC which embeds an IP block from GDA Technologies labeled "Pravega USB3 SuperSpeed Controller" (data-sheet is v0.99r dated 2014-01-29). A cursory search returns: http://w

Re: Unable to safely detach external HDD on USB 3.0

2016-05-31 Thread Mathias Nyman
On 30.05.2016 19:39, Alan Stern wrote: On Sun, 29 May 2016, Marco Chiappero wrote: Hello, I'm experiencing a problem I'm not able to troubleshoot. I own a WD Elements Portable USB 3.0 HDD (WDBU6Y0020BBK) containing a drive model WD20NMVW-11AV3S3. When connected to a USB 3.0 port the drive wor

Re: [PATCH v2 0/2] usb: host: xhci: rcar: fix the quirks setting of XHCI_NO_64BIT_SUPPORT

2016-06-01 Thread Mathias Nyman
isn't the following enough? @@ -4886,7 +4886,7 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks) xhci->hcc_params2 = readl(&xhci->cap_regs->hcc_params2); xhci_print_registers(xhci); - xhci->quirks = quirks; + xhci->quirks |= quirks;

[PATCH 0/4] xhci fixes for usb-linus

2016-06-01 Thread Mathias Nyman
Hi Greg These xhci fixes solve a 4.7-rc1 regression in xhci platform driver quirks, a couple of pending completion cases during driver unload/host lockup, and a deferred probe case. -Mathias Gabriel Krisman Bertazi (1): xhci: Cleanup only when releasing primary hcd Mathias Nyman (2): xhci

[PATCH 4/4] xhci: fix platform quirks overwrite regression in 4.7-rc1

2016-06-01 Thread Mathias Nyman
e use of new methods in xhci_plat_priv") Reported-by: Yoshihiro Shimoda Cc: Felipe Balbi Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index fe95602..f2f9518 100644 -

[PATCH 2/4] xhci: Fix handling timeouted commands on hosts in weird states.

2016-06-01 Thread Mathias Nyman
nce Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 27 ++- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 1287339..d7d5025 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/driv

[PATCH 1/4] xhci: Cleanup only when releasing primary hcd

2016-06-01 Thread Mathias Nyman
au Cc: sta...@vger.kernel.org Reviewed-by: Roger Quadros Cc: #v4.3+ Tested-by: Joel Stanley Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 3 ++- drivers/usb/host/xhci.c | 27 +++ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/d

[PATCH 3/4] usb: xhci-plat: properly handle probe deferral for devm_clk_get()

2016-06-01 Thread Mathias Nyman
the probe() will continue with the clock prepared and enabled as expected. In practice, such issue is seen on the ARM64 Marvell 7K/8K platform, where the clocks are registered by a platform driver. Cc: Signed-off-by: Thomas Petazzoni Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-

Re: Unable to safely detach external HDD on USB 3.0

2016-06-08 Thread Mathias Nyman
On 06.06.2016 21:31, Alan Stern wrote: On Sat, 4 Jun 2016, Marco Chiappero wrote: On 31/05/2016 16:34, Alan Stern wrote: On Tue, 31 May 2016, Mathias Nyman wrote: xhci specs say that port will move from Disconnected (PLS = RX_DETECT) to Polling if "SuperSpeed far-end receiver termina

Re: Unable to safely detach external HDD on USB 3.0

2016-06-08 Thread Mathias Nyman
On 08.06.2016 16:47, Mathias Nyman wrote: On 06.06.2016 21:31, Alan Stern wrote: On Sat, 4 Jun 2016, Marco Chiappero wrote: On 31/05/2016 16:34, Alan Stern wrote: On Tue, 31 May 2016, Mathias Nyman wrote: xhci specs say that port will move from Disconnected (PLS = RX_DETECT) to Polling if

[TESTPATCH] xhci: usb2 hw lpm extra debug

2016-06-15 Thread Mathias Nyman
custom testpatch to show more info about touching usb2 hw lpm setting for usb3 devices not for upstream, just testing Signed-off-by: Mathias Nyman --- drivers/usb/core/hub.c | 32 +--- drivers/usb/host/xhci.c | 11 +++ 2 files changed, 36 insertions(+), 7

[PATCH 00/14] xhci features for usb-next

2016-06-21 Thread Mathias Nyman
unified device property interface usb: dwc3: host: use build-in property instead of platform data xhci: get rid of platform data Mathias Nyman (11): xhci: rename ep_ring variable in queue_bulk_tx(), no functional change xhci: properly prepare zero packet TD after normal bulk TD. xhci: use

[PATCH 02/14] xhci: properly prepare zero packet TD after normal bulk TD.

2016-06-21 Thread Mathias Nyman
TD is enqueued instead. It sets these pointers correctly. This change also simplifies unnecessary complexity related to keeping track of the last trb when enqueuing trbs. Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 38 +++--- 1 file changed, 15 inse

[PATCH 03/14] xhci: use boolean to indicate last trb in td remainder calculation

2016-06-21 Thread Mathias Nyman
omply with data alignment requirements in xhci specs section 4.11.7.1. Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 15dd226..f74ac1c 1

[PATCH 06/14] xhci: TD-fragment, align the unsplittable case with a bounce buffer

2016-06-21 Thread Mathias Nyman
original sg list, and finally unmap it Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-mem.c | 74 ++ drivers/usb/host/xhci-ring.c | 106 +++ drivers/usb/host/xhci.c | 5 +- drivers/usb/host/xhci.h | 10 +++- 4

[PATCH 08/14] xhci: use and add separate function for checking for link trbs

2016-06-21 Thread Mathias Nyman
: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index c13b842..4de8a2b 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c

[PATCH 07/14] xhci: clean up event ring checks from inc_enq()

2016-06-21 Thread Mathias Nyman
Remove the event ring related checks in inc_enq() Host hardware is the producer of events on the event ring, driver will not queue anything, or call inc_enq() for the event ring. Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 64 +++- 1

[PATCH 01/14] xhci: rename ep_ring variable in queue_bulk_tx(), no functional change

2016-06-21 Thread Mathias Nyman
Tiny change, a bit more readable. The real reason for this change is that the coming td fragment work had several over 80 lines character lines split just because of a few extra characters in variable names. no functional changes Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c

[PATCH 04/14] xhci: don't rely on precalculated value of needed trbs in the enqueue loop

2016-06-21 Thread Mathias Nyman
in advance all together. It's an unnecessary extra walk through the scatterlist. This change also allows some bulk queue function simplifications Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 75 +--- 1 file changed, 29 insertions(+

[PATCH 05/14] xhci: align the last trb before link if it is easily splittable.

2016-06-21 Thread Mathias Nyman
then just split the trb at the boundary. If not, then just print a debug message and continue as we have always done, hoping for the best Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/drivers/usb/host

[PATCH 10/14] xhci: remove enqueue_is_link() helper

2016-06-21 Thread Mathias Nyman
Only used in one place, replace with trb_is_link() helper Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 086b871..2d8dcb1f 100644 --- a

[PATCH 09/14] xhci: rework inc_deq() and fix off by one error.

2016-06-21 Thread Mathias Nyman
the faulty last_trb() helper, add new last_trb_on_seg() and last_trb_on_ring() helpers Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 68 +--- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b

[PATCH 11/14] xhci: rename and simplify last_trb_on_last_seg() helper

2016-06-21 Thread Mathias Nyman
It's only used with rings that have link trbs Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 65 +--- 1 file changed, 25 insertions(+), 40 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c

[PATCH 13/14] usb: dwc3: host: use build-in property instead of platform data

2016-06-21 Thread Mathias Nyman
From: Heikki Krogerus This should allow xhci to remove handling of platform data. Signed-off-by: Heikki Krogerus Cc: Felipe Balbi Signed-off-by: Mathias Nyman --- drivers/usb/dwc3/host.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/usb/dwc3

[PATCH 12/14] xhci: plat: adapt to unified device property interface

2016-06-21 Thread Mathias Nyman
From: Heikki Krogerus Requesting the only property that the driver needs using the unified device property interface so it will be available for all types of platforms, not just the ones using DT. Signed-off-by: Heikki Krogerus Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-plat.c

[PATCH 14/14] xhci: get rid of platform data

2016-06-21 Thread Mathias Nyman
From: Heikki Krogerus No more users for it. Signed-off-by: Heikki Krogerus Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-plat.c | 5 + include/linux/usb/xhci_pdriver.h | 27 --- 2 files changed, 1 insertion(+), 31 deletions(-) delete mode 100644

Re: [PATCH] xhci: free the correct ring

2016-06-30 Thread Mathias Nyman
xhci_giveback_urb_in_irq(xhci, cur_td, 0); Thanks, Acked-by: Mathias Nyman In most cases each endpoint has only one ring and one list of canceled TDs, so each TD on a cancelled_td_list is for the same ring. But with streams in use that might no longer be the case. This does e

Re: [PATCH V2] usb: xhci: add support for performing fake doorbell

2016-11-21 Thread Mathias Nyman
On 21.11.2016 09:57, Rafał Miłecki wrote: Hi Mathias, On 17 October 2016 at 22:30, Rafał Miłecki wrote: From: Rafał Miłecki Broadcom's Northstar XHCI controllers seem to need a special start procedure to work correctly. There isn't any official documentation of this, the problem is that cont

Re: Flood of hub_ext_port_status failed (err = -71) messages

2016-11-22 Thread Mathias Nyman
On 21.11.2016 23:52, Simon Arlott wrote: I have a 5-port USB 2.0 hub attached to a USB 3.0 host by a long length of Cat 5e cable (via a pair of cheap USB<->Cat5e adapters from eBay) that only works at full speed and doesn't stay connected all the time. This wouldn't be a problem except that the

Re: Flood of hub_ext_port_status failed (err = -71) messages

2016-11-22 Thread Mathias Nyman
On 22.11.2016 11:52, Simon Arlott wrote: On 22/11/16 08:37, Mathias Nyman wrote: On 21.11.2016 23:52, Simon Arlott wrote: 2016-06-17T09:56:09.219+01:00 kernel: xhci_hcd :00:14.0: URB transfer length is wrong, xHC issue? req. len = 4, act. len = 4294967292 Your broken hardware triggered

[RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first

2016-11-23 Thread Mathias Nyman
max slot_id as children more commonly have higher slot_id than parent. CC: Signed-off-by: Mathias Nyman --- Guenter Roeck, does this work for you? A rework of how tt_info is stored and used might be needed, but that will take some time and won't go to stable as easily. --- drivers/usb

Re: [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first

2016-11-23 Thread Mathias Nyman
On 23.11.2016 15:32, Guenter Roeck wrote: On 11/23/2016 04:24 AM, Mathias Nyman wrote: the tt_info provided by a HS hub might be in use to by a child device Make sure we free the devices in the correct order. This is needed in special cases such as when xhci controller is reset when resuming

Re: [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first

2016-11-24 Thread Mathias Nyman
On 24.11.2016 11:02, Felipe Balbi wrote: Hi, Mathias Nyman writes: the tt_info provided by a HS hub might be in use to by a child device Make sure we free the devices in the correct order. This is needed in special cases such as when xhci controller is reset when resuming from hibernate

Re: [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first

2016-11-24 Thread Mathias Nyman
On 24.11.2016 13:03, Felipe Balbi wrote: Hi, Mathias Nyman writes: + /* are any devices using this tt_info? */ + for (i = 1; i < HCS_MAX_SLOTS(xhci->hcs_params1); i++) { off-by-one here ? Why is i starting

Re: [PATCH 3/3] xhci: Remove busy loop from xhci_abort_cmd_ring()

2016-11-24 Thread Mathias Nyman
On 16.11.2016 07:01, OGAWA Hirofumi wrote: Now, xhci_abort_cmd_ring() is sleepable. So no reason to use busy loop anymore. - Convert udelay(1000) => msleep(1). Sounds good. - Add xhci_handshake_sleep(), and use it. This seems a but overkill, I'd rather don't have xhci_handshake(), xhci_ha

Re: [PATCH 1/2] usb: host: xhci: dynamically allocate devs array

2016-11-24 Thread Mathias Nyman
On 24.11.2016 15:33, Felipe Balbi wrote: Instead of always defaulting to a 256-entry array, we can dynamically allocate devs based on what HW tells us it supports. Note that we can't, yet, purge MAX_HC_SLOTS completely because of struct xhci_device_context_array reliance on it. Signed-off-by: F

Re: [PATCH 2/2] usb: host: xhci: handle COMP_STOP from SETUP phase too

2016-11-24 Thread Mathias Nyman
On 24.11.2016 15:33, Felipe Balbi wrote: Stop Endpoint command can come at any point and we have no control of that. We should make sure to handle COMP_STOP on SETUP phase as well, otherwise urb->actual_lenght might be set to negative values in some occasions such as below: urb->length = 4;

Re: [PATCH] usb: xhci: apply XHCI_PME_STUCK_QUIRK to Intel Apollo Lake

2016-11-28 Thread Mathias Nyman
On 28.11.2016 09:24, Greg KH wrote: On Mon, Nov 28, 2016 at 09:53:52AM +0800, wan.ahmad.zainie.wan.moha...@intel.com wrote: From: Wan Ahmad Zainie Intel Apollo Lake also requires XHCI_PME_STUCK_QUIRK. Adding its PCI ID to quirk. Signed-off-by: Wan Ahmad Zainie --- drivers/usb/host/xhci-pc

Re: [PATCH v2] usb: xhci: Remove unuseful 'return' and 'break' statement

2016-11-28 Thread Mathias Nyman
On 28.11.2016 09:41, Baolin Wang wrote: On 28 November 2016 at 15:21, Greg KH wrote: On Mon, Nov 28, 2016 at 02:29:25PM +0800, Baolin Wang wrote: Hi Mathias, On 24 November 2016 at 19:16, Baolin Wang wrote: Since these 'return' statements are not generally useful in void function, remove th

Re: [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first

2016-11-30 Thread Mathias Nyman
On 28.11.2016 22:24, Guenter Roeck wrote: On Wed, Nov 23, 2016 at 02:24:27PM +0200, Mathias Nyman wrote: the tt_info provided by a HS hub might be in use to by a child device Make sure we free the devices in the correct order. This is needed in special cases such as when xhci controller is

Re: [PATCH 1/1] usb: return error code when platform_get_irq fails

2016-11-30 Thread Mathias Nyman
On 30.11.2016 15:41, Matthias Brugger wrote: On 29/11/16 13:57, Pan Bian wrote: In function xhci_mtk_probe(), variable ret takes the return value. Its value should be negative on failures. However, when the call to function platform_get_irq() fails, it does not set the error code, and 0 will b

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-11-30 Thread Mathias Nyman
On 30.11.2016 11:02, Baolin Wang wrote: If the hardware never responds to the stop endpoint command, the URBs will never be completed, and we might hang the USB subsystem. The original watchdog timer is used to watch if one stop endpoint command is timeout, if timeout, then the watchdog timer wil

Re: [PATCH 1/1] xhci: Put warning message on a single line

2016-12-01 Thread Mathias Nyman
On 01.12.2016 12:17, Alexander Stein wrote: This allows someone to grep for the complete warning message as in; xhci-hcd xhci-hcd.0.auto: USB core suspending device not in U0/U1/U2. Signed-off-by: Alexander Stein --- Thanks, added to queue for 4.11 -Mathias -- To unsubscribe from this list:

Re: [RFC] usb: host: xhci: Remove the watchdog timer and use command timer to watch stop endpoint command

2016-12-01 Thread Mathias Nyman
On 01.12.2016 06:54, Baolin Wang wrote: On 30 November 2016 at 22:09, Mathias Nyman wrote: On 30.11.2016 11:02, Baolin Wang wrote: If the hardware never responds to the stop endpoint command, the URBs will never be completed, and we might hang the USB subsystem. The original watchdog timer

Re: [PATCH 01/25] usb: host: xhci: dynamically allocate devs array

2016-12-02 Thread Mathias Nyman
On 01.12.2016 15:30, Felipe Balbi wrote: Instead of always defaulting to a 256-entry array, we can dynamically allocate devs based on what HW tells us it supports. Note that we can't, yet, purge MAX_HC_SLOTS completely because of struct xhci_device_context_array reliance on it. Signed-off-by: F

Re: [PATCH 24/25] usb: host: xhci: use trb_to_noop() from xhci_handle_stopped_cmd_ring()

2016-12-02 Thread Mathias Nyman
On 01.12.2016 15:31, Felipe Balbi wrote: instead of open coding how to convert a TRB to no-op, let's use our newly introduced helper. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-ring.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/usb/hos

Re: [PATCH 1/1] usb: xhci: fix possible wild pointer

2016-12-02 Thread Mathias Nyman
On 02.12.2016 04:29, Lu Baolu wrote: handle_cmd_completion() frees a command structure which might be still referenced by xhci->current_cmd. This might cause problem when xhci->current_cmd is accessed after that. A real-life case could be like this. The host takes a very long time to respond to

Re: USB3.0 DWC3 can't work with latest Linux-4.9.rc7

2016-12-05 Thread Mathias Nyman
On 05.12.2016 13:00, Felipe Balbi wrote: (no top-posting, please) Hi, it helps if you include maintainers for correct drivers. scripts/get_maintainer.pl helps a lot. Jerry Huang writes: And I tested USB2.0 disk, with Sriram's 6 patches, it works well. So Just USB3.0 can't work. BTW, The b

Re: [PATCH 1/2] usb: host: xhci: Fix possible wild pointer when handling abort command

2016-12-05 Thread Mathias Nyman
On 05.12.2016 09:51, Baolin Wang wrote: When current command was supposed to be aborted, host will free the command in handle_cmd_completion() function. But it might be still referenced by xhci->current_cmd, which need to set NULL. Signed-off-by: Baolin Wang --- This patch is based on Lu Baolu'

Re: [PATCH 00/25] usb: host: xhci: cleanup series

2016-12-07 Thread Mathias Nyman
On 07.12.2016 14:41, Felipe Balbi wrote: Hi, Felipe Balbi writes: hi Mathias, here's a much longer series of cleanups which I have been working on for the past few days. Let me know what you think about it. I did some light tests SKL and everything still works as before. I know you have som

Re: Should xhci_irq() call usb_hc_died()?

2016-12-12 Thread Mathias Nyman
On 12.12.2016 10:43, Felipe Balbi wrote: Hi, Bjorn Helgaas writes: Hi Mathias, ehci_irq(), ohci_irq(), fotg210_irq(), and oxu210_hcd_irq() contain code equivalent to this: status = ehci_readl(...); if (status == ~(u32) 0) { ... usb_hc_died(hcd); ... return IRQ_HAND

Re: usb:xhci: support disable usb2 LPM Remote Wakeup

2016-12-12 Thread Mathias Nyman
On 12.12.2016 06:00, Thang Q. Nguyen wrote: On Sat, Dec 10, 2016 at 4:36 AM, Rob Herring wrote: On Sun, Dec 04, 2016 at 07:42:01PM +0700, Thang Q. Nguyen wrote: From: Thang Nguyen As per USB 2.0 link power management addendum ECN, table 1-2, page 4, device or host initiated via resume signal

Re: [RFT PATCH 1/1] xhci: free xhci virtual devices with leaf nodes first

2016-12-12 Thread Mathias Nyman
On 09.12.2016 23:28, Guenter Roeck wrote: On Wed, Nov 30, 2016 at 01:41:24PM +0200, Mathias Nyman wrote: On 28.11.2016 22:24, Guenter Roeck wrote: On Wed, Nov 23, 2016 at 02:24:27PM +0200, Mathias Nyman wrote: the tt_info provided by a HS hub might be in use to by a child device Make sure we

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-12 Thread Mathias Nyman
On 05.12.2016 09:51, Baolin Wang wrote: If a command event is found on the event ring during an interrupt, we need to stop the command timer with del_timer(). Since del_timer() can fail if the timer is running and waiting on the xHCI lock, then it maybe get the wrong timeout command in xhci_handl

Re: [PATCH 3/3] xhci: Remove busy loop from xhci_abort_cmd_ring()

2016-12-14 Thread Mathias Nyman
On 14.12.2016 01:40, OGAWA Hirofumi wrote: ping about [PATCH 1/3, 2/3, 3/3]? 1/3 and 2/3 will be sent to 4.10 usb-linus after rc1, 3/3 maybe to usb-next after that -Mathias -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kern

Re: xhci_reset_endpoint() doesn't reset endpoint

2016-12-14 Thread Mathias Nyman
On 14.12.2016 12:58, Michal Necasek wrote: prior to the endpoint reset. SetFeature(CLEAR_HALT) resets the toggle on the device, but not on the host. But we know for a fact that the device sends a packet (with data toggle 0) which the host USB stack never sees, and a data toggle mismatch explains

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-19 Thread Mathias Nyman
On 13.12.2016 05:21, Baolin Wang wrote: Hi Mathias, On 12 December 2016 at 23:52, Mathias Nyman wrote: On 05.12.2016 09:51, Baolin Wang wrote: If a command event is found on the event ring during an interrupt, we need to stop the command timer with del_timer(). Since del_timer() can fail if

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-19 Thread Mathias Nyman
On 19.12.2016 13:34, Baolin Wang wrote: Hi Mathias, On 19 December 2016 at 18:33, Mathias Nyman wrote: On 13.12.2016 05:21, Baolin Wang wrote: Hi Mathias, On 12 December 2016 at 23:52, Mathias Nyman wrote: On 05.12.2016 09:51, Baolin Wang wrote: If a command event is found on the

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-20 Thread Mathias Nyman
On 20.12.2016 09:30, Baolin Wang wrote: ... Alright, I gathered all current work related to xhci races and timeouts and put them into a branch: git://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git timeout_race_fixes Its based on 4.9 It includes a few other patches just to avoid conflic

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-21 Thread Mathias Nyman
On 21.12.2016 08:17, Lu Baolu wrote: Hi Mathias, I have some comments for the implementation of xhci_abort_cmd_ring() below. On 12/20/2016 11:13 PM, Mathias Nyman wrote: On 20.12.2016 09:30, Baolin Wang wrote: ... Alright, I gathered all current work related to xhci races and timeouts and

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-21 Thread Mathias Nyman
On 21.12.2016 08:57, Lu Baolu wrote: Hi Mathias, I have some comments for the implementation of xhci_handle_command_timeout() as well. On 12/20/2016 11:13 PM, Mathias Nyman wrote: On 20.12.2016 09:30, Baolin Wang wrote: ... Alright, I gathered all current work related to xhci races and

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-21 Thread Mathias Nyman
On 21.12.2016 04:22, Baolin Wang wrote: Hi Mathias, On 20 December 2016 at 23:13, Mathias Nyman wrote: On 20.12.2016 09:30, Baolin Wang wrote: ... Alright, I gathered all current work related to xhci races and timeouts and put them into a branch: git://git.kernel.org/pub/scm/linux/kernel

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-21 Thread Mathias Nyman
On 21.12.2016 16:10, OGAWA Hirofumi wrote: Mathias Nyman writes: Below is the latest code. I put my comments in line. 322 static int xhci_abort_cmd_ring(struct xhci_hcd *xhci) 323 { 324 u64 temp_64; 325 int ret; 326 327 xhci_dbg(xhci, "Abort co

Re: [PATCH 0/2] Intel cherrytrail xhci extended cap phy/mux support

2016-12-22 Thread Mathias Nyman
On 22.12.2016 14:45, Hans de Goede wrote: Hi, On 22-12-16 13:11, Felipe Balbi wrote: Hi, Hans de Goede writes: Hi All, Here are 2 patches which can and should be merged separately, but which do belong together, as together they add support for the usb-phy / mux bits found in the Intel Cher

Re: [PATCH 0/1] xhci: Fix race related to abort operation

2016-12-23 Thread Mathias Nyman
On 23.12.2016 08:50, Lu Baolu wrote: Hi Mathias, This is a follow-up patch for below comment "rebase OGAWA Hirofumi's changes on top of that, and send to usb-linus only" in below discussion thread. https://lkml.org/lkml/2016/12/21/186 I rebased the patch and added unlock-before and lock-afte

Re: [PATCH 1/1] usb: xhci: hold lock over xhci_abort_cmd_ring()

2016-12-23 Thread Mathias Nyman
On 23.12.2016 08:46, Lu Baolu wrote: In command timer function, xhci_handle_command_timeout(), xhci->lock is unlocked before call into xhci_abort_cmd_ring(). This might cause race between the timer function and the event handler. The xhci_abort_cmd_ring() function sets the CMD_RING_ABORT bit in

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-23 Thread Mathias Nyman
On 22.12.2016 03:46, Lu Baolu wrote: Hi, On 12/21/2016 11:18 PM, OGAWA Hirofumi wrote: Mathias Nyman writes: We set CMD_RING_STATE_ABORTED state under locking. I'm not checking what is for taking lock for register though, I guess it should be enough just lock around of read=>

Re: xHCI issues Reset Device Command at invalid states

2017-01-02 Thread Mathias Nyman
On 30.12.2016 14:01, Felipe Balbi wrote: Hi Mathias, So the problem I found with v4.10-rc1 doesn't appear to be a regression. I can't, however, trigger it with Broadwell, only Skylake and Kabylake. According to tracepoints, our Reset Device Command sometimes completes with "Context State Error

Re: xHCI issues Reset Device Command at invalid states

2017-01-02 Thread Mathias Nyman
On 02.01.2017 14:13, Felipe Balbi wrote: Hi, Felipe Balbi writes: Hi Mathias, So the problem I found with v4.10-rc1 doesn't appear to be a regression. I can't, however, trigger it with Broadwell, only Skylake and Kabylake. According to tracepoints, our Reset Device Command sometimes complet

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2017-01-02 Thread Mathias Nyman
On 27.12.2016 05:07, Baolin Wang wrote: Hi, On 21 December 2016 at 21:00, Mathias Nyman wrote: On 21.12.2016 04:22, Baolin Wang wrote: Hi Mathias, On 20 December 2016 at 23:13, Mathias Nyman wrote: On 20.12.2016 09:30, Baolin Wang wrote: ... Alright, I gathered all current work related

  1   2   3   4   5   6   7   8   9   10   >