UPSTREAM: usb: dwc2: host: Add missing spinlock in dwc2_hcd_reset_func()
authorDouglas Anderson <dianders@chromium.org>
Fri, 20 Nov 2015 17:06:27 +0000 (09:06 -0800)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 3 Jan 2017 09:50:57 +0000 (17:50 +0800)
commit4b7440cc72276d2f7b9e805d809e5a48ae48cf6e
tree430c63b0d9be8ebb415178ad903c69ef2aece53d
parent5a514c08f31ed1a2f6978beb9fc5d2c929a753d2
UPSTREAM: usb: dwc2: host: Add missing spinlock in dwc2_hcd_reset_func()

The dwc2_hcd_reset_func() function is only ever called directly by a
delayed work function.  As such no locks are already held when the
function is called.

Doing a read-modify-write of CPU registers and setting fields in the
main hsotg data structure is a bad idea without locks.  Let's add
locks.

The bug was found by code inspection only.  It turns out that the
dwc2_hcd_reset_func() is only ever called today if the
"host_support_fs_ls_low_power" parameter is enabled and no code in
mainline enables that parameter.  Thus no known issues in mainline are
fixed by this patch, but it's still probably wise to fix the function.

Change-Id: I14ff93f64f1fd405d4911d67c7d0b20e50be4f53
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 4a065c7bdbec9536f7b899241b125b9c3b5ba97a)
drivers/usb/dwc2/hcd.c