2021-05-01 07:30:42

by Jari Ruusu

[permalink] [raw]
Subject: Re: [PATCH 5.10 1/2] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()

Greg Kroah-Hartman wrote:
> From: Jiri Kosina <[email protected]>
>
> commit e7020bb068d8be50a92f48e36b236a1a1ef9282e upstream.
>
> 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.

Greg,
This patch and above mentioned earlier patch
"iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_enqueue_hcmd()",
upstream commit 2800aadc18a64c96b051bcb7da8a7df7d505db3f, both need
to be backported to older kernels too.

I see that there are trivial context rejects if/when you attempt to
apply those patches to older kernels. Those trivial context rejects
should not prevent backporting them. Maybe run both patches through sed?

sed -e s/iwl_txq_space/iwl_queue_space/ -e s/iwl_txq_get_/iwl_pcie_get_/

My ability test in-tree iwlwifi is limited. I compile out-of-tree
iwlwifi source, and testing that is limited to pinging mobile-wifi
router that does not have SIM-card.

--
Jari Ruusu 4096R/8132F189 12D6 4C3A DCDA 0AA4 27BD ACDF F073 3C80 8132 F189


2021-05-02 11:08:54

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 5.10 1/2] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()

On Sat, May 01, 2021 at 10:12:42AM +0300, Jari Ruusu wrote:
> Greg Kroah-Hartman wrote:
> > From: Jiri Kosina <[email protected]>
> >
> > commit e7020bb068d8be50a92f48e36b236a1a1ef9282e upstream.
> >
> > 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.
>
> Greg,
> This patch and above mentioned earlier patch
> "iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_enqueue_hcmd()",
> upstream commit 2800aadc18a64c96b051bcb7da8a7df7d505db3f, both need
> to be backported to older kernels too.
>
> I see that there are trivial context rejects if/when you attempt to
> apply those patches to older kernels. Those trivial context rejects
> should not prevent backporting them. Maybe run both patches through sed?
>
> sed -e s/iwl_txq_space/iwl_queue_space/ -e s/iwl_txq_get_/iwl_pcie_get_/
>
> My ability test in-tree iwlwifi is limited. I compile out-of-tree
> iwlwifi source, and testing that is limited to pinging mobile-wifi
> router that does not have SIM-card.

If you could provide backported patches to those kernels you think this
is needed to, I can take them directly. Otherwise running sed isn't
always the easiest thing to do on my end :)

thanks

greg k-h

2021-05-03 11:41:21

by Jari Ruusu

[permalink] [raw]
Subject: Re: [PATCH 5.10 1/2] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()

On Sunday, May 2, 2021 2:03 PM, Greg Kroah-Hartman <[email protected]> wrote:
> If you could provide backported patches to those kernels you think this
> is needed to, I can take them directly. Otherwise running sed isn't
> always the easiest thing to do on my end :)

iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()
upstream commit e7020bb068d8be50a92f48e36b236a1a1ef9282e,
backport for linux-5.4.y and linux-4.19.y (booted and ping tested)
Signed-off-by: Jari Ruusu <[email protected]>

--- a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
@@ -705,6 +705,7 @@ static 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 flags2;

copy_size = sizeof(struct iwl_cmd_header_wide);
cmd_size = sizeof(struct iwl_cmd_header_wide);
@@ -773,14 +774,14 @@ static int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans,
goto free_dup_buf;
}

- spin_lock_bh(&txq->lock);
+ spin_lock_irqsave(&txq->lock, flags2);

idx = iwl_pcie_get_cmd_index(txq, txq->write_ptr);
tfd = iwl_pcie_get_tfd(trans, txq, txq->write_ptr);
memset(tfd, 0, sizeof(*tfd));

if (iwl_queue_space(trans, txq) < ((cmd->flags & CMD_ASYNC) ? 2 : 1)) {
- spin_unlock_bh(&txq->lock);
+ spin_unlock_irqrestore(&txq->lock, flags2);

IWL_ERR(trans, "No space in command queue\n");
iwl_op_mode_cmd_queue_full(trans->op_mode);
@@ -915,7 +916,7 @@ static int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans,
spin_unlock_irqrestore(&trans_pcie->reg_lock, flags);

out:
- spin_unlock_bh(&txq->lock);
+ spin_unlock_irqrestore(&txq->lock, flags2);
free_dup_buf:
if (idx < 0)
kfree(dup_buf);

--
Jari Ruusu  4096R/8132F189 12D6 4C3A DCDA 0AA4 27BD  ACDF F073 3C80 8132 F189

2021-05-03 11:41:55

by Jari Ruusu

[permalink] [raw]
Subject: Re: [PATCH 5.10 1/2] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()

On Sunday, May 2, 2021 2:03 PM, Greg Kroah-Hartman <[email protected]> wrote:
> If you could provide backported patches to those kernels you think this
> is needed to, I can take them directly. Otherwise running sed isn't
> always the easiest thing to do on my end :)

iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_enqueue_hcmd()
upstream commit 2800aadc18a64c96b051bcb7da8a7df7d505db3f,
backport for linux-5.4.y and linux-4.19.y (booted and ping tested)
Signed-off-by: Jari Ruusu <[email protected]>

--- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
@@ -1544,6 +1544,7 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
u32 cmd_pos;
const u8 *cmddata[IWL_MAX_CMD_TBS_PER_TFD];
u16 cmdlen[IWL_MAX_CMD_TBS_PER_TFD];
+ unsigned long flags2;

if (WARN(!trans->wide_cmd_header &&
group_id > IWL_ALWAYS_LONG_GROUP,
@@ -1627,10 +1628,10 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
goto free_dup_buf;
}

- spin_lock_bh(&txq->lock);
+ spin_lock_irqsave(&txq->lock, flags2);

if (iwl_queue_space(trans, txq) < ((cmd->flags & CMD_ASYNC) ? 2 : 1)) {
- spin_unlock_bh(&txq->lock);
+ spin_unlock_irqrestore(&txq->lock, flags2);

IWL_ERR(trans, "No space in command queue\n");
iwl_op_mode_cmd_queue_full(trans->op_mode);
@@ -1791,7 +1792,7 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
spin_unlock_irqrestore(&trans_pcie->reg_lock, flags);

out:
- spin_unlock_bh(&txq->lock);
+ spin_unlock_irqrestore(&txq->lock, flags2);
free_dup_buf:
if (idx < 0)
kfree(dup_buf);

--
Jari Ruusu  4096R/8132F189 12D6 4C3A DCDA 0AA4 27BD  ACDF F073 3C80 8132 F189

2021-05-03 12:52:37

by Jari Ruusu

[permalink] [raw]
Subject: Re: [PATCH 5.10 1/2] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()

On Sunday, May 2, 2021 2:03 PM, Greg Kroah-Hartman <[email protected]> wrote:
> If you could provide backported patches to those kernels you think this
> is needed to, I can take them directly. Otherwise running sed isn't
> always the easiest thing to do on my end :)

iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_enqueue_hcmd()
upstream commit 2800aadc18a64c96b051bcb7da8a7df7d505db3f,
backport for linux-4.9.y (booted and ping tested)
Signed-off-by: Jari Ruusu <[email protected]>

--- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
@@ -1510,6 +1510,7 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
u32 cmd_pos;
const u8 *cmddata[IWL_MAX_CMD_TBS_PER_TFD];
u16 cmdlen[IWL_MAX_CMD_TBS_PER_TFD];
+ unsigned long flags2;

if (WARN(!trans->wide_cmd_header &&
group_id > IWL_ALWAYS_LONG_GROUP,
@@ -1593,10 +1594,10 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
goto free_dup_buf;
}

- spin_lock_bh(&txq->lock);
+ spin_lock_irqsave(&txq->lock, flags2);

if (iwl_queue_space(txq) < ((cmd->flags & CMD_ASYNC) ? 2 : 1)) {
- spin_unlock_bh(&txq->lock);
+ spin_unlock_irqrestore(&txq->lock, flags2);

IWL_ERR(trans, "No space in command queue\n");
iwl_op_mode_cmd_queue_full(trans->op_mode);
@@ -1757,7 +1758,7 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
spin_unlock_irqrestore(&trans_pcie->reg_lock, flags);

out:
- spin_unlock_bh(&txq->lock);
+ spin_unlock_irqrestore(&txq->lock, flags2);
free_dup_buf:
if (idx < 0)
kfree(dup_buf);

--
Jari Ruusu  4096R/8132F189 12D6 4C3A DCDA 0AA4 27BD  ACDF F073 3C80 8132 F189

2021-05-03 12:52:45

by Jari Ruusu

[permalink] [raw]
Subject: Re: [PATCH 5.10 1/2] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()

On Sunday, May 2, 2021 2:03 PM, Greg Kroah-Hartman <[email protected]> wrote:
> If you could provide backported patches to those kernels you think this
> is needed to, I can take them directly. Otherwise running sed isn't
> always the easiest thing to do on my end :)

iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()
upstream commit e7020bb068d8be50a92f48e36b236a1a1ef9282e,
backport for linux-4.14.y (booted and ping tested)
Signed-off-by: Jari Ruusu <[email protected]>

--- a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
@@ -559,6 +559,7 @@ static 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 = iwl_pcie_get_tfd(trans, txq, txq->write_ptr);
+ unsigned long flags2;

memset(tfd, 0, sizeof(*tfd));

@@ -629,10 +630,10 @@ static int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans,
goto free_dup_buf;
}

- spin_lock_bh(&txq->lock);
+ spin_lock_irqsave(&txq->lock, flags2);

if (iwl_queue_space(txq) < ((cmd->flags & CMD_ASYNC) ? 2 : 1)) {
- spin_unlock_bh(&txq->lock);
+ spin_unlock_irqrestore(&txq->lock, flags2);

IWL_ERR(trans, "No space in command queue\n");
iwl_op_mode_cmd_queue_full(trans->op_mode);
@@ -773,7 +774,7 @@ static int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans,
spin_unlock_irqrestore(&trans_pcie->reg_lock, flags);

out:
- spin_unlock_bh(&txq->lock);
+ spin_unlock_irqrestore(&txq->lock, flags2);
free_dup_buf:
if (idx < 0)
kfree(dup_buf);

--
Jari Ruusu  4096R/8132F189 12D6 4C3A DCDA 0AA4 27BD  ACDF F073 3C80 8132 F189

2021-05-03 12:53:00

by Jari Ruusu

[permalink] [raw]
Subject: Re: [PATCH 5.10 1/2] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()

On Sunday, May 2, 2021 2:03 PM, Greg Kroah-Hartman <[email protected]> wrote:
> If you could provide backported patches to those kernels you think this
> is needed to, I can take them directly. Otherwise running sed isn't
> always the easiest thing to do on my end :)

iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_enqueue_hcmd()
upstream commit 2800aadc18a64c96b051bcb7da8a7df7d505db3f,
backport for linux-4.4.y (compile tested only)
Signed-off-by: Jari Ruusu <[email protected]>

--- a/drivers/net/wireless/iwlwifi/pcie/tx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/tx.c
@@ -1341,6 +1341,7 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
u32 cmd_pos;
const u8 *cmddata[IWL_MAX_CMD_TBS_PER_TFD];
u16 cmdlen[IWL_MAX_CMD_TBS_PER_TFD];
+ unsigned long flags2;

if (WARN(!trans_pcie->wide_cmd_header &&
group_id > IWL_ALWAYS_LONG_GROUP,
@@ -1423,10 +1424,10 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
goto free_dup_buf;
}

- spin_lock_bh(&txq->lock);
+ spin_lock_irqsave(&txq->lock, flags2);

if (iwl_queue_space(q) < ((cmd->flags & CMD_ASYNC) ? 2 : 1)) {
- spin_unlock_bh(&txq->lock);
+ spin_unlock_irqrestore(&txq->lock, flags2);

IWL_ERR(trans, "No space in command queue\n");
iwl_op_mode_cmd_queue_full(trans->op_mode);
@@ -1588,7 +1589,7 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
spin_unlock_irqrestore(&trans_pcie->reg_lock, flags);

out:
- spin_unlock_bh(&txq->lock);
+ spin_unlock_irqrestore(&txq->lock, flags2);
free_dup_buf:
if (idx < 0)
kfree(dup_buf);

--
Jari Ruusu  4096R/8132F189 12D6 4C3A DCDA 0AA4 27BD  ACDF F073 3C80 8132 F189

2021-05-03 12:53:03

by Jari Ruusu

[permalink] [raw]
Subject: Re: [PATCH 5.10 1/2] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()

On Sunday, May 2, 2021 2:03 PM, Greg Kroah-Hartman <[email protected]> wrote:
> If you could provide backported patches to those kernels you think this
> is needed to, I can take them directly. Otherwise running sed isn't
> always the easiest thing to do on my end :)

iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_enqueue_hcmd()
upstream commit 2800aadc18a64c96b051bcb7da8a7df7d505db3f,
backport for linux-4.14.y (booted and ping tested)
Signed-off-by: Jari Ruusu <[email protected]>

--- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
@@ -1473,6 +1473,7 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
u32 cmd_pos;
const u8 *cmddata[IWL_MAX_CMD_TBS_PER_TFD];
u16 cmdlen[IWL_MAX_CMD_TBS_PER_TFD];
+ unsigned long flags2;

if (WARN(!trans->wide_cmd_header &&
group_id > IWL_ALWAYS_LONG_GROUP,
@@ -1556,10 +1557,10 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
goto free_dup_buf;
}

- spin_lock_bh(&txq->lock);
+ spin_lock_irqsave(&txq->lock, flags2);

if (iwl_queue_space(txq) < ((cmd->flags & CMD_ASYNC) ? 2 : 1)) {
- spin_unlock_bh(&txq->lock);
+ spin_unlock_irqrestore(&txq->lock, flags2);

IWL_ERR(trans, "No space in command queue\n");
iwl_op_mode_cmd_queue_full(trans->op_mode);
@@ -1720,7 +1721,7 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
spin_unlock_irqrestore(&trans_pcie->reg_lock, flags);

out:
- spin_unlock_bh(&txq->lock);
+ spin_unlock_irqrestore(&txq->lock, flags2);
free_dup_buf:
if (idx < 0)
kfree(dup_buf);

--
Jari Ruusu  4096R/8132F189 12D6 4C3A DCDA 0AA4 27BD  ACDF F073 3C80 8132 F189

2021-05-04 07:45:33

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 5.10 1/2] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()

On Mon, May 03, 2021 at 11:27:07AM +0000, Jari Ruusu wrote:
> On Sunday, May 2, 2021 2:03 PM, Greg Kroah-Hartman <[email protected]> wrote:
> > If you could provide backported patches to those kernels you think this
> > is needed to, I can take them directly. Otherwise running sed isn't
> > always the easiest thing to do on my end :)
>
> iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_enqueue_hcmd()
> upstream commit 2800aadc18a64c96b051bcb7da8a7df7d505db3f,
> backport for linux-4.4.y (compile tested only)
> Signed-off-by: Jari Ruusu <[email protected]>

All now queued up, thanks.

greg k-h

2021-05-04 13:07:34

by Jari Ruusu

[permalink] [raw]
Subject: Re: [PATCH 5.10 1/2] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()

On Tuesday, May 4, 2021 10:24 AM, Greg Kroah-Hartman <[email protected]> wrote:
> All now queued up, thanks.

For 5.4 and 4.19 and 4.14 kernels there were 2 patches,
first patch is upstream commit 2800aadc18a64c96b051bcb7da8a7df7d505db3f,
second patch is upstream commit e7020bb068d8be50a92f48e36b236a1a1ef9282e.
First patch modifies iwlwifi/pcie/tx.c (older models use this)
Second patch modifies iwlwifi/pcie/tx-gen2.c (for newer models)

I see you queued only the "tx.c" patches, not the "tx-gen2.c" ones.

--
Jari Ruusu  4096R/8132F189 12D6 4C3A DCDA 0AA4 27BD  ACDF F073 3C80 8132 F189

2021-05-04 15:03:30

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 5.10 1/2] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()

On Tue, May 04, 2021 at 01:05:56PM +0000, Jari Ruusu wrote:
> On Tuesday, May 4, 2021 10:24 AM, Greg Kroah-Hartman <[email protected]> wrote:
> > All now queued up, thanks.
>
> For 5.4 and 4.19 and 4.14 kernels there were 2 patches,
> first patch is upstream commit 2800aadc18a64c96b051bcb7da8a7df7d505db3f,

That one is queued up, thanks.

> second patch is upstream commit e7020bb068d8be50a92f48e36b236a1a1ef9282e.

This is not in any newer stable trees, and it was not obvious what you
were doing here at all.

> First patch modifies iwlwifi/pcie/tx.c (older models use this)
> Second patch modifies iwlwifi/pcie/tx-gen2.c (for newer models)
>
> I see you queued only the "tx.c" patches, not the "tx-gen2.c" ones.

That is because it is not in 5.12.y yet either, right?

If it needs to be there, please let us know. Having a subject line that
said "5.10" for all of these was impossible to determine...

So, for e7020bb068d8 ("iwlwifi: Fix softirq/hardirq disabling in
iwl_pcie_gen2_enqueue_hcmd()") what tree(s) do you need it in exactly?

thanks,

greg k-h

2021-05-04 15:05:04

by Jari Ruusu

[permalink] [raw]
Subject: Re: [PATCH 5.10 1/2] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()

On Tuesday, May 4, 2021 4:36 PM, Greg Kroah-Hartman <[email protected]> wrote:
> On Tue, May 04, 2021 at 01:05:56PM +0000, Jari Ruusu wrote:
> > second patch is upstream commit e7020bb068d8be50a92f48e36b236a1a1ef9282e.
>
> This is not in any newer stable trees, and it was not obvious what you
> were doing here at all.

That patch is in 5.10 + 5.11 + 5.12

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.10.y&id=2a442f11407ec9c9bc9b84d7155484f2b60d01f9

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.11.y&id=a9315228c1d4b1ced803761e81ef761d97f3e2fa

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.12.y&id=f935c64a0c87d86730efd6e1e168555460234d04

--
Jari Ruusu  4096R/8132F189 12D6 4C3A DCDA 0AA4 27BD  ACDF F073 3C80 8132 F189

2021-05-04 15:39:11

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 5.10 1/2] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()

On Tue, May 04, 2021 at 02:22:51PM +0000, Jari Ruusu wrote:
> On Tuesday, May 4, 2021 4:36 PM, Greg Kroah-Hartman <[email protected]> wrote:
> > On Tue, May 04, 2021 at 01:05:56PM +0000, Jari Ruusu wrote:
> > > second patch is upstream commit e7020bb068d8be50a92f48e36b236a1a1ef9282e.
> >
> > This is not in any newer stable trees, and it was not obvious what you
> > were doing here at all.
>
> That patch is in 5.10 + 5.11 + 5.12
>
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.10.y&id=2a442f11407ec9c9bc9b84d7155484f2b60d01f9
>
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.11.y&id=a9315228c1d4b1ced803761e81ef761d97f3e2fa
>
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.12.y&id=f935c64a0c87d86730efd6e1e168555460234d04

{sigh}

It's been a long week, I forgot to update my database of what commit is
in what stable release, my fault.

Can you resend your backports here now, and properly let us know what
kernel they belong into (again, the subject line is very confusing.)

thanks,

greg k-h

2021-05-04 17:19:08

by Jari Ruusu

[permalink] [raw]
Subject: Re: [PATCH 5.10 1/2] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()

On Tuesday, May 4, 2021 6:35 PM, Greg Kroah-Hartman <[email protected]> wrote:
> Can you resend your backports here now, and properly let us know what
> kernel they belong into (again, the subject line is very confusing.)

iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()
upstream commit e7020bb068d8be50a92f48e36b236a1a1ef9282e,
backport for linux-5.4.y and linux-4.19.y (booted and ping tested)
Signed-off-by: Jari Ruusu <[email protected]>

--- a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
@@ -705,6 +705,7 @@ static 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 flags2;

copy_size = sizeof(struct iwl_cmd_header_wide);
cmd_size = sizeof(struct iwl_cmd_header_wide);
@@ -773,14 +774,14 @@ static int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans,
goto free_dup_buf;
}

