All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mac80211: call ieee80211_mgd_teardown() on interface stop
@ 2012-04-23 10:47 Eliad Peller
  2012-04-23 10:55 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Eliad Peller @ 2012-04-23 10:47 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

ieee80211_mgd_teardown() is called on netdev removal, which
occurs after the vif was already removed from the low-level
driver, resulting in the following warning:

[ 4809.014734] ------------[ cut here ]------------
[ 4809.019861] WARNING: at net/mac80211/driver-ops.h:12 ieee80211_bss_info_change_notify+0x200/0x2c8 [mac80211]()
[ 4809.030388] wlan0:  Failed check-sdata-in-driver check, flags: 0x4
[ 4809.036862] Modules linked in: wlcore_sdio(-) wl12xx wlcore mac80211 cfg80211 [last unloaded: cfg80211]
[ 4809.046849] [<c001bd4c>] (unwind_backtrace+0x0/0x12c)
[ 4809.055937] [<c047cf1c>] (dump_stack+0x20/0x24)
[ 4809.065385] [<c003e334>] (warn_slowpath_common+0x5c/0x74)
[ 4809.075589] [<c003e408>] (warn_slowpath_fmt+0x40/0x48)
[ 4809.088291] [<bf033630>] (ieee80211_bss_info_change_notify+0x200/0x2c8 [mac80211])
[ 4809.102844] [<bf067f84>] (ieee80211_destroy_auth_data+0x80/0xa4 [mac80211])
[ 4809.116276] [<bf068004>] (ieee80211_mgd_teardown+0x5c/0x74 [mac80211])
[ 4809.129331] [<bf043f18>] (ieee80211_teardown_sdata+0xb0/0xd8 [mac80211])
[ 4809.141595] [<c03b5e58>] (rollback_registered_many+0x228/0x2f0)
[ 4809.153056] [<c03b5f48>] (unregister_netdevice_many+0x28/0x50)
[ 4809.165696] [<bf041ea8>] (ieee80211_remove_interfaces+0xb4/0xdc [mac80211])
[ 4809.179151] [<bf032174>] (ieee80211_unregister_hw+0x50/0xf0 [mac80211])
[ 4809.191043] [<bf0bebb4>] (wlcore_remove+0x5c/0x7c [wlcore])
[ 4809.201491] [<c02c6918>] (platform_drv_remove+0x24/0x28)
[ 4809.212029] [<c02c4d50>] (__device_release_driver+0x8c/0xcc)
[ 4809.222738] [<c02c4e84>] (device_release_driver+0x30/0x3c)
[ 4809.233099] [<c02c4258>] (bus_remove_device+0x10c/0x128)
[ 4809.242620] [<c02c26f8>] (device_del+0x11c/0x17c)
[ 4809.252150] [<c02c6de0>] (platform_device_del+0x28/0x68)
[ 4809.263051] [<bf0df49c>] (wl1271_remove+0x3c/0x50 [wlcore_sdio])
[ 4809.273590] [<c03806b0>] (sdio_bus_remove+0x48/0xf8)
[ 4809.283754] [<c02c4d50>] (__device_release_driver+0x8c/0xcc)
[ 4809.293729] [<c02c4e2c>] (driver_detach+0x9c/0xc4)
[ 4809.303163] [<c02c3d7c>] (bus_remove_driver+0xc4/0xf4)
[ 4809.312973] [<c02c5a98>] (driver_unregister+0x70/0x7c)
[ 4809.323220] [<c03809c4>] (sdio_unregister_driver+0x24/0x2c)
[ 4809.334213] [<bf0df458>] (wl1271_exit+0x14/0x1c [wlcore_sdio])
[ 4809.344930] [<c009b1a4>] (sys_delete_module+0x228/0x2a8)
[ 4809.354734] ---[ end trace 515290ccf5feb522 ]---

Fix it by calling ieee80211_mgd_teardown() on ieee80211_do_stop().

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 net/mac80211/iface.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 6e85fae..060e62b 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -649,6 +649,8 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
 		if (sdata->vif.type == NL80211_IFTYPE_MESH_POINT)
 			ieee80211_bss_info_change_notify(sdata,
 				BSS_CHANGED_BEACON_ENABLED);
+		else if (sdata->vif.type == NL80211_IFTYPE_STATION)
+			ieee80211_mgd_teardown(sdata);
 
 		/*
 		 * Free all remaining keys, there shouldn't be any,
@@ -767,8 +769,6 @@ static void ieee80211_teardown_sdata(struct net_device *dev)
 
 	if (ieee80211_vif_is_mesh(&sdata->vif))
 		mesh_rmc_free(sdata);
-	else if (sdata->vif.type == NL80211_IFTYPE_STATION)
-		ieee80211_mgd_teardown(sdata);
 
 	flushed = sta_info_flush(local, sdata);
 	WARN_ON(flushed);
-- 
1.7.6.401.g6a319


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

* Re: [PATCH] mac80211: call ieee80211_mgd_teardown() on interface stop
  2012-04-23 10:47 [PATCH] mac80211: call ieee80211_mgd_teardown() on interface stop Eliad Peller
@ 2012-04-23 10:55 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2012-04-23 10:55 UTC (permalink / raw)
  To: Eliad Peller; +Cc: linux-wireless

On Mon, 2012-04-23 at 13:47 +0300, Eliad Peller wrote:
> ieee80211_mgd_teardown() is called on netdev removal, which
> occurs after the vif was already removed from the low-level
> driver, resulting in the following warning:

> Fix it by calling ieee80211_mgd_teardown() on ieee80211_do_stop().

Would you rename it to mgd_stop() as well maybe? The "teardown" name is
pretty specific here.

> +++ b/net/mac80211/iface.c
> @@ -649,6 +649,8 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
>  		if (sdata->vif.type == NL80211_IFTYPE_MESH_POINT)
>  			ieee80211_bss_info_change_notify(sdata,
>  				BSS_CHANGED_BEACON_ENABLED);
> +		else if (sdata->vif.type == NL80211_IFTYPE_STATION)
> +			ieee80211_mgd_teardown(sdata);

Could there be a case where the teardown could start a work item? It
might be better to make this part of the switch, and fall through to
flush_work() etc.?

johannes


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

end of thread, other threads:[~2012-04-23 10:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-23 10:47 [PATCH] mac80211: call ieee80211_mgd_teardown() on interface stop Eliad Peller
2012-04-23 10:55 ` Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.