Skip to content

Commit

Permalink
msm: ipa3: Fix to recycle buffers
Browse files Browse the repository at this point in the history
Make a change to protect cleaning up of recycle buffers
as there can be a race between clean up and recycling.

Change-Id: I7cc4f40ea87fb0a2b9ce76ff24b47c5d8a02d94f
Signed-off-by: Chaitanya Pratapa <[email protected]>
  • Loading branch information
chetanpratap authored and Gerrit - the friendly Code Review server committed Jul 2, 2019
1 parent 09920fa commit a92c2f5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/platform/msm/ipa/ipa_v3/ipa_dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2397,6 +2397,7 @@ static void ipa3_cleanup_rx(struct ipa3_sys_context *sys)
kmem_cache_free(ipa3_ctx->rx_pkt_wrapper_cache, rx_pkt);
}

spin_lock_bh(&sys->spinlock);
list_for_each_entry_safe(rx_pkt, r,
&sys->rcycl_list, link) {
list_del(&rx_pkt->link);
Expand All @@ -2405,6 +2406,7 @@ static void ipa3_cleanup_rx(struct ipa3_sys_context *sys)
sys->free_skb(rx_pkt->data.skb);
kmem_cache_free(ipa3_ctx->rx_pkt_wrapper_cache, rx_pkt);
}
spin_unlock_bh(&sys->spinlock);

if (sys->repl) {
head = atomic_read(&sys->repl->head_idx);
Expand Down

0 comments on commit a92c2f5

Please sign in to comment.