Skip to content

Commit 542c409

Browse files
committed
Merge tag 'wireless-drivers-2021-04-21' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers
Kalle Valo says: ==================== wireless-drivers fixes for v5.12 As there was -rc8 release, one more important fix for v5.12. iwlwifi * fix spinlock warning in gen2 devices ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents d83b8aa + e7020bb commit 542c409

File tree

1 file changed

+4
-3
lines changed
  • drivers/net/wireless/intel/iwlwifi/pcie

1 file changed

+4
-3
lines changed

drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans,
4040
const u8 *cmddata[IWL_MAX_CMD_TBS_PER_TFD];
4141
u16 cmdlen[IWL_MAX_CMD_TBS_PER_TFD];
4242
struct iwl_tfh_tfd *tfd;
43+
unsigned long flags;
4344

4445
copy_size = sizeof(struct iwl_cmd_header_wide);
4546
cmd_size = sizeof(struct iwl_cmd_header_wide);
@@ -108,14 +109,14 @@ int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans,
108109
goto free_dup_buf;
109110
}
110111

111-
spin_lock_bh(&txq->lock);
112+
spin_lock_irqsave(&txq->lock, flags);
112113

113114
idx = iwl_txq_get_cmd_index(txq, txq->write_ptr);
114115
tfd = iwl_txq_get_tfd(trans, txq, txq->write_ptr);
115116
memset(tfd, 0, sizeof(*tfd));
116117

117118
if (iwl_txq_space(trans, txq) < ((cmd->flags & CMD_ASYNC) ? 2 : 1)) {
118-
spin_unlock_bh(&txq->lock);
119+
spin_unlock_irqrestore(&txq->lock, flags);
119120

120121
IWL_ERR(trans, "No space in command queue\n");
121122
iwl_op_mode_cmd_queue_full(trans->op_mode);
@@ -250,7 +251,7 @@ int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans,
250251
spin_unlock(&trans_pcie->reg_lock);
251252

252253
out:
253-
spin_unlock_bh(&txq->lock);
254+
spin_unlock_irqrestore(&txq->lock, flags);
254255
free_dup_buf:
255256
if (idx < 0)
256257
kfree(dup_buf);

0 commit comments

Comments
 (0)