Forráskód Böngészése

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: Chaitanya Pratapa <[email protected]>
Signed-off-by: Praveen Kurapati <[email protected]>
Signed-off-by: Bojun Pan <[email protected]>
Bojun Pan 5 éve
szülő
commit
1022df8dfa
1 módosított fájl, 3 hozzáadás és 0 törlés
  1. 3 0
      drivers/platform/msm/ipa/ipa_v3/ipa_client.c

+ 3 - 0
drivers/platform/msm/ipa/ipa_v3/ipa_client.c

@@ -1526,6 +1526,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);