From 7582104cb6a3f8869c0ebf4f96be40c571196575 Mon Sep 17 00:00:00 2001 From: Sivan Reinstein Date: Wed, 24 Mar 2021 10:44:07 +0200 Subject: [PATCH] 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 Signed-off-by: Sivan Reinstein Signed-off-by: Chaitanya Pratapa --- drivers/platform/msm/ipa/ipa_v3/ipa_dp.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c b/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c index 23ec7f6eb2..cf4b4ee29e 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_dp.c +++ b/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: + case IPA_CLIENT_APPS_WAN_PROD: + case IPA_CLIENT_APPS_LAN_PROD: + case IPA_CLIENT_APPS_WAN_LOW_LAT_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); - break; default: - IPAERR("unexpected client:%d\n", client); + IPAERR_RL("unexpected client:%d\n", client); break; }