linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xhci: Don't use soft retry if slot id > 0
@ 2019-10-13  0:33 Bernhard Gebetsberger
  2019-10-14  8:06 ` Mathias Nyman
  0 siblings, 1 reply; 3+ messages in thread
From: Bernhard Gebetsberger @ 2019-10-13  0:33 UTC (permalink / raw)
  Cc: Bernhard Gebetsberger, Mathias Nyman, Greg Kroah-Hartman,
	open list:USB XHCI DRIVER, open list

According to the xhci specification(chapter 4.6.8.1) soft retry
shouldn't be used if the slot id is higher than 0. Currently some usb
devices break on some systems because soft retry is being used when
there is a transaction error, without checking the slot id.

Fixes: f8f80be501aa ("xhci: Use soft retry to recover faster from
transaction errors")

Signed-off-by: Bernhard Gebetsberger <bernhard.gebetsberger@gmx.at>
---
 drivers/usb/host/xhci-ring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 85ceb43e3405..5fa06189068d 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -2270,7 +2270,7 @@ static int process_bulk_intr_td(struct xhci_hcd *xhci, struct xhci_td *td,
 		break;
 	case COMP_USB_TRANSACTION_ERROR:
 		if ((ep_ring->err_count++ > MAX_SOFT_RETRY) ||
-		    le32_to_cpu(slot_ctx->tt_info) & TT_SLOT)
+		    le32_to_cpu(slot_ctx->tt_info) & TT_SLOT || slot_id > 0)
 			break;
 		*status = 0;
 		xhci_cleanup_halted_endpoint(xhci, slot_id, ep_index,
--
2.23.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xhci: Don't use soft retry if slot id > 0
  2019-10-13  0:33 [PATCH] xhci: Don't use soft retry if slot id > 0 Bernhard Gebetsberger
@ 2019-10-14  8:06 ` Mathias Nyman
  2019-10-14  9:17   ` Bernhard Gebetsberger
  0 siblings, 1 reply; 3+ messages in thread
From: Mathias Nyman @ 2019-10-14  8:06 UTC (permalink / raw)
  To: Bernhard Gebetsberger
  Cc: Mathias Nyman, Greg Kroah-Hartman, linux-usb, linux-kernel

On 13.10.2019 3.33, Bernhard Gebetsberger wrote:
> According to the xhci specification(chapter 4.6.8.1) soft retry
> shouldn't be used if the slot id is higher than 0. Currently some usb
> devices break on some systems because soft retry is being used when
> there is a transaction error, without checking the slot id.
> 
That is not correct

Specs say that soft retry should not be used if we are dealing with a
FS/LS device behind a HS hub, this can be checked from the "TT Hub Slot ID"
field in the slot context, which we do.

In xhci all devices have a slot id, so this change would prevent
soft retry almost completely.

Specs 4.6.8.1:
"Soft Retry attempts shall not be performed if the device is behind a
TT in a HS Hub (i.e. TT Hub Slot ID > ‘0’)."

-Mathias

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xhci: Don't use soft retry if slot id > 0
  2019-10-14  8:06 ` Mathias Nyman
@ 2019-10-14  9:17   ` Bernhard Gebetsberger
  0 siblings, 0 replies; 3+ messages in thread
From: Bernhard Gebetsberger @ 2019-10-14  9:17 UTC (permalink / raw)
  To: Mathias Nyman; +Cc: Mathias Nyman, Greg Kroah-Hartman, linux-usb, linux-kernel

Am 14.10.19 um 10:06 schrieb Mathias Nyman:
> On 13.10.2019 3.33, Bernhard Gebetsberger wrote:
>> According to the xhci specification(chapter 4.6.8.1) soft retry
>> shouldn't be used if the slot id is higher than 0. Currently some usb
>> devices break on some systems because soft retry is being used when
>> there is a transaction error, without checking the slot id.
>>
> That is not correct
>
> Specs say that soft retry should not be used if we are dealing with a
> FS/LS device behind a HS hub, this can be checked from the "TT Hub Slot ID"
> field in the slot context, which we do.
>
> In xhci all devices have a slot id, so this change would prevent
> soft retry almost completely.
>
> Specs 4.6.8.1:
> "Soft Retry attempts shall not be performed if the device is behind a
> TT in a HS Hub (i.e. TT Hub Slot ID > ‘0’)."
>
> -Mathias
Thanks for the explanation, I have misunderstood that part from the xhci

spec. Sorry.

- Bernhard




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-14  9:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-13  0:33 [PATCH] xhci: Don't use soft retry if slot id > 0 Bernhard Gebetsberger
2019-10-14  8:06 ` Mathias Nyman
2019-10-14  9:17   ` Bernhard Gebetsberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).