2019-12-01 23:29:57

by Anders Kaseorg

[permalink] [raw]
Subject: [PATCH] Revert "iwlwifi: assign directly to iwl_trans->cfg in QuZ detection"

This reverts commit 968dcfb4905245dc64d65312c0d17692fa087b99.

Both that commit and commit 809805a820c6445f7a701ded24fdc6bbc841d1e4
attempted to fix the same bug (dead assignments to the local variable
cfg), but they did so in incompatible ways. When they were both merged,
independently of each other, the combination actually caused the bug to
reappear, leading to a firmware crash on boot for some cards.

https://bugzilla.kernel.org/show_bug.cgi?id=205719

Signed-off-by: Anders Kaseorg <[email protected]>
Cc: [email protected] # v5.4+
---
drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 24 +++++++++----------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index 040cec17d3ad..b0b7eca1754e 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -1109,22 +1109,22 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
cfg = &iwl9560_2ac_160_cfg_qu_c0_jf_b0;
}

/* same thing for QuZ... */
if (iwl_trans->hw_rev == CSR_HW_REV_TYPE_QUZ) {
- if (iwl_trans->cfg == &iwl_ax101_cfg_qu_hr)
- iwl_trans->cfg = &iwl_ax101_cfg_quz_hr;
- else if (iwl_trans->cfg == &iwl_ax201_cfg_qu_hr)
- iwl_trans->cfg = &iwl_ax201_cfg_quz_hr;
- else if (iwl_trans->cfg == &iwl9461_2ac_cfg_qu_b0_jf_b0)
- iwl_trans->cfg = &iwl9461_2ac_cfg_quz_a0_jf_b0_soc;
- else if (iwl_trans->cfg == &iwl9462_2ac_cfg_qu_b0_jf_b0)
- iwl_trans->cfg = &iwl9462_2ac_cfg_quz_a0_jf_b0_soc;
- else if (iwl_trans->cfg == &iwl9560_2ac_cfg_qu_b0_jf_b0)
- iwl_trans->cfg = &iwl9560_2ac_cfg_quz_a0_jf_b0_soc;
- else if (iwl_trans->cfg == &iwl9560_2ac_160_cfg_qu_b0_jf_b0)
- iwl_trans->cfg = &iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc;
+ if (cfg == &iwl_ax101_cfg_qu_hr)
+ cfg = &iwl_ax101_cfg_quz_hr;
+ else if (cfg == &iwl_ax201_cfg_qu_hr)
+ cfg = &iwl_ax201_cfg_quz_hr;
+ else if (cfg == &iwl9461_2ac_cfg_qu_b0_jf_b0)
+ cfg = &iwl9461_2ac_cfg_quz_a0_jf_b0_soc;
+ else if (cfg == &iwl9462_2ac_cfg_qu_b0_jf_b0)
+ cfg = &iwl9462_2ac_cfg_quz_a0_jf_b0_soc;
+ else if (cfg == &iwl9560_2ac_cfg_qu_b0_jf_b0)
+ cfg = &iwl9560_2ac_cfg_quz_a0_jf_b0_soc;
+ else if (cfg == &iwl9560_2ac_160_cfg_qu_b0_jf_b0)
+ cfg = &iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc;
}

#endif
/* now set the real cfg we decided to use */
iwl_trans->cfg = cfg;
--
2.24.0


2019-12-02 22:00:40

by Anders Kaseorg

[permalink] [raw]
Subject: [PATCH v1.1] Revert "iwlwifi: assign directly to iwl_trans->cfg in QuZ detection"

This reverts commit 968dcfb4905245dc64d65312c0d17692fa087b99.

Both that commit and commit 809805a820c6445f7a701ded24fdc6bbc841d1e4
attempted to fix the same bug (dead assignments to the local variable
cfg), but they did so in incompatible ways. When they were both merged,
independently of each other, the combination actually caused the bug to
reappear, leading to a firmware crash on boot for some cards.

https://bugzilla.kernel.org/show_bug.cgi?id=205719

Signed-off-by: Anders Kaseorg <[email protected]>
---
[Re-sending without format=flowed damage. Sorry about that, it?s been a
while!]

drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 24 +++++++++----------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index 040cec17d3ad..b0b7eca1754e 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -1109,22 +1109,22 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
cfg = &iwl9560_2ac_160_cfg_qu_c0_jf_b0;
}

