Re: [ 07/91] net/wireless: ipw2200: Fix WARN_ON occurring inwiphy_register called by ipw_pci_probe

From: Ben Hutchings
Date: Sun May 27 2012 - 15:50:19 EST


On Sun, 2012-05-27 at 16:24 -0300, Herton Ronaldo Krzesinski wrote:
> On Sun, May 27, 2012 at 09:25:13AM +0900, Greg KH wrote:
> > 3.4-stable review patch. If anyone has any objections, please let me know.
> >
> > ------------------
>
> As I see, this is not needed on 3.4.x or 3.3.x, since the commit
> "ipw2200: Fix order of device registration", wasn't included in 3.4 or
> any earlier kernels.
>
> This is fixing an issue introduced on that commit ("ipw2200: Fix order of
> device registration"), that moved register_netdev after ipw_wdev_init,
> but ipw_wdev_init needs initialization made on ndo_init callback.
>
> Unless there is any plan to include any of the "... Fix order of device
> registration" commits on 3.4 stable, I don't see any reason to include
> the fix for them.
>
> Besides that, I noted that ipw2100 seems to need a similar fix as below
> after the change "ipw2100: Fix order of device registration". ipw2100
> will have the same issue I expect: because ipw2100_wdev_init was moved
> before register_netdev, the ndo_init callback that runs ipw2100_up will
> only execute later with required initialization, after wiphy_register
> inside ipw2100_wdev_init runs.
[...]

Right.

As it happens, ipw2100 also has a comment explaining why .ndo_init is
used now:

* If we called ipw2100_up before we registered the device, then the
* device name wasn't registered. So, we instead use the net_dev->init
* member to call a function that then just turns and calls ipw2100_up.
* net_dev->init is called after name allocation but before the
* notifier chain is called */

So this can result in log messages referring to "wlan%d" rather than the
yet-to-be-determined device name. (That can be avoided by using
netdev_printk, which will log the PCI address.)

If userland depends on the "phy80211" symlinks for wireless net devices
in sysfs then all 4 fixes would be worth applying to stable. Otherwise,
none of them should be applied.

Ben.

--
Ben Hutchings
The obvious mathematical breakthrough [to break modern encryption] would be
development of an easy way to factor large prime numbers. - Bill Gates

Attachment: signature.asc
Description: This is a digitally signed message part