All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG] usb: dwc2: split interrupt in transactions silently dropped due to driver latency
@ 2022-08-13  1:37 Frank Mori Hess
  2022-08-13  7:15 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Frank Mori Hess @ 2022-08-13  1:37 UTC (permalink / raw)
  To: Minas Harutyunyan, linux-usb

When there is interrupt latency, the dwc2 driver can fail to issue its
"complete split" transactions during the microframes they were
scheduled for.  When this happens, the result from the transaction is
silently lost without producing any error.

The reason the complete splits need to happen on time, is the
"transaction translator" on the hub discards responses from its
complete split pipeline after keeping them only 1 microframe, as
specified by the usb standard. So if the complete split transactions
are late, there is no way to recover.  An error must be returned so
higher level code can deal with the lost transaction (in my case, the
USB HID driver needs to re-sync with my keyboard after losing an
interrupt urb).

Instead, the current code silently continues by issuing a new "start
split".  This next split transaction may succeed, but it is not enough
since the devices thinks it has already successfully sent its
interrupt transaction (it has in fact succeeded in sending the
transaction to the hub, buy the hub then discarded it).

My hack to fix this was to change dwc2_hc_nyet_intr() so it sets
qtd->error_count=3 when past_end is true.

Also I should mention I am using an old kernel 5.4.13, but based on
inspection of the mainline master branch, this problem still exists in
current kernels.

-- 
Frank

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

end of thread, other threads:[~2022-08-14 12:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-13  1:37 [BUG] usb: dwc2: split interrupt in transactions silently dropped due to driver latency Frank Mori Hess
2022-08-13  7:15 ` Greg KH
2022-08-13 14:52   ` Frank Mori Hess
2022-08-13 15:08     ` Greg KH
2022-08-14 12:33       ` Frank Mori Hess
2022-08-14 12:58         ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.