stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] iwlwifi: mvm: fix regulatory domain update when the firmware" failed to apply to 4.4-stable tree
@ 2018-11-28  9:34 gregkh
  2018-11-29  8:43 ` [PATCH v4.4] iwlwifi: mvm: fix regulatory domain update when the firmware starts Luca Coelho
  0 siblings, 1 reply; 4+ messages in thread
From: gregkh @ 2018-11-28  9:34 UTC (permalink / raw)
  To: emmanuel.grumbach, luciano.coelho; +Cc: stable


The patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

>From 82715ac71e6b94a2c2136e31f3a8e6748e33aa8c Mon Sep 17 00:00:00 2001
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date: Wed, 3 Oct 2018 11:16:54 +0300
Subject: [PATCH] iwlwifi: mvm: fix regulatory domain update when the firmware
 starts

When the firmware starts, it doesn't have any regulatory
information, hence it uses the world wide limitations. The
driver can feed the firmware with previous knowledge that
was kept in the driver, but the firmware may still not
update its internal tables.

This happens when we start a BSS interface, and then the
firmware can change the regulatory tables based on our
location and it'll use more lenient, location specific
rules. Then, if the firmware is shut down (when the
interface is brought down), and then an AP interface is
created, the firmware will forget the country specific
rules.

The host will think that we are in a certain country that
may allow channels and will try to teach the firmware about
our location, but the firmware may still not allow to drop
the world wide limitations and apply country specific rules
because it was just re-started.

In this case, the firmware will reply with MCC_RESP_ILLEGAL
to the MCC_UPDATE_CMD. In that case, iwlwifi needs to let
the upper layers (cfg80211 / hostapd) know that the channel
list they know about has been updated.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=201105

Cc: stable@vger.kernel.org
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 7c09ce20e8b1..00f831d88366 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -301,8 +301,12 @@ struct ieee80211_regdomain *iwl_mvm_get_regdomain(struct wiphy *wiphy,
 		goto out;
 	}
 
-	if (changed)
-		*changed = (resp->status == MCC_RESP_NEW_CHAN_PROFILE);
+	if (changed) {
+		u32 status = le32_to_cpu(resp->status);
+
+		*changed = (status == MCC_RESP_NEW_CHAN_PROFILE ||
+			    status == MCC_RESP_ILLEGAL);
+	}
 
 	regd = iwl_parse_nvm_mcc_info(mvm->trans->dev, mvm->cfg,
 				      __le32_to_cpu(resp->n_channels),
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
index 3633f27d048a..6fc5cc1f2b5b 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
@@ -539,9 +539,8 @@ iwl_mvm_update_mcc(struct iwl_mvm *mvm, const char *alpha2,
 	}
 
 	IWL_DEBUG_LAR(mvm,
-		      "MCC response status: 0x%x. new MCC: 0x%x ('%c%c') change: %d n_chans: %d\n",
-		      status, mcc, mcc >> 8, mcc & 0xff,
-		      !!(status == MCC_RESP_NEW_CHAN_PROFILE), n_channels);
+		      "MCC response status: 0x%x. new MCC: 0x%x ('%c%c') n_chans: %d\n",
+		      status, mcc, mcc >> 8, mcc & 0xff, n_channels);
 
 exit:
 	iwl_free_resp(&cmd);

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

* [PATCH v4.4] iwlwifi: mvm: fix regulatory domain update when the firmware starts
  2018-11-28  9:34 FAILED: patch "[PATCH] iwlwifi: mvm: fix regulatory domain update when the firmware" failed to apply to 4.4-stable tree gregkh
@ 2018-11-29  8:43 ` Luca Coelho
  2018-11-29 10:25   ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Luca Coelho @ 2018-11-29  8:43 UTC (permalink / raw)
  To: stable; +Cc: Emmanuel Grumbach, Luca Coelho

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

