linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for v5.15 0/5] iwlwifi: fixes intended for v5.15 2021-10-16
@ 2021-10-16  8:43 Luca Coelho
  2021-10-16  8:43 ` [PATCH for v5.15 1/5] iwlwifi: mvm: reset PM state on unsuccessful resume Luca Coelho
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Luca Coelho @ 2021-10-16  8:43 UTC (permalink / raw)
  To: kvalo; +Cc: luca, linux-wireless

From: Luca Coelho <luciano.coelho@intel.com>

Hi,

This is the first patchset with fixes for v5.15.

The changes are:

* Some memory handling fixes;
* Fix the device initialization configuration for So devices;
* Fix resume flow when iwlwifi resume fails;
* Fix device configuration for JnP edvices.

As usual, I'm pushing this to a pending branch, for kbuild bot.  And
since these are fixes for the rc series, please take them directly to
wireless-drivers.git, as we agreed.  I'll assign them to you.

Cheers,
Luca.


Johannes Berg (4):
  iwlwifi: mvm: reset PM state on unsuccessful resume
  iwlwifi: pnvm: don't kmemdup() more than we have
  iwlwifi: pnvm: read EFI data only if long enough
  iwlwifi: cfg: set low-latency-xtal for some integrated So devices

Yaara Baruch (1):
  iwlwifi: change all JnP to NO-160 configuration

 drivers/net/wireless/intel/iwlwifi/cfg/22000.c |  2 +-
 drivers/net/wireless/intel/iwlwifi/fw/pnvm.c   | 13 ++++++++-----
 drivers/net/wireless/intel/iwlwifi/mvm/d3.c    |  5 ++++-
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c  |  6 +++---
 4 files changed, 16 insertions(+), 10 deletions(-)

-- 
2.33.0


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

* [PATCH for v5.15 1/5] iwlwifi: mvm: reset PM state on unsuccessful resume
  2021-10-16  8:43 [PATCH for v5.15 0/5] iwlwifi: fixes intended for v5.15 2021-10-16 Luca Coelho
@ 2021-10-16  8:43 ` Luca Coelho
  2021-10-20  9:31   ` Kalle Valo
  2021-10-16  8:43 ` [PATCH for v5.15 2/5] iwlwifi: change all JnP to NO-160 configuration Luca Coelho
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 9+ messages in thread
From: Luca Coelho @ 2021-10-16  8:43 UTC (permalink / raw)
  To: kvalo; +Cc: luca, linux-wireless

From: Johannes Berg <johannes.berg@intel.com>

If resume fails for some reason, we need to set the PM state
back to normal so we're able to send commands during firmware
reset, rather than failing all of them because we're in D3.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Fixes: 708a39aaca22 ("iwlwifi: mvm: don't send commands during suspend\resume transition")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
index 9f706fffb592..d3013a51a509 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
@@ -2336,7 +2336,6 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
 		iwl_fw_dbg_collect_desc(&mvm->fwrt, &iwl_dump_desc_assert,
 					false, 0);
 		ret = 1;
-		mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED;
 		goto err;
 	}
 
@@ -2385,6 +2384,7 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
 		}
 	}
 
+	/* after the successful handshake, we're out of D3 */
 	mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED;
 
 	/*
@@ -2455,6 +2455,9 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
 	 */
 	set_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status);
 
+	/* regardless of what happened, we're now out of D3 */
+	mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED;
+
 	return 1;
 }
 
-- 
2.33.0


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

