summaryrefslogtreecommitdiff
path: root/trafgen
ModeNameSize
-rw-r--r--.gitignore27logplain
-rw-r--r--Makefile1237logplain
Nyman <mathias.nyman@linux.intel.com>2017-01-03 18:28:48 +0200 committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-03 17:37:32 +0100 commita5a1b9514154437aa1ed35c291191f82fd3e941a (patch) treed166091e509be9a6b07ed40103deb29c797afbb4 parent2a7cfdf37b7c08ac29df4c62ea5ccb01474b6597 (diff)
xhci: Handle command completion and timeout race
If we get a command completion event at the same time as the command timeout work starts on another cpu we might end up aborting the wrong command. If the command completion takes the xhci lock before the timeout work, it will handle the command, pick the next command, mark it as current_cmd, and re-queue the timeout work. When the timeout work finally gets the lock It will start aborting the wrong command. This case can be resolved by checking if the timeout work is pending inside the timeout function itself. A new timeout work can only be pending if the command completed and a new command was queued. If there are no more commands pending then command completion will set the current_cmd to NULL, which is already handled in the timeout work. Cc: <stable@vger.kernel.org> Reported-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat
-rw-r--r--drivers/usb/host/xhci-ring.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c