wl1251: switch to threaded irq
authorGrazvydas Ignotas <notasas@gmail.com>
Wed, 22 May 2013 20:39:12 +0000 (23:39 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Thu, 23 May 2013 22:13:10 +0000 (01:13 +0300)
seems to improve performance slightly?
At least top output looks nicer with dedicated thread to wl1251.

drivers/net/wireless/wl1251/main.c
drivers/net/wireless/wl1251/sdio.c
drivers/net/wireless/wl1251/wl1251.h

index 4706d50..e448837 100644 (file)
@@ -212,12 +212,11 @@ out:
        return ret;
 }
 
-#define WL1251_IRQ_LOOP_COUNT 10
-static void wl1251_irq_work(struct work_struct *work)
+#define WL1251_IRQ_LOOP_COUNT 100
+irqreturn_t wl1251_irq(int irq, void *cookie)
 {
        u32 intr, ctr = WL1251_IRQ_LOOP_COUNT;
-       struct wl1251 *wl =
-               container_of(work, struct wl1251, irq_work);
+       struct wl1251 *wl = cookie;
        int ret;
 
        mutex_lock(&wl->mutex);
@@ -320,6 +319,16 @@ out_sleep:
 
 out:
        mutex_unlock(&wl->mutex);
+       return IRQ_HANDLED;
+}
+EXPORT_SYMBOL_GPL(wl1251_irq);
+
+static void wl1251_irq_work(struct work_struct *work)
+{
+       struct wl1251 *wl =
+               container_of(work, struct wl1251, irq_work);
+
+       wl1251_irq(0, wl);
 }
 
 static int wl1251_join(struct wl1251 *wl, u8 bss_type, u8 channel,
index cc34bea..9b8461b 100644 (file)
@@ -160,16 +160,6 @@ static void wl1251_sdio_disable_irq(struct wl1251 *wl)
        sdio_release_host(func);
 }
 
-/* Interrupts when using dedicated WLAN_IRQ pin */
-static irqreturn_t wl1251_line_irq(int irq, void *cookie)
-{
-       struct wl1251 *wl = cookie;
-
-       ieee80211_queue_work(wl->hw, &wl->irq_work);
-
-       return IRQ_HANDLED;
-}
-
 static void wl1251_enable_line_irq(struct wl1251 *wl)
 {
        return enable_irq(wl->irq);
@@ -274,7 +264,9 @@ static int wl1251_sdio_probe(struct sdio_func *func,
 
        if (wl->irq) {
                irq_set_status_flags(wl->irq, IRQ_NOAUTOEN);
-               ret = request_irq(wl->irq, wl1251_line_irq, 0, "wl1251", wl);
+
+               ret = request_threaded_irq(wl->irq, NULL, wl1251_irq,
+                       IRQF_ONESHOT, "wl1251", wl);
                if (ret < 0) {
                        wl1251_error("request_irq() failed: %d", ret);
                        goto disable;
index 8051cd4..fbe5092 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/mutex.h>
 #include <linux/list.h>
 #include <linux/bitops.h>
+#include <linux/interrupt.h>
 #include <net/mac80211.h>
 
 #define DRIVER_NAME "wl1251"
@@ -414,6 +415,7 @@ int wl1251_free_hw(struct wl1251 *wl);
 int wl1251_init_ieee80211(struct wl1251 *wl);
 void wl1251_enable_interrupts(struct wl1251 *wl);
 void wl1251_disable_interrupts(struct wl1251 *wl);
+irqreturn_t wl1251_irq(int irq, void *cookie);
 
 #define DEFAULT_HW_GEN_MODULATION_TYPE    CCK_LONG /* Long Preamble */
 #define DEFAULT_HW_GEN_TX_RATE          RATE_2MBPS