Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 16/22] iwlwifi: mvm: iwl_mvm_wowlan_config_key_params is for wowlan only
From: Luca Coelho @ 2019-08-17  6:51 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless
In-Reply-To: <20190817065200.9701-1-luca@coelho.fi>

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

Now that d0i3 is dead, this function can't be called from d0i3
flows. Change its signature and make it static.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/d3.c  | 64 +++++---------------
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 12 ----
 2 files changed, 15 insertions(+), 61 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
index 2ddc6cc56d1d..89839a83d8c2 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
@@ -735,40 +735,16 @@ iwl_mvm_get_wowlan_config(struct iwl_mvm *mvm,
 	return 0;
 }
 
-static void
-iwl_mvm_iter_d0i3_ap_keys(struct iwl_mvm *mvm,
-			  struct ieee80211_vif *vif,
-			  void (*iter)(struct ieee80211_hw *hw,
-				       struct ieee80211_vif *vif,
-				       struct ieee80211_sta *sta,
-				       struct ieee80211_key_conf *key,
-				       void *data),
-			  void *data)
-{
-	struct ieee80211_sta *ap_sta;
-
-	rcu_read_lock();
-
-	ap_sta = rcu_dereference(mvm->fw_id_to_mac_id[mvm->d0i3_ap_sta_id]);
-	if (IS_ERR_OR_NULL(ap_sta))
-		goto out;
-
-	ieee80211_iter_keys_rcu(mvm->hw, vif, iter, data);
-out:
-	rcu_read_unlock();
-}
-
-int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
-				     struct ieee80211_vif *vif,
-				     bool d0i3,
-				     u32 cmd_flags)
+static int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
+					    struct ieee80211_vif *vif,
+					    u32 cmd_flags)
 {
 	struct iwl_wowlan_kek_kck_material_cmd kek_kck_cmd = {};
 	struct iwl_wowlan_tkip_params_cmd tkip_cmd = {};
 	bool unified = fw_has_capa(&mvm->fw->ucode_capa,
 				   IWL_UCODE_TLV_CAPA_CNSLDTD_D3_D0_IMG);
 	struct wowlan_key_data key_data = {
-		.configure_keys = !d0i3 && !unified,
+		.configure_keys = !unified,
 		.use_rsc_tsc = false,
 		.tkip = &tkip_cmd,
 		.use_tkip = false,
@@ -784,25 +760,16 @@ int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
 	 * if we have to configure keys, call ieee80211_iter_keys(),
 	 * as we need non-atomic context in order to take the
 	 * required locks.
-	 * for the d0i3 we can't use ieee80211_iter_keys(), as
-	 * taking (almost) any mutex might result in deadlock.
 	 */
-	if (!d0i3) {
-		/*
-		 * Note that currently we don't propagate cmd_flags
-		 * to the iterator. In case of key_data.configure_keys,
-		 * all the configured commands are SYNC, and
-		 * iwl_mvm_wowlan_program_keys() will take care of
-		 * locking/unlocking mvm->mutex.
-		 */
-		ieee80211_iter_keys(mvm->hw, vif,
-				    iwl_mvm_wowlan_program_keys,
-				    &key_data);
-	} else {
-		iwl_mvm_iter_d0i3_ap_keys(mvm, vif,
-					  iwl_mvm_wowlan_program_keys,
-					  &key_data);
-	}
+	/*
+	 * Note that currently we don't propagate cmd_flags
+	 * to the iterator. In case of key_data.configure_keys,
+	 * all the configured commands are SYNC, and
+	 * iwl_mvm_wowlan_program_keys() will take care of
+	 * locking/unlocking mvm->mutex.
+	 */
+	ieee80211_iter_keys(mvm->hw, vif, iwl_mvm_wowlan_program_keys,
+			    &key_data);
 
 	if (key_data.error) {
 		ret = -EIO;
@@ -830,7 +797,7 @@ int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
 	}
 
 	/* configure rekey data only if offloaded rekey is supported (d3) */
-	if (mvmvif->rekey_data.valid && !d0i3) {
+	if (mvmvif->rekey_data.valid) {
 		memset(&kek_kck_cmd, 0, sizeof(kek_kck_cmd));
 		memcpy(kek_kck_cmd.kck, mvmvif->rekey_data.kck,
 		       NL80211_KCK_LEN);
@@ -881,8 +848,7 @@ iwl_mvm_wowlan_config(struct iwl_mvm *mvm,
 		 * that isn't really a problem though.
 		 */
 		mutex_unlock(&mvm->mutex);
-		ret = iwl_mvm_wowlan_config_key_params(mvm, vif, false,
-						       CMD_ASYNC);
+		ret = iwl_mvm_wowlan_config_key_params(mvm, vif, CMD_ASYNC);
 		mutex_lock(&mvm->mutex);
 		if (ret)
 			return ret;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 2cf5d31ad3ed..03f3faa02781 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -1802,21 +1802,9 @@ void iwl_mvm_set_default_unicast_key(struct ieee80211_hw *hw,
 extern const struct file_operations iwl_dbgfs_d3_test_ops;
 struct iwl_wowlan_status *iwl_mvm_send_wowlan_get_status(struct iwl_mvm *mvm);
 #ifdef CONFIG_PM
-int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
-				     struct ieee80211_vif *vif,
-				     bool host_awake,
-				     u32 cmd_flags);
 void iwl_mvm_set_last_nonqos_seq(struct iwl_mvm *mvm,
 				 struct ieee80211_vif *vif);
 #else
-static inline int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
-						   struct ieee80211_vif *vif,
-						   bool host_awake,
-						   u32 cmd_flags)
-{
-	return 0;
-}
-
 static inline void
 iwl_mvm_set_last_nonqos_seq(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
 {
-- 
2.23.0.rc1


^ permalink raw reply related

* [PATCH 15/22] iwlwifi: mvm: remove the d0i3 entry/exit flow
From: Luca Coelho @ 2019-08-17  6:51 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless
In-Reply-To: <20190817065200.9701-1-luca@coelho.fi>

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

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/d3.c   | 111 +-----
 .../net/wireless/intel/iwlwifi/mvm/mac80211.c |  14 -
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h  |  35 +-
 drivers/net/wireless/intel/iwlwifi/mvm/ops.c  | 350 ------------------
 4 files changed, 2 insertions(+), 508 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
index 7493cae70ea6..2ddc6cc56d1d 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
@@ -1118,37 +1118,12 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
 	return ret;
 }
 
-static int iwl_mvm_enter_d0i3_sync(struct iwl_mvm *mvm)
-{
-	struct iwl_notification_wait wait_d3;
-	static const u16 d3_notif[] = { D3_CONFIG_CMD };
-	int ret;
-
-	iwl_init_notification_wait(&mvm->notif_wait, &wait_d3,
-				   d3_notif, ARRAY_SIZE(d3_notif),
-				   NULL, NULL);
-
-	ret = iwl_mvm_enter_d0i3(mvm->hw->priv);
-	if (ret)
-		goto remove_notif;
-
-	ret = iwl_wait_notification(&mvm->notif_wait, &wait_d3, HZ);
-	WARN_ON_ONCE(ret);
-	return ret;
-
-remove_notif:
-	iwl_remove_notification(&mvm->notif_wait, &wait_d3);
-	return ret;
-}
-
 int iwl_mvm_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
 {
 	struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
 	struct iwl_trans *trans = mvm->trans;
 	int ret;
 
-	/* make sure the d0i3 exit work is not pending */
-	flush_work(&mvm->d0i3_exit_work);
 	iwl_mvm_pause_tcm(mvm, true);
 
 	iwl_fw_runtime_suspend(&mvm->fwrt);
@@ -1157,25 +1132,6 @@ int iwl_mvm_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
 	if (ret)
 		return ret;
 
-	if (wowlan->any) {
-		trans->system_pm_mode = IWL_PLAT_PM_MODE_D0I3;
-
-		if (iwl_mvm_enter_d0i3_on_suspend(mvm)) {
-			ret = iwl_mvm_enter_d0i3_sync(mvm);
-
-			if (ret)
-				return ret;
-		}
-
-		mutex_lock(&mvm->d0i3_suspend_mutex);
-		__set_bit(D0I3_DEFER_WAKEUP, &mvm->d0i3_suspend_flags);
-		mutex_unlock(&mvm->d0i3_suspend_mutex);
-
-		iwl_trans_d3_suspend(trans, false, false);
-
-		return 0;
-	}
-
 	trans->system_pm_mode = IWL_PLAT_PM_MODE_D3;
 
 	return __iwl_mvm_suspend(hw, wowlan, false);
@@ -1751,30 +1707,6 @@ static bool iwl_mvm_query_wakeup_reasons(struct iwl_mvm *mvm,
 	return false;
 }
 
-void iwl_mvm_d0i3_update_keys(struct iwl_mvm *mvm,
-			      struct ieee80211_vif *vif,
-			      struct iwl_wowlan_status *status)
-{
-	struct iwl_mvm_d3_gtk_iter_data gtkdata = {
-		.mvm = mvm,
-		.status = status,
-	};
-
-	/*
-	 * rekey handling requires taking locks that can't be taken now.
-	 * however, d0i3 doesn't offload rekey, so we're fine.
-	 */
-	if (WARN_ON_ONCE(status->num_of_gtk_rekeys))
-		return;
-
-	/* find last GTK that we used initially, if any */
-	gtkdata.find_phase = true;
-	iwl_mvm_iter_d0i3_ap_keys(mvm, vif, iwl_mvm_d3_update_keys, &gtkdata);
-
-	gtkdata.find_phase = false;
-	iwl_mvm_iter_d0i3_ap_keys(mvm, vif, iwl_mvm_d3_update_keys, &gtkdata);
-}
-
 #define ND_QUERY_BUF_LEN (sizeof(struct iwl_scan_offload_profile_match) * \
 			  IWL_SCAN_MAX_PROFILES)
 
@@ -2125,53 +2057,12 @@ static int iwl_mvm_resume_d3(struct iwl_mvm *mvm)
 	return __iwl_mvm_resume(mvm, false);
 }
 
-static int iwl_mvm_resume_d0i3(struct iwl_mvm *mvm)
-{
-	bool exit_now;
-	enum iwl_d3_status d3_status;
-	struct iwl_trans *trans = mvm->trans;
-
-	iwl_trans_d3_resume(trans, &d3_status, false, false);
-
-	/*
-	 * make sure to clear D0I3_DEFER_WAKEUP before
-	 * calling iwl_trans_resume(), which might wait
-	 * for d0i3 exit completion.
-	 */
-	mutex_lock(&mvm->d0i3_suspend_mutex);
-	__clear_bit(D0I3_DEFER_WAKEUP, &mvm->d0i3_suspend_flags);
-	exit_now = __test_and_clear_bit(D0I3_PENDING_WAKEUP,
-					&mvm->d0i3_suspend_flags);
-	mutex_unlock(&mvm->d0i3_suspend_mutex);
-	if (exit_now) {
-		IWL_DEBUG_RPM(mvm, "Run deferred d0i3 exit\n");
-		_iwl_mvm_exit_d0i3(mvm);
-	}
-
-	iwl_trans_resume(trans);
-
-	if (iwl_mvm_enter_d0i3_on_suspend(mvm)) {
-		int ret = iwl_mvm_exit_d0i3(mvm->hw->priv);
-
-		if (ret)
-			return ret;
-		/*
-		 * d0i3 exit will be deferred until reconfig_complete.
-		 * make sure there we are out of d0i3.
-		 */
-	}
-	return 0;
-}
-
 int iwl_mvm_resume(struct ieee80211_hw *hw)
 {
 	struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
 	int ret;
 
-	if (mvm->trans->system_pm_mode == IWL_PLAT_PM_MODE_D0I3)
-		ret = iwl_mvm_resume_d0i3(mvm);
-	else
-		ret = iwl_mvm_resume_d3(mvm);
+	ret = iwl_mvm_resume_d3(mvm);
 
 	mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED;
 
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index cb99a07ad689..2a246f69229d 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -1128,19 +1128,6 @@ static int iwl_mvm_mac_start(struct ieee80211_hw *hw)
 	struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
 	int ret;
 
-	/* Some hw restart cleanups must not hold the mutex */
-	if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) {
-		/*
-		 * Make sure we are out of d0i3. This is needed
-		 * to make sure the reference accounting is correct
-		 * (and there is no stale d0i3_exit_work).
-		 */
-		wait_event_timeout(mvm->d0i3_exit_waitq,
-				   !test_bit(IWL_MVM_STATUS_IN_D0I3,
-					     &mvm->status),
-				   HZ);
-	}
-
 	mutex_lock(&mvm->mutex);
 	ret = __iwl_mvm_mac_start(mvm);
 	mutex_unlock(&mvm->mutex);
@@ -1244,7 +1231,6 @@ static void iwl_mvm_mac_stop(struct ieee80211_hw *hw)
 {
 	struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
 
-	flush_work(&mvm->d0i3_exit_work);
 	flush_work(&mvm->async_handlers_wk);
 	flush_work(&mvm->add_stream_wk);
 
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 6a79b6c49cd5..2cf5d31ad3ed 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -1017,12 +1017,7 @@ struct iwl_mvm {
 
 	/* d0i3 */
 	u8 d0i3_ap_sta_id;
-	bool d0i3_offloading;
-	struct work_struct d0i3_exit_work;
-	/* protect d0i3_suspend_flags */
-	struct mutex d0i3_suspend_mutex;
-	unsigned long d0i3_suspend_flags;
-	wait_queue_head_t d0i3_exit_waitq;
+
 	wait_queue_head_t rx_sync_waitq;
 
 	/* BT-Coex */
@@ -1290,19 +1285,6 @@ static inline bool iwl_mvm_is_short_beacon_notif_supported(struct iwl_mvm *mvm)
 			  IWL_UCODE_TLV_API_SHORT_BEACON_NOTIF);
 }
 
-static inline bool iwl_mvm_enter_d0i3_on_suspend(struct iwl_mvm *mvm)
-{
-	/* For now we only use this mode to differentiate between
-	 * slave transports, which handle D0i3 entry in suspend by
-	 * themselves in conjunction with runtime PM D0i3.  So, this
-	 * function is used to check whether we need to do anything
-	 * when entering suspend or if the transport layer has already
-	 * done it.
-	 */
-	return (mvm->trans->system_pm_mode == IWL_PLAT_PM_MODE_D0I3) &&
-		(mvm->trans->runtime_pm_mode != IWL_PLAT_PM_MODE_D0I3);
-}
-
 static inline bool iwl_mvm_is_dqa_data_queue(struct iwl_mvm *mvm, u8 queue)
 {
 	return (queue >= IWL_MVM_DQA_MIN_DATA_QUEUE) &&
@@ -1824,9 +1806,6 @@ int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
 				     struct ieee80211_vif *vif,
 				     bool host_awake,
 				     u32 cmd_flags);
-void iwl_mvm_d0i3_update_keys(struct iwl_mvm *mvm,
-			      struct ieee80211_vif *vif,
-			      struct iwl_wowlan_status *status);
 void iwl_mvm_set_last_nonqos_seq(struct iwl_mvm *mvm,
 				 struct ieee80211_vif *vif);
 #else
@@ -1838,12 +1817,6 @@ static inline int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
 	return 0;
 }
 
-static inline void iwl_mvm_d0i3_update_keys(struct iwl_mvm *mvm,
-					    struct ieee80211_vif *vif,
-					    struct iwl_wowlan_status *status)
-{
-}
-
 static inline void
 iwl_mvm_set_last_nonqos_seq(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
 {
@@ -1857,12 +1830,6 @@ int iwl_mvm_send_proto_offload(struct iwl_mvm *mvm,
 			       bool offload_ns,
 			       u32 cmd_flags);
 
-#ifdef CONFIG_PM
-int iwl_mvm_enter_d0i3(struct iwl_op_mode *op_mode);
-int iwl_mvm_exit_d0i3(struct iwl_op_mode *op_mode);
-int _iwl_mvm_exit_d0i3(struct iwl_mvm *mvm);
-#endif
-
 /* BT Coex */
 int iwl_mvm_send_bt_init_conf(struct iwl_mvm *mvm);
 void iwl_mvm_rx_bt_coex_notif(struct iwl_mvm *mvm,
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
index e9b0aee38f35..efd694fd8b79 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -516,9 +516,6 @@ static const struct iwl_hcmd_arr iwl_mvm_groups[] = {
 
 /* this forward declaration can avoid to export the function */
 static void iwl_mvm_async_handlers_wk(struct work_struct *wk);
-#ifdef CONFIG_PM
-static void iwl_mvm_d0i3_exit_work(struct work_struct *wk);
-#endif
 
 static u32 iwl_mvm_min_backoff(struct iwl_mvm *mvm)
 {
@@ -695,7 +692,6 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
 	mvm->drop_bcn_ap_mode = true;
 
 	mutex_init(&mvm->mutex);
-	mutex_init(&mvm->d0i3_suspend_mutex);
 	spin_lock_init(&mvm->async_handlers_lock);
 	INIT_LIST_HEAD(&mvm->time_event_list);
 	INIT_LIST_HEAD(&mvm->aux_roc_te_list);
@@ -705,15 +701,11 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
 
 	INIT_WORK(&mvm->async_handlers_wk, iwl_mvm_async_handlers_wk);
 	INIT_WORK(&mvm->roc_done_wk, iwl_mvm_roc_done_wk);
-#ifdef CONFIG_PM
-	INIT_WORK(&mvm->d0i3_exit_work, iwl_mvm_d0i3_exit_work);
-#endif
 	INIT_DELAYED_WORK(&mvm->tdls_cs.dwork, iwl_mvm_tdls_ch_switch_work);
 	INIT_DELAYED_WORK(&mvm->scan_timeout_dwork, iwl_mvm_scan_timeout_wk);
 	INIT_WORK(&mvm->add_stream_wk, iwl_mvm_add_new_dqa_stream_wk);
 	INIT_LIST_HEAD(&mvm->add_stream_txqs);
 
-	init_waitqueue_head(&mvm->d0i3_exit_waitq);
 	init_waitqueue_head(&mvm->rx_sync_waitq);
 
 	atomic_set(&mvm->queue_sync_counter, 0);
@@ -909,7 +901,6 @@ static void iwl_op_mode_mvm_stop(struct iwl_op_mode *op_mode)
 
 	iwl_fw_runtime_free(&mvm->fwrt);
 	mutex_destroy(&mvm->mutex);
-	mutex_destroy(&mvm->d0i3_suspend_mutex);
 
 	ieee80211_free_hw(mvm->hw);
 }
@@ -1337,346 +1328,6 @@ static void iwl_mvm_cmd_queue_full(struct iwl_op_mode *op_mode)
 	iwl_mvm_nic_restart(mvm, true);
 }
 
-#ifdef CONFIG_PM
-struct iwl_d0i3_iter_data {
-	struct iwl_mvm *mvm;
-	struct ieee80211_vif *connected_vif;
-	u8 ap_sta_id;
-	u8 vif_count;
-	u8 offloading_tid;
-	bool disable_offloading;
-};
-
-static bool iwl_mvm_disallow_offloading(struct iwl_mvm *mvm,
-					struct ieee80211_vif *vif,
-					struct iwl_d0i3_iter_data *iter_data)
-{
-	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
-	struct iwl_mvm_sta *mvmsta;
-	u32 available_tids = 0;
-	u8 tid;
-
-	if (WARN_ON(vif->type != NL80211_IFTYPE_STATION ||
-		    mvmvif->ap_sta_id == IWL_MVM_INVALID_STA))
-		return false;
-
-	mvmsta = iwl_mvm_sta_from_staid_rcu(mvm, mvmvif->ap_sta_id);
-	if (!mvmsta)
-		return false;
-
-	spin_lock_bh(&mvmsta->lock);
-	for (tid = 0; tid < IWL_MAX_TID_COUNT; tid++) {
-		struct iwl_mvm_tid_data *tid_data = &mvmsta->tid_data[tid];
-
-		/*
-		 * in case of pending tx packets, don't use this tid
-		 * for offloading in order to prevent reuse of the same
-		 * qos seq counters.
-		 */
-		if (iwl_mvm_tid_queued(mvm, tid_data))
-			continue;
-
-		if (tid_data->state != IWL_AGG_OFF)
-			continue;
-
-		available_tids |= BIT(tid);
-	}
-	spin_unlock_bh(&mvmsta->lock);
-
-	/*
-	 * disallow protocol offloading if we have no available tid
-	 * (with no pending frames and no active aggregation,
-	 * as we don't handle "holes" properly - the scheduler needs the
-	 * frame's seq number and TFD index to match)
-	 */
-	if (!available_tids)
-		return true;
-
-	/* for simplicity, just use the first available tid */
-	iter_data->offloading_tid = ffs(available_tids) - 1;
-	return false;
-}
-
-static void iwl_mvm_enter_d0i3_iterator(void *_data, u8 *mac,
-					struct ieee80211_vif *vif)
-{
-	struct iwl_d0i3_iter_data *data = _data;
-	struct iwl_mvm *mvm = data->mvm;
-	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
-	u32 flags = CMD_ASYNC | CMD_HIGH_PRIO | CMD_SEND_IN_IDLE;
-
-	IWL_DEBUG_RPM(mvm, "entering D0i3 - vif %pM\n", vif->addr);
-	if (vif->type != NL80211_IFTYPE_STATION ||
-	    !vif->bss_conf.assoc)
-		return;
-
-	/*
-	 * in case of pending tx packets or active aggregations,
-	 * avoid offloading features in order to prevent reuse of
-	 * the same qos seq counters.
-	 */
-	if (iwl_mvm_disallow_offloading(mvm, vif, data))
-		data->disable_offloading = true;
-
-	iwl_mvm_update_d0i3_power_mode(mvm, vif, true, flags);
-	iwl_mvm_send_proto_offload(mvm, vif, data->disable_offloading,
-				   false, flags);
-
-	/*
-	 * on init/association, mvm already configures POWER_TABLE_CMD
-	 * and REPLY_MCAST_FILTER_CMD, so currently don't
-	 * reconfigure them (we might want to use different
-	 * params later on, though).
-	 */
-	data->ap_sta_id = mvmvif->ap_sta_id;
-	data->vif_count++;
-
-	/*
-	 * no new commands can be sent at this stage, so it's safe
-	 * to save the vif pointer during d0i3 entrance.
-	 */
-	data->connected_vif = vif;
-}
-
-static void iwl_mvm_set_wowlan_data(struct iwl_mvm *mvm,
-				    struct iwl_wowlan_config_cmd *cmd,
-				    struct iwl_d0i3_iter_data *iter_data)
-{
-	struct ieee80211_sta *ap_sta;
-	struct iwl_mvm_sta *mvm_ap_sta;
-
-	if (iter_data->ap_sta_id == IWL_MVM_INVALID_STA)
-		return;
-
-	rcu_read_lock();
-
-	ap_sta = rcu_dereference(mvm->fw_id_to_mac_id[iter_data->ap_sta_id]);
-	if (IS_ERR_OR_NULL(ap_sta))
-		goto out;
-
-	mvm_ap_sta = iwl_mvm_sta_from_mac80211(ap_sta);
-	cmd->is_11n_connection = ap_sta->ht_cap.ht_supported;
-	cmd->offloading_tid = iter_data->offloading_tid;
-	cmd->flags = ENABLE_L3_FILTERING | ENABLE_NBNS_FILTERING |
-		ENABLE_DHCP_FILTERING | ENABLE_STORE_BEACON;
-	/*
-	 * The d0i3 uCode takes care of the nonqos counters,
-	 * so configure only the qos seq ones.
-	 */
-	iwl_mvm_set_wowlan_qos_seq(mvm_ap_sta, cmd);
-out:
-	rcu_read_unlock();
-}
-
-int iwl_mvm_enter_d0i3(struct iwl_op_mode *op_mode)
-{
-	struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode);
-	u32 flags = CMD_ASYNC | CMD_HIGH_PRIO | CMD_SEND_IN_IDLE;
-	int ret;
-	struct iwl_d0i3_iter_data d0i3_iter_data = {
-		.mvm = mvm,
-	};
-	struct iwl_wowlan_config_cmd wowlan_config_cmd = {
-		.wakeup_filter = cpu_to_le32(IWL_WOWLAN_WAKEUP_RX_FRAME |
-					     IWL_WOWLAN_WAKEUP_BEACON_MISS |
-					     IWL_WOWLAN_WAKEUP_LINK_CHANGE),
-	};
-	struct iwl_d3_manager_config d3_cfg_cmd = {
-		.min_sleep_time = cpu_to_le32(1000),
-		.wakeup_flags = cpu_to_le32(IWL_WAKEUP_D3_CONFIG_FW_ERROR),
-	};
-
-	IWL_DEBUG_RPM(mvm, "MVM entering D0i3\n");
-
-	if (WARN_ON_ONCE(mvm->fwrt.cur_fw_img != IWL_UCODE_REGULAR))
-		return -EINVAL;
-
-	set_bit(IWL_MVM_STATUS_IN_D0I3, &mvm->status);
-
-	ieee80211_iterate_active_interfaces_atomic(mvm->hw,
-						   IEEE80211_IFACE_ITER_NORMAL,
-						   iwl_mvm_enter_d0i3_iterator,
-						   &d0i3_iter_data);
-	if (d0i3_iter_data.vif_count == 1) {
-		mvm->d0i3_ap_sta_id = d0i3_iter_data.ap_sta_id;
-		mvm->d0i3_offloading = !d0i3_iter_data.disable_offloading;
-	} else {
-		WARN_ON_ONCE(d0i3_iter_data.vif_count > 1);
-		mvm->d0i3_ap_sta_id = IWL_MVM_INVALID_STA;
-		mvm->d0i3_offloading = false;
-	}
-
-	iwl_mvm_pause_tcm(mvm, true);
-	/* make sure we have no running tx while configuring the seqno */
-	synchronize_net();
-
-	/* Flush the hw queues, in case something got queued during entry */
-	/* TODO new tx api */
-	if (iwl_mvm_has_new_tx_api(mvm)) {
-		WARN_ONCE(1, "d0i3: Need to implement flush TX queue\n");
-	} else {
-		ret = iwl_mvm_flush_tx_path(mvm, iwl_mvm_flushable_queues(mvm),
-					    flags);
-		if (ret)
-			return ret;
-	}
-
-	/* configure wowlan configuration only if needed */
-	if (mvm->d0i3_ap_sta_id != IWL_MVM_INVALID_STA) {
-		/* wake on beacons only if beacon storing isn't supported */
-		if (!fw_has_capa(&mvm->fw->ucode_capa,
-				 IWL_UCODE_TLV_CAPA_BEACON_STORING))
-			wowlan_config_cmd.wakeup_filter |=
-				cpu_to_le32(IWL_WOWLAN_WAKEUP_BCN_FILTERING);
-
-		iwl_mvm_wowlan_config_key_params(mvm,
-						 d0i3_iter_data.connected_vif,
-						 true, flags);
-
-		iwl_mvm_set_wowlan_data(mvm, &wowlan_config_cmd,
-					&d0i3_iter_data);
-
-		ret = iwl_mvm_send_cmd_pdu(mvm, WOWLAN_CONFIGURATION, flags,
-					   sizeof(wowlan_config_cmd),
-					   &wowlan_config_cmd);
-		if (ret)
-			return ret;
-	}
-
-	return iwl_mvm_send_cmd_pdu(mvm, D3_CONFIG_CMD,
-				    flags | CMD_MAKE_TRANS_IDLE,
-				    sizeof(d3_cfg_cmd), &d3_cfg_cmd);
-}
-
-static void iwl_mvm_exit_d0i3_iterator(void *_data, u8 *mac,
-				       struct ieee80211_vif *vif)
-{
-	struct iwl_mvm *mvm = _data;
-	u32 flags = CMD_ASYNC | CMD_HIGH_PRIO;
-
-	IWL_DEBUG_RPM(mvm, "exiting D0i3 - vif %pM\n", vif->addr);
-	if (vif->type != NL80211_IFTYPE_STATION ||
-	    !vif->bss_conf.assoc)
-		return;
-
-	iwl_mvm_update_d0i3_power_mode(mvm, vif, false, flags);
-}
-
-struct iwl_mvm_d0i3_exit_work_iter_data {
-	struct iwl_mvm *mvm;
-	struct iwl_wowlan_status *status;
-	u32 wakeup_reasons;
-};
-
-static void iwl_mvm_d0i3_exit_work_iter(void *_data, u8 *mac,
-					struct ieee80211_vif *vif)
-{
-	struct iwl_mvm_d0i3_exit_work_iter_data *data = _data;
-	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
-	u32 reasons = data->wakeup_reasons;
-
-	/* consider only the relevant station interface */
-	if (vif->type != NL80211_IFTYPE_STATION || !vif->bss_conf.assoc ||
-	    data->mvm->d0i3_ap_sta_id != mvmvif->ap_sta_id)
-		return;
-
-	if (reasons & IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH)
-		iwl_mvm_connection_loss(data->mvm, vif, "D0i3");
-	else if (reasons & IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON)
-		ieee80211_beacon_loss(vif);
-	else
-		iwl_mvm_d0i3_update_keys(data->mvm, vif, data->status);
-}
-
-static void iwl_mvm_d0i3_exit_work(struct work_struct *wk)
-{
-	struct iwl_mvm *mvm = container_of(wk, struct iwl_mvm, d0i3_exit_work);
-	struct iwl_mvm_d0i3_exit_work_iter_data iter_data = {
-		.mvm = mvm,
-	};
-
-	struct iwl_wowlan_status *status;
-	u32 wakeup_reasons = 0;
-
-	mutex_lock(&mvm->mutex);
-
-	status = iwl_mvm_send_wowlan_get_status(mvm);
-	if (IS_ERR_OR_NULL(status)) {
-		/* set to NULL so we don't need to check before kfree'ing */
-		status = NULL;
-		goto out;
-	}
-
-	wakeup_reasons = le32_to_cpu(status->wakeup_reasons);
-
-	IWL_DEBUG_RPM(mvm, "wakeup reasons: 0x%x\n", wakeup_reasons);
-
-	iter_data.wakeup_reasons = wakeup_reasons;
-	iter_data.status = status;
-	ieee80211_iterate_active_interfaces(mvm->hw,
-					    IEEE80211_IFACE_ITER_NORMAL,
-					    iwl_mvm_d0i3_exit_work_iter,
-					    &iter_data);
-out:
-	IWL_DEBUG_INFO(mvm, "d0i3 exit completed (wakeup reasons: 0x%x)\n",
-		       wakeup_reasons);
-
-	kfree(status);
-
-	/* the FW might have updated the regdomain */
-	iwl_mvm_update_changed_regdom(mvm);
-
-	iwl_mvm_resume_tcm(mvm);
-	mutex_unlock(&mvm->mutex);
-}
-
-int _iwl_mvm_exit_d0i3(struct iwl_mvm *mvm)
-{
-	u32 flags = CMD_ASYNC | CMD_HIGH_PRIO | CMD_SEND_IN_IDLE |
-		    CMD_WAKE_UP_TRANS;
-	int ret;
-
-	IWL_DEBUG_RPM(mvm, "MVM exiting D0i3\n");
-
-	if (WARN_ON_ONCE(mvm->fwrt.cur_fw_img != IWL_UCODE_REGULAR))
-		return -EINVAL;
-
-	mutex_lock(&mvm->d0i3_suspend_mutex);
-	if (test_bit(D0I3_DEFER_WAKEUP, &mvm->d0i3_suspend_flags)) {
-		IWL_DEBUG_RPM(mvm, "Deferring d0i3 exit until resume\n");
-		__set_bit(D0I3_PENDING_WAKEUP, &mvm->d0i3_suspend_flags);
-		mutex_unlock(&mvm->d0i3_suspend_mutex);
-		return 0;
-	}
-	mutex_unlock(&mvm->d0i3_suspend_mutex);
-
-	ret = iwl_mvm_send_cmd_pdu(mvm, D0I3_END_CMD, flags, 0, NULL);
-	if (ret)
-		goto out;
-
-	ieee80211_iterate_active_interfaces_atomic(mvm->hw,
-						   IEEE80211_IFACE_ITER_NORMAL,
-						   iwl_mvm_exit_d0i3_iterator,
-						   mvm);
-out:
-	schedule_work(&mvm->d0i3_exit_work);
-	return ret;
-}
-
-int iwl_mvm_exit_d0i3(struct iwl_op_mode *op_mode)
-{
-	struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode);
-
-	return _iwl_mvm_exit_d0i3(mvm);
-}
-
-#define IWL_MVM_D0I3_OPS					\
-	.enter_d0i3 = iwl_mvm_enter_d0i3,			\
-	.exit_d0i3 = iwl_mvm_exit_d0i3,
-#else /* CONFIG_PM */
-#define IWL_MVM_D0I3_OPS
-#endif /* CONFIG_PM */
-
 #define IWL_MVM_COMMON_OPS					\
 	/* these could be differentiated */			\
 	.async_cb = iwl_mvm_async_cb,				\
@@ -1687,7 +1338,6 @@ int iwl_mvm_exit_d0i3(struct iwl_op_mode *op_mode)
 	.nic_error = iwl_mvm_nic_error,				\
 	.cmd_queue_full = iwl_mvm_cmd_queue_full,		\
 	.nic_config = iwl_mvm_nic_config,			\
-	IWL_MVM_D0I3_OPS					\
 	/* as we only register one, these MUST be common! */	\
 	.start = iwl_op_mode_mvm_start,				\
 	.stop = iwl_op_mode_mvm_stop
-- 
2.23.0.rc1


^ permalink raw reply related

* [PATCH 17/22] iwlwifi: mvm: remove d0i3_ap_sta_id
From: Luca Coelho @ 2019-08-17  6:51 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless
In-Reply-To: <20190817065200.9701-1-luca@coelho.fi>

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

This variable read, but never set. Remove it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 4 ----
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h      | 3 ---
 drivers/net/wireless/intel/iwlwifi/mvm/sta.c      | 4 ----
 3 files changed, 11 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 2a246f69229d..f4aa121f36f8 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -1071,7 +1071,6 @@ static void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm)
 	ieee80211_iterate_interfaces(mvm->hw, 0, iwl_mvm_cleanup_iterator, mvm);
 
 	mvm->p2p_device_vif = NULL;
-	mvm->d0i3_ap_sta_id = IWL_MVM_INVALID_STA;
 
 	iwl_mvm_reset_phy_ctxts(mvm);
 	memset(mvm->fw_key_table, 0, sizeof(mvm->fw_key_table));
@@ -2335,9 +2334,6 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm,
 					IWL_ERR(mvm,
 						"failed to remove AP station\n");
 
-				if (mvm->d0i3_ap_sta_id == mvmvif->ap_sta_id)
-					mvm->d0i3_ap_sta_id =
-						IWL_MVM_INVALID_STA;
 				mvmvif->ap_sta_id = IWL_MVM_INVALID_STA;
 			}
 
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 03f3faa02781..4a9e8ae99cac 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -1015,9 +1015,6 @@ struct iwl_mvm {
 #endif
 #endif
 
-	/* d0i3 */
-	u8 d0i3_ap_sta_id;
-
 	wait_queue_head_t rx_sync_waitq;
 
 	/* BT-Coex */
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
index 4fae0cb22195..b0f92c9b20f0 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
@@ -1887,10 +1887,6 @@ int iwl_mvm_rm_sta(struct iwl_mvm *mvm,
 
 		/* unassoc - go ahead - remove the AP STA now */
 		mvmvif->ap_sta_id = IWL_MVM_INVALID_STA;
-
-		/* clear d0i3_ap_sta_id if no longer relevant */
-		if (mvm->d0i3_ap_sta_id == sta_id)
-			mvm->d0i3_ap_sta_id = IWL_MVM_INVALID_STA;
 	}
 
 	/*
-- 
2.23.0.rc1


^ permalink raw reply related

* [PATCH 18/22] iwlwifi: mvm: remove iwl_mvm_update_d0i3_power_mode
From: Luca Coelho @ 2019-08-17  6:51 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless
In-Reply-To: <20190817065200.9701-1-luca@coelho.fi>

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

Also change the signature of the power functions that won't
receive d0i3=true anymore.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h  |  3 -
 .../net/wireless/intel/iwlwifi/mvm/power.c    | 82 +++----------------
 2 files changed, 11 insertions(+), 74 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 4a9e8ae99cac..15780e994a30 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -1845,9 +1845,6 @@ iwl_mvm_beacon_filter_debugfs_parameters(struct ieee80211_vif *vif,
 					 struct iwl_beacon_filter_cmd *cmd)
 {}
 #endif
-int iwl_mvm_update_d0i3_power_mode(struct iwl_mvm *mvm,
-				   struct ieee80211_vif *vif,
-				   bool enable, u32 flags);
 int iwl_mvm_enable_beacon_filter(struct iwl_mvm *mvm,
 				 struct ieee80211_vif *vif,
 				 u32 flags);
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/power.c b/drivers/net/wireless/intel/iwlwifi/mvm/power.c
index 36f5fa1ee793..22136e4832ea 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/power.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/power.c
@@ -127,12 +127,11 @@ int iwl_mvm_beacon_filter_send_cmd(struct iwl_mvm *mvm,
 static
 void iwl_mvm_beacon_filter_set_cqm_params(struct iwl_mvm *mvm,
 					  struct ieee80211_vif *vif,
-					  struct iwl_beacon_filter_cmd *cmd,
-					  bool d0i3)
+					  struct iwl_beacon_filter_cmd *cmd)
 {
 	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
 
-	if (vif->bss_conf.cqm_rssi_thold && !d0i3) {
+	if (vif->bss_conf.cqm_rssi_thold) {
 		cmd->bf_energy_delta =
 			cpu_to_le32(vif->bss_conf.cqm_rssi_hyst);
 		/* fw uses an absolute value for this */
@@ -849,8 +848,7 @@ iwl_mvm_beacon_filter_debugfs_parameters(struct ieee80211_vif *vif,
 static int _iwl_mvm_enable_beacon_filter(struct iwl_mvm *mvm,
 					 struct ieee80211_vif *vif,
 					 struct iwl_beacon_filter_cmd *cmd,
-					 u32 cmd_flags,
-					 bool d0i3)
+					 u32 cmd_flags)
 {
 	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
 	int ret;
@@ -859,13 +857,11 @@ static int _iwl_mvm_enable_beacon_filter(struct iwl_mvm *mvm,
 	    vif->type != NL80211_IFTYPE_STATION || vif->p2p)
 		return 0;
 
-	iwl_mvm_beacon_filter_set_cqm_params(mvm, vif, cmd, d0i3);
-	if (!d0i3)
-		iwl_mvm_beacon_filter_debugfs_parameters(vif, cmd);
+	iwl_mvm_beacon_filter_set_cqm_params(mvm, vif, cmd);
+	iwl_mvm_beacon_filter_debugfs_parameters(vif, cmd);
 	ret = iwl_mvm_beacon_filter_send_cmd(mvm, cmd, cmd_flags);
 
-	/* don't change bf_enabled in case of temporary d0i3 configuration */
-	if (!ret && !d0i3)
+	if (!ret)
 		mvmvif->bf_data.bf_enabled = true;
 
 	return ret;
@@ -880,12 +876,12 @@ int iwl_mvm_enable_beacon_filter(struct iwl_mvm *mvm,
 		.bf_enable_beacon_filter = cpu_to_le32(1),
 	};
 
-	return _iwl_mvm_enable_beacon_filter(mvm, vif, &cmd, flags, false);
+	return _iwl_mvm_enable_beacon_filter(mvm, vif, &cmd, flags);
 }
 
 static int _iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm,
 					  struct ieee80211_vif *vif,
-					  u32 flags, bool d0i3)
+					  u32 flags)
 {
 	struct iwl_beacon_filter_cmd cmd = {};
 	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
@@ -896,8 +892,7 @@ static int _iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm,
 
 	ret = iwl_mvm_beacon_filter_send_cmd(mvm, &cmd, flags);
 
-	/* don't change bf_enabled in case of temporary d0i3 configuration */
-	if (!ret && !d0i3)
+	if (!ret)
 		mvmvif->bf_data.bf_enabled = false;
 
 	return ret;
@@ -907,7 +902,7 @@ int iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm,
 				  struct ieee80211_vif *vif,
 				  u32 flags)
 {
-	return _iwl_mvm_disable_beacon_filter(mvm, vif, flags, false);
+	return _iwl_mvm_disable_beacon_filter(mvm, vif, flags);
 }
 
 static int iwl_mvm_power_set_ps(struct iwl_mvm *mvm)
@@ -958,7 +953,7 @@ static int iwl_mvm_power_set_ba(struct iwl_mvm *mvm,
 				       !vif->bss_conf.ps ||
 				       iwl_mvm_vif_low_latency(mvmvif));
 
-	return _iwl_mvm_enable_beacon_filter(mvm, vif, &cmd, 0, false);
+	return _iwl_mvm_enable_beacon_filter(mvm, vif, &cmd, 0);
 }
 
 int iwl_mvm_power_update_ps(struct iwl_mvm *mvm)
