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

Commit 04969db1 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa: fix a race condition in teardown pipe"

parents 770ae7eb a9840763
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -1113,11 +1113,6 @@ int ipa3_teardown_sys_pipe(u32 clnt_hdl)
		IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl));

	ipa3_disable_data_path(clnt_hdl);
	if (ep->napi_enabled) {
		do {
			usleep_range(95, 105);
		} while (atomic_read(&ep->sys->curr_polling_state));
	}

	if (IPA_CLIENT_IS_PROD(ep->client)) {
		do {
@@ -1131,9 +1126,6 @@ int ipa3_teardown_sys_pipe(u32 clnt_hdl)
		} while (1);
	}

	if (IPA_CLIENT_IS_CONS(ep->client))
		cancel_delayed_work_sync(&ep->sys->replenish_rx_work);
	flush_workqueue(ep->sys->wq);
	/* channel stop might fail on timeout if IPA is busy */
	for (i = 0; i < IPA_GSI_CHANNEL_STOP_MAX_RETRY; i++) {
		result = ipa3_stop_gsi_channel(clnt_hdl);
@@ -1150,6 +1142,17 @@ int ipa3_teardown_sys_pipe(u32 clnt_hdl)
		ipa_assert();
		return result;
	}

	if (ep->napi_enabled) {
		do {
			usleep_range(95, 105);
		} while (atomic_read(&ep->sys->curr_polling_state));
	}

	if (IPA_CLIENT_IS_CONS(ep->client))
		cancel_delayed_work_sync(&ep->sys->replenish_rx_work);
	flush_workqueue(ep->sys->wq);

	result = ipa3_reset_gsi_channel(clnt_hdl);
	if (result != GSI_STATUS_SUCCESS) {
		IPAERR("Failed to reset chan: %d.\n", result);