cfg80211: fix initialisation if built-in
Subsystems (4)
Johannes Berg
maintainerPATCH 1/1 cfg80211: fix initialisation if built-in
When cfg80211 is built into the kernel it needs to init earlier so that device registrations are run after it has initialised.
--- net/wireless/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/wireless/core.c +1 -1
@@ -363,7 +363,7 @@ out_fail_notifier: out_fail_sysfs:return err; } -module_init (cfg80211_init); +subsys_initcall (cfg80211_init);static void cfg80211_exit (void ) {
Quoted 4 lines · Johannes Berg
When cfg80211 is built into the kernel it needs to init earlier so that device registrations are run after it has initialised.
Signed-off-by Johannes Berg <[email protected]>
Yep, I need this fix as well. Without it the ath5k driver built in bombs out during module_init(). Something with kref and a struct device pointing to an uninitialized ieee80211_class.
I need a similar fix for net/mac80211/rc80211_simple.c as well to get ath5k working though, not sure why at the moment. There may be some bug with request_module() not being called properly. ieee80211_register_hw() calls ieee80211_init_rate_ctrl_alg() with NULL as name which calls rate_control_alloc() with NULL which always seems to fail when built in.
This hack works around that problem, not sure what the real fix is.
net/mac80211/rc80211_simple.c 2007-09-09 18:11:48.000000000 +0900 renamed from net/mac80211/rc80211_simple.c +2 -1
@@ -431,7 +431,8 @@ static void __exit rate_control_simple_e } -module_init(rate_control_simple_init); +//module_init(rate_control_simple_init); +postcore_initcall(rate_control_simple_init); module_exit(rate_control_simple_exit); MODULE_DESCRIPTION("Simple rate control algorithm for ieee80211");
Thanks,
/ magnus
net/mac80211/rc80211_simple.c 2007-09-09 18:11:48.000000000 +0900 static void __exit rate_control_simple_e · line 438
Quoted 6 lines · Magnus Damm
net/mac80211/rc80211_simple.c 2007-09-09 18:11:48.000000000 +0900 renamed from net/mac80211/rc80211_simple.c +2
-1-module_init(rate_control_simple_init); +//module_init(rate_control_simple_init); +postcore_initcall(rate_control_simple_init); module_exit(rate_control_simple_exit); MODULE_DESCRIPTION("Simple rate control algorithm for ieee80211");
Same problem here, except with the rt2x00 driver. I changed it to subsys_initcall(rate_control_simple_init), which also worked. I also found that without this change, it was failing at this point in ieee80211_rate.c:
ieee80211_try_rate_control_ops_get(const char *name)
{
struct rate_control_alg *alg;
struct rate_control_ops *ops = NULL;
mutex_lock(&rate_ctrl_mutex);
list_for_each_entry(alg, &rate_ctrl_algs, list) { <===== Here
if (!name || !strcmp(alg->ops->name, name))
if (try_module_get(alg->ops->module)) {
ops = alg->ops;
break;
}Johannes Berg
maintainerQuoted 6 lines · Magnus Damm
Quoted 4 lines · Johannes Berg
When cfg80211 is built into the kernel it needs to init earlier so that device registrations are run after it has initialised.
Signed-off-by Johannes Berg <[email protected]>
Quoted 7 lines
Yep, I need this fix as well. Without it the ath5k driver built in bombs out during
module_init(). Something with kref and a struct device pointing to an uninitializedieee80211_class.I need a similar fix for
net/mac80211/rc80211_simple.cas well to get ath5k working though, not sure why at the moment. There may be some bug withrequest_module()not being called properly.
Nah, it's just all too late and the rate control algorithm is built-in too iirc. Rob tested a patch that changes those to subsys_initcall() as well, so I'll be posting that.
johannes
Quoted 4 lines · Johannes Berg
When cfg80211 is built into the kernel it needs to init earlier so that device registrations are run after it has initialised.
Signed-off-by Johannes Berg <[email protected]>
When this goes into Linus's tree, please resend it to the [email protected] address so we can add it to our queue.
thanks,
greg k-h
Johannes Berg
maintainerQuoted 2 lines · Greg KH
When this goes into Linus's tree, please resend it to the [email protected] address so we can add it to our queue.
It's on the way, sitting in net-2.6.24 right now but I don't know whether it's scheduled for .23. I'm no longer sure if it really matters for -stable since we have no drivers there so typically drivers build as out-of-tree modules and the issue doesn't matter.
johannes