@@ -1022,58 +1017,3 @@ int iwl_mvm_power_update_mac(struct iwl_mvm *mvm)
 
 	return 0;
 }
-
-int iwl_mvm_update_d0i3_power_mode(struct iwl_mvm *mvm,
-				   struct ieee80211_vif *vif,
-				   bool enable, u32 flags)
-{
-	int ret;
-	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
-	struct iwl_mac_power_cmd cmd = {};
-
-	if (vif->type != NL80211_IFTYPE_STATION || vif->p2p)
-		return 0;
-
-	if (!vif->bss_conf.assoc)
-		return 0;
-
-	iwl_mvm_power_build_cmd(mvm, vif, &cmd, !enable);
-
-	iwl_mvm_power_log(mvm, &cmd);
-#ifdef CONFIG_IWLWIFI_DEBUGFS
-	memcpy(&mvmvif->mac_pwr_cmd, &cmd, sizeof(cmd));
-#endif
-	ret = iwl_mvm_send_cmd_pdu(mvm, MAC_PM_POWER_TABLE, flags,
-				   sizeof(cmd), &cmd);
-	if (ret)
-		return ret;
-
-	/* configure beacon filtering */
-	if (mvmvif != mvm->bf_allowed_vif)
-		return 0;
-
-	if (enable) {
-		struct iwl_beacon_filter_cmd cmd_bf = {
-			IWL_BF_CMD_CONFIG_D0I3,
-			.bf_enable_beacon_filter = cpu_to_le32(1),
-		};
-		/*
-		 * When beacon storing is supported - disable beacon filtering
-		 * altogether - the latest beacon will be sent when exiting d0i3
-		 */
-		if (fw_has_capa(&mvm->fw->ucode_capa,
-				IWL_UCODE_TLV_CAPA_BEACON_STORING))
-			ret = _iwl_mvm_disable_beacon_filter(mvm, vif, flags,
-							     true);
-		else
-			ret = _iwl_mvm_enable_beacon_filter(mvm, vif, &cmd_bf,
-							    flags, true);
-	} else {
-		if (mvmvif->bf_data.bf_enabled)
-			ret = iwl_mvm_enable_beacon_filter(mvm, vif, flags);
-		else
-			ret = iwl_mvm_disable_beacon_filter(mvm, vif, flags);
-	}
-
-	return ret;
-}
-- 
2.23.0.rc1


