Commit 8bf6008c authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files
Kalle Valo says:

====================
wireless fixes for v5.18

Second set of fixes for v5.18 and hopefully the last one. We have a
new iwlwifi maintainer, a fix to rfkill ioctl interface and important
fixes to both stack and two drivers.

* tag 'wireless-2022-05-11' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless:
  rfkill: uapi: fix RFKILL_IOCTL_MAX_SIZE ioctl request definition
  nl80211: fix locking in nl80211_set_tx_bitrate_mask()
  mac80211_hwsim: call ieee80211_tx_prepare_skb under RCU protection
  mac80211_hwsim: fix RCU protected chanctx access
  mailmap: update Kalle Valo's email
  mac80211: Reset MBSSID parameters upon connection
  cfg80211: retrieve S1G operating channel number
  nl80211: validate S1G channel width
  mac80211: fix rx reordering with non explicit / psmp ack policy
  ath11k: reduce the wait time of 11d scan and hw scan while add interface
  MAINTAINERS: update iwlwifi driver maintainer
  iwlwifi: iwl-dbg: Use del_timer_sync() before freeing
====================

Link: https://lore.kernel.org/r/20220511154535.A1A12C340EE@smtp.kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 3f95a747 a36e07df
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -204,6 +204,7 @@ Juha Yrjola <at solidboot.com>
Juha Yrjola <juha.yrjola@nokia.com>
Juha Yrjola <juha.yrjola@solidboot.com>
Julien Thierry <julien.thierry.kdev@gmail.com> <julien.thierry@arm.com>
Kalle Valo <kvalo@kernel.org> <kvalo@codeaurora.org>
Kalyan Thota <quic_kalyant@quicinc.com> <kalyan_t@codeaurora.org>
Kay Sievers <kay.sievers@vrfy.org>
Kees Cook <keescook@chromium.org> <kees.cook@canonical.com>
+1 −1
Original line number Diff line number Diff line
@@ -10132,7 +10132,7 @@ S: Supported
F:	drivers/net/wireless/intel/iwlegacy/
INTEL WIRELESS WIFI LINK (iwlwifi)
M:	Luca Coelho <luciano.coelho@intel.com>
M:	Gregory Greenman <gregory.greenman@intel.com>
L:	linux-wireless@vger.kernel.org
S:	Supported
W:	https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi
+1 −0
Original line number Diff line number Diff line
@@ -1288,6 +1288,7 @@ static void ath11k_core_restart(struct work_struct *work)

		ieee80211_stop_queues(ar->hw);
		ath11k_mac_drain_tx(ar);
		complete(&ar->completed_11d_scan);
		complete(&ar->scan.started);
		complete(&ar->scan.completed);
		complete(&ar->peer_assoc_done);
+10 −3
Original line number Diff line number Diff line
@@ -38,6 +38,8 @@

extern unsigned int ath11k_frame_mode;

#define ATH11K_SCAN_TIMEOUT_HZ (20 * HZ)

#define ATH11K_MON_TIMER_INTERVAL  10

