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

Commit 7df41603 authored by Bojun Pan's avatar Bojun Pan Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa: Fix setting disconnect in progress flag



When USB is disconnected USB driver deregisters callback
with IPA driver. If there are exception packets coming to USB
driver at the same time there is a possiblity of race condition
where callback is de-registered and IPA driver tries to access it.
Make changes to restrict the callback access when disconnect is
in progress.

Change-Id: I85d2876847bfd0b23f19b2b81e1aab68729b2e31
Acked-by: default avatarChaitanya Pratapa <cpratapa@qti.qualcomm.com>
Signed-off-by: default avatarBojun Pan <bojunp@codeaurora.org>
parent 55303f9f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1466,6 +1466,9 @@ int ipa3_release_gsi_channel(u32 clnt_hdl)
	if (!ep->keep_ipa_awake)
		IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl));

	/* Set the disconnect in progress flag to avoid calling cb.*/
	atomic_set(&ep->disconnect_in_progress, 1);

	gsi_res = gsi_dealloc_channel(ep->gsi_chan_hdl);
	if (gsi_res != GSI_STATUS_SUCCESS) {
		IPAERR("Error deallocating channel: %d\n", gsi_res);