^ permalink raw reply related

* [PATCH 19/22] iwlwifi: mvm: remove last leftovers of d0i3
From: Luca Coelho @ 2019-08-17  6:51 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless
In-Reply-To: <20190817065200.9701-1-luca@coelho.fi>

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

We're now left with a status bit that is never set and a few
other leftovers.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 3 ---
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h      | 7 -------
 drivers/net/wireless/intel/iwlwifi/mvm/sta.c      | 7 -------
 3 files changed, 17 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index f4aa121f36f8..e49558fb8aa3 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -1079,9 +1079,6 @@ static void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm)
 
 	ieee80211_wake_queues(mvm->hw);
 
-	/* clear any stale d0i3 state */
-	clear_bit(IWL_MVM_STATUS_IN_D0I3, &mvm->status);
-
 	mvm->vif_count = 0;
 	mvm->rx_ba_sessions = 0;
 	mvm->fwrt.dump.conf = FW_DBG_INVALID;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 15780e994a30..ed52e2ea97d9 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -588,11 +588,6 @@ struct iwl_mvm_frame_stats {
 	int last_frame_idx;
 };
 
-enum {
-	D0I3_DEFER_WAKEUP,
-	D0I3_PENDING_WAKEUP,
-};
-
 #define IWL_MVM_DEBUG_SET_TEMPERATURE_DISABLE 0xff
 #define IWL_MVM_DEBUG_SET_TEMPERATURE_MIN -100
 #define IWL_MVM_DEBUG_SET_TEMPERATURE_MAX 200
