Skip to content

Commit e7020bb

Browse files
Jiri KosinaKalle Valo
authored andcommitted
iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()
Analogically to what we did in 2800aad ("iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_enqueue_hcmd()"), we must apply the same fix to iwl_pcie_gen2_enqueue_hcmd(), as it's being called from exactly the same contexts. Reported-by: Heiner Kallweit <hkallweit1@gmail.com Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/nycvar.YFH.7.76.2104171112390.18270@cbobk.fhfr.pm
1 parent d434405 commit e7020bb

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)