backports: backports: reshufle the threaded IRQ backport series
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>
Thu, 3 Apr 2014 23:30:16 +0000 (23:30 +0000)
committerLuis R. Rodriguez <mcgrof@do-not-panic.com>
Wed, 9 Apr 2014 01:16:21 +0000 (18:16 -0700)
This reshufles the patches that deal with backported threaded
IRQ support. The purpose of this reshufle is to try get them
into a consistent style. Only the b43 driver takes a major
change in that the the workqueue used for threading work
is now also destroyed upon its b43_wireless_core_stop() call.
This change was tested by pkgadd from #linux-wireless on b43 on
an older kernel. The b43 driver just fails to unload but that
issue was present before this change.

The non-general changes to the b43 driver are also moved
out to a helper patch to help separate the general
collateral evolution changes from driver specific required
changes.

Cc: Peter Senna <peter.senna@gmail.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>
Cc: Gilles Muller <Gilles.Muller@lip6.fr>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
patches/collateral-evolutions/network/09-threaded-irq/drivers_net_wireless_b43_b43.patch
patches/collateral-evolutions/network/09-threaded-irq/drivers_net_wireless_b43_main.patch
patches/collateral-evolutions/network/09-threaded-irq/drivers_net_wireless_iwlwifi_pcie_internal.patch
patches/collateral-evolutions/network/09-threaded-irq/drivers_net_wireless_ti_wlcore_main.patch
patches/collateral-evolutions/network/09-threaded-irq/drivers_net_wireless_ti_wlcore_main_extra.patch [new file with mode: 0644]

index 8889d233b0a948234373cf9e30ad84acfde5dda5..43d1672615f4a9fa4eaf8186b82faadf9e00ff19 100644 (file)
@@ -1,12 +1,12 @@
 --- a/drivers/net/wireless/b43/b43.h
 +++ b/drivers/net/wireless/b43/b43.h
