usb: dwc3-msm: Simplify restart_usb_host_mode() callback
Convert restart_usb_host_mode() into a generic blocking_sync()
callback which simply ensures that any pending role switches are
fully flushed before proceeding with the next extcon_set_state()
call. Move the responsibility of stopping/restarting host mode
with the speed to the PD policy engine instead.
This fixes a couple of possible race scenarios:
1) stopping host mode needs to be fully completed before allowing
DisplayPort to initialize as it may require exclusive use of
the PHY.
2) data role swap followed by entering DisplayPort alt mode in
which it determines it needs 4-lane configuration. The
back-to-back start peripheral, stop peripheral and start
host may overlap if they are not serialized.
Change-Id: Ic29b74ae3e22f69f67e73aba59d211b81eb70de0
Signed-off-by:
Jack Pham <jackp@codeaurora.org>
Loading
Please register or sign in to comment