Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c65d9cd9 authored by Jack Pham's avatar Jack Pham
Browse files

usb: dwc3-msm: Fix incorrect roles with multiple instances



dwc3_init_sm() uses a static boolean variable which does not
play nicely when multiple instances are in use. For instance
if one controller is configured in host-only mode, it would
set the sm_initialized flag and can force the second controller
to also see ID=0 and enter host mode even if it is a peripheral.

The false ID=0 is actually caused by the init sequence never
actually setting the initial inputs bit, so the state machine
simply sees it as unset and proceeds to the A_IDLE case. Fix this
by setting it to 1 to match the id_state=FLOAT during probe().

Furthermore, there is no longer any use case for the vbus_init
completion since the state machine should only be entered upon
event changes anyway. So removing that can allow us to get rid
of dwc3_init_sm() entirely. Also ensure that sm_work is
unconditionally flushed before processing the initial events.

CRs-Fixed: 974882
Change-Id: I48e361a622bffa62ab7fa4c8d2e6719e66b90076
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 1c10389d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment