CHROMIUM: usb: dwc3: rockchip: Fix race conditions involving extcon
authorWilliam wu <wulf@rock-chips.com>
Mon, 10 Oct 2016 03:53:09 +0000 (11:53 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Thu, 13 Oct 2016 01:51:35 +0000 (09:51 +0800)
commit0d9cd7338bb64efa9d37d09730d0b99a7da56728
tree186ad6d0bc96d7a33eccb23c2b63796de5fdb020
parentcbdcfea9e3a3d7206c0feb2c9400cad564bb0cd8
CHROMIUM: usb: dwc3: rockchip: Fix race conditions involving extcon

Use a lock to ensure that the extcon callback only runs after probe()
has finished. In suspend() we unregister the extcon handler to prevent
it from being executed when the controller is suspended, which might
lead to crashes or unexpected behavior.

TEST=build and boot on 3399 board; plug in a USB device and verify
whether it is enumerated; suspend the DUT; resume the DUT; unplug
and re-plug the USB device and verify it is enumerated.

Change-Id: I965e66631a2d0f4d6cc53917d6a6e80bf8774fe1
Signed-off-by: William wu <wulf@rock-chips.com>
drivers/usb/dwc3/dwc3-rockchip.c