Loading drivers/platform/msm/ipa/ipa_v3/ipa_dp.c +9 −4 Original line number Diff line number Diff line Loading @@ -319,10 +319,12 @@ int ipa3_send(struct ipa3_sys_context *sys, for (i = 0; i < num_desc; i++) { tx_pkt = kmem_cache_zalloc(ipa3_ctx->tx_pkt_wrapper_cache, mem_flag); if (!tx_pkt) GFP_ATOMIC); if (!tx_pkt) { IPAERR("failed to alloc tx wrapper\n"); result = -ENOMEM; goto failure; } INIT_LIST_HEAD(&tx_pkt->link); if (i == 0) { Loading @@ -336,6 +338,7 @@ int ipa3_send(struct ipa3_sys_context *sys, if (ipa_populate_tag_field(&desc[i], tx_pkt, &tag_pyld_ret)) { IPAERR("Failed to populate tag field\n"); result = -EFAULT; goto failure_dma_map; } } Loading Loading @@ -375,6 +378,7 @@ int ipa3_send(struct ipa3_sys_context *sys, } if (dma_mapping_error(ipa3_ctx->pdev, tx_pkt->mem.phys_base)) { IPAERR("failed to do dma map.\n"); result = -EFAULT; goto failure_dma_map; } Loading Loading @@ -421,6 +425,7 @@ int ipa3_send(struct ipa3_sys_context *sys, gsi_xfer, true); if (result != GSI_STATUS_SUCCESS) { IPAERR("GSI xfer failed.\n"); result = -EFAULT; goto failure; } Loading Loading @@ -472,7 +477,7 @@ int ipa3_send(struct ipa3_sys_context *sys, } spin_unlock_bh(&sys->spinlock); return -EFAULT; return result; } /** Loading drivers/platform/msm/ipa/ipa_v3/ipa_utils.c +17 −1 Original line number Diff line number Diff line Loading @@ -4151,6 +4151,9 @@ static void ipa3_tag_free_skb(void *user1, int user2) } #define REQUIRED_TAG_PROCESS_DESCRIPTORS 4 #define MAX_RETRY_ALLOC 10 #define ALLOC_MIN_SLEEP_RX 100000 #define ALLOC_MAX_SLEEP_RX 200000 /* ipa3_tag_process() - Initiates a tag process. Incorporates the input * descriptors Loading Loading @@ -4178,6 +4181,7 @@ int ipa3_tag_process(struct ipa3_desc desc[], int res; struct ipa3_tag_completion *comp; int ep_idx; u32 retry_cnt = 0; /* Not enough room for the required descriptors for the tag process */ if (IPA_TAG_MAX_DESC - descs_num < REQUIRED_TAG_PROCESS_DESCRIPTORS) { Loading Loading @@ -4283,10 +4287,22 @@ int ipa3_tag_process(struct ipa3_desc desc[], tag_desc[desc_idx].callback = ipa3_tag_free_skb; tag_desc[desc_idx].user1 = dummy_skb; desc_idx++; retry_alloc: /* send all descriptors to IPA with single EOT */ res = ipa3_send(sys, desc_idx, tag_desc, true); if (res) { if (res == -ENOMEM) { if (retry_cnt < MAX_RETRY_ALLOC) { IPADBG( "failed to alloc memory retry cnt = %d\n", retry_cnt); retry_cnt++; usleep_range(ALLOC_MIN_SLEEP_RX, ALLOC_MAX_SLEEP_RX); goto retry_alloc; } } IPAERR("failed to send TAG packets %d\n", res); res = -ENOMEM; goto fail_free_skb; Loading Loading
drivers/platform/msm/ipa/ipa_v3/ipa_dp.c +9 −4 Original line number Diff line number Diff line Loading @@ -319,10 +319,12 @@ int ipa3_send(struct ipa3_sys_context *sys, for (i = 0; i < num_desc; i++) { tx_pkt = kmem_cache_zalloc(ipa3_ctx->tx_pkt_wrapper_cache, mem_flag); if (!tx_pkt) GFP_ATOMIC); if (!tx_pkt) { IPAERR("failed to alloc tx wrapper\n"); result = -ENOMEM; goto failure; } INIT_LIST_HEAD(&tx_pkt->link); if (i == 0) { Loading @@ -336,6 +338,7 @@ int ipa3_send(struct ipa3_sys_context *sys, if (ipa_populate_tag_field(&desc[i], tx_pkt, &tag_pyld_ret)) { IPAERR("Failed to populate tag field\n"); result = -EFAULT; goto failure_dma_map; } } Loading Loading @@ -375,6 +378,7 @@ int ipa3_send(struct ipa3_sys_context *sys, } if (dma_mapping_error(ipa3_ctx->pdev, tx_pkt->mem.phys_base)) { IPAERR("failed to do dma map.\n"); result = -EFAULT; goto failure_dma_map; } Loading Loading @@ -421,6 +425,7 @@ int ipa3_send(struct ipa3_sys_context *sys, gsi_xfer, true); if (result != GSI_STATUS_SUCCESS) { IPAERR("GSI xfer failed.\n"); result = -EFAULT; goto failure; } Loading Loading @@ -472,7 +477,7 @@ int ipa3_send(struct ipa3_sys_context *sys, } spin_unlock_bh(&sys->spinlock); return -EFAULT; return result; } /** Loading
drivers/platform/msm/ipa/ipa_v3/ipa_utils.c +17 −1 Original line number Diff line number Diff line Loading @@ -4151,6 +4151,9 @@ static void ipa3_tag_free_skb(void *user1, int user2) } #define REQUIRED_TAG_PROCESS_DESCRIPTORS 4 #define MAX_RETRY_ALLOC 10 #define ALLOC_MIN_SLEEP_RX 100000 #define ALLOC_MAX_SLEEP_RX 200000 /* ipa3_tag_process() - Initiates a tag process. Incorporates the input * descriptors Loading Loading @@ -4178,6 +4181,7 @@ int ipa3_tag_process(struct ipa3_desc desc[], int res; struct ipa3_tag_completion *comp; int ep_idx; u32 retry_cnt = 0; /* Not enough room for the required descriptors for the tag process */ if (IPA_TAG_MAX_DESC - descs_num < REQUIRED_TAG_PROCESS_DESCRIPTORS) { Loading Loading @@ -4283,10 +4287,22 @@ int ipa3_tag_process(struct ipa3_desc desc[], tag_desc[desc_idx].callback = ipa3_tag_free_skb; tag_desc[desc_idx].user1 = dummy_skb; desc_idx++; retry_alloc: /* send all descriptors to IPA with single EOT */ res = ipa3_send(sys, desc_idx, tag_desc, true); if (res) { if (res == -ENOMEM) { if (retry_cnt < MAX_RETRY_ALLOC) { IPADBG( "failed to alloc memory retry cnt = %d\n", retry_cnt); retry_cnt++; usleep_range(ALLOC_MIN_SLEEP_RX, ALLOC_MAX_SLEEP_RX); goto retry_alloc; } } IPAERR("failed to send TAG packets %d\n", res); res = -ENOMEM; goto fail_free_skb; Loading