* [PATCH 2/2] cfg80211: fix wireless handlers assignment
@ 2009-09-27 18:27 Johannes Berg
2009-09-27 20:30 ` Luis R. Rodriguez
2009-09-27 20:58 ` Hugh Dickins
0 siblings, 2 replies; 8+ messages in thread
From: Johannes Berg @ 2009-09-27 18:27 UTC (permalink / raw)
To: netdev; +Cc: linux-wireless, Hugh Dickins
The point we assign dev->wireless_handlers at is too
late, we need to do that before netdev_register_kobject()
gets called, so use the new NETDEV_PRE_INIT notifier.
The result of adding wireless_handlers too late is the
disappearance of /sys/class/net/wlan0/wireless which a
bunch of distro scripts still require.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
This should fix the regression Hugh reported (of course requires the
other patch which unfortunately I forgot to CC you, Hugh, I'll send you
a copy in private).
net/wireless/core.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- wireless-testing.orig/net/wireless/core.c 2009-09-27 15:12:20.000000000 +0200
+++ wireless-testing/net/wireless/core.c 2009-09-27 15:12:54.000000000 +0200
@@ -641,6 +641,12 @@ static int cfg80211_netdev_notifier_call
WARN_ON(wdev->iftype == NL80211_IFTYPE_UNSPECIFIED);
switch (state) {
+ case NETDEV_PRE_INIT:
+#ifdef CONFIG_WIRELESS_EXT
+ if (!dev->wireless_handlers)
+ dev->wireless_handlers = &cfg80211_wext_handler;
+#endif
+ break;
case NETDEV_REGISTER:
/*
* NB: cannot take rdev->mtx here because this may be
@@ -666,8 +672,6 @@ static int cfg80211_netdev_notifier_call
wdev->sme_state = CFG80211_SME_IDLE;
mutex_unlock(&rdev->devlist_mtx);
#ifdef CONFIG_WIRELESS_EXT
- if (!dev->wireless_handlers)
- dev->wireless_handlers = &cfg80211_wext_handler;
wdev->wext.default_key = -1;
wdev->wext.default_mgmt_key = -1;
wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC;
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 2/2] cfg80211: fix wireless handlers assignment
2009-09-27 18:27 [PATCH 2/2] cfg80211: fix wireless handlers assignment Johannes Berg
@ 2009-09-27 20:30 ` Luis R. Rodriguez
2009-09-27 20:58 ` Hugh Dickins
1 sibling, 0 replies; 8+ messages in thread
From: Luis R. Rodriguez @ 2009-09-27 20:30 UTC (permalink / raw)
To: Johannes Berg; +Cc: netdev, linux-wireless, Hugh Dickins
On Sun, Sep 27, 2009 at 11:27 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> The point we assign dev->wireless_handlers at is too
> late, we need to do that before netdev_register_kobject()
> gets called, so use the new NETDEV_PRE_INIT notifier.
> The result of adding wireless_handlers too late is the
> disappearance of /sys/class/net/wlan0/wireless which a
> bunch of distro scripts still require.
>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> ---
> This should fix the regression Hugh reported (of course requires the
> other patch which unfortunately I forgot to CC you, Hugh, I'll send you
> a copy in private).
Are these stable fixes?
Luis
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] cfg80211: fix wireless handlers assignment
2009-09-27 18:27 [PATCH 2/2] cfg80211: fix wireless handlers assignment Johannes Berg
2009-09-27 20:30 ` Luis R. Rodriguez
@ 2009-09-27 20:58 ` Hugh Dickins
2009-09-27 21:50 ` Hugh Dickins
2009-09-28 7:41 ` Johannes Berg
1 sibling, 2 replies; 8+ messages in thread
From: Hugh Dickins @ 2009-09-27 20:58 UTC (permalink / raw)
To: Johannes Berg; +Cc: netdev, linux-wireless
On Sun, 27 Sep 2009, Johannes Berg wrote:
> The point we assign dev->wireless_handlers at is too
> late, we need to do that before netdev_register_kobject()
> gets called, so use the new NETDEV_PRE_INIT notifier.
> The result of adding wireless_handlers too late is the
> disappearance of /sys/class/net/wlan0/wireless which a
> bunch of distro scripts still require.
>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
This 2/2 patch does indeed work: many thanks. But...
> ---
> This should fix the regression Hugh reported (of course requires the
> other patch which unfortunately I forgot to CC you, Hugh, I'll send you
> a copy in private).
... the 1/2 patch has a couple of problems.
The trivial problem is that include/linux/notifier.h in Linus's git has
#define NETDEV_PRE_UP 0x000D
#define NETDEV_BONDING_OLDTYPE 0x000E
#define NETDEV_BONDING_NEWTYPE 0x000F
So it rejects the patch you posted: I changed it to add
#define NETDEV_PRE_INIT 0x0010
just after the NETDEV_BONDING_NEWTYPE line.
The more serious problem is that it stops both my machines from booting,
too early for framebuffer to show any messages, but vga=normal shows a
long stacktrace scrolling offscreen, with some notifier stuff in there.
I've experimented by moving your NETDEV_PRE_INIT hunk later in the
sequence, just before the netdev_initialize_kobject(dev) (so I also
changed the "goto out" to "goto err_uninit"): both* machines then boot
correctly, and this mail leaves me wirelessly.
I'll now experiment to see how early I can move that hunk.
Hugh
* I wrote that hoping the Aspire One build would complete soon,
but it's still going: assume it's fine unless I say otherwise.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] cfg80211: fix wireless handlers assignment
2009-09-27 20:58 ` Hugh Dickins
@ 2009-09-27 21:50 ` Hugh Dickins
2009-09-28 7:54 ` Johannes Berg
2009-09-28 7:41 ` Johannes Berg
1 sibling, 1 reply; 8+ messages in thread
From: Hugh Dickins @ 2009-09-27 21:50 UTC (permalink / raw)
To: Johannes Berg; +Cc: netdev, linux-wireless
On Sun, 27 Sep 2009, Hugh Dickins wrote:
>
> I've experimented by moving your NETDEV_PRE_INIT hunk later in the
> sequence, just before the netdev_initialize_kobject(dev) (so I also
> changed the "goto out" to "goto err_uninit"): both* machines then boot
> correctly, and this mail leaves me wirelessly.
>
> I'll now experiment to see how early I can move that hunk.
Both machines boot (and do wireless) correctly with your NETDEV_PRE_INIT
hunk placed just after the ndo_init block, instead of just before where
you placed it. That's i386 kernels on both.
But curiouser and curiouser... the laptop can do 64-bit, so I built
my 64-bit kernel, and went through the motions to reproduce the
early boot crash with the patch as you had it: but the x86_64 kernel
boots (and does wireless) correctly with the NETDEV_PRE_INIT hunk
just where you placed it, before the ndo_init block.
Perhaps there's a difference in the 32- and 64-bit startup sequence
with respect to notifiers; or perhaps your change tickles another bug.
I don't know, I'm turning off now.
Hugh
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] cfg80211: fix wireless handlers assignment
2009-09-27 21:50 ` Hugh Dickins
@ 2009-09-28 7:54 ` Johannes Berg
0 siblings, 0 replies; 8+ messages in thread
From: Johannes Berg @ 2009-09-28 7:54 UTC (permalink / raw)
To: Hugh Dickins; +Cc: netdev, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 1320 bytes --]
On Sun, 2009-09-27 at 22:50 +0100, Hugh Dickins wrote:
> On Sun, 27 Sep 2009, Hugh Dickins wrote:
> >
> > I've experimented by moving your NETDEV_PRE_INIT hunk later in the
> > sequence, just before the netdev_initialize_kobject(dev) (so I also
> > changed the "goto out" to "goto err_uninit"): both* machines then boot
> > correctly, and this mail leaves me wirelessly.
> >
> > I'll now experiment to see how early I can move that hunk.
>
> Both machines boot (and do wireless) correctly with your NETDEV_PRE_INIT
> hunk placed just after the ndo_init block, instead of just before where
> you placed it. That's i386 kernels on both.
>
> But curiouser and curiouser... the laptop can do 64-bit, so I built
> my 64-bit kernel, and went through the motions to reproduce the
> early boot crash with the patch as you had it: but the x86_64 kernel
> boots (and does wireless) correctly with the NETDEV_PRE_INIT hunk
> just where you placed it, before the ndo_init block.
>
> Perhaps there's a difference in the 32- and 64-bit startup sequence
> with respect to notifiers; or perhaps your change tickles another bug.
> I don't know, I'm turning off now.
Interesting, thanks for taking the time to test. I'll post an updated
patchset that calls it POST_INIT and moves it to there.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] cfg80211: fix wireless handlers assignment
2009-09-27 20:58 ` Hugh Dickins
2009-09-27 21:50 ` Hugh Dickins
@ 2009-09-28 7:41 ` Johannes Berg
1 sibling, 0 replies; 8+ messages in thread
From: Johannes Berg @ 2009-09-28 7:41 UTC (permalink / raw)
To: Hugh Dickins; +Cc: netdev, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 1677 bytes --]
On Sun, 2009-09-27 at 21:58 +0100, Hugh Dickins wrote:
> This 2/2 patch does indeed work: many thanks. But...
... it won't fix anything by itself.
> > This should fix the regression Hugh reported (of course requires the
> > other patch which unfortunately I forgot to CC you, Hugh, I'll send you
> > a copy in private).
>
> ... the 1/2 patch has a couple of problems.
>
> The trivial problem is that include/linux/notifier.h in Linus's git has
> #define NETDEV_PRE_UP 0x000D
> #define NETDEV_BONDING_OLDTYPE 0x000E
> #define NETDEV_BONDING_NEWTYPE 0x000F
>
> So it rejects the patch you posted: I changed it to add
> #define NETDEV_PRE_INIT 0x0010
> just after the NETDEV_BONDING_NEWTYPE line.
Right, that's fixable, I was evidently working against the wrong tree.
> The more serious problem is that it stops both my machines from booting,
> too early for framebuffer to show any messages, but vga=normal shows a
> long stacktrace scrolling offscreen, with some notifier stuff in there.
Ahrg. That's strange.
> I've experimented by moving your NETDEV_PRE_INIT hunk later in the
> sequence, just before the netdev_initialize_kobject(dev) (so I also
> changed the "goto out" to "goto err_uninit"): both* machines then boot
> correctly, and this mail leaves me wirelessly.
>
> I'll now experiment to see how early I can move that hunk.
Interesting. Thanks for that; must be some notifier that doesn't expect
to be run. For all I care, it can be right before the kobject stuff, so
maybe that makes more sense as it's a fairly last-minute fix now. Of
course then it should be POST_INIT or PRE_REGISTER I suppose.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] cfg80211: fix wireless handlers assignment
@ 2009-09-28 8:21 Johannes Berg
2009-09-28 9:29 ` Johannes Berg
0 siblings, 1 reply; 8+ messages in thread
From: Johannes Berg @ 2009-09-28 8:21 UTC (permalink / raw)
To: netdev; +Cc: Hugh Dickins, linux-wireless
The point we assign dev->wireless_handlers at is too
late, we need to do that before netdev_register_kobject()
gets called, so use the new NETDEV_PRE_INIT notifier.
The result of adding wireless_handlers too late is the
disappearance of /sys/class/net/wlan0/wireless which a
bunch of distro scripts still require.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/wireless/core.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- wireless-testing.orig/net/wireless/core.c 2009-09-28 09:54:52.000000000 +0200
+++ wireless-testing/net/wireless/core.c 2009-09-28 10:18:47.000000000 +0200
@@ -641,6 +641,12 @@ static int cfg80211_netdev_notifier_call
WARN_ON(wdev->iftype == NL80211_IFTYPE_UNSPECIFIED);
switch (state) {
+ case NETDEV_POST_INIT:
+#ifdef CONFIG_WIRELESS_EXT
+ if (!dev->wireless_handlers)
+ dev->wireless_handlers = &cfg80211_wext_handler;
+#endif
+ break;
case NETDEV_REGISTER:
/*
* NB: cannot take rdev->mtx here because this may be
@@ -666,8 +672,6 @@ static int cfg80211_netdev_notifier_call
wdev->sme_state = CFG80211_SME_IDLE;
mutex_unlock(&rdev->devlist_mtx);
#ifdef CONFIG_WIRELESS_EXT
- if (!dev->wireless_handlers)
- dev->wireless_handlers = &cfg80211_wext_handler;
wdev->wext.default_key = -1;
wdev->wext.default_mgmt_key = -1;
wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC;
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 2/2] cfg80211: fix wireless handlers assignment
2009-09-28 8:21 Johannes Berg
@ 2009-09-28 9:29 ` Johannes Berg
0 siblings, 0 replies; 8+ messages in thread
From: Johannes Berg @ 2009-09-28 9:29 UTC (permalink / raw)
To: netdev; +Cc: Hugh Dickins, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 456 bytes --]
On Mon, 2009-09-28 at 10:21 +0200, Johannes Berg wrote:
> The point we assign dev->wireless_handlers at is too
> late, we need to do that before netdev_register_kobject()
> gets called, so use the new NETDEV_PRE_INIT notifier.
> The result of adding wireless_handlers too late is the
> disappearance of /sys/class/net/wlan0/wireless which a
> bunch of distro scripts still require.
Ignore please, I have a better, self-contained fix.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-09-28 9:29 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-27 18:27 [PATCH 2/2] cfg80211: fix wireless handlers assignment Johannes Berg
2009-09-27 20:30 ` Luis R. Rodriguez
2009-09-27 20:58 ` Hugh Dickins
2009-09-27 21:50 ` Hugh Dickins
2009-09-28 7:54 ` Johannes Berg
2009-09-28 7:41 ` Johannes Berg
-- strict thread matches above, loose matches on Subject: below --
2009-09-28 8:21 Johannes Berg
2009-09-28 9:29 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox