Bladeren bron

msm: ipa3: Fix to recycle buffers

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: Arnav Sharma <[email protected]>
Chaitanya Pratapa 5 jaren geleden
bovenliggende
commit
6912f94f2c
1 gewijzigde bestanden met toevoegingen van 2 en 0 verwijderingen
  1. 2 0
      ipa/ipa_v3/ipa_dp.c

+ 2 - 0
ipa/ipa_v3/ipa_dp.c

@@ -2259,6 +2259,7 @@ static void ipa3_cleanup_rx(struct ipa3_sys_context *sys)
 	 * provided to gsi
 	 */
 
+	spin_lock_bh(&sys->spinlock);
 	list_for_each_entry_safe(rx_pkt, r,
 				 &sys->rcycl_list, link) {
 		list_del(&rx_pkt->link);
@@ -2267,6 +2268,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);