@@ -1157,7 +1152,6 @@ struct iwl_mvm {
  * @IWL_MVM_STATUS_ROC_RUNNING: remain-on-channel is running
  * @IWL_MVM_STATUS_HW_RESTART_REQUESTED: HW restart was requested
  * @IWL_MVM_STATUS_IN_HW_RESTART: HW restart is active
- * @IWL_MVM_STATUS_IN_D0I3: NIC is in D0i3
  * @IWL_MVM_STATUS_ROC_AUX_RUNNING: AUX remain-on-channel is running
  * @IWL_MVM_STATUS_FIRMWARE_RUNNING: firmware is running
  * @IWL_MVM_STATUS_NEED_FLUSH_P2P: need to flush P2P bcast STA
@@ -1168,7 +1162,6 @@ enum iwl_mvm_status {
 	IWL_MVM_STATUS_ROC_RUNNING,
 	IWL_MVM_STATUS_HW_RESTART_REQUESTED,
 	IWL_MVM_STATUS_IN_HW_RESTART,
-	IWL_MVM_STATUS_IN_D0I3,
 	IWL_MVM_STATUS_ROC_AUX_RUNNING,
 	IWL_MVM_STATUS_FIRMWARE_RUNNING,
 	IWL_MVM_STATUS_NEED_FLUSH_P2P,
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
index b0f92c9b20f0..aa0a2a3e0875 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
@@ -2759,13 +2759,6 @@ int iwl_mvm_sta_tx_agg_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 
 	spin_lock_bh(&mvmsta->lock);
 
-	/* possible race condition - we entered D0i3 while starting agg */
-	if (test_bit(IWL_MVM_STATUS_IN_D0I3, &mvm->status)) {
-		spin_unlock_bh(&mvmsta->lock);
-		IWL_ERR(mvm, "Entered D0i3 while starting Tx agg\n");
-		return -EIO;
-	}
-
 	/*
 	 * Note the possible cases:
 	 *  1. An enabled TXQ - TXQ needs to become agg'ed
-- 
2.23.0.rc1


^ permalink raw reply related

* [PATCH 22/22] iwlwifi: remove the code under IWLWIFI_PCIE_RTPM
From: Luca Coelho @ 2019-08-17  6:52 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless
In-Reply-To: <20190817065200.9701-1-luca@coelho.fi>

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

This is never set.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/Kconfig    | 14 ----
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 71 -------------------
 .../net/wireless/intel/iwlwifi/pcie/trans.c   |  4 --
 3 files changed, 89 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/Kconfig b/drivers/net/wireless/intel/iwlwifi/Kconfig
index 235349a33a3c..7dbc0d38bb3b 100644
--- a/drivers/net/wireless/intel/iwlwifi/Kconfig
+++ b/drivers/net/wireless/intel/iwlwifi/Kconfig
@@ -92,20 +92,6 @@ config IWLWIFI_BCAST_FILTERING
 	  If unsure, don't enable this option, as some programs might
 	  expect incoming broadcasts for their normal operations.
 
-config IWLWIFI_PCIE_RTPM
-       bool "Enable runtime power management mode for PCIe devices"
-       depends on IWLMVM && PM && EXPERT
-       help
-         Say Y here to enable runtime power management for PCIe
-         devices.  If enabled, the device will go into low power mode
-         when idle for a short period of time, allowing for improved
-         power saving during runtime. Note that this feature requires
-         a tight integration with the platform. It is not recommended
-         to enable this feature without proper validation with the
-         specific target platform.
-
-	 If unsure, say N.
-
 menu "Debugging Options"
 
 config IWLWIFI_DEBUG
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index 407abc835012..2a34f074d72c 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -1248,80 +1248,9 @@ int iwl_pci_fw_exit_d0i3(struct iwl_trans *trans)
 	return ret;
 }
 
-#ifdef CONFIG_IWLWIFI_PCIE_RTPM
-static int iwl_pci_runtime_suspend(struct device *device)
-{
-	struct pci_dev *pdev = to_pci_dev(device);
-	struct iwl_trans *trans = pci_get_drvdata(pdev);
-	int ret;
-
-	IWL_DEBUG_RPM(trans, "entering runtime suspend\n");
-
-	if (test_bit(STATUS_DEVICE_ENABLED, &trans->status)) {
-		ret = iwl_pci_fw_enter_d0i3(trans);
-		if (ret < 0)
-			return ret;
-	}
-
-	trans->system_pm_mode = IWL_PLAT_PM_MODE_D0I3;
-
-	iwl_trans_d3_suspend(trans, false, false);
-
-	return 0;
-}
-
-static int iwl_pci_runtime_resume(struct device *device)
-{
-	struct pci_dev *pdev = to_pci_dev(device);
-	struct iwl_trans *trans = pci_get_drvdata(pdev);
-	enum iwl_d3_status d3_status;
-
-	IWL_DEBUG_RPM(trans, "exiting runtime suspend (resume)\n");
-
-	iwl_trans_d3_resume(trans, &d3_status, false, false);
-
-	if (test_bit(STATUS_DEVICE_ENABLED, &trans->status))
-		return iwl_pci_fw_exit_d0i3(trans);
-
-	return 0;
-}
-
-static int iwl_pci_system_prepare(struct device *device)
-{
-	struct pci_dev *pdev = to_pci_dev(device);
-	struct iwl_trans *trans = pci_get_drvdata(pdev);
-
-	IWL_DEBUG_RPM(trans, "preparing for system suspend\n");
-
-	/* Wake the device up from runtime suspend before going to
-	 * platform suspend.  This is needed because we don't know
-	 * whether wowlan any is set and, if it's not, mac80211 will
-	 * disconnect (in which case, we can't be in D0i3).
-	 */
-	pm_runtime_resume(device);
-
-	return 0;
-}
-
-static void iwl_pci_system_complete(struct device *device)
-{
-	struct pci_dev *pdev = to_pci_dev(device);
-	struct iwl_trans *trans = pci_get_drvdata(pdev);
-
-	IWL_DEBUG_RPM(trans, "completing system suspend\n");
-}
-#endif /* CONFIG_IWLWIFI_PCIE_RTPM */
-
 static const struct dev_pm_ops iwl_dev_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(iwl_pci_suspend,
 				iwl_pci_resume)
-#ifdef CONFIG_IWLWIFI_PCIE_RTPM
-	SET_RUNTIME_PM_OPS(iwl_pci_runtime_suspend,
-			   iwl_pci_runtime_resume,
-			   NULL)
-	.prepare = iwl_pci_system_prepare,
-	.complete = iwl_pci_system_complete,
-#endif /* CONFIG_IWLWIFI_PCIE_RTPM */
 };
 
 #define IWL_PM_OPS	(&iwl_dev_pm_ops)
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
index a6deb61a3ab4..a423c5c6605e 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
@@ -3658,11 +3658,7 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
 						   WQ_HIGHPRI | WQ_UNBOUND, 1);
 	INIT_WORK(&trans_pcie->rba.rx_alloc, iwl_pcie_rx_allocator_work);
 