- spin_lock_bh(&txq->lock);
+ spin_lock_irqsave(&txq->lock, flags2);

idx = iwl_pcie_get_cmd_index(txq, txq->write_ptr);
tfd = iwl_pcie_get_tfd(trans, txq, txq->write_ptr);
memset(tfd, 0, sizeof(*tfd));

if (iwl_queue_space(trans, txq) < ((cmd->flags & CMD_ASYNC) ? 2 : 1)) {
- spin_unlock_bh(&txq->lock);
+ spin_unlock_irqrestore(&txq->lock, flags2);

IWL_ERR(trans, "No space in command queue\n");
iwl_op_mode_cmd_queue_full(trans->op_mode);
@@ -915,7 +916,7 @@ static int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans,
spin_unlock_irqrestore(&trans_pcie->reg_lock, flags);

out:
- spin_unlock_bh(&txq->lock);
+ spin_unlock_irqrestore(&txq->lock, flags2);
free_dup_buf:
if (idx < 0)
kfree(dup_buf);

--
Jari Ruusu  4096R/8132F189 12D6 4C3A DCDA 0AA4 27BD  ACDF F073 3C80 8132 F189

2021-05-04 17:19:19

by Jari Ruusu

[permalink] [raw]
Subject: Re: [PATCH 5.10 1/2] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()

On Tuesday, May 4, 2021 6:35 PM, Greg Kroah-Hartman <[email protected]> wrote:
> Can you resend your backports here now, and properly let us know what
> kernel they belong into (again, the subject line is very confusing.)

iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()
upstream commit e7020bb068d8be50a92f48e36b236a1a1ef9282e,
backport for linux-4.14.y (booted and ping tested)
Signed-off-by: Jari Ruusu <[email protected]>

--- a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
@@ -559,6 +559,7 @@ static 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 = iwl_pcie_get_tfd(trans, txq, txq->write_ptr);
+ unsigned long flags2;

memset(tfd, 0, sizeof(*tfd));

@@ -629,10 +630,10 @@ static int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans,
goto free_dup_buf;
}