enum ath11k_supported_bw {
@@ -189,6 +191,12 @@ enum ath11k_scan_state {
	ATH11K_SCAN_ABORTING,
};

enum ath11k_11d_state {
	ATH11K_11D_IDLE,
	ATH11K_11D_PREPARING,
	ATH11K_11D_RUNNING,
};

enum ath11k_dev_flags {
	ATH11K_CAC_RUNNING,
	ATH11K_FLAG_CORE_REGISTERED,
@@ -607,9 +615,8 @@ struct ath11k {
	bool dfs_block_radar_events;
	struct ath11k_thermal thermal;
	u32 vdev_id_11d_scan;
	struct completion finish_11d_scan;
	struct completion finish_11d_ch_list;
	bool pending_11d;
	struct completion completed_11d_scan;
	enum ath11k_11d_state state_11d;
	bool regdom_set_by_user;
	int hw_rate_code;
	u8 twt_enabled;
+29 −42
Original line number Diff line number Diff line
@@ -3601,26 +3601,6 @@ static int ath11k_mac_op_hw_scan(struct ieee80211_hw *hw,
	if (ret)
		goto exit;

	/* Currently the pending_11d=true only happened 1 time while
	 * wlan interface up in ath11k_mac_11d_scan_start(), it is called by
	 * ath11k_mac_op_add_interface(), after wlan interface up,
	 * pending_11d=false always.
	 * If remove below wait, it always happened scan fail and lead connect
	 * fail while wlan interface up, because it has a 11d scan which is running
	 * in firmware, and lead this scan failed.
	 */
	if (ar->pending_11d) {
		long time_left;
		unsigned long timeout = 5 * HZ;

		if (ar->supports_6ghz)
			timeout += 5 * HZ;

		time_left = wait_for_completion_timeout(&ar->finish_11d_ch_list, timeout);
		ath11k_dbg(ar->ab, ATH11K_DBG_MAC,
			   "mac wait 11d channel list time left %ld\n", time_left);
	}

	memset(&arg, 0, sizeof(arg));
	ath11k_wmi_start_scan_init(ar, &arg);
	arg.vdev_id = arvif->vdev_id;
@@ -3686,6 +3666,10 @@ static int ath11k_mac_op_hw_scan(struct ieee80211_hw *hw,
		kfree(arg.extraie.ptr);

	mutex_unlock(&ar->conf_mutex);

	if (ar->state_11d == ATH11K_11D_PREPARING)
		ath11k_mac_11d_scan_start(ar, arvif->vdev_id);

	return ret;
}

@@ -5814,7 +5798,7 @@ static int ath11k_mac_op_start(struct ieee80211_hw *hw)

	/* TODO: Do we need to enable ANI? */

	ath11k_reg_update_chan_list(ar);
	ath11k_reg_update_chan_list(ar, false);

	ar->num_started_vdevs = 0;
	ar->num_created_vdevs = 0;
@@ -5881,6 +5865,11 @@ static void ath11k_mac_op_stop(struct ieee80211_hw *hw)
	cancel_work_sync(&ar->ab->update_11d_work);
	cancel_work_sync(&ar->ab->rfkill_work);

	if (ar->state_11d == ATH11K_11D_PREPARING) {
		ar->state_11d = ATH11K_11D_IDLE;
		complete(&ar->completed_11d_scan);
	}

	spin_lock_bh(&ar->data_lock);
	list_for_each_entry_safe(ppdu_stats, tmp, &ar->ppdu_stats_info, list) {
		list_del(&ppdu_stats->list);
@@ -6051,7 +6040,7 @@ static bool ath11k_mac_vif_ap_active_any(struct ath11k_base *ab)
	return false;
}

void ath11k_mac_11d_scan_start(struct ath11k *ar, u32 vdev_id, bool wait)
void ath11k_mac_11d_scan_start(struct ath11k *ar, u32 vdev_id)
{
	struct wmi_11d_scan_start_params param;
	int ret;
@@ -6079,28 +6068,22 @@ void ath11k_mac_11d_scan_start(struct ath11k *ar, u32 vdev_id, bool wait)

	ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac start 11d scan\n");

	if (wait)
		reinit_completion(&ar->finish_11d_scan);

	ret = ath11k_wmi_send_11d_scan_start_cmd(ar, &param);
	if (ret) {
		ath11k_warn(ar->ab, "failed to start 11d scan vdev %d ret: %d\n",
			    vdev_id, ret);
	} else {
		ar->vdev_id_11d_scan = vdev_id;
		if (wait) {
			ar->pending_11d = true;
			ret = wait_for_completion_timeout(&ar->finish_11d_scan,
							  5 * HZ);
			ath11k_dbg(ar->ab, ATH11K_DBG_MAC,
				   "mac 11d scan left time %d\n", ret);

			if (!ret)
				ar->pending_11d = false;
		}
		if (ar->state_11d == ATH11K_11D_PREPARING)
			ar->state_11d = ATH11K_11D_RUNNING;
	}

fin:
	if (ar->state_11d == ATH11K_11D_PREPARING) {
		ar->state_11d = ATH11K_11D_IDLE;
		complete(&ar->completed_11d_scan);
	}

	mutex_unlock(&ar->ab->vdev_id_11d_lock);
}

@@ -6123,12 +6106,15 @@ void ath11k_mac_11d_scan_stop(struct ath11k *ar)
		vdev_id = ar->vdev_id_11d_scan;

		ret = ath11k_wmi_send_11d_scan_stop_cmd(ar, vdev_id);
		if (ret)
		if (ret) {
			ath11k_warn(ar->ab,
				    "failed to stopt 11d scan vdev %d ret: %d\n",
				    vdev_id, ret);
		else
		} else {
			ar->vdev_id_11d_scan = ATH11K_11D_INVALID_VDEV_ID;
			ar->state_11d = ATH11K_11D_IDLE;
			complete(&ar->completed_11d_scan);
		}
	}
	mutex_unlock(&ar->ab->vdev_id_11d_lock);
}
@@ -6324,8 +6310,10 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw,
			goto err_peer_del;
		}

		ath11k_mac_11d_scan_start(ar, arvif->vdev_id, true);

		if (test_bit(WMI_TLV_SERVICE_11D_OFFLOAD, ab->wmi_ab.svc_map)) {
			reinit_completion(&ar->completed_11d_scan);
			ar->state_11d = ATH11K_11D_PREPARING;
		}
		break;
	case WMI_VDEV_TYPE_MONITOR:
		set_bit(ATH11K_FLAG_MONITOR_VDEV_CREATED, &ar->monitor_flags);
@@ -7190,7 +7178,7 @@ ath11k_mac_op_unassign_vif_chanctx(struct ieee80211_hw *hw,
	}

	if (arvif->vdev_type == WMI_VDEV_TYPE_STA)
		ath11k_mac_11d_scan_start(ar, arvif->vdev_id, false);
		ath11k_mac_11d_scan_start(ar, arvif->vdev_id);

	mutex_unlock(&ar->conf_mutex);
}
@@ -8671,8 +8659,7 @@ int ath11k_mac_allocate(struct ath11k_base *ab)
		ar->monitor_vdev_id = -1;
		clear_bit(ATH11K_FLAG_MONITOR_VDEV_CREATED, &ar->monitor_flags);
		ar->vdev_id_11d_scan = ATH11K_11D_INVALID_VDEV_ID;
		init_completion(&ar->finish_11d_scan);
		init_completion(&ar->finish_11d_ch_list);
		init_completion(&ar->completed_11d_scan);
	}

	return 0;
Loading