-#ifdef CONFIG_IWLWIFI_PCIE_RTPM
-	trans->runtime_pm_mode = IWL_PLAT_PM_MODE_D0I3;
-#else
 	trans->runtime_pm_mode = IWL_PLAT_PM_MODE_DISABLED;
-#endif /* CONFIG_IWLWIFI_PCIE_RTPM */
 
 #ifdef CONFIG_IWLWIFI_DEBUGFS
 	trans_pcie->fw_mon_data.state = IWL_FW_MON_DBGFS_STATE_CLOSED;
-- 
2.23.0.rc1


^ permalink raw reply related

* [PATCH 10/22] iwlwifi: mvm: fix scan config command size
From: Luca Coelho @ 2019-08-17  6:51 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless
In-Reply-To: <20190817065200.9701-1-luca@coelho.fi>

From: Beker Ayala <ayala.beker@intel.com>

Use the actual length of channels array and not the max capable length.

Signed-off-by: Beker Ayala <ayala.beker@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
index c284e6975b1b..5999b4ebd699 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
@@ -1205,7 +1205,7 @@ int iwl_mvm_config_scan(struct iwl_mvm *mvm)
 		cmd_size = sizeof(struct iwl_scan_config);
 	else
 		cmd_size = sizeof(struct iwl_scan_config_v1);
-	cmd_size += mvm->fw->ucode_capa.n_scan_channels;
+	cmd_size += num_channels;
 
 	cfg = kzalloc(cmd_size, GFP_KERNEL);
 	if (!cfg)
-- 
2.23.0.rc1


^ permalink raw reply related

* Re: PROBLEM: 5.3.0-rc* causes iwlwifi failure
From: Serge Belyshev @ 2019-08-17  8:59 UTC (permalink / raw)
  To: Stuart Little
  Cc: Johannes Berg, Emmanuel Grumbach, Luca Coelho, kernel list,
	Intel Linux Wireless, linux-wireless, Haim Dreyfuss
In-Reply-To: <20190817041258.GA1641@chirva-slack.chirva-slack>


> I am on an Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz running Linux
> x86_64 (Slackware), with a custom-compiled 5.3.0-rc4 (.config
> attached).
>
> I am using the Intel wifi adapter on this machine:
>
> 02:00.0 Network controller: Intel Corporation Device 24fb (rev 10)
>
> with the iwlwifi driver. I am attaching the output to 'lspci -vv -s
> 02:00.0' as the file device-info.
>
> All 5.3.0-rc* versions I have tried (including rc4) cause multiple
> dmesg iwlwifi-related errors (dmesg attached). Examples:
>
> iwlwifi 0000:02:00.0: Failed to get geographic profile info -5
> iwlwifi 0000:02:00.0: Microcode SW error detected.  Restarting 0x82000000
> iwlwifi 0000:02:00.0: 0x00000038 | BAD_COMMAND
>

I have my logs filled with similar garbage throughout 5.3-rc*. Also
since 5.3-rcsomething not only it WARNS in dmesg about firmware failure,
but completely stops working after suspend/resume cycle.

It looks like that:

commit 4fd445a2c855bbcab81fbe06d110e78dbd974a5b
Author: Haim Dreyfuss <haim.dreyfuss@intel.com>
Date:   Thu May 2 11:45:02 2019 +0300

    iwlwifi: mvm: Add log information about SAR status
    
    Inform users when SAR status is changing.
    
    Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
    Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


is the culprit. (manually) reverting it on top of 5.3-rc4 makes
everything work again.

^ permalink raw reply

* Re: [PATCH 4/4] iwlwifi: Enable Extended Key ID for mvm and dvm
From: Alexander Wetzel @ 2019-08-17  8:31 UTC (permalink / raw)
  To: johannes, Luca Coelho; +Cc: linux-wireless
In-Reply-To: <20190629195015.19680-4-alexander@wetzel-home.de>

> All iwlwifi cards are able to handle multiple keyids per STA and are
> therefore fully compatible with the Extended Key ID implementation
> provided by mac80211.

I just tried Extended Key ID with a AX200 card and it really looks like 
it's incompatible:-(

The card is starting to use the PTK key immediately after installation, 
encrypting EAPOL #3 with the new (still Rx only!) key.

Digging around in the driver code it looks like we do not even pass the 
key information any longer to the card: iwl_mvm_set_tx_params() is 
bypassing iwl_mvm_set_tx_cmd_crypto() completely when we use the "new tx 
API". So all cards setting "use_tfh" to true are now incompatible.

Therefore it looks like that all cards starting with the 22000 series 
can't be used with Extended Key ID any longer.

Is there a way to hand over the key information within the new API or is 
the way forward to block Extended Key ID when the "new tx API" is being 
used?

The card is fine with using keyid 1 for unicast keys. But it looks like 
it assumes that a new key install also tells it to use the new key 
immediately... Still digging around but pretty sure that's happening now.

Alexander

^ permalink raw reply

* Re: Flag for detecting 802.11r Fast BSS Transition support
From: Marcel Holtmann @ 2019-08-17 13:40 UTC (permalink / raw)
  To: Brian Norris
  Cc: Johannes Berg, Matthew Wang, linux-wireless, Kirtika Ruchandani,
	Jouni Malinen
In-Reply-To: <CA+ASDXNC0hwFzSTvZmUq-B7r_H+pZ3N=p_kjfMqKb1gftsmDKw@mail.gmail.com>

Hi Brian,

>>> Well, I guess we could just run the command and look for EOPNOTSUPP...
>> 
>> this kind of API design and usage is bad. Try-and-error approach is just not sustainable.
> 
> Sure. That "suggestion" was quite literally an afterthought. Not
> really a proper suggestion.
> 
>> Even while it is late to add a proper flag that indicates support, we need to do this to make nl80211 better for the future.
> 
> I suppose. I'm not quite sure how I would make use of that properly
> though, given the corpus of kernels out there where the flag doesn't
> exist (but the feature does). Some other heurestic for determining
> kernel recency? Compile-time flags for the relevant user space, such
> that one builds it for "new kernel API (w/ flag)" vs. "old kernel API"
> (with the latter not even trying to look for the flag)?
> 
> Or I guess a more proactive approach: implement both a "supported" and
> an "unsupported" flag, so user space can figure out a tristate: flag
> not available (old kernel -- user space is left to guess) vs. command
> supported flag vs. command not supported flag.
> 
> That seems a bit awkward though.

I would not make it this complicated. Add the flag for future kernels and the move on with life. Trying to workaround older versions is something I would not bother with. It is always possible to backport the feature to older kernels. And if you have a distribution or an OEM that cares, then that is what is going to happen.

Regards

Marcel


^ permalink raw reply

