Skip to content

Commit ea02a20

Browse files
ggreenmajmberg-intel
authored andcommitted
wifi: iwlwifi: mvm: fix regdb initialization
In order to get regulatory domain, driver sends MCC_UPDATE_CMD to the FW. One of the parameters in the response is the status which can tell if the regdomain has changed or not. When iwl_mvm_init_mcc() is called during iwl_op_mode_mvm_start(), then sband is still NULL and channel parameters (i.e. chan->flags) cannot be initialized. When, further in the flow, iwl_mvm_update_mcc() is called during iwl_mvm_up(), it first checks if the regdomain has changed and then skips the update if it remains the same. But, since channel parameters weren't initialized yet, the update should be forced in this codepath. Fix that by adding a corresponding parameter to iwl_mvm_init_fw_regd(). Signed-off-by: Gregory Greenman <[email protected]> Link: https://lore.kernel.org/r/20231017115047.78b2c5b891b0.Iac49d52e0bfc0317372015607c63ea9276bbb188@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent ac0c6fd commit ea02a20

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/d3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ static int iwl_mvm_d3_reprogram(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
818818
if (ret)
819819
IWL_ERR(mvm, "Failed to send quota: %d\n", ret);
820820

821-
if (iwl_mvm_is_lar_supported(mvm) && iwl_mvm_init_fw_regd(mvm))
821+
if (iwl_mvm_is_lar_supported(mvm) && iwl_mvm_init_fw_regd(mvm, false))
822822
IWL_ERR(mvm, "Failed to initialize D3 LAR information\n");
823823

824824
return 0;

drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ struct ieee80211_regdomain *iwl_mvm_get_current_regdomain(struct iwl_mvm *mvm,
186186
MCC_SOURCE_OLD_FW, changed);
187187
}
188188

189-
int iwl_mvm_init_fw_regd(struct iwl_mvm *mvm)
189+
int iwl_mvm_init_fw_regd(struct iwl_mvm *mvm, bool force_regd_sync)
190190
{
191191
enum iwl_mcc_source used_src;
192192
struct ieee80211_regdomain *regd;
@@ -213,8 +213,10 @@ int iwl_mvm_init_fw_regd(struct iwl_mvm *mvm)
213213
if (IS_ERR_OR_NULL(regd))
214214
return -EIO;
215215

216-
/* update cfg80211 if the regdomain was changed */
217-
if (changed)
216+
/* update cfg80211 if the regdomain was changed or the caller explicitly
217+
* asked to update regdomain
218+
*/
219+
if (changed || force_regd_sync)
218220
ret = regulatory_set_wiphy_regd_sync(mvm->hw->wiphy, regd);
219221
else
220222
ret = 0;

drivers/net/wireless/intel/iwlwifi/mvm/mvm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2241,7 +2241,7 @@ struct ieee80211_regdomain *iwl_mvm_get_regdomain(struct wiphy *wiphy,
22412241
bool *changed);
22422242
struct ieee80211_regdomain *iwl_mvm_get_current_regdomain(struct iwl_mvm *mvm,
22432243
bool *changed);
2244-
int iwl_mvm_init_fw_regd(struct iwl_mvm *mvm);
2244+
int iwl_mvm_init_fw_regd(struct iwl_mvm *mvm, bool force_regd_sync);
22452245
void iwl_mvm_update_changed_regdom(struct iwl_mvm *mvm);
22462246

22472247
/* smart fifo */

drivers/net/wireless/intel/iwlwifi/mvm/nvm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ int iwl_mvm_init_mcc(struct iwl_mvm *mvm)
573573
* try to replay the last set MCC to FW. If it doesn't exist,
574574
* queue an update to cfg80211 to retrieve the default alpha2 from FW.
575575
*/
576-
retval = iwl_mvm_init_fw_regd(mvm);
576+
retval = iwl_mvm_init_fw_regd(mvm, true);
577577
if (retval != -ENOENT)
578578
return retval;
579579

0 commit comments

Comments
 (0)