When the firmware starts, it doesn't have any regulatory
information, hence it uses the world wide limitations. The
driver can feed the firmware with previous knowledge that
was kept in the driver, but the firmware may still not
update its internal tables.

This happens when we start a BSS interface, and then the
firmware can change the regulatory tables based on our
location and it'll use more lenient, location specific
rules. Then, if the firmware is shut down (when the
interface is brought down), and then an AP interface is
created, the firmware will forget the country specific
rules.

The host will think that we are in a certain country that
may allow channels and will try to teach the firmware about
our location, but the firmware may still not allow to drop
the world wide limitations and apply country specific rules
because it was just re-started.

In this case, the firmware will reply with MCC_RESP_ILLEGAL
to the MCC_UPDATE_CMD. In that case, iwlwifi needs to let
the upper layers (cfg80211 / hostapd) know that the channel
list they know about has been updated.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=201105

Cc: stable@vger.kernel.org
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/iwlwifi/mvm/mac80211.c | 8 ++++++--
 drivers/net/wireless/iwlwifi/mvm/nvm.c      | 5 ++---
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index 984cd2f05c4a..f372ab1f3e74 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -322,8 +322,12 @@ struct ieee80211_regdomain *iwl_mvm_get_regdomain(struct wiphy *wiphy,
 		goto out;
 	}
 
