All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5.12 -stable] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()
@ 2021-04-29 21:46 Jiri Kosina
  2021-04-30  5:45 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Kosina @ 2021-04-29 21:46 UTC (permalink / raw)
  To: stable; +Cc: Heiner Kallweit, Kalle Valo, Johannes Berg


[ commit e7020bb068d8be50a92f48e36b236a1a1ef9282e upstream ]

From: Jiri Kosina <jkosina@suse.cz>

Analogically to what we did in 2800aadc18a6 ("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
---

This fix unfortunately didn't make it upstream in time.

 drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
index 4456abb9a074..34bde8c87324 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
@@ -40,6 +40,7 @@ int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans,
 	const u8 *cmddata[IWL_MAX_CMD_TBS_PER_TFD];
 	u16 cmdlen[IWL_MAX_CMD_TBS_PER_TFD];
 	struct iwl_tfh_tfd *tfd;
+	unsigned long flags;
 
 	copy_size = sizeof(struct iwl_cmd_header_wide);
 	cmd_size = sizeof(struct iwl_cmd_header_wide);
@@ -108,14 +109,14 @@ int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans,
 		goto free_dup_buf;
 	}
 
-	spin_lock_bh(&txq->lock);
+	spin_lock_irqsave(&txq->lock, flags);
 
 	idx = iwl_txq_get_cmd_index(txq, txq->write_ptr);
 	tfd = iwl_txq_get_tfd(trans, txq, txq->write_ptr);
 	memset(tfd, 0, sizeof(*tfd));
 
 	if (iwl_txq_space(trans, txq) < ((cmd->flags & CMD_ASYNC) ? 2 : 1)) {
-		spin_unlock_bh(&txq->lock);
+		spin_unlock_irqrestore(&txq->lock, flags);
 
 		IWL_ERR(trans, "No space in command queue\n");
 		iwl_op_mode_cmd_queue_full(trans->op_mode);
@@ -250,7 +251,7 @@ int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans,
 	spin_unlock(&trans_pcie->reg_lock);
 
 out:
-	spin_unlock_bh(&txq->lock);
+	spin_unlock_irqrestore(&txq->lock, flags);
 free_dup_buf:
 	if (idx < 0)
 		kfree(dup_buf);
-- 
2.12.3


-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 5.12 -stable] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()
  2021-04-29 21:46 [PATCH 5.12 -stable] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd() Jiri Kosina
@ 2021-04-30  5:45 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2021-04-30  5:45 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: stable, Heiner Kallweit, Kalle Valo, Johannes Berg

On Thu, Apr 29, 2021 at 11:46:56PM +0200, Jiri Kosina wrote:
> 
> [ commit e7020bb068d8be50a92f48e36b236a1a1ef9282e upstream ]
> 
> From: Jiri Kosina <jkosina@suse.cz>
> 
> Analogically to what we did in 2800aadc18a6 ("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
> ---
> 
> This fix unfortunately didn't make it upstream in time.

Thanks, also added to 5.10.y and 5.11.y as I think it is needed there
too, right?

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-30  5:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-29 21:46 [PATCH 5.12 -stable] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd() Jiri Kosina
2021-04-30  5:45 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.