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

Commit 8d4687a9 authored by Sriharsha Allenki's avatar Sriharsha Allenki
Browse files

usb: pd: Ensure disconnect is processed when hard reset in progress



When hard reset is in progress, the pd state machine restarts
from PE_UNKNOWN state. If a Type-C disconnect notification
is received during the same time, the current_pr is set to
PR_NONE. Because of this we bail out of the usbpd_sm
assuming it is in disconnected state even though the
disconnect was not processed.
Fix this by validating the current_dr as well to confirm
that the state machine is actually in disconnected state.

Change-Id: Iea59a857c6826f65fef8b0c9a8ee6e2488683864
Signed-off-by: default avatarSriharsha Allenki <sallenki@codeaurora.org>
parent e980f66b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2101,7 +2101,8 @@ static void usbpd_sm(struct work_struct *w)

	/* Disconnect? */
	if (pd->current_pr == PR_NONE) {
		if (pd->current_state == PE_UNKNOWN)
		if (pd->current_state == PE_UNKNOWN &&
				pd->current_dr == DR_NONE)
			goto sm_done;

		if (pd->vconn_enabled) {