bes2600: take pending_record_lock with _bh() — fix SOFTIRQ-safe → -unsafe inversion (closes besser#18) #11

Merged
marfrit merged 3 commits from bes2600/queue-pending-record-lock-bh-fix into cleanups 2026-05-18 19:18:08 +00:00
2 changed files with 5 additions and 5 deletions
Showing only changes of commit d95453c98e - Show all commits
+3 -3
View File
@@ -829,19 +829,19 @@ int bes2600_queue_get_skb(struct bes2600_queue *queue, u32 packetID,
bes2600_queue_parse_id(packetID, &queue_generation, &queue_id, bes2600_queue_parse_id(packetID, &queue_generation, &queue_id,
&item_generation, &item_id, &if_id, &link_id); &item_generation, &item_id, &if_id, &link_id);
spin_lock(&queue->stats->hw_priv->tx_loop.pending_record_lock); spin_lock_bh(&queue->stats->hw_priv->tx_loop.pending_record_lock);
if (!list_empty(&queue->stats->hw_priv->tx_loop.pending_record_list)) { if (!list_empty(&queue->stats->hw_priv->tx_loop.pending_record_list)) {
list_for_each_entry_safe(record_item, temp_record_item, &queue->stats->hw_priv->tx_loop.pending_record_list, head) { list_for_each_entry_safe(record_item, temp_record_item, &queue->stats->hw_priv->tx_loop.pending_record_list, head) {
if (record_item->packetID == packetID) { if (record_item->packetID == packetID) {
list_del(&record_item->head); list_del(&record_item->head);
dev_kfree_skb(record_item->skb); dev_kfree_skb(record_item->skb);
kfree(record_item); kfree(record_item);
spin_unlock(&queue->stats->hw_priv->tx_loop.pending_record_lock); spin_unlock_bh(&queue->stats->hw_priv->tx_loop.pending_record_lock);
return -EINVAL; return -EINVAL;
} }
} }
} }
spin_unlock(&queue->stats->hw_priv->tx_loop.pending_record_lock); spin_unlock_bh(&queue->stats->hw_priv->tx_loop.pending_record_lock);
item = &queue->pool[item_id]; item = &queue->pool[item_id];
+2 -2
View File
@@ -109,9 +109,9 @@ void bes2600_tx_loop_set_enable(struct bes2600_common *hw_priv, bool need_warn)
bes2600_queue_iterate_pending_packet(&hw_priv->tx_queue[i], bes2600_queue_iterate_pending_packet(&hw_priv->tx_queue[i],
bes2600_tx_loop_item_pending_item); bes2600_tx_loop_item_pending_item);
} }
spin_lock(&hw_priv->tx_loop.pending_record_lock); spin_lock_bh(&hw_priv->tx_loop.pending_record_lock);
bes2600_queue_iterate_record_pending_packet(hw_priv, bes2600_tx_loop_item_pending_item); bes2600_queue_iterate_record_pending_packet(hw_priv, bes2600_tx_loop_item_pending_item);
spin_unlock(&hw_priv->tx_loop.pending_record_lock); spin_unlock_bh(&hw_priv->tx_loop.pending_record_lock);
if (atomic_read(&hw_priv->bh_rx) > 0) if (atomic_read(&hw_priv->bh_rx) > 0)
wake_up(&hw_priv->bh_wq); wake_up(&hw_priv->bh_wq);