-	if (changed)
-		*changed = (resp->status == MCC_RESP_NEW_CHAN_PROFILE);
+	if (changed) {
+		u32 status = le32_to_cpu(resp->status);
+
+		*changed = (status == MCC_RESP_NEW_CHAN_PROFILE ||
+			    status == MCC_RESP_ILLEGAL);
+	}
 
 	regd = iwl_parse_nvm_mcc_info(mvm->trans->dev, mvm->cfg,
 				      __le32_to_cpu(resp->n_channels),
diff --git a/drivers/net/wireless/iwlwifi/mvm/nvm.c b/drivers/net/wireless/iwlwifi/mvm/nvm.c
index 2ee0f6fe56a1..5509c5024352 100644
--- a/drivers/net/wireless/iwlwifi/mvm/nvm.c
+++ b/drivers/net/wireless/iwlwifi/mvm/nvm.c
@@ -667,9 +667,8 @@ iwl_mvm_update_mcc(struct iwl_mvm *mvm, const char *alpha2,
 
 	n_channels =  __le32_to_cpu(mcc_resp->n_channels);
 	IWL_DEBUG_LAR(mvm,
-		      "MCC response status: 0x%x. new MCC: 0x%x ('%c%c') change: %d n_chans: %d\n",
-		      status, mcc, mcc >> 8, mcc & 0xff,
-		      !!(status == MCC_RESP_NEW_CHAN_PROFILE), n_channels);
+		      "MCC response status: 0x%x. new MCC: 0x%x ('%c%c') n_chans: %d\n",
+		      status, mcc, mcc >> 8, mcc & 0xff, n_channels);
 
 	resp_len = sizeof(*mcc_resp) + n_channels * sizeof(__le32);
 	resp_cp = kmemdup(mcc_resp, resp_len, GFP_KERNEL);
-- 
2.19.1

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

* Re: [PATCH v4.4] iwlwifi: mvm: fix regulatory domain update when the firmware starts
  2018-11-29  8:43 ` [PATCH v4.4] iwlwifi: mvm: fix regulatory domain update when the firmware starts Luca Coelho
@ 2018-11-29 10:25   ` Greg KH
  2018-11-29 10:45     ` Coelho, Luciano
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2018-11-29 10:25 UTC (permalink / raw)
  To: Luca Coelho; +Cc: stable, Emmanuel Grumbach, Luca Coelho

On Thu, Nov 29, 2018 at 10:43:52AM +0200, Luca Coelho wrote:
> From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> 
> When the firmware starts, it doesn't have any regulatory
> information, hence it uses the world wide limitations. The
> driver can feed the firmware with previous knowledge that
> was kept in the driver, but the firmware may still not
> update its internal tables.
> 
> This happens when we start a BSS interface, and then the
> firmware can change the regulatory tables based on our
> location and it'll use more lenient, location specific
> rules. Then, if the firmware is shut down (when the
> interface is brought down), and then an AP interface is
> created, the firmware will forget the country specific
> rules.
> 
> The host will think that we are in a certain country that
> may allow channels and will try to teach the firmware about
> our location, but the firmware may still not allow to drop
> the world wide limitations and apply country specific rules
> because it was just re-started.
> 
> In this case, the firmware will reply with MCC_RESP_ILLEGAL
> to the MCC_UPDATE_CMD. In that case, iwlwifi needs to let
> the upper layers (cfg80211 / hostapd) know that the channel
> list they know about has been updated.
> 
> This fixes https://bugzilla.kernel.org/show_bug.cgi?id=201105
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> ---
>  drivers/net/wireless/iwlwifi/mvm/mac80211.c | 8 ++++++--
>  drivers/net/wireless/iwlwifi/mvm/nvm.c      | 5 ++---
>  2 files changed, 8 insertions(+), 5 deletions(-)

You forgot the git commit id :(

I dug it up and queued this up now.

greg k-h

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

* Re: [PATCH v4.4] iwlwifi: mvm: fix regulatory domain update when the firmware starts
  2018-11-29 10:25   ` Greg KH
@ 2018-11-29 10:45     ` Coelho, Luciano
  0 siblings, 0 replies; 4+ messages in thread
From: Coelho, Luciano @ 2018-11-29 10:45 UTC (permalink / raw)
  To: greg@kroah.com; +Cc: stable@vger.kernel.org, Grumbach, Emmanuel

On Thu, 2018-11-29 at 11:25 +0100, Greg KH wrote:
> On Thu, Nov 29, 2018 at 10:43:52AM +0200, Luca Coelho wrote:
> > From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> > 
> > When the firmware starts, it doesn't have any regulatory
> > information, hence it uses the world wide limitations. The
> > driver can feed the firmware with previous knowledge that
> > was kept in the driver, but the firmware may still not
> > update its internal tables.
> > 
> > This happens when we start a BSS interface, and then the
> > firmware can change the regulatory tables based on our
> > location and it'll use more lenient, location specific
> > rules. Then, if the firmware is shut down (when the
> > interface is brought down), and then an AP interface is
> > created, the firmware will forget the country specific
> > rules.
> > 
> > The host will think that we are in a certain country that
> > may allow channels and will try to teach the firmware about
> > our location, but the firmware may still not allow to drop
> > the world wide limitations and apply country specific rules
> > because it was just re-started.
> > 
> > In this case, the firmware will reply with MCC_RESP_ILLEGAL
> > to the MCC_UPDATE_CMD. In that case, iwlwifi needs to let
> > the upper layers (cfg80211 / hostapd) know that the channel
> > list they know about has been updated.
> > 
> > This fixes https://bugzilla.kernel.org/show_bug.cgi?id=201105
> > 
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> > Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> > ---
> >  drivers/net/wireless/iwlwifi/mvm/mac80211.c | 8 ++++++--
> >  drivers/net/wireless/iwlwifi/mvm/nvm.c      | 5 ++---
> >  2 files changed, 8 insertions(+), 5 deletions(-)
> 
> You forgot the git commit id :(

Ouch! Sorry about that...


> I dug it up and queued this up now.

Thanks, Greg!

--
Cheers,
Luca.

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

end of thread, other threads:[~2018-11-29 21:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-28  9:34 FAILED: patch "[PATCH] iwlwifi: mvm: fix regulatory domain update when the firmware" failed to apply to 4.4-stable tree gregkh
2018-11-29  8:43 ` [PATCH v4.4] iwlwifi: mvm: fix regulatory domain update when the firmware starts Luca Coelho
2018-11-29 10:25   ` Greg KH
2018-11-29 10:45     ` Coelho, Luciano

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).