[kernel] r20207 - in dists/wheezy/linux/debian: . patches patches/bugfix/x86
Ben Hutchings
benh at alioth.debian.org
Sat Jun 8 16:40:34 UTC 2013
Author: benh
Date: Sat Jun 8 16:40:34 2013
New Revision: 20207
Log:
ipw2100,ipw2200: Fix order of device registration (Closes: #656813)
Added:
dists/wheezy/linux/debian/patches/bugfix/x86/ipw2100-Fix-order-of-device-registration.patch
dists/wheezy/linux/debian/patches/bugfix/x86/ipw2200-Fix-order-of-device-registration.patch
dists/wheezy/linux/debian/patches/bugfix/x86/net-wireless-ipw2100-Fix-WARN_ON-occurring-in-wiphy_.patch
dists/wheezy/linux/debian/patches/bugfix/x86/net-wireless-ipw2200-Fix-WARN_ON-occurring-in-wiphy_.patch
Modified:
dists/wheezy/linux/debian/changelog
dists/wheezy/linux/debian/patches/series
Modified: dists/wheezy/linux/debian/changelog
==============================================================================
--- dists/wheezy/linux/debian/changelog Sat Jun 8 16:28:11 2013 (r20206)
+++ dists/wheezy/linux/debian/changelog Sat Jun 8 16:40:34 2013 (r20207)
@@ -192,6 +192,7 @@
* nfsd4: Fix performance problem with RELEASE_LOCKOWNER (Closes: #699361)
- hash lockowners to simplify RELEASE_LOCKOWNER
- maintain one seqid stream per (lockowner, file)
+ * ipw2100,ipw2200: Fix order of device registration (Closes: #656813)
-- Ben Hutchings <ben at decadent.org.uk> Wed, 27 Mar 2013 14:10:40 +0000
Added: dists/wheezy/linux/debian/patches/bugfix/x86/ipw2100-Fix-order-of-device-registration.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/wheezy/linux/debian/patches/bugfix/x86/ipw2100-Fix-order-of-device-registration.patch Sat Jun 8 16:40:34 2013 (r20207)
@@ -0,0 +1,77 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Sun, 22 Jan 2012 03:11:12 +0000
+Subject: ipw2100: Fix order of device registration
+
+commit e19d8baf8cfcc0b96d7578a22801d16400d877bd upstream.
+
+Currently cfg80211 fails to create a "phy80211" symlink in sysfs from
+the net device to the wiphy device. The latter needs to be registered
+first.
+
+Compile-tested only.
+
+Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
+Signed-off-by: John W. Linville <linville at tuxdriver.com>
+---
+ drivers/net/wireless/ipw2x00/ipw2100.c | 24 +++++++++++++-----------
+ 1 file changed, 13 insertions(+), 11 deletions(-)
+
+--- a/drivers/net/wireless/ipw2x00/ipw2100.c
++++ b/drivers/net/wireless/ipw2x00/ipw2100.c
+@@ -1960,10 +1960,8 @@ static int ipw2100_wdev_init(struct net_
+ wdev->wiphy->n_cipher_suites = ARRAY_SIZE(ipw_cipher_suites);
+
+ set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev);
+- if (wiphy_register(wdev->wiphy)) {
+- ipw2100_down(priv);
++ if (wiphy_register(wdev->wiphy))
+ return -EIO;
+- }
+ return 0;
+ }
+
+@@ -6340,6 +6338,11 @@ static int ipw2100_pci_init_one(struct p
+ printk(KERN_INFO DRV_NAME
+ ": Detected Intel PRO/Wireless 2100 Network Connection\n");
+
++ err = ipw2100_wdev_init(dev);
++ if (err)
++ goto fail;
++ registered = 1;
++
+ /* Bring up the interface. Pre 0.46, after we registered the
+ * network device we would call ipw2100_up. This introduced a race
+ * condition with newer hotplug configurations (network was coming
+@@ -6356,11 +6359,7 @@ static int ipw2100_pci_init_one(struct p
+ "Error calling register_netdev.\n");
+ goto fail;
+ }
+- registered = 1;
+-
+- err = ipw2100_wdev_init(dev);
+- if (err)
+- goto fail;
++ registered = 2;
+
+ mutex_lock(&priv->action_mutex);
+
+@@ -6399,13 +6398,16 @@ static int ipw2100_pci_init_one(struct p
+
+ fail_unlock:
+ mutex_unlock(&priv->action_mutex);
+- wiphy_unregister(priv->ieee->wdev.wiphy);
+- kfree(priv->ieee->bg_band.channels);
+ fail:
+ if (dev) {
+- if (registered)
++ if (registered >= 2)
+ unregister_netdev(dev);
+
++ if (registered) {
++ wiphy_unregister(priv->ieee->wdev.wiphy);
++ kfree(priv->ieee->bg_band.channels);
++ }
++
+ ipw2100_hw_stop_adapter(priv);
+
+ ipw2100_disable_interrupts(priv);
Added: dists/wheezy/linux/debian/patches/bugfix/x86/ipw2200-Fix-order-of-device-registration.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/wheezy/linux/debian/patches/bugfix/x86/ipw2200-Fix-order-of-device-registration.patch Sat Jun 8 16:40:34 2013 (r20207)
@@ -0,0 +1,70 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Sun, 22 Jan 2012 03:09:35 +0000
+Subject: ipw2200: Fix order of device registration
+
+commit b4050790d0a6bfec76e2186d461123cf9586aa34 upstream.
+
+Currently cfg80211 fails to create a "phy80211" symlink in sysfs from
+the net device to the wiphy device. The latter needs to be registered
+first.
+
+Compile-tested only.
+
+Reported-by: Cesare Leonardi <celeonar at gmail.com>
+Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
+Signed-off-by: John W. Linville <linville at tuxdriver.com>
+---
+ drivers/net/wireless/ipw2x00/ipw2200.c | 23 ++++++++++++-----------
+ 1 file changed, 12 insertions(+), 11 deletions(-)
+
+--- a/drivers/net/wireless/ipw2x00/ipw2200.c
++++ b/drivers/net/wireless/ipw2x00/ipw2200.c
+@@ -11834,16 +11834,17 @@ static int __devinit ipw_pci_probe(struc
+ }
+
+ mutex_unlock(&priv->mutex);
+- err = register_netdev(net_dev);
++
++ err = ipw_wdev_init(net_dev);
+ if (err) {
+- IPW_ERROR("failed to register network device\n");
++ IPW_ERROR("failed to register wireless device\n");
+ goto out_remove_sysfs;
+ }
+
+- err = ipw_wdev_init(net_dev);
++ err = register_netdev(net_dev);
+ if (err) {
+- IPW_ERROR("failed to register wireless device\n");
+- goto out_unregister_netdev;
++ IPW_ERROR("failed to register network device\n");
++ goto out_unregister_wiphy;
+ }
+
+ #ifdef CONFIG_IPW2200_PROMISCUOUS
+@@ -11852,10 +11853,8 @@ static int __devinit ipw_pci_probe(struc
+ if (err) {
+ IPW_ERROR("Failed to register promiscuous network "
+ "device (error %d).\n", err);
+- wiphy_unregister(priv->ieee->wdev.wiphy);
+- kfree(priv->ieee->a_band.channels);
+- kfree(priv->ieee->bg_band.channels);
+- goto out_unregister_netdev;
++ unregister_netdev(priv->net_dev);
++ goto out_unregister_wiphy;
+ }
+ }
+ #endif
+@@ -11867,8 +11866,10 @@ static int __devinit ipw_pci_probe(struc
+
+ return 0;
+
+- out_unregister_netdev:
+- unregister_netdev(priv->net_dev);
++ out_unregister_wiphy:
++ wiphy_unregister(priv->ieee->wdev.wiphy);
++ kfree(priv->ieee->a_band.channels);
++ kfree(priv->ieee->bg_band.channels);
+ out_remove_sysfs:
+ sysfs_remove_group(&pdev->dev.kobj, &ipw_attribute_group);
+ out_release_irq:
Added: dists/wheezy/linux/debian/patches/bugfix/x86/net-wireless-ipw2100-Fix-WARN_ON-occurring-in-wiphy_.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/wheezy/linux/debian/patches/bugfix/x86/net-wireless-ipw2100-Fix-WARN_ON-occurring-in-wiphy_.patch Sat Jun 8 16:40:34 2013 (r20207)
@@ -0,0 +1,123 @@
+From: Stanislav Yakovlev <stas.yakovlev at gmail.com>
+Date: Mon, 14 May 2012 19:06:19 -0400
+Subject: net/wireless: ipw2100: Fix WARN_ON occurring in wiphy_register
+ called by ipw2100_pci_init_one
+
+commit aac495a8002bbf20e879572c6cf0789ab2ffb32b upstream.
+
+The problem was found by Larry Finger:
+http://marc.info/?l=linux-wireless&m=133702401700614&w=2
+
+The problem is identical to the one for ipw2200 which is already fixed:
+http://marc.info/?l=linux-wireless&m=133457257407196&w=2
+
+[ 17.766431] ------------[ cut here ]------------
+[ 17.766467] WARNING: at net/wireless/core.c:562 wiphy_register+0x34c/0x3c0 [cfg80211]()
+[ 17.766471] Hardware name: Latitude D600
+[ 17.766474] Modules linked in: ipw2100(+) libipw pcmcia cfg80211 ppdev parport_pc yenta_socket sr_mod pcmcia_rsrc parport iTCO_wdt cdrom sg rfkill pcmcia_
+core lib80211 tg3 video button battery ac iTCO_vendor_support joydev shpchp pcspkr pciehp pci_hotplug autofs4 radeon ttm drm_kms_helper uhci_hcd ehci_hcd rtc
+_cmos thermal drm hwmon i2c_algo_bit i2c_core processor usbcore usb_common ata_generic ata_piix ahci libahci libata
+[ 17.766525] Pid: 474, comm: modprobe Not tainted 3.4.0-rc7-wl+ #6
+[ 17.766528] Call Trace:
+[ 17.766541] [<c066ad08>] ? printk+0x28/0x2a
+[ 17.766552] [<c0230edd>] warn_slowpath_common+0x6d/0xa0
+[ 17.766563] [<e0b253bc>] ? wiphy_register+0x34c/0x3c0 [cfg80211]
+[ 17.766573] [<e0b253bc>] ? wiphy_register+0x34c/0x3c0 [cfg80211]
+[ 17.766578] [<c0230f2d>] warn_slowpath_null+0x1d/0x20
+[ 17.766588] [<e0b253bc>] wiphy_register+0x34c/0x3c0 [cfg80211]
+[ 17.766605] [<e0b5b0d6>] ipw2100_wdev_init+0x196/0x1c0 [ipw2100]
+[ 17.766616] [<e0b5d962>] ipw2100_pci_init_one+0x2b2/0x694 [ipw2100]
+[ 17.766632] [<c047ce52>] local_pci_probe+0x42/0xb0
+[ 17.766637] [<c047e2b0>] pci_device_probe+0x60/0x90
+[ 17.766645] [<c0376de2>] ? sysfs_create_link+0x12/0x20
+[ 17.766654] [<c050f1f6>] really_probe+0x56/0x2e0
+[ 17.766659] [<c037636d>] ? create_dir+0x5d/0xa0
+[ 17.766667] [<c0518c6b>] ? pm_runtime_barrier+0x3b/0xa0
+[ 17.766672] [<c050f5e4>] driver_probe_device+0x44/0xa0
+[ 17.766677] [<c047e227>] ? pci_match_device+0x97/0xa0
+[ 17.766681] [<c050f6c9>] __driver_attach+0x89/0x90
+[ 17.766686] [<c050f640>] ? driver_probe_device+0xa0/0xa0
+[ 17.766691] [<c050da2a>] bus_for_each_dev+0x3a/0x70
+[ 17.766695] [<c050ee6c>] driver_attach+0x1c/0x30
+[ 17.766699] [<c050f640>] ? driver_probe_device+0xa0/0xa0
+[ 17.766704] [<c050ea77>] bus_add_driver+0x187/0x280
+[ 17.766710] [<c045b9cd>] ? kset_find_obj+0x2d/0x60
+[ 17.766715] [<c047e2e0>] ? pci_device_probe+0x90/0x90
+[ 17.766719] [<c047e2e0>] ? pci_device_probe+0x90/0x90
+[ 17.766724] [<c050fb85>] driver_register+0x65/0x110
+[ 17.766729] [<c047e09d>] __pci_register_driver+0x3d/0xa0
+[ 17.766738] [<e09f705c>] ipw2100_init+0x5c/0x1000 [ipw2100]
+[ 17.766743] [<c020110f>] do_one_initcall+0x2f/0x170
+[ 17.766749] [<e09f7000>] ? 0xe09f6fff
+[ 17.766757] [<c0287ce8>] sys_init_module+0xa8/0x210
+[ 17.766766] [<c067a075>] syscall_call+0x7/0xb
+[ 17.766769] ---[ end trace 559898c6bb0d1c75 ]---
+[ 17.767093] ipw2100: probe of 0000:02:03.0 failed with error -5
+
+This warning appears only if we apply Ben Hutchings' fix
+http://marc.info/?l=linux-wireless&m=132720204412667&w=2
+for the bug reported by Cesare Leonardi
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=656813
+with cfg80211 warning during device registration
+("cfg80211: failed to add phy80211 symlink to netdev!").
+
+We separate device bring up and registration with network stack
+to avoid the problem.
+
+Signed-off-by: Stanislav Yakovlev <stas.yakovlev at gmail.com>
+Tested-by: Larry Finger <Larry.Finger at lwfinger.net>
+Signed-off-by: John W. Linville <linville at tuxdriver.com>
+---
+ drivers/net/wireless/ipw2x00/ipw2100.c | 20 +++++---------------
+ 1 file changed, 5 insertions(+), 15 deletions(-)
+
+--- a/drivers/net/wireless/ipw2x00/ipw2100.c
++++ b/drivers/net/wireless/ipw2x00/ipw2100.c
+@@ -1900,14 +1900,6 @@ static void ipw2100_down(struct ipw2100_
+ netif_stop_queue(priv->net_dev);
+ }
+
+-/* Called by register_netdev() */
+-static int ipw2100_net_init(struct net_device *dev)
+-{
+- struct ipw2100_priv *priv = libipw_priv(dev);
+-
+- return ipw2100_up(priv, 1);
+-}
+-
+ static int ipw2100_wdev_init(struct net_device *dev)
+ {
+ struct ipw2100_priv *priv = libipw_priv(dev);
+@@ -6086,7 +6078,6 @@ static const struct net_device_ops ipw21
+ .ndo_stop = ipw2100_close,
+ .ndo_start_xmit = libipw_xmit,
+ .ndo_change_mtu = libipw_change_mtu,
+- .ndo_init = ipw2100_net_init,
+ .ndo_tx_timeout = ipw2100_tx_timeout,
+ .ndo_set_mac_address = ipw2100_set_address,
+ .ndo_validate_addr = eth_validate_addr,
+@@ -6338,6 +6329,10 @@ static int ipw2100_pci_init_one(struct p
+ printk(KERN_INFO DRV_NAME
+ ": Detected Intel PRO/Wireless 2100 Network Connection\n");
+
++ err = ipw2100_up(priv, 1);
++ if (err)
++ goto fail;
++
+ err = ipw2100_wdev_init(dev);
+ if (err)
+ goto fail;
+@@ -6347,12 +6342,7 @@ static int ipw2100_pci_init_one(struct p
+ * network device we would call ipw2100_up. This introduced a race
+ * condition with newer hotplug configurations (network was coming
+ * up and making calls before the device was initialized).
+- *
+- * 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 */
++ */
+ err = register_netdev(dev);
+ if (err) {
+ printk(KERN_WARNING DRV_NAME
Added: dists/wheezy/linux/debian/patches/bugfix/x86/net-wireless-ipw2200-Fix-WARN_ON-occurring-in-wiphy_.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/wheezy/linux/debian/patches/bugfix/x86/net-wireless-ipw2200-Fix-WARN_ON-occurring-in-wiphy_.patch Sat Jun 8 16:40:34 2013 (r20207)
@@ -0,0 +1,106 @@
+From: Stanislav Yakovlev <stas.yakovlev at gmail.com>
+Date: Mon, 16 Apr 2012 06:38:30 -0400
+Subject: net/wireless: ipw2200: Fix WARN_ON occurring in wiphy_register
+ called by ipw_pci_probe
+
+commit 7ed85b65ab611ba841d508ae4ff8c45fa0c48c80 upstream.
+
+The problem was found by Stefan Lippers-Hollmann
+http://marc.info/?l=linux-wireless&m=132720334512946&w=2
+
+WARNING: at /tmp/buildd/linux-aptosid-3.2/debian/build/source_i386_none/net/wireless/core.c:562 wiphy_register+0x45/0x38d [cfg80211]()
+Hardware name: TravelMate 290 \xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff\xffffffff
+Modules linked in: ipw2200(+) iTCO_wdt libipw joydev drm snd_seq snd_timer snd_seq_device iTCO_vendor_support yenta_socket snd intel_agp i2c_i801 pcmcia_rsrc cfg80211 soundcore parport_pc psmouse parport rng_core snd_page_alloc serio_raw pcspkr i2c_algo_bit intel_gtt pcmcia_core evdev irda crc_ccitt rfkill lib80211 processor container ac battery shpchp pci_hotplug button ext4 mbcache jbd2 crc16 dm_mod sd_mod sr_mod crc_t10dif cdrom ata_generic pata_acpi ata_piix libata scsi_mod firewire_ohci firewire_core crc_itu_t 8139too 8139cp mii uhci_hcd ehci_hcd usbcore usb_common [last unloaded: scsi_wait_scan]
+Pid: 328, comm: modprobe Not tainted 3.2-1.slh.4-aptosid-686 #1
+Call Trace:
+[<c012eaf4>] ? warn_slowpath_common+0x7c/0x8f
+[<e0ff0b3e>] ? wiphy_register+0x45/0x38d [cfg80211]
+[<e0ff0b3e>] ? wiphy_register+0x45/0x38d [cfg80211]
+[<c012eb22>] ? warn_slowpath_null+0x1b/0x1f
+[<e0ff0b3e>] ? wiphy_register+0x45/0x38d [cfg80211]
+[<c01f89d7>] ? internal_create_group+0xf5/0xff
+[<e0a2de1c>] ? ipw_pci_probe+0xa9a/0xbd0 [ipw2200]
+[<c01519f4>] ? arch_local_irq_save+0xf/0x14
+[<c0252986>] ? pci_device_probe+0x53/0x9a
+[<c02c2820>] ? driver_probe_device+0x94/0x124
+[<c0252871>] ? pci_match_id+0x15/0x34
+[<c02c28f0>] ? __driver_attach+0x40/0x5b
+[<c02c1d81>] ? bus_for_each_dev+0x37/0x60
+[<c02c25aa>] ? driver_attach+0x17/0x1a
+[<c02c28b0>] ? driver_probe_device+0x124/0x124
+[<c02c22c4>] ? bus_add_driver+0x92/0x1d1
+[<e099d000>] ? 0xe099cfff
+[<c02c2cb8>] ? driver_register+0x7d/0xd4
+[<c017cd50>] ? jump_label_module_notify+0xec/0x167
+[<e099d000>] ? 0xe099cfff
+[<c0253017>] ? __pci_register_driver+0x32/0x87
+[<e099d000>] ? 0xe099cfff
+[<e099d02e>] ? ipw_init+0x2e/0x72 [ipw2200]
+[<c0101173>] ? do_one_initcall+0x7d/0x132
+[<c0145016>] ? __blocking_notifier_call_chain+0x47/0x4f
+[<c0154a73>] ? sys_init_module+0x13a4/0x159c
+[<c03a639f>] ? sysenter_do_call+0x12/0x28
+
+This warning appears only if we apply Ben Hutchings' fix
+http://marc.info/?l=linux-wireless&m=132720195012653&w=2
+for the bug reported by Cesare Leonardi
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=656813
+with cfg80211 warning during device registration
+("cfg80211: failed to add phy80211 symlink to netdev!").
+
+We separate device bring up and registration with network stack
+to avoid the problem.
+
+After that Ben Hutchings' fix can be applied to fix the bug.
+
+Signed-off-by: Stanislav Yakovlev <stas.yakovlev at gmail.com>
+Tested-by: Stefan Lippers-Hollmann <s.l-h at gmx.de>
+Signed-off-by: John W. Linville <linville at tuxdriver.com>
+---
+ drivers/net/wireless/ipw2x00/ipw2200.c | 21 ++++++---------------
+ 1 file changed, 6 insertions(+), 15 deletions(-)
+
+--- a/drivers/net/wireless/ipw2x00/ipw2200.c
++++ b/drivers/net/wireless/ipw2x00/ipw2200.c
+@@ -11433,20 +11433,6 @@ static void ipw_bg_down(struct work_stru
+ mutex_unlock(&priv->mutex);
+ }
+
+-/* Called by register_netdev() */
+-static int ipw_net_init(struct net_device *dev)
+-{
+- int rc = 0;
+- struct ipw_priv *priv = libipw_priv(dev);
+-
+- mutex_lock(&priv->mutex);
+- if (ipw_up(priv))
+- rc = -EIO;
+- mutex_unlock(&priv->mutex);
+-
+- return rc;
+-}
+-
+ static int ipw_wdev_init(struct net_device *dev)
+ {
+ int i, rc = 0;
+@@ -11715,7 +11701,6 @@ static void ipw_prom_free(struct ipw_pri
+ #endif
+
+ static const struct net_device_ops ipw_netdev_ops = {
+- .ndo_init = ipw_net_init,
+ .ndo_open = ipw_net_open,
+ .ndo_stop = ipw_net_stop,
+ .ndo_set_rx_mode = ipw_net_set_multicast_list,
+@@ -11842,6 +11827,12 @@ static int __devinit ipw_pci_probe(struc
+ goto out_release_irq;
+ }
+
++ if (ipw_up(priv)) {
++ mutex_unlock(&priv->mutex);
++ err = -EIO;
++ goto out_remove_sysfs;
++ }
++
+ mutex_unlock(&priv->mutex);
+ err = register_netdev(net_dev);
+ if (err) {
Modified: dists/wheezy/linux/debian/patches/series
==============================================================================
--- dists/wheezy/linux/debian/patches/series Sat Jun 8 16:28:11 2013 (r20206)
+++ dists/wheezy/linux/debian/patches/series Sat Jun 8 16:40:34 2013 (r20207)
@@ -639,3 +639,7 @@
bugfix/all/dlm-Do-not-allocate-a-fd-for-peeloff.patch
bugfix/all/nfsd4-maintain-one-seqid-stream-per-lockowner-file.patch
bugfix/all/nfsd4-hash-lockowners-to-simplify-RELEASE_LOCKOWNER.patch
+bugfix/x86/net-wireless-ipw2200-Fix-WARN_ON-occurring-in-wiphy_.patch
+bugfix/x86/ipw2200-Fix-order-of-device-registration.patch
+bugfix/x86/ipw2100-Fix-order-of-device-registration.patch
+bugfix/x86/net-wireless-ipw2100-Fix-WARN_ON-occurring-in-wiphy_.patch
More information about the Kernel-svn-changes
mailing list