Linux-Wireless Archive on lore.kernel.org
 help / color / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Jiri Kosina <jikos@kernel.org>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
	linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()
Date: Sat, 17 Apr 2021 08:50:11 +0000 (UTC)
Message-ID: <20210417085011.70190C433CA@smtp.codeaurora.org> (raw)
In-Reply-To: <nycvar.YFH.7.76.2104070918090.12405@cbobk.fhfr.pm>

Jiri Kosina <jikos@kernel.org> wrote:

> On Wed, 7 Apr 2021, Heiner Kallweit wrote:
> 
> > Same fix as in 2800aadc18a6 ("iwlwifi: Fix softirq/hardirq disabling in
> > iwl_pcie_enqueue_hcmd()") is needed for iwl_pcie_gen2_enqueue_hcmd.
> > I get the same lockdep warning on AX210.
> 
> Makes sense, it's being called from exactly the same contexts.
> 
> 
> 
> From: Jiri Kosina <jkosina@suse.cz>
> Subject: [PATCH] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()
> 
> 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: Johannes Berg <johannes.berg@intel.com>
> 
> 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);

This is malformed in patchwork, check the link below. Please resend, and
I strongly recommend to use git send-email to avoid any format issues.

Patch set to Changes Requested.

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/nycvar.YFH.7.76.2104070918090.12405@cbobk.fhfr.pm/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


  parent reply index

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-07  5:55 iwl_pcie_gen2_enqueue_hcmd needs same fix as iwl_pcie_enqueue_hcmd Heiner Kallweit
2021-04-07  7:51 ` [PATCH] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd() Jiri Kosina
2021-04-07  7:55   ` Johannes Berg
2021-04-07  7:56     ` Johannes Berg
2021-04-07  8:30       ` Heiner Kallweit
2021-04-17  8:50   ` Kalle Valo [this message]
     [not found]   ` <20210417085010.58522C433C6@smtp.codeaurora.org>
2021-04-17  9:12     ` Jiri Kosina
2021-04-17  9:13       ` [PATCH v2] " Jiri Kosina
2021-04-19 17:36         ` Kalle Valo
2021-04-17  9:24       ` [PATCH] " Jiri Kosina
2021-04-17 12:06         ` Sedat Dilek
2021-04-18  6:47           ` Sedat Dilek
2021-04-18  6:46       ` Kalle Valo
2021-04-18  7:07         ` Sedat Dilek
2021-04-15 12:04 Hans de Goede
2021-04-15 12:21 ` Johannes Berg
2021-04-15 12:37   ` Coelho, Luciano
2021-04-15 12:37     ` Johannes Berg
2021-04-15 12:43       ` Coelho, Luciano
2021-04-15 12:44     ` Jiri Kosina
2021-04-15 13:04       ` Coelho, Luciano
2021-04-15 13:06         ` Johannes Berg
2021-04-15 13:54       ` Coelho, Luciano
2021-04-15 15:32   ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210417085011.70190C433CA@smtp.codeaurora.org \
    --to=kvalo@codeaurora.org \
    --cc=hkallweit1@gmail.com \
    --cc=jikos@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Wireless Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-wireless/0 linux-wireless/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-wireless linux-wireless/ https://lore.kernel.org/linux-wireless \
		linux-wireless@vger.kernel.org
	public-inbox-index linux-wireless

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-wireless


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git