Loading drivers/platform/msm/ipa/ipa_v3/ipa_dp.c +7 −3 Original line number Diff line number Diff line Loading @@ -302,16 +302,17 @@ int ipa3_send(struct ipa3_sys_context *sys, mem_flag); if (!gsi_xfer_elem_array) { IPAERR("Failed to alloc mem for gsi xfer array.\n"); return -EFAULT; return -ENOMEM; } spin_lock_bh(&sys->spinlock); for (i = 0; i < num_desc; i++) { tx_pkt = kmem_cache_zalloc(ipa3_ctx->tx_pkt_wrapper_cache, mem_flag); GFP_ATOMIC); if (!tx_pkt) { IPAERR("failed to alloc tx wrapper\n"); result = -ENOMEM; goto failure; } Loading @@ -328,6 +329,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 @@ -367,6 +369,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 @@ -413,6 +416,7 @@ int ipa3_send(struct ipa3_sys_context *sys, gsi_xfer_elem_array, true); if (result != GSI_STATUS_SUCCESS) { IPAERR("GSI xfer failed.\n"); result = -EFAULT; goto failure; } kfree(gsi_xfer_elem_array); Loading Loading @@ -466,7 +470,7 @@ int ipa3_send(struct ipa3_sys_context *sys, kfree(gsi_xfer_elem_array); 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 @@ -3822,6 +3822,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 @@ -3849,6 +3852,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 @@ -3954,10 +3958,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 +7 −3 Original line number Diff line number Diff line Loading @@ -302,16 +302,17 @@ int ipa3_send(struct ipa3_sys_context *sys, mem_flag); if (!gsi_xfer_elem_array) { IPAERR("Failed to alloc mem for gsi xfer array.\n"); return -EFAULT; return -ENOMEM; } spin_lock_bh(&sys->spinlock); for (i = 0; i < num_desc; i++) { tx_pkt = kmem_cache_zalloc(ipa3_ctx->tx_pkt_wrapper_cache, mem_flag); GFP_ATOMIC); if (!tx_pkt) { IPAERR("failed to alloc tx wrapper\n"); result = -ENOMEM; goto failure; } Loading @@ -328,6 +329,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 @@ -367,6 +369,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 @@ -413,6 +416,7 @@ int ipa3_send(struct ipa3_sys_context *sys, gsi_xfer_elem_array, true); if (result != GSI_STATUS_SUCCESS) { IPAERR("GSI xfer failed.\n"); result = -EFAULT; goto failure; } kfree(gsi_xfer_elem_array); Loading Loading @@ -466,7 +470,7 @@ int ipa3_send(struct ipa3_sys_context *sys, kfree(gsi_xfer_elem_array); 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 @@ -3822,6 +3822,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 @@ -3849,6 +3852,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 @@ -3954,10 +3958,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