* [PATCH for v5.15 2/5] iwlwifi: change all JnP to NO-160 configuration
  2021-10-16  8:43 [PATCH for v5.15 0/5] iwlwifi: fixes intended for v5.15 2021-10-16 Luca Coelho
  2021-10-16  8:43 ` [PATCH for v5.15 1/5] iwlwifi: mvm: reset PM state on unsuccessful resume Luca Coelho
@ 2021-10-16  8:43 ` Luca Coelho
  2021-10-16  8:43 ` [PATCH for v5.15 3/5] iwlwifi: pnvm: don't kmemdup() more than we have Luca Coelho
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Luca Coelho @ 2021-10-16  8:43 UTC (permalink / raw)
  To: kvalo; +Cc: luca, linux-wireless

From: Yaara Baruch <yaara.baruch@intel.com>

JnP should not have the 160 MHz.

Signed-off-by: Yaara Baruch <yaara.baruch@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index e3996ff99bad..3b974388d834 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -931,9 +931,9 @@ static const struct iwl_dev_info iwl_dev_info_table[] = {
 		      IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_NO_CDB,
 		      iwl_qu_b0_hr1_b0, iwl_ax101_name),
 	_IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY,
-		      IWL_CFG_MAC_TYPE_QU, SILICON_C_STEP,
+		      IWL_CFG_MAC_TYPE_QU, SILICON_B_STEP,
 		      IWL_CFG_RF_TYPE_HR2, IWL_CFG_ANY,
-		      IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_NO_CDB,
+		      IWL_CFG_NO_160, IWL_CFG_ANY, IWL_CFG_NO_CDB,
 		      iwl_qu_b0_hr_b0, iwl_ax203_name),
 
 	/* Qu C step */
@@ -945,7 +945,7 @@ static const struct iwl_dev_info iwl_dev_info_table[] = {
 	_IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY,
 		      IWL_CFG_MAC_TYPE_QU, SILICON_C_STEP,
 		      IWL_CFG_RF_TYPE_HR2, IWL_CFG_ANY,
-		      IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_NO_CDB,
+		      IWL_CFG_NO_160, IWL_CFG_ANY, IWL_CFG_NO_CDB,
 		      iwl_qu_c0_hr_b0, iwl_ax203_name),
 
 	/* QuZ */
-- 
2.33.0


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

* [PATCH for v5.15 3/5] iwlwifi: pnvm: don't kmemdup() more than we have
  2021-10-16  8:43 [PATCH for v5.15 0/5] iwlwifi: fixes intended for v5.15 2021-10-16 Luca Coelho
  2021-10-16  8:43 ` [PATCH for v5.15 1/5] iwlwifi: mvm: reset PM state on unsuccessful resume Luca Coelho
  2021-10-16  8:43 ` [PATCH for v5.15 2/5] iwlwifi: change all JnP to NO-160 configuration Luca Coelho
@ 2021-10-16  8:43 ` Luca Coelho
  2021-10-16  8:43 ` [PATCH for v5.15 4/5] iwlwifi: pnvm: read EFI data only if long enough Luca Coelho
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Luca Coelho @ 2021-10-16  8:43 UTC (permalink / raw)
  To: kvalo; +Cc: luca, linux-wireless

From: Johannes Berg <johannes.berg@intel.com>

We shouldn't kmemdup() more data than we have, that might
cause the code to crash. Fix that by updating the length
before the kmemdup.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/pnvm.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c b/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c
index dde22bdc8703..9b0eee53488a 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c
@@ -284,16 +284,15 @@ int iwl_pnvm_load(struct iwl_trans *trans,
 	/* First attempt to get the PNVM from BIOS */
 	package = iwl_uefi_get_pnvm(trans, &len);
 	if (!IS_ERR_OR_NULL(package)) {
+		/* we need only the data */
+		len -= sizeof(*package);
 		data = kmemdup(package->data, len, GFP_KERNEL);
 
 		/* free package regardless of whether kmemdup succeeded */
 		kfree(package);
 
-		if (data) {
-			/* we need only the data size */
-			len -= sizeof(*package);
+		if (data)
 			goto parse;
-		}
 	}
 
 	/* If it's not available, try from the filesystem */
-- 
2.33.0


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

* [PATCH for v5.15 4/5] iwlwifi: pnvm: read EFI data only if long enough
  2021-10-16  8:43 [PATCH for v5.15 0/5] iwlwifi: fixes intended for v5.15 2021-10-16 Luca Coelho
                   ` (2 preceding siblings ...)
  2021-10-16  8:43 ` [PATCH for v5.15 3/5] iwlwifi: pnvm: don't kmemdup() more than we have Luca Coelho
@ 2021-10-16  8:43 ` Luca Coelho
  2021-10-16  8:43 ` [PATCH for v5.15 5/5] iwlwifi: cfg: set low-latency-xtal for some integrated So devices Luca Coelho
  2021-10-18  7:55 ` [PATCH for v5.15 0/5] iwlwifi: fixes intended for v5.15 2021-10-16 Kalle Valo
  5 siblings, 0 replies; 9+ messages in thread
From: Luca Coelho @ 2021-10-16  8:43 UTC (permalink / raw)
  To: kvalo; +Cc: luca, linux-wireless

From: Johannes Berg <johannes.berg@intel.com>

