usb: chipidea: udc: workaround for endpoint conflict issue
authorPeter Chen <peter.chen@nxp.com>
Mon, 17 Jun 2019 01:49:07 +0000 (09:49 +0800)
committerLi Jun <jun.li@nxp.com>
Thu, 11 Jul 2019 06:30:45 +0000 (14:30 +0800)
commit5e09884288683a5323e87d5ee9818ad028fb323c
tree21f5cafa97c474a98ef2afa554eab324a15b2b28
parent3abd1b6252d8b1337d786a44607334835d102eca
usb: chipidea: udc: workaround for endpoint conflict issue

An endpoint conflict occurs when the USB is working in device mode
during an isochronous communication. When the endpointA IN direction
is an isochronous IN endpoint, and the host sends an IN token to
endpointA on another device, then the OUT transaction may be missed
regardless the OUT endpoint number. Generally, this occurs when the
device is connected to the host through a hub and other devices are
connected to the same hub.

The affected OUT endpoint can be either control, bulk, isochronous, or
an interrupt endpoint. After the OUT endpoint is primed, if an IN token
to the same endpoint number on another device is received, then the OUT
endpoint may be unprimed (cannot be detected by software), which causes
this endpoint to no longer respond to the host OUT token, and thus, no
corresponding interrupt occurs.

There is no good workaround for this issue, the only thing the software
could do is numbering isochronous IN from the highest endpoint since we
have observed most of device number endpoint from the lowest.

Cc: <stable@vger.kernel.org> #v3.14+
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c19dffc0a9511a7d7493ec21019aefd97e9a111b)
drivers/usb/chipidea/udc.c