linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath9k: Fix a WARNING in suspend/resume with IBSS
@ 2012-06-01  6:39 Mohammed Shafi Shajakhan
  2012-06-01  6:44 ` Johannes Berg
  0 siblings, 1 reply; 9+ messages in thread
From: Mohammed Shafi Shajakhan @ 2012-06-01  6:39 UTC (permalink / raw)
  To: John W. Linville
  Cc: linux-wireless, Rodriguez Luis, ath9k-devel,
	Mohammed Shafi Shajakhan, stable, Rajkumar Manoharan

From: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>

In ath9k we make sure the following two things
*if the first interface is ADHOC we cannot have any other interface.
*we cannot add an ADHOC interface if there is already an interface
is present.

when drv_add_interface is called during resume we got to consider
number of vifs already present in addition to checking the drivers
'opmode' information about ADHOC, otherwise during suspend/resume
we incorrectly assume an ADHOC interface is already present.
Then we may miss some driver specific data for the ADHOC
interface after resume.

	ath: phy0: Cannot create ADHOC interface when other
	interfaces already exist.
	WARNING: at net/mac80211/driver-ops.h:12
	ieee80211_reconfig+0x1882/0x1ca0 [mac80211]()
	Hardware name: 2842RK1
	wlan2:  Failed check-sdata-in-driver check, flags: 0x0

	Call Trace:
	[<c01361b2>] warn_slowpath_common+0x72/0xa0
	[<f8aaa7c2>] ? ieee80211_reconfig+0x1882/0x1ca0
	[mac80211]
	[<f8aaa7c2>] ? ieee80211_reconfig+0x1882/0x1ca0
	[mac80211]
	[<c0136283>] warn_slowpath_fmt+0x33/0x40
	[<f8aaa7c2>] ieee80211_reconfig+0x1882/0x1ca0 [mac80211]
	[<c06c1d1a>] ? mutex_lock_nested+0x23a/0x2f0
	[<f8a95097>] ieee80211_resume+0x27/0x70 [mac80211]
	[<fd177edf>] wiphy_resume+0x8f/0xa0 [cfg80211]

Cc: stable@vger.kernel.org
Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/main.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 4de4473..c26497d 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1443,11 +1443,14 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
 		}
 	}
 
-	if ((ah->opmode == NL80211_IFTYPE_ADHOC) ||
-	    ((vif->type == NL80211_IFTYPE_ADHOC) &&
-	     sc->nvifs > 0)) {
-		ath_err(common, "Cannot create ADHOC interface when other"
-			" interfaces already exist.\n");
+	if ((ah->opmode == NL80211_IFTYPE_ADHOC) && (sc->nvifs > 0)) {
+		ath_err(common, "Cannot create any other interface when an ADHOC interface already exists.\n");
+		ret = -EINVAL;
+		goto out;
+	}
+
+	if ((vif->type == NL80211_IFTYPE_ADHOC) && (sc->nvifs > 0)) {
+		ath_err(common, "Cannot create ADHOC interface when other interfaces already exist.\n");
 		ret = -EINVAL;
 		goto out;
 	}
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-06-04 15:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-01  6:39 [PATCH] ath9k: Fix a WARNING in suspend/resume with IBSS Mohammed Shafi Shajakhan
2012-06-01  6:44 ` Johannes Berg
2012-06-01  7:09   ` Mohammed Shafi Shajakhan
2012-06-01  7:13     ` Johannes Berg
2012-06-02 15:27       ` Mohammed Shafi Shajakhan
2012-06-02 17:45         ` Johannes Berg
2012-06-02 18:14           ` [ath9k-devel] " Guido Iribarren
2012-06-02 18:30             ` Felix Fietkau
2012-06-04 15:46           ` Mohammed Shafi Shajakhan

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).