If the data we get from EFI is not even long enough for
the package struct we expect then ignore it entirely.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Fixes: a1a6a4cf49ec ("iwlwifi: pnvm: implement reading PNVM from UEFI")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/pnvm.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c b/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c
index 9b0eee53488a..069fcbc46d2b 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c
@@ -284,9 +284,13 @@ int iwl_pnvm_load(struct iwl_trans *trans,
 	/* First attempt to get the PNVM from BIOS */
 	package = iwl_uefi_get_pnvm(trans, &len);
 	if (!IS_ERR_OR_NULL(package)) {
-		/* we need only the data */
-		len -= sizeof(*package);
-		data = kmemdup(package->data, len, GFP_KERNEL);
+		if (len >= sizeof(*package)) {
+			/* we need only the data */
+			len -= sizeof(*package);
+			data = kmemdup(package->data, len, GFP_KERNEL);
+		} else {
+			data = NULL;
+		}
 
 		/* free package regardless of whether kmemdup succeeded */
 		kfree(package);
-- 
2.33.0


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

* [PATCH for v5.15 5/5] iwlwifi: cfg: set low-latency-xtal for some integrated So devices
  2021-10-16  8:43 [PATCH for v5.15 0/5] iwlwifi: fixes intended for v5.15 2021-10-16 Luca Coelho
                   ` (3 preceding siblings ...)
  2021-10-16  8:43 ` [PATCH for v5.15 4/5] iwlwifi: pnvm: read EFI data only if long enough Luca Coelho
@ 2021-10-16  8:43 ` Luca Coelho
  2021-10-18  7:55 ` [PATCH for v5.15 0/5] iwlwifi: fixes intended for v5.15 2021-10-16 Kalle Valo
  5 siblings, 0 replies; 9+ messages in thread
From: Luca Coelho @ 2021-10-16  8:43 UTC (permalink / raw)
  To: kvalo; +Cc: luca, linux-wireless

From: Johannes Berg <johannes.berg@intel.com>

The integrated So devices covered by the iwl_so_long_latency_trans_cfg
configuration should all have low-latency-xtal enabled, so do that.
While at it, remove the TODO, I've checked the other values as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Fixes: 6f60fb03c8e7 ("iwlwifi: move SnJ and So rules to the new tables")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/cfg/22000.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
index d8231cc821ae..c18b27b0d60e 100644
--- a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
+++ b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
@@ -355,7 +355,7 @@ const struct iwl_cfg_trans_params iwl_so_long_latency_trans_cfg = {
 	.base_params = &iwl_ax210_base_params,
 	.umac_prph_offset = 0x300000,
 	.integrated = true,
-	/* TODO: the following values need to be checked */
+	.low_latency_xtal = true,
 	.xtal_latency = 12000,
 	.ltr_delay = IWL_CFG_TRANS_LTR_DELAY_2500US,
 };
-- 
2.33.0


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

* Re: [PATCH for v5.15 0/5] iwlwifi: fixes intended for v5.15 2021-10-16
  2021-10-16  8:43 [PATCH for v5.15 0/5] iwlwifi: fixes intended for v5.15 2021-10-16 Luca Coelho
                   ` (4 preceding siblings ...)
  2021-10-16  8:43 ` [PATCH for v5.15 5/5] iwlwifi: cfg: set low-latency-xtal for some integrated So devices Luca Coelho
@ 2021-10-18  7:55 ` Kalle Valo
  2021-10-22  6:32   ` Luca Coelho
  5 siblings, 1 reply; 9+ messages in thread
From: Kalle Valo @ 2021-10-18  7:55 UTC (permalink / raw)
  To: Luca Coelho; +Cc: linux-wireless

Luca Coelho <luca@coelho.fi> writes:

> From: Luca Coelho <luciano.coelho@intel.com>
>
> Hi,
>
> This is the first patchset with fixes for v5.15.
>
> The changes are:
>
> * Some memory handling fixes;
> * Fix the device initialization configuration for So devices;
> * Fix resume flow when iwlwifi resume fails;
> * Fix device configuration for JnP edvices.
>
> As usual, I'm pushing this to a pending branch, for kbuild bot.  And
> since these are fixes for the rc series, please take them directly to
> wireless-drivers.git, as we agreed.  I'll assign them to you.

We are in -rc6 now and I'm not planning to send anymore fixes to v5.15,
unless something really critical pops up. Can I take these to
wireless-drivers-next?

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

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

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

* Re: [PATCH for v5.15 1/5] iwlwifi: mvm: reset PM state on unsuccessful resume
  2021-10-16  8:43 ` [PATCH for v5.15 1/5] iwlwifi: mvm: reset PM state on unsuccessful resume Luca Coelho
@ 2021-10-20  9:31   ` Kalle Valo
  0 siblings, 0 replies; 9+ messages in thread
From: Kalle Valo @ 2021-10-20  9:31 UTC (permalink / raw)
  To: Luca Coelho; +Cc: luca, linux-wireless

Luca Coelho <luca@coelho.fi> wrote:

> From: Johannes Berg <johannes.berg@intel.com>
> 
> If resume fails for some reason, we need to set the PM state
> back to normal so we're able to send commands during firmware
> reset, rather than failing all of them because we're in D3.
> 
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> Fixes: 708a39aaca22 ("iwlwifi: mvm: don't send commands during suspend\resume transition")
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>

5 patches applied to wireless-drivers-next.git, thanks.

2f629a7772e2 iwlwifi: mvm: reset PM state on unsuccessful resume
70382b0897ee iwlwifi: change all JnP to NO-160 configuration
0f892441d8c3 iwlwifi: pnvm: don't kmemdup() more than we have
e864a77f51d0 iwlwifi: pnvm: read EFI data only if long enough
8bf26aa10a8e iwlwifi: cfg: set low-latency-xtal for some integrated So devices

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/iwlwifi.20211016114029.7ceb9eaca9f6.If0cbef38c6d07ec1ddce125878a4bdadcb35d2c9@changeid/

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


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

* Re: [PATCH for v5.15 0/5] iwlwifi: fixes intended for v5.15 2021-10-16
  2021-10-18  7:55 ` [PATCH for v5.15 0/5] iwlwifi: fixes intended for v5.15 2021-10-16 Kalle Valo
@ 2021-10-22  6:32   ` Luca Coelho
  0 siblings, 0 replies; 9+ messages in thread
From: Luca Coelho @ 2021-10-22  6:32 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless

On Mon, 2021-10-18 at 10:55 +0300, Kalle Valo wrote:
> Luca Coelho <luca@coelho.fi> writes:
> 
> > From: Luca Coelho <luciano.coelho@intel.com>
> > 
> > Hi,
> > 
> > This is the first patchset with fixes for v5.15.
> > 
> > The changes are:
> > 
> > * Some memory handling fixes;
> > * Fix the device initialization configuration for So devices;
> > * Fix resume flow when iwlwifi resume fails;
> > * Fix device configuration for JnP edvices.
> > 
> > As usual, I'm pushing this to a pending branch, for kbuild bot.  And
> > since these are fixes for the rc series, please take them directly to
> > wireless-drivers.git, as we agreed.  I'll assign them to you.
> 
> We are in -rc6 now and I'm not planning to send anymore fixes to v5.15,
> unless something really critical pops up. Can I take these to
> wireless-drivers-next?

Yes, I guess that's okay.  And I see that you already did, thanks! :)

Sorry for not reacting earlier, I was on vacation till Wednesday.

We should probably have added Cc: stable, though, but of course we can
always just send it to stable later.

--
Cheers,
Luca.

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

end of thread, other threads:[~2021-10-22  6:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-16  8:43 [PATCH for v5.15 0/5] iwlwifi: fixes intended for v5.15 2021-10-16 Luca Coelho
2021-10-16  8:43 ` [PATCH for v5.15 1/5] iwlwifi: mvm: reset PM state on unsuccessful resume Luca Coelho
2021-10-20  9:31   ` Kalle Valo
2021-10-16  8:43 ` [PATCH for v5.15 2/5] iwlwifi: change all JnP to NO-160 configuration Luca Coelho
2021-10-16  8:43 ` [PATCH for v5.15 3/5] iwlwifi: pnvm: don't kmemdup() more than we have Luca Coelho
2021-10-16  8:43 ` [PATCH for v5.15 4/5] iwlwifi: pnvm: read EFI data only if long enough Luca Coelho
2021-10-16  8:43 ` [PATCH for v5.15 5/5] iwlwifi: cfg: set low-latency-xtal for some integrated So devices Luca Coelho
2021-10-18  7:55 ` [PATCH for v5.15 0/5] iwlwifi: fixes intended for v5.15 2021-10-16 Kalle Valo
2021-10-22  6:32   ` Luca Coelho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).