Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2403539rdb; Tue, 12 Sep 2023 00:06:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHAuuUWwTR7CO1AI71mysi9Qh7/RUeaG9KGDnjBrRAXn0gFZPlQtTVbFRrA/UPpqgIN5L6z X-Received: by 2002:a05:6870:6491:b0:1bb:90c3:bb09 with SMTP id cz17-20020a056870649100b001bb90c3bb09mr15930386oab.9.1694502377841; Tue, 12 Sep 2023 00:06:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694502377; cv=none; d=google.com; s=arc-20160816; b=DRBnR+TMl9XV8vuuCZrdTkq9ClCtAoXlPjU04O/zHxEtUHLg9HTSsriigGhyWka4lE +732jfs4VB6J4cCGXds8P5zkuO6oCSVrcM2n+hqze8edaL412k2krRD1uPaE0mTtih2K 4Cch1N3NBymrZe7ETGAlS6EY6UZvpyU9Qw4BqaLo3YtWXstH3gLbglCt1pyRG0ne/BZm Ri7ITAeboGs5tv8S2YPeBY393+0IX/q71vpad54ZIP/NuK0zjiFrrWd4AcgExeVHvyAL ggEpeh8P/K3DblNO1SIM97W803G74bz7/RNf+Rh9WQ2mUI+kiqgqPLZojweH4btUdjJy 4flA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=9w8N1w65eM3j1HplfovIWdoaEqkHF1YpWPFz5tjpCFo=; fh=YSlvpPL42+OV5bLFCL+NbyjIvOHCcshrxbzBHge5Zrw=; b=OWasBa1N3zNJ30pfS4po6j3zoNswXUKFA7HSBluyQ0mr7OLCKKXQ0ay0dTNfOsg4ai FxTHCBHRGh2FLQCuhsLA5KFQaqYCBcvRmFTsBevypBmvNudCQhHlnpUUtIpeWUkZo4Ys m1M9jkhudorHxRqGqFMHLnjlRzAYZ+XMJ5vmlQlIuG4ZKLu6J5Syx61L/5SdnqMu0GTE FhBW2NYZqROEf2BO6QBFJEuQZrywyDEFfbg34dFhvdU3wHzy2lUf23bnypa+IV4HJO7K IHEqIcbIrDTmvh/uqTzA5KxmASSmfUjc0WBDUCYKcWpSOCSHEB7t2GYT5sR/zYTfxatE o+Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canb.auug.org.au header.s=201702 header.b=naIlmKO7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canb.auug.org.au Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id p10-20020a635b0a000000b0056532a14f54si7164139pgb.900.2023.09.12.00.06.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 00:06:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@canb.auug.org.au header.s=201702 header.b=naIlmKO7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canb.auug.org.au Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 7BEF080FC169; Mon, 11 Sep 2023 21:53:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229448AbjILDPl (ORCPT + 99 others); Mon, 11 Sep 2023 23:15:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242025AbjILDP0 (ORCPT ); Mon, 11 Sep 2023 23:15:26 -0400 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 250926CD7; Mon, 11 Sep 2023 19:46:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canb.auug.org.au; s=201702; t=1694486786; bh=9w8N1w65eM3j1HplfovIWdoaEqkHF1YpWPFz5tjpCFo=; h=Date:From:To:Cc:Subject:From; b=naIlmKO7lUSHzKh3udlfvGQAyEBpEO6uHF4815s40RKckMzEJAizrivmQ/FhSlhOb G8M6UGG9lYS9LFgrsuwa+zgk2k3X2OjKSWczolx31ctq1GKJebXMx2I2BTTzz/CCwW ikOShORCXJgH5ZRZLx9cUL/NfgOvsf12vuw7q5ZN9kIO8FTptXQ359QQI0NCu6gkLF dn3MzwOGVskGP5zFN6Jli0nqWgrT6EiKs8QOa5dc2GlCxTtd+LhZldZ152pXGSn7Cl +/yy0eYtelhaE2jCRG1Lk0J0AIGIYsVdUz2XrhWe5Nj9pindOZ6Y5LIbq3kh+0BaHK 24pVpuzDswEPg== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Rl7JJ4Pfgz4x3C; Tue, 12 Sep 2023 12:46:24 +1000 (AEST) Date: Tue, 12 Sep 2023 12:46:23 +1000 From: Stephen Rothwell To: Kalle Valo , Johannes Berg , Wireless Cc: Johannes Berg , Linux Kernel Mailing List , Linux Next Mailing List Subject: linux-next: manual merge of the wireless-next tree with the wireless tree Message-ID: <20230912124623.6591edd4@canb.auug.org.au> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/EtIg2kmiN+NByGDtODittXt"; protocol="application/pgp-signature"; micalg=pgp-sha256 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 11 Sep 2023 21:53:14 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email --Sig_/EtIg2kmiN+NByGDtODittXt Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable 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. --=20 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 =20 err =3D nl80211_calculate_ap_params(params); if (err) - goto out_unlock; + goto out; =20 + err =3D nl80211_validate_ap_phy_operation(params); + if (err) - goto out_unlock; ++ goto out; + if (info->attrs[NL80211_ATTR_AP_SETTINGS_FLAGS]) params->flags =3D nla_get_u32( info->attrs[NL80211_ATTR_AP_SETTINGS_FLAGS]); @@@ -12884,11 -12747,10 +12767,11 @@@ static int nl80211_set_cqm_rssi(struc= t=20 u32 hysteresis) { struct cfg80211_registered_device *rdev =3D info->user_ptr[0]; + struct cfg80211_cqm_config *cqm_config =3D NULL, *old; struct net_device *dev =3D info->user_ptr[1]; struct wireless_dev *wdev =3D dev->ieee80211_ptr; - int i, err; s32 prev =3D S32_MIN; - int i; ++ int i, err; =20 /* Check all values negative and sorted */ for (i =3D 0; i < n_thresholds; i++) { @@@ -12917,11 -12781,9 +12800,9 @@@ if (n_thresholds =3D=3D 1 && thresholds[0] =3D=3D 0) /* Disabling */ n_thresholds =3D 0; =20 - wdev_lock(wdev); - old =3D rcu_dereference_protected(wdev->cqm_config, - lockdep_is_held(&wdev->mtx)); - if (n_thresholds) { - struct cfg80211_cqm_config *cqm_config; ++ old =3D wiphy_dereference(wdev->wiphy, wdev->cqm_config); =20 + if (n_thresholds) { cqm_config =3D 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)); =20 - wdev->cqm_config =3D cqm_config; + rcu_assign_pointer(wdev->cqm_config, cqm_config); + } else { + RCU_INIT_POINTER(wdev->cqm_config, NULL); } =20 - return cfg80211_cqm_rssi_update(rdev, dev); + err =3D 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; } =20 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 !=3D NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH)) return; =20 - if (wdev->cqm_config) { - wdev->cqm_config->last_rssi_event_value =3D rssi_level; + rcu_read_lock(); + cqm_config =3D rcu_dereference(wdev->cqm_config); + if (cqm_config) { + cqm_config->last_rssi_event_value =3D rssi_level; + cqm_config->last_rssi_event_type =3D 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 =3D container_of(work, struct wireless_dev, + cqm_rssi_work); + struct cfg80211_registered_device *rdev =3D 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 =3D rcu_dereference_protected(wdev->cqm_config, - lockdep_is_held(&wdev->mtx)); ++ cqm_config =3D wiphy_dereference(wdev->wiphy, wdev->cqm_config); + if (!wdev->cqm_config) - goto unlock; ++ return; =20 - cfg80211_cqm_rssi_update(rdev, dev); + cfg80211_cqm_rssi_update(rdev, wdev->netdev, cqm_config); =20 - if (rssi_level =3D=3D 0) - rssi_level =3D wdev->cqm_config->last_rssi_event_value; - } + rssi_level =3D cqm_config->last_rssi_event_value; + rssi_event =3D cqm_config->last_rssi_event_type; =20 - msg =3D cfg80211_prepare_cqm(dev, NULL, gfp); + msg =3D cfg80211_prepare_cqm(wdev->netdev, NULL, GFP_KERNEL); if (!msg) - goto unlock; + return; =20 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; =20 - cfg80211_send_cqm(msg, gfp); + cfg80211_send_cqm(msg, GFP_KERNEL); =20 - goto unlock; + return; =20 nla_put_failure: nlmsg_free(msg); - unlock: - wdev_unlock(wdev); } -EXPORT_SYMBOL(cfg80211_cqm_rssi_notify); =20 void cfg80211_cqm_txe_notify(struct net_device *dev, const u8 *peer, u32 num_packets, --Sig_/EtIg2kmiN+NByGDtODittXt Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEENIC96giZ81tWdLgKAVBC80lX0GwFAmT/0P8ACgkQAVBC80lX 0GxmKAgAhFwTkAlObU0Rl4d/XxvO2r6z01TP1U6Ga1NwuhFQfOYh0TPd5ybS30X6 Cgz3tDgyj/KzL7j/FejSdE1cDaFv3HB6OUOcTy8jrEFpLGk8P9ERuI13fsZZeTDi uCI9SEhM7ZpPjvyysCPsf0lyAfAEDSh6DMWmgyOgwM6O9TV01mQxYF2jFeTA7xWB BWRdLo/0t6rgew+ygEjMEggmNt/QWjVU5Mn1TseurpFoyZXGuCjXJwPjubv1noKw n12OwGNQssLKRDKbFI9o7SCia/twSHEKvA/FmGeIn7/48aPsceUR0/u1VhKOjMAO naFqbuZmU/Nz2ozw2kdvzqlbzgqQPw== =ZBWJ -----END PGP SIGNATURE----- --Sig_/EtIg2kmiN+NByGDtODittXt--