Commit 300fbb24 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files
Johannes Berg says:

====================
wireless fixes:
 - debugfs had a deadlock (removal vs. use of files),
   fixes going through wireless ACKed by Greg
 - support for HT STAs on 320 MHz channels, even if it's
   not clear that should ever happen (that's 6 GHz), best
   not to WARN()
 - fix for the previous CQM fix that broke most cases
 - various wiphy locking fixes
 - various small driver fixes

* tag 'wireless-2023-11-29' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless:
  wifi: mac80211: use wiphy locked debugfs for sdata/link
  wifi: mac80211: use wiphy locked debugfs helpers for agg_status
  wifi: cfg80211: add locked debugfs wrappers
  debugfs: add API to allow debugfs operations cancellation
  debugfs: annotate debugfs handlers vs. removal with lockdep
  debugfs: fix automount d_fsdata usage
  wifi: mac80211: handle 320 MHz in ieee80211_ht_cap_ie_to_sta_ht_cap
  wifi: avoid offset calculation on NULL pointer
  wifi: cfg80211: hold wiphy mutex for send_interface
  wifi: cfg80211: lock wiphy mutex for rfkill poll
  wifi: cfg80211: fix CQM for non-range use
  wifi: mac80211: do not pass AP_VLAN vif pointer to drivers during flush
  wifi: iwlwifi: mvm: fix an error code in iwl_mvm_mld_add_sta()
  wifi: mt76: mt7925: fix typo in mt7925_init_he_caps
  wifi: mt76: mt7921: fix 6GHz disabled by the missing default CLC config
====================

Link: https://lore.kernel.org/r/20231129150809.31083-3-johannes@sipsolutions.net


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 0d47fa5c 4ded3bfe
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -57,8 +57,7 @@ config ATH9K_AHB

config ATH9K_DEBUGFS
	bool "Atheros ath9k debugging"
	depends on ATH9K && DEBUG_FS
	select MAC80211_DEBUGFS
	depends on ATH9K && DEBUG_FS && MAC80211_DEBUGFS
	select ATH9K_COMMON_DEBUG
	help
	  Say Y, if you need access to ath9k's statistics for
@@ -70,7 +69,6 @@ config ATH9K_DEBUGFS
config ATH9K_STATION_STATISTICS
	bool "Detailed station statistics"
	depends on ATH9K && ATH9K_DEBUGFS && DEBUG_FS
	select MAC80211_DEBUGFS
	default n
	help
	  This option enables detailed statistics for association stations.
+3 −1
Original line number Diff line number Diff line
@@ -707,8 +707,10 @@ int iwl_mvm_mld_add_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
			rcu_dereference_protected(mvm_sta->link[link_id],
						  lockdep_is_held(&mvm->mutex));

		if (WARN_ON(!link_conf || !mvm_link_sta))
		if (WARN_ON(!link_conf || !mvm_link_sta)) {
			ret = -EINVAL;
			goto err;
		}

		ret = iwl_mvm_mld_cfg_sta(mvm, sta, vif, link_sta, link_conf,
					  mvm_link_sta);
+1 −0
Original line number Diff line number Diff line
@@ -375,6 +375,7 @@ static int mt7921_load_clc(struct mt792x_dev *dev, const char *fw_name)
	int ret, i, len, offset = 0;
	u8 *clc_base = NULL, hw_encap = 0;

	dev->phy.clc_chan_conf = 0xff;
	if (mt7921_disable_clc ||
	    mt76_is_usb(&dev->mt76))
		return 0;
+2 −2
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ mt7925_init_he_caps(struct mt792x_phy *phy, enum nl80211_band band,
		IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO |
		IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO;

	switch (i) {
	switch (iftype) {
	case NL80211_IFTYPE_AP:
		he_cap_elem->mac_cap_info[2] |=
			IEEE80211_HE_MAC_CAP2_BSR;
+100 −0
Original line number Diff line number Diff line
@@ -84,6 +84,14 @@ int debugfs_file_get(struct dentry *dentry)
	struct debugfs_fsdata *fsd;
	void *d_fsd;

	/*
	 * This could only happen if some debugfs user erroneously calls
	 * debugfs_file_get() on a dentry that isn't even a file, let
	 * them know about it.
	 */
	if (WARN_ON(!d_is_reg(dentry)))
		return -EINVAL;

	d_fsd = READ_ONCE(dentry->d_fsdata);
	if (!((unsigned long)d_fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)) {
		fsd = d_fsd;
@@ -100,6 +108,14 @@ int debugfs_file_get(struct dentry *dentry)
			kfree(fsd);
			fsd = READ_ONCE(dentry->d_fsdata);
		}
#ifdef CONFIG_LOCKDEP
		fsd->lock_name = kasprintf(GFP_KERNEL, "debugfs:%pd", dentry);
		lockdep_register_key(&fsd->key);
		lockdep_init_map(&fsd->lockdep_map, fsd->lock_name ?: "debugfs",
				 &fsd->key, 0);
#endif
		INIT_LIST_HEAD(&fsd->cancellations);
		mutex_init(&fsd->cancellations_mtx);
	}

	/*
@@ -116,6 +132,8 @@ int debugfs_file_get(struct dentry *dentry)
	if (!refcount_inc_not_zero(&fsd->active_users))
		return -EIO;

	lock_map_acquire_read(&fsd->lockdep_map);

	return 0;
}
EXPORT_SYMBOL_GPL(debugfs_file_get);
@@ -133,11 +151,93 @@ void debugfs_file_put(struct dentry *dentry)
{
	struct debugfs_fsdata *fsd = READ_ONCE(dentry->d_fsdata);

	lock_map_release(&fsd->lockdep_map);

	if (refcount_dec_and_test(&fsd->active_users))
		complete(&fsd->active_users_drained);
}
EXPORT_SYMBOL_GPL(debugfs_file_put);

/**
 * debugfs_enter_cancellation - enter a debugfs cancellation
 * @file: the file being accessed
 * @cancellation: the cancellation object, the cancel callback
 *	inside of it must be initialized
 *
 * When a debugfs file is removed it needs to wait for all active
 * operations to complete. However, the operation itself may need
 * to wait for hardware or completion of some asynchronous process
 * or similar. As such, it may need to be cancelled to avoid long
 * waits or even deadlocks.
 *
 * This function can be used inside a debugfs handler that may
 * need to be cancelled. As soon as this function is called, the
 * cancellation's 'cancel' callback may be called, at which point
 * the caller should proceed to call debugfs_leave_cancellation()
 * and leave the debugfs handler function as soon as possible.
 * Note that the 'cancel' callback is only ever called in the
 * context of some kind of debugfs_remove().
 *
 * This function must be paired with debugfs_leave_cancellation().
 */
void debugfs_enter_cancellation(struct file *file,
				struct debugfs_cancellation *cancellation)
{
	struct debugfs_fsdata *fsd;
	struct dentry *dentry = F_DENTRY(file);

	INIT_LIST_HEAD(&cancellation->list);

	if (WARN_ON(!d_is_reg(dentry)))
		return;

	if (WARN_ON(!cancellation->cancel))
		return;

	fsd = READ_ONCE(dentry->d_fsdata);
	if (WARN_ON(!fsd ||
		    ((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)))
		return;

	mutex_lock(&fsd->cancellations_mtx);
	list_add(&cancellation->list, &fsd->cancellations);
	mutex_unlock(&fsd->cancellations_mtx);

	/* if we're already removing wake it up to cancel */
	if (d_unlinked(dentry))
		complete(&fsd->active_users_drained);
}
EXPORT_SYMBOL_GPL(debugfs_enter_cancellation);

/**
 * debugfs_leave_cancellation - leave cancellation section
 * @file: the file being accessed
 * @cancellation: the cancellation previously registered with
 *	debugfs_enter_cancellation()
 *
 * See the documentation of debugfs_enter_cancellation().
 */
void debugfs_leave_cancellation(struct file *file,
				struct debugfs_cancellation *cancellation)
{
	struct debugfs_fsdata *fsd;
	struct dentry *dentry = F_DENTRY(file);

	if (WARN_ON(!d_is_reg(dentry)))
		return;

	fsd = READ_ONCE(dentry->d_fsdata);
	if (WARN_ON(!fsd ||
		    ((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)))
		return;

	mutex_lock(&fsd->cancellations_mtx);
	if (!list_empty(&cancellation->list))
		list_del(&cancellation->list);
	mutex_unlock(&fsd->cancellations_mtx);
}
EXPORT_SYMBOL_GPL(debugfs_leave_cancellation);

/*
 * Only permit access to world-readable files when the kernel is locked down.
 * We also need to exclude any file that has ways to write or alter it as root
Loading