]> git.baikalelectronics.ru Git - kernel.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)
commitb3c3c31d4e7f87e4866873f565849ef5ca8791f5
treecef685d96a4e5a1253f10f4966427d3bf4d65d21
parent5db567731b670c33ba32f3ca65fd03d2898e301a
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