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

Commit bd16a409 authored by Sriharsha Allenki's avatar Sriharsha Allenki
Browse files

usb: f_gsi: Prevent enabling data path if disconnect follows connect



In the state CONNECT_IN_PROGRESS if EVT_CONNECT is
followed by a EVT_DISCONNECT event, there is a possible case
where doorbell is unblocked with endpoints disabled resulting
in a possible spurious doorbell from the USB wrapper.

Fix this by bailing out if a connect event is followed
by disconnect.

Change-Id: I73f971548b6c13924e9f857e57fa6dd517a4e56a
Signed-off-by: default avatarSriharsha Allenki <sallenki@codeaurora.org>
parent 75ecf1a3
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -938,8 +938,9 @@ static void ipa_work_handler(struct work_struct *w)
			log_event_dbg("%s: ST_CON_IN_PROG_EVT_HOST_READY",
					 __func__);
		} else if (event == EVT_CONNECTED) {
			if (peek_event(d_port) == EVT_SUSPEND) {
				log_event_dbg("%s: ST_CON_IN_PROG_EVT_SUSPEND",
			if (peek_event(d_port) == EVT_SUSPEND ||
				peek_event(d_port) == EVT_DISCONNECTED) {
				log_event_dbg("%s: NO_OP CONN_SUS CONN_DIS",
					 __func__);
				break;
			}