Selaa lähdekoodia

msm: ipa: napi_tx fix for shared events and ipa devote

Update poll state only for EPs with shared evt ring.
Prevent devoting ipa twice incase of irq during tx_napi poll.

Change-Id: I6ae69e17067bdd47d9ac153b04eb86ae1d11199d
Acked-by: Nadav Levintov <nadavl@qti.qualcomm.com>
Signed-off-by: Sivan Reinstein <sivanr@codeaurora.org>
Signed-off-by: Chaitanya Pratapa <cpratapa@codeaurora.org>
Sivan Reinstein 4 vuotta sitten
vanhempi
sitoutus
7582104cb6
1 muutettua tiedostoa jossa 9 lisäystä ja 7 poistoa
  1. 9 7
      drivers/platform/msm/ipa/ipa_v3/ipa_dp.c

+ 9 - 7
drivers/platform/msm/ipa/ipa_v3/ipa_dp.c

@@ -290,6 +290,7 @@ static int ipa3_aux_napi_poll_tx_complete(struct napi_struct *napi_tx,
 {
 	struct ipa3_sys_context *sys = container_of(napi_tx,
 		struct ipa3_sys_context, napi_tx);
+	bool napi_rescheduled = false;
 	int tx_done = 0;
 	int ret = 0;
 
@@ -306,9 +307,13 @@ poll_tx:
 		/* if we got an EOT while we marked NAPI as complete */
 		if (ret == -GSI_STATUS_PENDING_IRQ &&
 			napi_reschedule(napi_tx)) {
+			/* rescheduale will perform poll again, don't dec vote twice*/
+			napi_rescheduled = true;
 			goto poll_tx;
 		}
-		IPA_ACTIVE_CLIENTS_DEC_EP(sys->ep->client);
+
+		if(!napi_rescheduled)
+			IPA_ACTIVE_CLIENTS_DEC_EP_NO_BLOCK(sys->ep->client);
 	}
 	IPADBG_LOW("the number of tx completions is: %d", tx_done);
 	return min(tx_done, budget);
@@ -943,16 +948,13 @@ void __ipa3_update_curr_poll_state(enum ipa_client_type client, int state)
 			ep_idx = ipa3_get_ep_mapping(IPA_CLIENT_APPS_WAN_COAL_CONS);
 			break;
 		case IPA_CLIENT_APPS_LAN_CONS:
-			/* for error handling */
-			break;
 		case IPA_CLIENT_APPS_WAN_PROD:
-			ep_idx = ipa3_get_ep_mapping(IPA_CLIENT_APPS_LAN_PROD);
-			break;
 		case IPA_CLIENT_APPS_LAN_PROD:
-			ep_idx = ipa3_get_ep_mapping(IPA_CLIENT_APPS_WAN_PROD);
+		case IPA_CLIENT_APPS_WAN_LOW_LAT_CONS:
+			/* for error handling */
 			break;
 		default:
-			IPAERR("unexpected client:%d\n", client);
+			IPAERR_RL("unexpected client:%d\n", client);
 			break;
 	}