* Re: PROBLEM: 5.3.0-rc* causes iwlwifi failure
From: Stuart Little @ 2019-08-17 13:45 UTC (permalink / raw)
  To: Serge Belyshev
  Cc: Johannes Berg, Emmanuel Grumbach, Luca Coelho, kernel list,
	Intel Linux Wireless, linux-wireless, Haim Dreyfuss
In-Reply-To: <87y2zsf9ps.fsf@depni.sinp.msu.ru>

On Sat, Aug 17, 2019 at 11:59:59AM +0300, Serge Belyshev wrote:
> It looks like that:
> 
> commit 4fd445a2c855bbcab81fbe06d110e78dbd974a5b
> Author: Haim Dreyfuss <haim.dreyfuss@intel.com>
> Date:   Thu May 2 11:45:02 2019 +0300
> 
>     iwlwifi: mvm: Add log information about SAR status
>     
>     Inform users when SAR status is changing.
>     
>     Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
>     Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> 
> 
> is the culprit. (manually) reverting it on top of 5.3-rc4 makes
> everything work again.

Revert how?

git revert 4fd445a2c855bbcab81fbe06d110e78dbd974a5b

errors out:

warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your merge.renamelimit variable to at least 1583 and retry the command.
error: could not revert 4fd445a2c855... iwlwifi: mvm: Add log information about SAR status
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'

Making a patch out of the commit with

git format-patch -1 4fd445a2c855bbcab81fbe06d110e78dbd974a5b

and attempting to apply the patch in reverse with

git apply -R --ignore-space-change --ignore-whitespace <patch filename>

also fails:

error: patch failed: drivers/net/wireless/intel/iwlwifi/mvm/fw.c:861
error: drivers/net/wireless/intel/iwlwifi/mvm/fw.c: patch does not apply
error: patch failed: drivers/net/wireless/intel/iwlwifi/mvm/nvm.c:620
error: drivers/net/wireless/intel/iwlwifi/mvm/nvm.c: patch does not apply

^ permalink raw reply

* Re: iwlwifi: 9260: Spurious "Unhandled alg: 0x707" and 0x71b
From: Grumbach, Emmanuel @ 2019-08-17 20:01 UTC (permalink / raw)
  To: Peer, Ilan, angelsl@in04.sg; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <badc218b-ea1f-3697-b1f2-3ebb294d9849@in04.sg>

Hi,

On Fri, 2019-08-16 at 16:55 +0800, Tee Hao Wei wrote:
> Hi,
> 
> I've been getting "Unhandled alg: 0x707" or 0x71b randomly
> on my Intel 9260. It seems to happen most often when it
> associates to a new AP (or roams to a different one that
> has the same SSID/authentication). It also seems to happen
> only with particular APs. (I don't have access to the APs,
> so there's not much I know about them.)
> 
> I applied the two patches mentioned in Bugzilla #203593[1]
> i.e. "iwlwifi: mvm: Allow multicast data frames only when
> associated" and "iwlwifi: mvm: Allow multicast data frames
> only when authorized" on top of iwlwifi in 5.2.8, which
> improved the situation a lot, but it still happens pretty
> frequently.
> 
> [1]: https://bugzilla.kernel.org/show_bug.cgi?id=203593

This print is harmless really. After this bug has been reported, I have
been contact by the firmware team who wanted to deprecate the flag that
we change in the bug for that Bugzilla, so that the fix will be a no-op 
for newer firmware. Bottom line, we are removing this print, or we are
leaving it only for unicast packets. This has been merged in our
internal repository and it will be upstreamed following the regular
process.

You can find it here in our backport based driver:

https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/backport-iwlwifi.git/commit/?id=f9b9f92dd84c5c467cbcc620584864de8fbfb56c


> 
> I'll try to collect some debug data soon. Also, I'll try
> to see if my 8260 has the same issues.
> 
> Is there anything else I should try or any other patches I
> should backport?
> 
> Thanks.
> 

^ permalink raw reply

* Re: PROBLEM: 5.3.0-rc* causes iwlwifi failure
From: Stuart Little @ 2019-08-17 21:44 UTC (permalink / raw)
  To: Serge Belyshev
  Cc: Johannes Berg, Emmanuel Grumbach, Luca Coelho, kernel list,
	Intel Linux Wireless, linux-wireless, Haim Dreyfuss
In-Reply-To: <87y2zsf9ps.fsf@depni.sinp.msu.ru>

After some private coaching from Serge Belyshev on git-revert I can confirm that reverting that commit atop the current tree resolves the issue (the wifi card scans for and finds networks just fine, no dmesg errors reported, etc.).

On Sat, Aug 17, 2019 at 11:59:59AM +0300, Serge Belyshev wrote:
> 
> > I am on an Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz running Linux
> > x86_64 (Slackware), with a custom-compiled 5.3.0-rc4 (.config
> > attached).
> >
> > I am using the Intel wifi adapter on this machine:
> >
> > 02:00.0 Network controller: Intel Corporation Device 24fb (rev 10)
> >
> > with the iwlwifi driver. I am attaching the output to 'lspci -vv -s
> > 02:00.0' as the file device-info.
> >
> > All 5.3.0-rc* versions I have tried (including rc4) cause multiple
> > dmesg iwlwifi-related errors (dmesg attached). Examples:
> >
> > iwlwifi 0000:02:00.0: Failed to get geographic profile info -5
> > iwlwifi 0000:02:00.0: Microcode SW error detected.  Restarting 0x82000000
> > iwlwifi 0000:02:00.0: 0x00000038 | BAD_COMMAND
> >
> 
> I have my logs filled with similar garbage throughout 5.3-rc*. Also
> since 5.3-rcsomething not only it WARNS in dmesg about firmware failure,
> but completely stops working after suspend/resume cycle.
> 
> It looks like that:
> 
> commit 4fd445a2c855bbcab81fbe06d110e78dbd974a5b
> Author: Haim Dreyfuss <haim.dreyfuss@intel.com>
> Date:   Thu May 2 11:45:02 2019 +0300
> 
>     iwlwifi: mvm: Add log information about SAR status
>     
>     Inform users when SAR status is changing.
>     
>     Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
>     Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> 
> 
> is the culprit. (manually) reverting it on top of 5.3-rc4 makes
> everything work again.

^ permalink raw reply

* Re: PROBLEM: 5.3.0-rc* causes iwlwifi failure
From: Chris Clayton @ 2019-08-18  8:17 UTC (permalink / raw)
  To: achirvasub, LKML, linux-wireless
In-Reply-To: <20190817214448.GB1070 () chirva-slack ! chirva-slack>



On 17/08/2019 22:44, Stuart Little wrote:
> After some private coaching from Serge Belyshev on git-revert I can confirm that reverting that commit atop the current tree resolves the issue (the wifi card scans for and finds networks just fine, no dmesg errors reported, etc.).
> 

I've reported the "Microcode SW error detected" issue too, but, wrongly, only to LKML. I'll point that thread to this
one. I've also been experiencing my network stopping working after suspend resume, but haven't got round to reporting
that yet.

What was the git magic that you acquired to revert the patch, please?

> On Sat, Aug 17, 2019 at 11:59:59AM +0300, Serge Belyshev wrote:
>>
>>> I am on an Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz running Linux
>>> x86_64 (Slackware), with a custom-compiled 5.3.0-rc4 (.config
>>> attached).
>>>
>>> I am using the Intel wifi adapter on this machine:
>>>
>>> 02:00.0 Network controller: Intel Corporation Device 24fb (rev 10)
>>>
>>> with the iwlwifi driver. I am attaching the output to 'lspci -vv -s
>>> 02:00.0' as the file device-info.
>>>
>>> All 5.3.0-rc* versions I have tried (including rc4) cause multiple
>>> dmesg iwlwifi-related errors (dmesg attached). Examples:
>>>
>>> iwlwifi 0000:02:00.0: Failed to get geographic profile info -5
>>> iwlwifi 0000:02:00.0: Microcode SW error detected.  Restarting 0x82000000
>>> iwlwifi 0000:02:00.0: 0x00000038 | BAD_COMMAND
>>>
>>
>> I have my logs filled with similar garbage throughout 5.3-rc*. Also
>> since 5.3-rcsomething not only it WARNS in dmesg about firmware failure,
>> but completely stops working after suspend/resume cycle.
>>
>> It looks like that:
>>
>> commit 4fd445a2c855bbcab81fbe06d110e78dbd974a5b
>> Author: Haim Dreyfuss <haim.dreyfuss@intel.com>
>> Date:   Thu May 2 11:45:02 2019 +0300
>>
>>     iwlwifi: mvm: Add log information about SAR status
>>     
>>     Inform users when SAR status is changing.
>>     
>>     Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
>>     Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
>>
>>
>> is the culprit. (manually) reverting it on top of 5.3-rc4 makes
>> everything work again.
> 

^ permalink raw reply

* wifi on Motorola Droid 4 in 5.3-rc2
From: Pavel Machek @ 2019-08-18 10:46 UTC (permalink / raw)
  To: kernel list, linux-arm-kernel, linux-omap, tony, sre, nekit1000,
	mpartap, merlijn
  Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1227 bytes --]

Hi!

First, I guess I should mention that this is first time I'm attempting
to get wifi going on D4.

I'm getting this:

user@devuan:~/g/ofono$ sudo ifconfig wlan0 down
user@devuan:~/g/ofono$ sudo ifconfig wlan0 up
user@devuan:~/g/ofono$ sudo iwlist wlan0 scan
wlan0     Interface doesn't support scanning.

user@devuan:~/g/ofono$ sudo ifconfig wlan0 down
user@devuan:~/g/ofono$ sudo iwlist wlan0 scan
wlan0     Interface doesn't support scanning.

user@devuan:~/g/ofono$

I'm getting this warning during bootup:

[   13.733703] asoc-audio-graph-card soundcard: No GPIO consumer pa
found
[   14.279724] wlcore: WARNING Detected unconfigured mac address in
nvs, derive from fuse instead.
[   14.293273] wlcore: WARNING Your device performance is not
optimized.
[   14.304443] wlcore: WARNING Please use the calibrator tool to
configure your device.
[   14.317474] wlcore: loaded
[   16.977325] motmdm serial0-0: motmdm_dlci_send_command: AT+VERSION=
got MASERATIBP_N_05.25.00R,026.0R,XSAMASR01VRZNA026.0R,???

Any ideas?

Best regards,
									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply

* Re: wifi on Motorola Droid 4 in 5.3-rc2
From: Michael Nazzareno Trimarchi @ 2019-08-18 10:53 UTC (permalink / raw)
  To: Pavel Machek
  Cc: kernel list, linux-arm-kernel, Linux OMAP Mailing List,
	Tony Lindgren, Sebastian Reichel, nekit1000, mpartap,
	Merlijn Wajer, open list:TI WILINK WIRELES...
In-Reply-To: <20190818104629.GA27360@amd>

Hi

On Sun, Aug 18, 2019 at 12:46 PM Pavel Machek <pavel@ucw.cz> wrote:
>
> Hi!
>
> First, I guess I should mention that this is first time I'm attempting
> to get wifi going on D4.
>
> I'm getting this:
>
> user@devuan:~/g/ofono$ sudo ifconfig wlan0 down
> user@devuan:~/g/ofono$ sudo ifconfig wlan0 up
> user@devuan:~/g/ofono$ sudo iwlist wlan0 scan
> wlan0     Interface doesn't support scanning.
>

Try to use iw command. iwlist use an obsolete interface that you need
to activate in kernel for back compatibility with old command. Can be
your problem?

Michael