- spin_lock_bh(&txq->lock);
+ spin_lock_irqsave(&txq->lock, flags2);

if (iwl_queue_space(txq) < ((cmd->flags & CMD_ASYNC) ? 2 : 1)) {
- spin_unlock_bh(&txq->lock);
+ spin_unlock_irqrestore(&txq->lock, flags2);

IWL_ERR(trans, "No space in command queue\n");
iwl_op_mode_cmd_queue_full(trans->op_mode);
@@ -773,7 +774,7 @@ static int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans,
spin_unlock_irqrestore(&trans_pcie->reg_lock, flags);

out:
- spin_unlock_bh(&txq->lock);
+ spin_unlock_irqrestore(&txq->lock, flags2);
free_dup_buf:
if (idx < 0)
kfree(dup_buf);

--
Jari Ruusu  4096R/8132F189 12D6 4C3A DCDA 0AA4 27BD  ACDF F073 3C80 8132 F189

2021-05-04 18:31:33

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 5.10 1/2] iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()

On Tue, May 04, 2021 at 05:02:21PM +0000, Jari Ruusu wrote:
> On Tuesday, May 4, 2021 6:35 PM, Greg Kroah-Hartman <[email protected]> wrote:
> > Can you resend your backports here now, and properly let us know what
> > kernel they belong into (again, the subject line is very confusing.)
>
> iwlwifi: Fix softirq/hardirq disabling in iwl_pcie_gen2_enqueue_hcmd()
> upstream commit e7020bb068d8be50a92f48e36b236a1a1ef9282e,
> backport for linux-5.4.y and linux-4.19.y (booted and ping tested)

Why does the subject still say 5.10?

Please fix up both of these and resend.

thanks,

greg k-h