]> git.karo-electronics.de Git - karo-tx-linux.git/commit
xhci: detect stop endpoint race using pending timer instead of counter.
authorMathias Nyman <mathias.nyman@linux.intel.com>
Mon, 23 Jan 2017 12:19:53 +0000 (14:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Jan 2017 09:57:34 +0000 (10:57 +0100)
commitf99265965b3203baf5266994578db14851fbf7fa
treecef685d96a4e5a1253f10f4966427d3bf4d65d21
parent9983a5fc39bfce7581db49f884aa782f24149d93
xhci: detect stop endpoint race using pending timer instead of counter.

A counter was used to find out if the stop endpoint completion raced with
the stop endpoint timeout timer. This was needed in case the stop ep
completion failed to delete the timer as it was running on anoter cpu.

The EP_STOP_CMD_PENDING flag was not enough as a new stop endpoint command
may be queued between the command completion and timeout function, which
would set the flag back.

Instead of the separate counter that was used we can detect the race by
checking both the STOP_EP_PENDING flag and timer_pending in the timeout
function.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci.c
drivers/usb/host/xhci.h