> user@devuan:~/g/ofono$ sudo ifconfig wlan0 down
> user@devuan:~/g/ofono$ sudo iwlist wlan0 scan
> wlan0     Interface doesn't support scanning.
>
> user@devuan:~/g/ofono$
>
> I'm getting this warning during bootup:
>
> [   13.733703] asoc-audio-graph-card soundcard: No GPIO consumer pa
> found
> [   14.279724] wlcore: WARNING Detected unconfigured mac address in
> nvs, derive from fuse instead.
> [   14.293273] wlcore: WARNING Your device performance is not
> optimized.
> [   14.304443] wlcore: WARNING Please use the calibrator tool to
> configure your device.
> [   14.317474] wlcore: loaded
> [   16.977325] motmdm serial0-0: motmdm_dlci_send_command: AT+VERSION=
> got MASERATIBP_N_05.25.00R,026.0R,XSAMASR01VRZNA026.0R,???
>
> Any ideas?
>
> Best regards,
>                                                                         Pavel
>
> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html



-- 
| Michael Nazzareno Trimarchi                     Amarula Solutions BV |
| COO  -  Founder                                      Cruquiuskade 47 |
| +31(0)851119172                                 Amsterdam 1018 AM NL |
|                  [`as] http://www.amarulasolutions.com               |

^ permalink raw reply

* Re: PROBLEM: 5.3.0-rc* causes iwlwifi failure
From: Stuart Little @ 2019-08-18 10:55 UTC (permalink / raw)
  To: Chris Clayton; +Cc: LKML, linux-wireless
In-Reply-To: <fd102579-d83d-b86d-e165-8168c74a4bac@googlemail.com>

On Sun, Aug 18, 2019 at 09:17:59AM +0100, Chris Clayton wrote:
> 
> 
> On 17/08/2019 22:44, Stuart Little wrote:
> > After some private coaching from Serge Belyshev on git-revert I can confirm that reverting that commit atop the current tree resolves the issue (the wifi card scans for and finds networks just fine, no dmesg errors reported, etc.).
> > 
> 
> I've reported the "Microcode SW error detected" issue too, but, wrongly, only to LKML. I'll point that thread to this
> one. I've also been experiencing my network stopping working after suspend resume, but haven't got round to reporting
> that yet.
> 
> What was the git magic that you acquired to revert the patch, please?
> 

$ git revert <offending commit>

This will fail as noted, but will place in a revert mode where you can fix the errors.

$ git status

will show (it did in my case, for the latest Linux tree at the time I did this) a modified file

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

to be committed without issue and a conflicted file

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

whose conflicts you have to first resolve.

I then opened that conflicted file in a text editor and simply removed everything between the lines

<<<<<<< HEAD

and 

>>>>>>> parent of 4fd445a2c855... iwlwifi: mvm: Add log information about SAR status

(inclusive). This resolved the conflict, whereupon

$ git revert --continue

and

$ git commit -a

will finish the reversion. 

> > On Sat, Aug 17, 2019 at 11:59:59AM +0300, Serge Belyshev wrote:
> >>
> >>> I am on an Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz running Linux
> >>> x86_64 (Slackware), with a custom-compiled 5.3.0-rc4 (.config
> >>> attached).
> >>>
> >>> I am using the Intel wifi adapter on this machine:
> >>>
> >>> 02:00.0 Network controller: Intel Corporation Device 24fb (rev 10)
> >>>
> >>> with the iwlwifi driver. I am attaching the output to 'lspci -vv -s
> >>> 02:00.0' as the file device-info.
> >>>
> >>> All 5.3.0-rc* versions I have tried (including rc4) cause multiple
> >>> dmesg iwlwifi-related errors (dmesg attached). Examples:
> >>>
> >>> iwlwifi 0000:02:00.0: Failed to get geographic profile info -5
> >>> iwlwifi 0000:02:00.0: Microcode SW error detected.  Restarting 0x82000000
> >>> iwlwifi 0000:02:00.0: 0x00000038 | BAD_COMMAND
> >>>
> >>
> >> I have my logs filled with similar garbage throughout 5.3-rc*. Also
> >> since 5.3-rcsomething not only it WARNS in dmesg about firmware failure,
> >> but completely stops working after suspend/resume cycle.
> >>
> >> It looks like that:
> >>
> >> commit 4fd445a2c855bbcab81fbe06d110e78dbd974a5b
> >> Author: Haim Dreyfuss <haim.dreyfuss@intel.com>
> >> Date:   Thu May 2 11:45:02 2019 +0300
> >>
> >>     iwlwifi: mvm: Add log information about SAR status
> >>     
> >>     Inform users when SAR status is changing.
> >>     
> >>     Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
> >>     Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> >>
> >>
> >> is the culprit. (manually) reverting it on top of 5.3-rc4 makes
> >> everything work again.
> > 

^ permalink raw reply

* Re: wifi on Motorola Droid 4 in 5.3-rc2
From: Pavel Machek @ 2019-08-18 11:43 UTC (permalink / raw)
  To: Michael Nazzareno Trimarchi
  Cc: kernel list, linux-arm-kernel, Linux OMAP Mailing List,
	Tony Lindgren, Sebastian Reichel, nekit1000, mpartap,
	Merlijn Wajer, open list:TI WILINK WIRELES...
In-Reply-To: <CAOf5uwnUx3mtGGHFGqKB30qcb_AMhMEhHLp2pf-4pUdhi7KP7w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3271 bytes --]

On Sun 2019-08-18 12:53:01, Michael Nazzareno Trimarchi wrote:
> Hi
> 
> On Sun, Aug 18, 2019 at 12:46 PM Pavel Machek <pavel@ucw.cz> wrote:
> >
> > Hi!
> >
> > First, I guess I should mention that this is first time I'm attempting
> > to get wifi going on D4.
> >
> > I'm getting this:
> >
> > user@devuan:~/g/ofono$ sudo ifconfig wlan0 down
> > user@devuan:~/g/ofono$ sudo ifconfig wlan0 up
> > user@devuan:~/g/ofono$ sudo iwlist wlan0 scan
> > wlan0     Interface doesn't support scanning.
> >
> 
> Try to use iw command. iwlist use an obsolete interface that you need
> to activate in kernel for back compatibility with old command. Can be
> your problem?

Let me see ... CONFIG_CFG80211_WEXT was not set.

Tried enabling it, and now I got. I remember getting it before,
too... let me try few more boots, perhaps it is random.

Best regards,
								Pavel



[   13.653778] panel-dsi-cm 58004000.encoder:display: using lookup
tables for GPIO lookup
[   13.661834] panel-dsi-cm 58004000.encoder:display: No GPIO consumer
te found
[   14.756622] ------------[ cut here ]------------
[   14.761352] WARNING: CPU: 0 PID: 20 at
/data/fast/l/k/drivers/net/wireless/ti/wlcore/sdio.c:86
wl12xx_sdio_raw_read+0xa8/0x128
[   14.772888] Modules linked in:
[   14.776062] CPU: 0 PID: 20 Comm: kworker/0:1 Tainted: G        W
5.3.0-rc4-58571-gdbaece1 #85
[   14.783630] Hardware name: Generic OMAP4 (Flattened Device Tree)
[   14.791381] Workqueue: events request_firmware_work_func
[   14.796813] [<c010f2b4>] (unwind_backtrace) from [<c010b528>]
(show_stack+0x10/0x14)
[   14.804595] [<c010b528>] (show_stack) from [<c08c1d68>]
(dump_stack+0xa8/0xc8)
[   14.811950] [<c08c1d68>] (dump_stack) from [<c012df4c>]
(__warn+0xe8/0x114)
[   14.816894] [<c012df4c>] (__warn) from [<c012dfb4>]
(warn_slowpath_null+0x3c/0x48)
[   14.826629] [<c012dfb4>] (warn_slowpath_null) from [<c0566674>]
(wl12xx_sdio_raw_read+0xa8/0x128)
[   14.835540] [<c0566674>] (wl12xx_sdio_raw_read) from [<c0567704>]
(wl12xx_get_mac+0x134/0x260)
[   14.844268] [<c0567704>] (wl12xx_get_mac) from [<c05530cc>]
(wlcore_nvs_cb+0x270/0xb64)
[   14.852355] [<c05530cc>] (wlcore_nvs_cb) from [<c04d7264>]
(request_firmware_work_func+0x3c/0x64)
[   14.861267] [<c04d7264>] (request_firmware_work_func) from
[<c01455c0>] (process_one_work+0x140/0x348)
[   14.870697] [<c01455c0>] (process_one_work) from [<c0145964>]
(worker_thread+0x164/0x4b0)
[   14.878906] [<c0145964>] (worker_thread) from [<c014a788>]
(kthread+0x110/0x148)
[   14.883636] [<c014a788>] (kthread) from [<c01010e8>]
(ret_from_fork+0x14/0x2c)
[   14.893615] Exception stack(0xeda0bfb0 to 0xeda0bff8)
[   14.893615] bfa0:                                     00000000
00000000 00000000 00000000
[   14.903625] bfc0: 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000
[   14.913635] bfe0: 00000000 00000000 00000000 00000000 00000013
00000000
[   14.922058] ---[ end trace b611e5d6e7d5aa92 ]---
[   14.926788] wl1271_sdio mmc4:0001:2: sdio read failed (-110)
[   14.932525] wlcore: ERROR couldn't get hw info


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply

* Re: wifi on Motorola Droid 4 in 5.3-rc2
From: Pavel Machek @ 2019-08-18 11:46 UTC (permalink / raw)
  To: Michael Nazzareno Trimarchi
  Cc: kernel list, linux-arm-kernel, Linux OMAP Mailing List,
	Tony Lindgren, Sebastian Reichel, nekit1000, mpartap,
	Merlijn Wajer, open list:TI WILINK WIRELES...
In-Reply-To: <CAOf5uwnUx3mtGGHFGqKB30qcb_AMhMEhHLp2pf-4pUdhi7KP7w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 760 bytes --]

Hi!

> > First, I guess I should mention that this is first time I'm attempting
> > to get wifi going on D4.
> >
> > I'm getting this:
> >
> > user@devuan:~/g/ofono$ sudo ifconfig wlan0 down
> > user@devuan:~/g/ofono$ sudo ifconfig wlan0 up
> > user@devuan:~/g/ofono$ sudo iwlist wlan0 scan
> > wlan0     Interface doesn't support scanning.
> >
> 
> Try to use iw command. iwlist use an obsolete interface that you need
> to activate in kernel for back compatibility with old command. Can be
> your problem?

Two more reboots (with no changes in the config) and wifi now
works. Thanks!
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply

* Re: wifi on Motorola Droid 4 in 5.3-rc2
From: Michael Nazzareno Trimarchi @ 2019-08-18 12:43 UTC (permalink / raw)
  To: Pavel Machek
  Cc: kernel list, linux-arm-kernel, Linux OMAP Mailing List,
	Tony Lindgren, Sebastian Reichel, nekit1000, mpartap,
	Merlijn Wajer, open list:TI WILINK WIRELES...
In-Reply-To: <20190818114332.GA32205@amd>

Hi

On Sun, Aug 18, 2019 at 1:43 PM Pavel Machek <pavel@ucw.cz> wrote:
>
> On Sun 2019-08-18 12:53:01, Michael Nazzareno Trimarchi wrote:
> > Hi
> >
> > On Sun, Aug 18, 2019 at 12:46 PM Pavel Machek <pavel@ucw.cz> wrote:
> > >
> > > Hi!
> > >
> > > First, I guess I should mention that this is first time I'm attempting
> > > to get wifi going on D4.
> > >
> > > I'm getting this:
> > >
> > > user@devuan:~/g/ofono$ sudo ifconfig wlan0 down
> > > user@devuan:~/g/ofono$ sudo ifconfig wlan0 up
> > > user@devuan:~/g/ofono$ sudo iwlist wlan0 scan
> > > wlan0     Interface doesn't support scanning.
> > >
> >
> > Try to use iw command. iwlist use an obsolete interface that you need
> > to activate in kernel for back compatibility with old command. Can be
> > your problem?
>
> Let me see ... CONFIG_CFG80211_WEXT was not set.
>
> Tried enabling it, and now I got. I remember getting it before,
> too... let me try few more boots, perhaps it is random.
>
> Best regards,
>                                                                 Pavel
>
>
>
> [   13.653778] panel-dsi-cm 58004000.encoder:display: using lookup
> tables for GPIO lookup
> [   13.661834] panel-dsi-cm 58004000.encoder:display: No GPIO consumer
> te found
> [   14.756622] ------------[ cut here ]------------
> [   14.761352] WARNING: CPU: 0 PID: 20 at
> /data/fast/l/k/drivers/net/wireless/ti/wlcore/sdio.c:86
> wl12xx_sdio_raw_read+0xa8/0x128
> [   14.772888] Modules linked in:
> [   14.776062] CPU: 0 PID: 20 Comm: kworker/0:1 Tainted: G        W
> 5.3.0-rc4-58571-gdbaece1 #85
> [   14.783630] Hardware name: Generic OMAP4 (Flattened Device Tree)
> [   14.791381] Workqueue: events request_firmware_work_func
> [   14.796813] [<c010f2b4>] (unwind_backtrace) from [<c010b528>]
> (show_stack+0x10/0x14)
> [   14.804595] [<c010b528>] (show_stack) from [<c08c1d68>]
> (dump_stack+0xa8/0xc8)
> [   14.811950] [<c08c1d68>] (dump_stack) from [<c012df4c>]
> (__warn+0xe8/0x114)
> [   14.816894] [<c012df4c>] (__warn) from [<c012dfb4>]
> (warn_slowpath_null+0x3c/0x48)
> [   14.826629] [<c012dfb4>] (warn_slowpath_null) from [<c0566674>]
> (wl12xx_sdio_raw_read+0xa8/0x128)
> [   14.835540] [<c0566674>] (wl12xx_sdio_raw_read) from [<c0567704>]
> (wl12xx_get_mac+0x134/0x260)
> [   14.844268] [<c0567704>] (wl12xx_get_mac) from [<c05530cc>]
> (wlcore_nvs_cb+0x270/0xb64)
> [   14.852355] [<c05530cc>] (wlcore_nvs_cb) from [<c04d7264>]
> (request_firmware_work_func+0x3c/0x64)
> [   14.861267] [<c04d7264>] (request_firmware_work_func) from
> [<c01455c0>] (process_one_work+0x140/0x348)
> [   14.870697] [<c01455c0>] (process_one_work) from [<c0145964>]
> (worker_thread+0x164/0x4b0)
> [   14.878906] [<c0145964>] (worker_thread) from [<c014a788>]
> (kthread+0x110/0x148)
> [   14.883636] [<c014a788>] (kthread) from [<c01010e8>]
> (ret_from_fork+0x14/0x2c)
> [   14.893615] Exception stack(0xeda0bfb0 to 0xeda0bff8)
> [   14.893615] bfa0:                                     00000000
> 00000000 00000000 00000000
> [   14.903625] bfc0: 00000000 00000000 00000000 00000000 00000000
> 00000000 00000000 00000000
> [   14.913635] bfe0: 00000000 00000000 00000000 00000000 00000013
> 00000000
> [   14.922058] ---[ end trace b611e5d6e7d5aa92 ]---
> [   14.926788] wl1271_sdio mmc4:0001:2: sdio read failed (-110)
> [   14.932525] wlcore: ERROR couldn't get hw info

You have a timeout here. Can be that your reset sequence of the wifi
is not optimal because
is not responding?

Michael

>
>
> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html



-- 
| Michael Nazzareno Trimarchi                     Amarula Solutions BV |
| COO  -  Founder                                      Cruquiuskade 47 |
| +31(0)851119172                                 Amsterdam 1018 AM NL |
|                  [`as] http://www.amarulasolutions.com               |