-@@ -872,6 +872,9 @@ struct b43_wldev {
-       unsigned int tx_count;
-       unsigned int rx_count;
- #endif
+@@ -805,6 +805,9 @@ enum {
+ /* Data structure for one wireless device (802.11 core) */
+ struct b43_wldev {
 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
 +      struct compat_threaded_irq irq_compat;
 +#endif
};
/* Data structure for the WLAN parts (802.11 cores) of the b43 chip. */
      struct b43_bus_dev *dev;
+       struct b43_wl *wl;
      /* a completion event structure needed if this call is asynchronous */
index d8c85d426a3cfecc1baedbc7ed21d0a672f92210..70e1b4b22686f4146b453c39694ca2d4c68ff6a1 100644 (file)
@@ -1,45 +1,38 @@
 --- a/drivers/net/wireless/b43/main.c
 +++ b/drivers/net/wireless/b43/main.c
-@@ -4243,8 +4243,13 @@ redo:
+@@ -4243,8 +4243,17 @@ redo:
        if (b43_bus_host_is_sdio(dev->dev)) {
                b43_sdio_free_irq(dev);
        } else {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
-+              compat_synchronize_threaded_irq(&dev->irq_compat);
-+              compat_free_threaded_irq(&dev->irq_compat);
-+#else
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
                synchronize_irq(dev->dev->irq);
++#else
++              compat_synchronize_threaded_irq(&dev->irq_compat);
++#endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
                free_irq(dev->dev->irq, dev);
++#else
++              compat_free_threaded_irq(&dev->irq_compat);
++              compat_destroy_threaded_irq(&dev->irq_compat);
 +#endif
        }
        mutex_lock(&wl->mutex);
        dev = wl->current_dev;
-@@ -4290,9 +4295,17 @@ static int b43_wireless_core_start(struc
+@@ -4290,9 +4299,17 @@ static int b43_wireless_core_start(struc
                        goto out;
                }
        } else {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
+               err = request_threaded_irq(dev->dev->irq, b43_interrupt_handler,
+                                          b43_interrupt_thread_handler,
+                                          IRQF_SHARED, KBUILD_MODNAME, dev);
++#else
 +              err = compat_request_threaded_irq(&dev->irq_compat,
 +                                                dev->dev->irq,
 +                                                b43_interrupt_handler,
 +                                                b43_interrupt_thread_handler,
 +                                                IRQF_SHARED, KBUILD_MODNAME, dev);
-+#else
-               err = request_threaded_irq(dev->dev->irq, b43_interrupt_handler,
-                                          b43_interrupt_thread_handler,
-                                          IRQF_SHARED, KBUILD_MODNAME, dev);
 +#endif
                if (err) {
                        b43err(dev->wl, "Cannot request IRQ-%d\n",
                               dev->dev->irq);
-@@ -5123,6 +5136,10 @@ static int b43_setup_bands(struct b43_wl
- static void b43_wireless_core_detach(struct b43_wldev *dev)
- {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
-+      if (dev->dev->sdev->bus->bustype != SSB_BUSTYPE_SDIO)
-+              compat_destroy_threaded_irq(&dev->irq_compat);
-+#endif
-       /* We release firmware that late to not be required to re-request
-        * is all the time when we reinit the core. */
-       b43_release_firmware(dev);
index b12b28d78ea5a8d438423d5ea43a4eda013eed7c..666f5211fce60daa022a4d45b1ab90073eaae06e 100644 (file)
@@ -1,12 +1,12 @@
 --- a/drivers/net/wireless/iwlwifi/pcie/internal.h
 +++ b/drivers/net/wireless/iwlwifi/pcie/internal.h
-@@ -312,6 +312,9 @@ struct iwl_trans_pcie {
-       /*protect hw register */
-       spinlock_t reg_lock;
-       bool cmd_in_flight;
+@@ -265,6 +265,9 @@ iwl_pcie_get_scratchbuf_dma(struct iwl_t
+  * @cmd_in_flight: true when we have a host command in flight
+  */
+ struct iwl_trans_pcie {
 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
 +      struct compat_threaded_irq irq_compat;
 +#endif
};
- #define IWL_TRANS_GET_PCIE_TRANS(_iwl_trans) \
      struct iwl_rxq rxq;
+       struct work_struct rx_replenish;
+       struct iwl_trans *trans;
index b3089b1f73d03df57a36b0627bd3440fd765a2ed..603bd0bdc3f328340dfcd6e0c90882022dc0c4b6 100644 (file)
@@ -1,54 +1,43 @@
 --- a/drivers/net/wireless/ti/wlcore/main.c
 +++ b/drivers/net/wireless/ti/wlcore/main.c
-@@ -6081,15 +6081,27 @@ static void wlcore_nvs_cb(const struct f
-       wl->platform_quirks = pdata->platform_quirks;
-       wl->if_ops = pdev_data->if_ops;
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
-+      irqflags = IRQF_TRIGGER_RISING;
-+      hardirq_fn = wlcore_hardirq;
-+#else
-       if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ) {
-               irqflags = IRQF_TRIGGER_RISING;
-               hardirq_fn = wlcore_hardirq;
-       } else {
+@@ -6088,8 +6088,15 @@ static void wlcore_nvs_cb(const struct f
                irqflags = IRQF_TRIGGER_HIGH | IRQF_ONESHOT;
        }
-+#endif
  
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
+       ret = request_threaded_irq(wl->irq, hardirq_fn, wlcore_irq,
+                                  irqflags, pdev->name, wl);
++#else
 +      ret = compat_request_threaded_irq(&wl->irq_compat, wl->irq,
 +                                        hardirq_fn, wlcore_irq,
 +                                        irqflags,
 +                                        pdev->name, wl);
-+#else
-       ret = request_threaded_irq(wl->irq, hardirq_fn, wlcore_irq,
-                                  irqflags, pdev->name, wl);
 +#endif
        if (ret < 0) {
                wl1271_error("request_irq() failed: %d", ret);
                goto out_free_nvs;
-@@ -6135,7 +6147,11 @@ out_unreg:
+@@ -6135,7 +6142,12 @@ out_unreg:
        wl1271_unregister_hw(wl);
  
  out_irq:
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
-+      compat_free_threaded_irq(&wl->irq_compat);
-+#else
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
        free_irq(wl->irq, wl);
++#else
++      compat_free_threaded_irq(&wl->irq_compat);
++      compat_destroy_threaded_irq(&wl->irq_compat);
 +#endif
  
  out_free_nvs:
        kfree(wl->nvs);
-@@ -6181,7 +6197,12 @@ int wlcore_remove(struct platform_device
+@@ -6181,7 +6193,12 @@ int wlcore_remove(struct platform_device
                disable_irq_wake(wl->irq);
        }
        wl1271_unregister_hw(wl);
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
+       free_irq(wl->irq, wl);
++#else
 +      compat_free_threaded_irq(&wl->irq_compat);
 +      compat_destroy_threaded_irq(&wl->irq_compat);
-+#else
-       free_irq(wl->irq, wl);
 +#endif
        wlcore_free_hw(wl);
  
diff --git a/patches/collateral-evolutions/network/09-threaded-irq/drivers_net_wireless_ti_wlcore_main_extra.patch b/patches/collateral-evolutions/network/09-threaded-irq/drivers_net_wireless_ti_wlcore_main_extra.patch
new file mode 100644 (file)
index 0000000..c320242
--- /dev/null
@@ -0,0 +1,21 @@
+--- a/drivers/net/wireless/ti/wlcore/main.c
++++ b/drivers/net/wireless/ti/wlcore/main.c
+@@ -6080,6 +6080,10 @@ static void wlcore_nvs_cb(const struct f
+       wl->irq = platform_get_irq(pdev, 0);
+       wl->platform_quirks = pdata->platform_quirks;
+       wl->if_ops = pdev_data->if_ops;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
++      irqflags = IRQF_TRIGGER_RISING;
++      hardirq_fn = wlcore_hardirq;
++#else
+       if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ) {
+               irqflags = IRQF_TRIGGER_RISING;
+@@ -6087,6 +6091,7 @@ static void wlcore_nvs_cb(const struct f
+       } else {
+               irqflags = IRQF_TRIGGER_HIGH | IRQF_ONESHOT;
+       }
++#endif
+       ret = request_threaded_irq(wl->irq, hardirq_fn, wlcore_irq,
+                                  irqflags, pdev->name, wl);