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

Commit f5a4da3f authored by Mayank Rana's avatar Mayank Rana
Browse files

usb: f_gsi: Resume USB on handling disconnect event in suspend state



Currently USB GSI function driver releases pm runtime usage count and
child count on receiving suspend event i.e. it doesn't prevent USB going
into LPM. There is race condition seen while USB going into LPM in
parallel USB GSI driver is trying to free allocated TRB ring. Due to USB
SMMU usage, it is must to have USB SMMU attach while freeing TRB ring.
Hence fix this issue by incrementing pm runtime usage count and child
count when handling disconnect event while USB GSI state is suspended
before trying to free TRB ring.

Change-Id: Icd9d43a6cd8956a1bdca219ad9686a57e89989c8
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent e137b4a2
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -827,9 +827,11 @@ static void ipa_work_handler(struct work_struct *w)
			ipa_resume_work_handler(d_port);
			ipa_resume_work_handler(d_port);
			d_port->sm_state = STATE_CONNECTED;
			d_port->sm_state = STATE_CONNECTED;
		} else if (event == EVT_DISCONNECTED) {
		} else if (event == EVT_DISCONNECTED) {
			usb_gadget_autopm_get(d_port->gadget);
			ipa_disconnect_work_handler(d_port);
			ipa_disconnect_work_handler(d_port);
			d_port->sm_state = STATE_INITIALIZED;
			d_port->sm_state = STATE_INITIALIZED;
			log_event_dbg("%s: ST_SUS_EVT_DIS", __func__);
			log_event_dbg("%s: ST_SUS_EVT_DIS", __func__);
			usb_gadget_autopm_put_async(d_port->gadget);
		}
		}
		break;
		break;
	default:
	default: