linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: gregory.greenman@intel.com
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org,
	Johannes Berg <johannes.berg@intel.com>,
	Gregory Greenman <gregory.greenman@intel.com>
Subject: [PATCH 16/16] wifi: mac80211: stop warning after reconfig failures
Date: Sun,  4 Jun 2023 12:11:28 +0300	[thread overview]
Message-ID: <20230604120651.3750c4ae6e76.I9e80d6026f59263c008a1a68f6cd6891ca0b93b0@changeid> (raw)
In-Reply-To: <20230604091128.609335-1-gregory.greenman@intel.com>

From: Johannes Berg <johannes.berg@intel.com>

If we have a reconfig failure in the driver, then we need
to shut down the network interface(s) at the network stack
level through cfg80211, which can result in a lot of those
"Failed check-sdata-in-driver check, ..." warnings, since
interfaces are considered to not be in the driver when the
reconfiguration fails, but we still need to go through all
the shutdown flow.

Avoid many of these warnings by storing the fact that the
stack experienced a reconfiguration failure and not doing
the warning in that case.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
---
 net/mac80211/driver-ops.h  | 10 ++++++----
 net/mac80211/ieee80211_i.h |  3 +++
 net/mac80211/iface.c       |  3 +++
 net/mac80211/util.c        |  1 +
 4 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 45d3e53c7383..c4505593ba7a 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -2,7 +2,7 @@
 /*
 * Portions of this file
 * Copyright(c) 2016 Intel Deutschland GmbH
-* Copyright (C) 2018 - 2019, 2021 Intel Corporation
+* Copyright (C) 2018 - 2019, 2021 - 2023 Intel Corporation
 */
 
 #ifndef __MAC80211_DRIVER_OPS
@@ -13,9 +13,11 @@
 #include "trace.h"
 
 #define check_sdata_in_driver(sdata)	({					\
-	!WARN_ONCE(!(sdata->flags & IEEE80211_SDATA_IN_DRIVER),			\
-		   "%s: Failed check-sdata-in-driver check, flags: 0x%x\n",	\
-		   sdata->dev ? sdata->dev->name : sdata->name, sdata->flags);	\
+	WARN_ONCE(!sdata->local->reconfig_failure &&				\
+		  !(sdata->flags & IEEE80211_SDATA_IN_DRIVER),			\
+		  "%s: Failed check-sdata-in-driver check, flags: 0x%x\n",	\
+		  sdata->dev ? sdata->dev->name : sdata->name, sdata->flags);	\
+	!!(sdata->flags & IEEE80211_SDATA_IN_DRIVER);				\
 })
 
 static inline struct ieee80211_sub_if_data *
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 46adb1d9a589..8358051720f8 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1394,6 +1394,9 @@ struct ieee80211_local {
 	/* device is during a HW reconfig */
 	bool in_reconfig;
 
+	/* reconfiguration failed ... suppress some warnings etc. */
+	bool reconfig_failure;
+
 	/* wowlan is enabled -- don't reconfig on resume */
 	bool wowlan;
 
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index f1e01f7a9b2e..2e2115af38f5 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -1281,6 +1281,9 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
 	}
 
 	if (local->open_count == 0) {
+		/* here we can consider everything in good order (again) */
+		local->reconfig_failure = false;
+
 		res = drv_start(local);
 		if (res)
 			goto err_del_bss;
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 316a052d61bd..45ab533ef4f1 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -2370,6 +2370,7 @@ static void ieee80211_handle_reconfig_failure(struct ieee80211_local *local)
 	local->resuming = false;
 	local->suspended = false;
 	local->in_reconfig = false;
+	local->reconfig_failure = true;
 
 	ieee80211_flush_completed_scan(local, true);
 
-- 
2.38.1


      parent reply	other threads:[~2023-06-04  9:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-04  9:11 [PATCH 00/16] cfg80211/mac80211 patches from our internal tree 2023-06-04 gregory.greenman
2023-06-04  9:11 ` [PATCH 01/16] wifi: mac80211: use u64 to hold enum ieee80211_bss_change flags gregory.greenman
2023-06-04  9:11 ` [PATCH 02/16] wifi: mac80211: refactor ieee80211_select_link_key() gregory.greenman
2023-06-04  9:11 ` [PATCH 03/16] wifi: mac80211: don't translate beacon/presp addrs gregory.greenman
2023-06-04  9:11 ` [PATCH 04/16] wifi: mac80211: mlme: fix non-inheritence element gregory.greenman
2023-06-04  9:11 ` [PATCH 05/16] wifi: mac80211: provide a helper to fetch the medium synchronization delay gregory.greenman
2023-06-04  9:11 ` [PATCH 06/16] wifi: cfg80211: reject bad AP MLD address gregory.greenman
2023-06-04  9:11 ` [PATCH 07/16] wifi: mac80211_hwsim: check the return value of nla_put_u32 gregory.greenman
2023-06-04  9:11 ` [PATCH 08/16] wifi: mac80211: recalc min chandef for new STA links gregory.greenman
2023-06-04  9:11 ` [PATCH 09/16] wifi: mac80211: move sta_info_move_state() up gregory.greenman
2023-06-04  9:11 ` [PATCH 10/16] wifi: mac80211: batch recalc during STA flush gregory.greenman
2023-06-04  9:11 ` [PATCH 11/16] wifi: mac80211: use correct iftype HE cap gregory.greenman
2023-06-04  9:11 ` [PATCH 12/16] wifi: mac80211: add helpers to access sband iftype data gregory.greenman
2023-06-04  9:11 ` [PATCH 13/16] wifi: mac80211: remove typecast in a call to ieee80211_config_bw() gregory.greenman
2023-06-06 13:18   ` Nicolas Escande
2023-06-06 13:22     ` Johannes Berg
2023-06-04  9:11 ` [PATCH 14/16] wifi: mac80211: Modify type of "changed" variable gregory.greenman
2023-12-02 17:56   ` Jeff Johnson
2023-12-03 16:48     ` Jeff Johnson
2023-12-03 18:42       ` Johannes Berg
2023-06-04  9:11 ` [PATCH 15/16] wifi: mac80211_hwsim: Fix possible NULL dereference gregory.greenman
2023-06-04  9:11 ` gregory.greenman [this message]

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=20230604120651.3750c4ae6e76.I9e80d6026f59263c008a1a68f6cd6891ca0b93b0@changeid \
    --to=gregory.greenman@intel.com \
    --cc=johannes.berg@intel.com \
    --cc=johannes@sipsolutions.net \
    --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).