wl12xx: Switch to level trigger interrupts
authorIdo Yariv <ido@wizery.com>
Tue, 1 Mar 2011 13:14:42 +0000 (15:14 +0200)
committerLuciano Coelho <coelho@ti.com>
Thu, 3 Mar 2011 14:10:46 +0000 (16:10 +0200)
The interrupt of the wl12xx is a level interrupt in nature, since the
interrupt line is not auto-reset. However, since resetting the interrupt
requires bus transactions, this cannot be done from an interrupt
context. Thus, requesting a level interrupt would require to disable the
irq and re-enable it after the HW is acknowledged. Since we now request
a threaded irq, this can also be done by specifying the IRQF_ONESHOT
flag.

Triggering on an edge can be problematic in some platforms, if the
sampling frequency is not sufficient for detecting very frequent
interrupts. In case an interrupt is missed, the driver will hang as the
interrupt line will stay high until it is acknowledged by the driver,
which will never happen.

Fix this by requesting a level triggered interrupt, with the
IRQF_ONESHOT flag.

Signed-off-by: Ido Yariv <ido@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/wl12xx/sdio.c
drivers/net/wireless/wl12xx/spi.c

index b66abb5..5b9dbea 100644 (file)
@@ -241,7 +241,7 @@ static int __devinit wl1271_probe(struct sdio_func *func,
        wl->ref_clock = wlan_data->board_ref_clock;
 
        ret = request_threaded_irq(wl->irq, wl1271_hardirq, wl1271_irq,
-                                  IRQF_TRIGGER_RISING,
+                                  IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
                                   DRIVER_NAME, wl);
        if (ret < 0) {
                wl1271_error("request_irq() failed: %d", ret);
index df5a00f..18cf017 100644 (file)
@@ -409,7 +409,7 @@ static int __devinit wl1271_probe(struct spi_device *spi)
        }
 
        ret = request_threaded_irq(wl->irq, wl1271_hardirq, wl1271_irq,
-                                  IRQF_TRIGGER_RISING,
+                                  IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
                                   DRIVER_NAME, wl);
        if (ret < 0) {
                wl1271_error("request_irq() failed: %d", ret);