xhci: Convert xhci_handshake() to use readl_poll_timeout_atomic()
authorAndrey Smirnov <andrew.smirnov@gmail.com>
Wed, 22 May 2019 11:34:01 +0000 (14:34 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Jun 2019 07:17:11 +0000 (09:17 +0200)
commit8e30ba04a20a26a0f2e2e92088c9bf395660a961
treef4305fb547ecbeeaf90025ea92487cd7d9ac6b82
parent32adfa3d92e7e910897f236ace9afacabb398cca
xhci: Convert xhci_handshake() to use readl_poll_timeout_atomic()

commit f7fac17ca925faa03fc5eb854c081a24075f8bad upstream.

Xhci_handshake() implements the algorithm already captured by
readl_poll_timeout_atomic(). Convert the former to use the latter to
avoid repetition.

Turned out this patch also fixes a bug on the AMD Stoneyridge platform
where usleep(1) sometimes takes over 10ms.
This means a 5 second timeout can easily take over 15 seconds which will
trigger the watchdog and reboot the system.

[Add info about patch fixing a bug to commit message -Mathias]
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Tested-by: Raul E Rangel <rrangel@chromium.org>
Reviewed-by: Raul E Rangel <rrangel@chromium.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci.c