]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
usb: xhci: Issue stop EP command only when the EP state is running
authorShyam Sundar S K <Shyam-sundar.S-k@amd.com>
Wed, 16 Aug 2017 12:03:00 +0000 (14:03 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Thu, 24 Aug 2017 09:49:54 +0000 (11:49 +0200)
commitce9e98894314cab2738d3a1c4e220d6c923265e6
tree668c5c36e43d63365b42c79c06c72d495e5b456d
parent080f7febfb1d5f39ddc6107d5545ec9d0393d5d7
usb: xhci: Issue stop EP command only when the EP state is running

BugLink: https://bugs.launchpad.net/bugs/1711098
on AMD platforms with SNPS 3.1 USB controller if stop endpoint command is
issued the controller does not respond, when the EP is not in running
state. HW completes the command execution and reports
"Context State Error" completion code. This is as per the spec. However
HW on receiving the second command additionally marks EP to Flow control
state in HW which is RTL bug. This bug causes the HW not to respond
to any further doorbells that are rung by the driver. This makes the EP
to not functional anymore and causes gross functional failures.

As a workaround, not to hit this problem, it's better to check the EP state
and issue a stop EP command only when the EP is in running state.

As a sidenote, even with this patch there is still a possibility of
triggering the RTL bug if the context state races with the stop endpoint
command as described in xHCI spec 4.6.9

[code simplification and reworded sidenote in commit message -Mathias]
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Signed-off-by: Nehal Shah <Nehal-bakulchandra.Shah@amd.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 28a2369f7d72ece55089f33e7d7b9c1223673cc3)
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/usb/host/xhci-hub.c