/* same thing for QuZ... */
if (iwl_trans->hw_rev == CSR_HW_REV_TYPE_QUZ) {
- if (iwl_trans->cfg == &iwl_ax101_cfg_qu_hr)
- iwl_trans->cfg = &iwl_ax101_cfg_quz_hr;
- else if (iwl_trans->cfg == &iwl_ax201_cfg_qu_hr)
- iwl_trans->cfg = &iwl_ax201_cfg_quz_hr;
- else if (iwl_trans->cfg == &iwl9461_2ac_cfg_qu_b0_jf_b0)
- iwl_trans->cfg = &iwl9461_2ac_cfg_quz_a0_jf_b0_soc;
- else if (iwl_trans->cfg == &iwl9462_2ac_cfg_qu_b0_jf_b0)
- iwl_trans->cfg = &iwl9462_2ac_cfg_quz_a0_jf_b0_soc;
- else if (iwl_trans->cfg == &iwl9560_2ac_cfg_qu_b0_jf_b0)
- iwl_trans->cfg = &iwl9560_2ac_cfg_quz_a0_jf_b0_soc;
- else if (iwl_trans->cfg == &iwl9560_2ac_160_cfg_qu_b0_jf_b0)
- iwl_trans->cfg = &iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc;
+ if (cfg == &iwl_ax101_cfg_qu_hr)
+ cfg = &iwl_ax101_cfg_quz_hr;
+ else if (cfg == &iwl_ax201_cfg_qu_hr)
+ cfg = &iwl_ax201_cfg_quz_hr;
+ else if (cfg == &iwl9461_2ac_cfg_qu_b0_jf_b0)
+ cfg = &iwl9461_2ac_cfg_quz_a0_jf_b0_soc;
+ else if (cfg == &iwl9462_2ac_cfg_qu_b0_jf_b0)
+ cfg = &iwl9462_2ac_cfg_quz_a0_jf_b0_soc;
+ else if (cfg == &iwl9560_2ac_cfg_qu_b0_jf_b0)
+ cfg = &iwl9560_2ac_cfg_quz_a0_jf_b0_soc;
+ else if (cfg == &iwl9560_2ac_160_cfg_qu_b0_jf_b0)
+ cfg = &iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc;
}

#endif
/* now set the real cfg we decided to use */
iwl_trans->cfg = cfg;
--
2.24.0

2019-12-02 22:12:36

by Anders Kaseorg

[permalink] [raw]
Subject: [PATCH v1.2] Revert "iwlwifi: assign directly to iwl_trans->cfg in QuZ detection"

This reverts commit 968dcfb4905245dc64d65312c0d17692fa087b99.

Both that commit and commit 809805a820c6445f7a701ded24fdc6bbc841d1e4
attempted to fix the same bug (dead assignments to the local variable
cfg), but they did so in incompatible ways. When they were both merged,
independently of each other, the combination actually caused the bug to
reappear, leading to a firmware crash on boot for some cards.

https://bugzilla.kernel.org/show_bug.cgi?id=205719

Signed-off-by: Anders Kaseorg <[email protected]>
---
[Nope it was more than just format=flowed damage. This one should be
better for real.]

drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 24 +++++++++----------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index 040cec17d3ad..b0b7eca1754e 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -1109,22 +1109,22 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
cfg = &iwl9560_2ac_160_cfg_qu_c0_jf_b0;
}

/* same thing for QuZ... */
if (iwl_trans->hw_rev == CSR_HW_REV_TYPE_QUZ) {
- if (iwl_trans->cfg == &iwl_ax101_cfg_qu_hr)
- iwl_trans->cfg = &iwl_ax101_cfg_quz_hr;
- else if (iwl_trans->cfg == &iwl_ax201_cfg_qu_hr)
- iwl_trans->cfg = &iwl_ax201_cfg_quz_hr;
- else if (iwl_trans->cfg == &iwl9461_2ac_cfg_qu_b0_jf_b0)
- iwl_trans->cfg = &iwl9461_2ac_cfg_quz_a0_jf_b0_soc;
- else if (iwl_trans->cfg == &iwl9462_2ac_cfg_qu_b0_jf_b0)
- iwl_trans->cfg = &iwl9462_2ac_cfg_quz_a0_jf_b0_soc;
- else if (iwl_trans->cfg == &iwl9560_2ac_cfg_qu_b0_jf_b0)
- iwl_trans->cfg = &iwl9560_2ac_cfg_quz_a0_jf_b0_soc;
- else if (iwl_trans->cfg == &iwl9560_2ac_160_cfg_qu_b0_jf_b0)
- iwl_trans->cfg = &iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc;
+ if (cfg == &iwl_ax101_cfg_qu_hr)
+ cfg = &iwl_ax101_cfg_quz_hr;
+ else if (cfg == &iwl_ax201_cfg_qu_hr)
+ cfg = &iwl_ax201_cfg_quz_hr;
+ else if (cfg == &iwl9461_2ac_cfg_qu_b0_jf_b0)
+ cfg = &iwl9461_2ac_cfg_quz_a0_jf_b0_soc;
+ else if (cfg == &iwl9462_2ac_cfg_qu_b0_jf_b0)
+ cfg = &iwl9462_2ac_cfg_quz_a0_jf_b0_soc;
+ else if (cfg == &iwl9560_2ac_cfg_qu_b0_jf_b0)
+ cfg = &iwl9560_2ac_cfg_quz_a0_jf_b0_soc;
+ else if (cfg == &iwl9560_2ac_160_cfg_qu_b0_jf_b0)
+ cfg = &iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc;
}

#endif
/* now set the real cfg we decided to use */
iwl_trans->cfg = cfg;
--
2.24.0

2019-12-03 07:40:15

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v1.2] Revert "iwlwifi: assign directly to iwl_trans->cfg in QuZ detection"

Anders Kaseorg <[email protected]> writes:

> This reverts commit 968dcfb4905245dc64d65312c0d17692fa087b99.
>
> Both that commit and commit 809805a820c6445f7a701ded24fdc6bbc841d1e4
> attempted to fix the same bug (dead assignments to the local variable
> cfg), but they did so in incompatible ways. When they were both merged,
> independently of each other, the combination actually caused the bug to
> reappear, leading to a firmware crash on boot for some cards.
>
> https://bugzilla.kernel.org/show_bug.cgi?id=205719
>
> Signed-off-by: Anders Kaseorg <[email protected]>
> ---
> [Nope it was more than just format=flowed damage. This one should be
> better for real.]

This is nitpicking but as a general comment I would prefer to use simple
version numbering v2, v3 and so on. Trying to sort v1.2 in a script is
awful. So calling this version v3 is very much preferred, it's not like
we are running out of numbers :)

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

2019-12-03 07:42:13

by Luciano Coelho

[permalink] [raw]
Subject: Re: [PATCH v1.2] Revert "iwlwifi: assign directly to iwl_trans->cfg in QuZ detection"

On Tue, 2019-12-03 at 07:39 +0000, Kalle Valo wrote:
> Anders Kaseorg <[email protected]> writes:
>
> > This reverts commit 968dcfb4905245dc64d65312c0d17692fa087b99.
> >
> > Both that commit and commit 809805a820c6445f7a701ded24fdc6bbc841d1e4
> > attempted to fix the same bug (dead assignments to the local variable
> > cfg), but they did so in incompatible ways. When they were both merged,
> > independently of each other, the combination actually caused the bug to
> > reappear, leading to a firmware crash on boot for some cards.
> >
> > https://bugzilla.kernel.org/show_bug.cgi?id=205719
> >
> > Signed-off-by: Anders Kaseorg <[email protected]>
> > ---
> > [Nope it was more than just format=flowed damage. This one should be
> > better for real.]
>
> This is nitpicking but as a general comment I would prefer to use simple
> version numbering v2, v3 and so on. Trying to sort v1.2 in a script is
> awful. So calling this version v3 is very much preferred, it's not like
> we are running out of numbers :)

Kalle, this patch makes sense. There was some merge damage because the
functions were moved around and the local variables' names have
changed, causing this mess.

Can you please take this patch to v5.4 fixes when you're satisfied?

Thanks!

Acked-by: Luca Coelho <[email protected]>

--
Cheers,
Luca.

2019-12-03 09:09:10

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v1.2] Revert "iwlwifi: assign directly to iwl_trans->cfg in QuZ detection"

Luciano Coelho <[email protected]> writes:

> On Tue, 2019-12-03 at 07:39 +0000, Kalle Valo wrote:
>> Anders Kaseorg <[email protected]> writes:
>>
>> > This reverts commit 968dcfb4905245dc64d65312c0d17692fa087b99.
>> >
>> > Both that commit and commit 809805a820c6445f7a701ded24fdc6bbc841d1e4
>> > attempted to fix the same bug (dead assignments to the local variable
>> > cfg), but they did so in incompatible ways. When they were both merged,
>> > independently of each other, the combination actually caused the bug to
>> > reappear, leading to a firmware crash on boot for some cards.
>> >
>> > https://bugzilla.kernel.org/show_bug.cgi?id=205719
>> >
>> > Signed-off-by: Anders Kaseorg <[email protected]>
>> > ---
>> > [Nope it was more than just format=flowed damage. This one should be
>> > better for real.]
>>
>> This is nitpicking but as a general comment I would prefer to use simple
>> version numbering v2, v3 and so on. Trying to sort v1.2 in a script is
>> awful. So calling this version v3 is very much preferred, it's not like
>> we are running out of numbers :)
>
> Kalle, this patch makes sense. There was some merge damage because the
> functions were moved around and the local variables' names have
> changed, causing this mess.
>
> Can you please take this patch to v5.4 fixes when you're satisfied?

Ok, I assigned this to myself and queue for v5.5.

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

2019-12-03 09:12:07

by Luciano Coelho

[permalink] [raw]
Subject: Re: [PATCH v1.2] Revert "iwlwifi: assign directly to iwl_trans->cfg in QuZ detection"

On Tue, 2019-12-03 at 09:08 +0000, Kalle Valo wrote:
> Luciano Coelho <[email protected]> writes:
>
> > On Tue, 2019-12-03 at 07:39 +0000, Kalle Valo wrote:
> > > Anders Kaseorg <[email protected]> writes:
> > >
> > > > This reverts commit 968dcfb4905245dc64d65312c0d17692fa087b99.
> > > >
> > > > Both that commit and commit 809805a820c6445f7a701ded24fdc6bbc841d1e4
> > > > attempted to fix the same bug (dead assignments to the local variable
> > > > cfg), but they did so in incompatible ways. When they were both merged,
> > > > independently of each other, the combination actually caused the bug to
> > > > reappear, leading to a firmware crash on boot for some cards.
> > > >
> > > > https://bugzilla.kernel.org/show_bug.cgi?id=205719
> > > >
> > > > Signed-off-by: Anders Kaseorg <[email protected]>
> > > > ---
> > > > [Nope it was more than just format=flowed damage. This one should be
> > > > better for real.]
> > >
> > > This is nitpicking but as a general comment I would prefer to use simple
> > > version numbering v2, v3 and so on. Trying to sort v1.2 in a script is
> > > awful. So calling this version v3 is very much preferred, it's not like
> > > we are running out of numbers :)
> >
> > Kalle, this patch makes sense. There was some merge damage because the
> > functions were moved around and the local variables' names have
> > changed, causing this mess.
> >
> > Can you please take this patch to v5.4 fixes when you're satisfied?
>
> Ok, I assigned this to myself and queue for v5.5.

Thanks! And yeah, I meant v5.5, obviously. It should reach v5.4 as
part of stable.

--
Cheers,
Luca.

2019-12-10 08:34:08

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v1.2] Revert "iwlwifi: assign directly to iwl_trans->cfg in QuZ detection"

Anders Kaseorg <[email protected]> wrote:

> This reverts commit 968dcfb4905245dc64d65312c0d17692fa087b99.
>
> Both that commit and commit 809805a820c6445f7a701ded24fdc6bbc841d1e4
> attempted to fix the same bug (dead assignments to the local variable
> cfg), but they did so in incompatible ways. When they were both merged,
> independently of each other, the combination actually caused the bug to
> reappear, leading to a firmware crash on boot for some cards.
>
> https://bugzilla.kernel.org/show_bug.cgi?id=205719
>
> Signed-off-by: Anders Kaseorg <[email protected]>
> Acked-by: Luca Coelho <[email protected]>

Patch applied to wireless-drivers.git, thanks.

db5cce1afc8d Revert "iwlwifi: assign directly to iwl_trans->cfg in QuZ detection"

--
https://patchwork.kernel.org/patch/11269985/

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