^ permalink raw reply

* Re: wifi on Motorola Droid 4 in 5.3-rc2
From: Michael Nazzareno Trimarchi @ 2019-08-18 12:45 UTC (permalink / raw)
  To: Pavel Machek
  Cc: kernel list, linux-arm-kernel, Linux OMAP Mailing List,
	Tony Lindgren, Sebastian Reichel, nekit1000, mpartap,
	Merlijn Wajer, open list:TI WILINK WIRELES...
In-Reply-To: <20190818104629.GA27360@amd>

Hi Pavel

For the second part

On Sun, Aug 18, 2019 at 12:46 PM Pavel Machek <pavel@ucw.cz> wrote:
>
> Hi!
>
> First, I guess I should mention that this is first time I'm attempting
> to get wifi going on D4.
>
> I'm getting this:
>
> user@devuan:~/g/ofono$ sudo ifconfig wlan0 down
> user@devuan:~/g/ofono$ sudo ifconfig wlan0 up
> user@devuan:~/g/ofono$ sudo iwlist wlan0 scan
> wlan0     Interface doesn't support scanning.
>
> user@devuan:~/g/ofono$ sudo ifconfig wlan0 down
> user@devuan:~/g/ofono$ sudo iwlist wlan0 scan
> wlan0     Interface doesn't support scanning.
>
> user@devuan:~/g/ofono$
>
> I'm getting this warning during bootup:
>
> [   13.733703] asoc-audio-graph-card soundcard: No GPIO consumer pa
> found
> [   14.279724] wlcore: WARNING Detected unconfigured mac address in
> nvs, derive from fuse instead.

This is ok. It means that your nvs file is not the original one taken
from android

> [   14.293273] wlcore: WARNING Your device performance is not
> optimized.

you can use plt command with calibrate

Michael

> [   14.304443] wlcore: WARNING Please use the calibrator tool to
> configure your device.
> [   14.317474] wlcore: loaded
> [   16.977325] motmdm serial0-0: motmdm_dlci_send_command: AT+VERSION=
> got MASERATIBP_N_05.25.00R,026.0R,XSAMASR01VRZNA026.0R,???
>
> Any ideas?
>
> Best regards,
>                                                                         Pavel
>
> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html



-- 
| Michael Nazzareno Trimarchi                     Amarula Solutions BV |
| COO  -  Founder                                      Cruquiuskade 47 |
| +31(0)851119172                                 Amsterdam 1018 AM NL |
|                  [`as] http://www.amarulasolutions.com               |

^ permalink raw reply

* Re: [PATCH 09/22] iwlwifi: remove iwl-constants.h
From: Kalle Valo @ 2019-08-18 13:55 UTC (permalink / raw)
  To: Luca Coelho; +Cc: linux-wireless
In-Reply-To: <20190817065200.9701-10-luca@coelho.fi>

Luca Coelho <luca@coelho.fi> writes:

> From: Shahar S Matityahu <shahar.s.matityahu@intel.com>
>
> This file is included in a few source files, but its content
> is never used. Remove it.
>
> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> ---
>  drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
> index bf0b9ee05c44..2aa5320e9d1a 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
> @@ -414,6 +414,7 @@ static const struct iwl_hcmd_names iwl_mvm_legacy_names[] = {
>  	HCMD_NAME(SCAN_ITERATION_COMPLETE),
>  	HCMD_NAME(D0I3_END_CMD),
>  	HCMD_NAME(LTR_CONFIG),
> +	HCMD_NAME(LDBG_CONFIG_CMD),
>  };
>  
>  /* Please keep this array *SORTED* by hex value.

The commit log does not seem to match with the actual patch.

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

^ permalink raw reply

* Re: [PATCH 22/22] iwlwifi: remove the code under IWLWIFI_PCIE_RTPM
From: Kalle Valo @ 2019-08-18 13:59 UTC (permalink / raw)
  To: Luca Coelho; +Cc: linux-wireless
In-Reply-To: <20190817065200.9701-23-luca@coelho.fi>

Luca Coelho <luca@coelho.fi> writes:

> From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
>
> This is never set.
>
> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> ---
>  drivers/net/wireless/intel/iwlwifi/Kconfig    | 14 ----
>  drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 71 -------------------
>  .../net/wireless/intel/iwlwifi/pcie/trans.c   |  4 --
>  3 files changed, 89 deletions(-)
>
> diff --git a/drivers/net/wireless/intel/iwlwifi/Kconfig b/drivers/net/wireless/intel/iwlwifi/Kconfig
> index 235349a33a3c..7dbc0d38bb3b 100644
> --- a/drivers/net/wireless/intel/iwlwifi/Kconfig
> +++ b/drivers/net/wireless/intel/iwlwifi/Kconfig
> @@ -92,20 +92,6 @@ config IWLWIFI_BCAST_FILTERING
>  	  If unsure, don't enable this option, as some programs might
>  	  expect incoming broadcasts for their normal operations.
>  
> -config IWLWIFI_PCIE_RTPM
> -       bool "Enable runtime power management mode for PCIe devices"
> -       depends on IWLMVM && PM && EXPERT
> -       help
> -         Say Y here to enable runtime power management for PCIe
> -         devices.  If enabled, the device will go into low power mode
> -         when idle for a short period of time, allowing for improved
> -         power saving during runtime. Note that this feature requires
> -         a tight integration with the platform. It is not recommended
> -         to enable this feature without proper validation with the
> -         specific target platform.
> -
> -	 If unsure, say N.

I would like to have more understanding why you are removing an existing
Kconfig option? "Never set" tells nothing.

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

^ permalink raw reply

* Re: [PATCH 12/22] iwlwifi: mvm: start to remove the code for d0i3
From: Kalle Valo @ 2019-08-18 14:01 UTC (permalink / raw)
  To: Luca Coelho; +Cc: linux-wireless
In-Reply-To: <20190817065200.9701-13-luca@coelho.fi>

Luca Coelho <luca@coelho.fi> writes:

> From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
>
> This is only the very start, much more work is needed.
> Remove the places where we check iwl_mvm_is_d0i3_supported
> but leave all the refs, those will be removed in a different
> patch.
>
> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>

It would be good to explain _why_ you are removing d0i3 support. Basend
on the cover letter apparently it's broken but there's no detailed
information.

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

^ permalink raw reply

* Re: wifi on Motorola Droid 4 in 5.3-rc2
From: Kalle Valo @ 2019-08-18 14:06 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Michael Nazzareno Trimarchi, kernel list, linux-arm-kernel,
	Linux OMAP Mailing List, Tony Lindgren, Sebastian Reichel,
	nekit1000, mpartap, Merlijn Wajer, open list:TI WILINK WIRELES...
In-Reply-To: <20190818114332.GA32205@amd>

Pavel Machek <pavel@ucw.cz> writes:

> On Sun 2019-08-18 12:53:01, Michael Nazzareno Trimarchi wrote:
>> Hi
>> 
>> On Sun, Aug 18, 2019 at 12:46 PM Pavel Machek <pavel@ucw.cz> wrote:
>> >
>> > Hi!
>> >
>> > First, I guess I should mention that this is first time I'm attempting
>> > to get wifi going on D4.
>> >
>> > I'm getting this:
>> >
>> > user@devuan:~/g/ofono$ sudo ifconfig wlan0 down
>> > user@devuan:~/g/ofono$ sudo ifconfig wlan0 up
>> > user@devuan:~/g/ofono$ sudo iwlist wlan0 scan
>> > wlan0     Interface doesn't support scanning.
>> >
>> 
>> Try to use iw command. iwlist use an obsolete interface that you need
>> to activate in kernel for back compatibility with old command. Can be
>> your problem?
>
> Let me see ... CONFIG_CFG80211_WEXT was not set.
>
> Tried enabling it, and now I got. I remember getting it before,
> too... let me try few more boots, perhaps it is random.

From developers' point of view WEXT is ancient and untested, everybody
should switch to nl80211. So I strongly using iw (which uses nl80211).
Of course this nothing to do with the wlcore warning you saw, just
wanted to make you aware the state of wireless extensions.

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

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox