Merge "msm: ipa3: Add spinlock to avoid deleting already deleted list"

This commit is contained in:
Linux Build Service Account 2017-07-19 17:20:49 -07:00 committed by Gerrit - the friendly Code Review server
commit 347dbf7277

View file

@ -2093,6 +2093,8 @@ static void ipa3_cleanup_wlan_rx_common_cache(void)
struct ipa3_rx_pkt_wrapper *rx_pkt;
struct ipa3_rx_pkt_wrapper *tmp;
spin_lock_bh(&ipa3_ctx->wc_memb.wlan_spinlock);
list_for_each_entry_safe(rx_pkt, tmp,
&ipa3_ctx->wc_memb.wlan_comm_desc_list, link) {
list_del(&rx_pkt->link);
@ -2113,6 +2115,8 @@ static void ipa3_cleanup_wlan_rx_common_cache(void)
IPAERR("wlan comm buff total cnt: %d\n",
ipa3_ctx->wc_memb.wlan_comm_total_cnt);
spin_unlock_bh(&ipa3_ctx->wc_memb.wlan_spinlock);
}
static void ipa3_alloc_wlan_rx_common_cache(u32 size)
@ -2150,11 +2154,13 @@ static void ipa3_alloc_wlan_rx_common_cache(u32 size)
goto fail_dma_mapping;
}
spin_lock_bh(&ipa3_ctx->wc_memb.wlan_spinlock);
list_add_tail(&rx_pkt->link,
&ipa3_ctx->wc_memb.wlan_comm_desc_list);
rx_len_cached = ++ipa3_ctx->wc_memb.wlan_comm_total_cnt;
ipa3_ctx->wc_memb.wlan_comm_free_cnt++;
spin_unlock_bh(&ipa3_ctx->wc_memb.wlan_spinlock);
}