From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Kalle Valo <kvalo@kernel.org>,
Johannes Berg <johannes@sipsolutions.net>,
Wireless <linux-wireless@vger.kernel.org>
Cc: Johannes Berg <johannes.berg@intel.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: linux-next: manual merge of the wireless-next tree with the wireless tree
Date: Tue, 12 Sep 2023 12:46:23 +1000 [thread overview]
Message-ID: <20230912124623.6591edd4@canb.auug.org.au> (raw)
[-- Attachment #1: Type: text/plain, Size: 5267 bytes --]
Hi all,
Today's linux-next merge of the wireless-next tree got a conflict in:
net/wireless/nl80211.c
between commit:
37c20b2effe9 ("wifi: cfg80211: fix cqm_config access race")
from the wireless tree and commit:
076fc8775daf ("wifi: cfg80211: remove wdev mutex")
from the wireless-next tree.
I fixed it up (I used a supplied resolution from Johannes - see below)
and can carry the fix as necessary. This is now fixed as far as
linux-next is concerned, but any non trivial conflicts should be
mentioned to your upstream maintainer when your tree is submitted for
merging. You may also want to consider cooperating with the maintainer
of the conflicting tree to minimise any particularly complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc net/wireless/nl80211.c
index 7a88361b3414,ab0aea7dca7d..fe06c238d4ef
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@@ -6191,12 -6135,8 +6150,12 @@@ static int nl80211_start_ap(struct sk_b
err = nl80211_calculate_ap_params(params);
if (err)
- goto out_unlock;
+ goto out;
+ err = nl80211_validate_ap_phy_operation(params);
+ if (err)
- goto out_unlock;
++ goto out;
+
if (info->attrs[NL80211_ATTR_AP_SETTINGS_FLAGS])
params->flags = nla_get_u32(
info->attrs[NL80211_ATTR_AP_SETTINGS_FLAGS]);
@@@ -12884,11 -12747,10 +12767,11 @@@ static int nl80211_set_cqm_rssi(struct
u32 hysteresis)
{
struct cfg80211_registered_device *rdev = info->user_ptr[0];
+ struct cfg80211_cqm_config *cqm_config = NULL, *old;
struct net_device *dev = info->user_ptr[1];
struct wireless_dev *wdev = dev->ieee80211_ptr;
- int i, err;
s32 prev = S32_MIN;
- int i;
++ int i, err;
/* Check all values negative and sorted */
for (i = 0; i < n_thresholds; i++) {
@@@ -12917,11 -12781,9 +12800,9 @@@
if (n_thresholds == 1 && thresholds[0] == 0) /* Disabling */
n_thresholds = 0;
- wdev_lock(wdev);
- old = rcu_dereference_protected(wdev->cqm_config,
- lockdep_is_held(&wdev->mtx));
- if (n_thresholds) {
- struct cfg80211_cqm_config *cqm_config;
++ old = wiphy_dereference(wdev->wiphy, wdev->cqm_config);
+ if (n_thresholds) {
cqm_config = kzalloc(struct_size(cqm_config, rssi_thresholds,
n_thresholds),
GFP_KERNEL);
@@@ -12936,22 -12796,10 +12815,20 @@@
flex_array_size(cqm_config, rssi_thresholds,
n_thresholds));
- wdev->cqm_config = cqm_config;
+ rcu_assign_pointer(wdev->cqm_config, cqm_config);
+ } else {
+ RCU_INIT_POINTER(wdev->cqm_config, NULL);
}
- return cfg80211_cqm_rssi_update(rdev, dev);
+ err = cfg80211_cqm_rssi_update(rdev, dev, cqm_config);
+ if (err) {
+ rcu_assign_pointer(wdev->cqm_config, old);
+ kfree_rcu(cqm_config, rcu_head);
+ } else {
+ kfree_rcu(old, rcu_head);
+ }
- unlock:
- wdev_unlock(wdev);
+
+ return err;
}
static int nl80211_set_cqm(struct sk_buff *skb, struct genl_info *info)
@@@ -19107,41 -18879,18 +18907,39 @@@ void cfg80211_cqm_rssi_notify(struct ne
rssi_event != NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH))
return;
- if (wdev->cqm_config) {
- wdev->cqm_config->last_rssi_event_value = rssi_level;
+ rcu_read_lock();
+ cqm_config = rcu_dereference(wdev->cqm_config);
+ if (cqm_config) {
+ cqm_config->last_rssi_event_value = rssi_level;
+ cqm_config->last_rssi_event_type = rssi_event;
+ wiphy_work_queue(wdev->wiphy, &wdev->cqm_rssi_work);
+ }
+ rcu_read_unlock();
+}
+EXPORT_SYMBOL(cfg80211_cqm_rssi_notify);
+
+void cfg80211_cqm_rssi_notify_work(struct wiphy *wiphy, struct wiphy_work *work)
+{
+ struct wireless_dev *wdev = container_of(work, struct wireless_dev,
+ cqm_rssi_work);
+ struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
+ enum nl80211_cqm_rssi_threshold_event rssi_event;
+ struct cfg80211_cqm_config *cqm_config;
+ struct sk_buff *msg;
+ s32 rssi_level;
+
- wdev_lock(wdev);
- cqm_config = rcu_dereference_protected(wdev->cqm_config,
- lockdep_is_held(&wdev->mtx));
++ cqm_config = wiphy_dereference(wdev->wiphy, wdev->cqm_config);
+ if (!wdev->cqm_config)
- goto unlock;
++ return;
- cfg80211_cqm_rssi_update(rdev, dev);
+ cfg80211_cqm_rssi_update(rdev, wdev->netdev, cqm_config);
- if (rssi_level == 0)
- rssi_level = wdev->cqm_config->last_rssi_event_value;
- }
+ rssi_level = cqm_config->last_rssi_event_value;
+ rssi_event = cqm_config->last_rssi_event_type;
- msg = cfg80211_prepare_cqm(dev, NULL, gfp);
+ msg = cfg80211_prepare_cqm(wdev->netdev, NULL, GFP_KERNEL);
if (!msg)
- goto unlock;
+ return;
if (nla_put_u32(msg, NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT,
rssi_event))
@@@ -19151,15 -18900,14 +18949,13 @@@
rssi_level))
goto nla_put_failure;
- cfg80211_send_cqm(msg, gfp);
+ cfg80211_send_cqm(msg, GFP_KERNEL);
- goto unlock;
+ return;
nla_put_failure:
nlmsg_free(msg);
- unlock:
- wdev_unlock(wdev);
}
-EXPORT_SYMBOL(cfg80211_cqm_rssi_notify);
void cfg80211_cqm_txe_notify(struct net_device *dev,
const u8 *peer, u32 num_packets,
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next reply other threads:[~2023-09-12 3:15 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-12 2:46 Stephen Rothwell [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-07-16 3:52 linux-next: manual merge of the wireless-next tree with the wireless tree Stephen Rothwell
2025-07-16 8:59 ` Johannes Berg
2025-07-16 11:54 ` Stephen Rothwell
2025-07-16 17:18 ` Jeff Johnson
2024-10-28 1:36 Stephen Rothwell
2024-10-28 6:51 ` Johannes Berg
2024-10-31 2:20 ` Stephen Rothwell
2024-10-24 0:55 Stephen Rothwell
2024-10-24 6:58 ` Johannes Berg
2024-10-31 2:24 ` Stephen Rothwell
2024-06-03 1:01 Stephen Rothwell
2024-06-03 10:01 ` Kalle Valo
2024-06-06 10:09 ` Kalle Valo
2024-06-07 9:44 ` Alexis Lothoré
2024-06-07 10:29 ` Kalle Valo
2024-05-31 2:44 Stephen Rothwell
2024-04-22 0:56 Stephen Rothwell
2024-03-25 23:09 Stephen Rothwell
2024-03-26 7:58 ` Johannes Berg
2024-02-08 23:56 Stephen Rothwell
2024-02-09 7:03 ` Johannes Berg
2023-09-26 2:20 Stephen Rothwell
2023-09-26 2:02 Stephen Rothwell
2023-09-26 2:41 ` Stephen Rothwell
2023-09-26 6:21 ` Johannes Berg
2023-03-30 23:49 Stephen Rothwell
2023-03-31 9:17 ` Johannes Berg
2023-04-03 2:23 ` Stephen Rothwell
2023-04-03 8:43 ` Kalle Valo
2014-11-25 3:36 Stephen Rothwell
2013-12-03 0:20 Stephen Rothwell
2013-12-03 15:52 ` John W. Linville
2013-12-03 16:09 ` Johannes Berg
2013-12-03 18:12 ` Bob Copeland
2013-12-04 1:21 ` Yeoh Chun-Yeow
2013-08-19 2:41 Stephen Rothwell
2013-08-12 1:53 Stephen Rothwell
2013-08-12 15:15 ` John W. Linville
2013-08-12 15:34 ` Berg, Johannes
2013-06-07 2:56 Stephen Rothwell
2013-06-07 6:21 ` Sujith Manoharan
2013-03-26 1:18 Stephen Rothwell
2013-03-12 1:00 Stephen Rothwell
2012-11-15 2:17 Stephen Rothwell
2012-11-15 8:06 ` Arend van Spriel
2012-10-22 0:46 Stephen Rothwell
2012-10-22 0:13 Stephen Rothwell
2011-11-14 0:53 Stephen Rothwell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230912124623.6591edd4@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=johannes.berg@intel.com \
--cc=johannes@sipsolutions.net \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).