[Prism54-devel] Suggested islpci_dev.c patch

Margit Schubert-While margitsw at t-online.de
Wed Jul 28 12:29:51 UTC 2004


Here is suggested patch to islpci_dev.c, interrupt handling
1) We need to take the spin lock early.
2) If the interrupt is not for us, don't do anything.
    At the moment, we are adjusting state and returning "HANDLED"
    when the IRQ is not for us.

diff -Naur linux-2.6.8-01/drivers/net/wireless/prism54/islpci_dev.c 
linux-2.6.8-02/drivers/net/wireless/prism54/islpci_dev.c
--- linux-2.6.8-01/drivers/net/wireless/prism54/islpci_dev.c    2004-07-28 
13:58:06.000000000 +0200
+++ linux-2.6.8-02/drivers/net/wireless/prism54/islpci_dev.c    2004-07-28 
14:04:08.000000000 +0200
@@ -186,6 +186,9 @@
         void *device = priv->device_base;
         int powerstate = ISL38XX_PSM_POWERSAVE_STATE;

+       /* lock the interrupt handler */
+       spin_lock(&priv->slock);
+
         /* received an interrupt request on a shared IRQ line
          * first check whether the device is in sleep mode */
         reg = readl(device + ISL38XX_CTRL_STAT_REG);
@@ -195,14 +198,10 @@
  #if VERBOSE > SHOW_ERROR_MESSAGES
                 DEBUG(SHOW_TRACING, "Assuming someone else called the IRQ\n");
  #endif
+               spin_unlock(&priv->slock);
                 return IRQ_NONE;
         }

-       if (islpci_get_state(priv) != PRV_STATE_SLEEP)
-               powerstate = ISL38XX_PSM_ACTIVE_STATE;
-
-       /* lock the interrupt handler */
-       spin_lock(&priv->slock);

         /* check whether there is any source of interrupt on the device */
         reg = readl(device + ISL38XX_INT_IDENT_REG);
@@ -213,6 +212,9 @@
         reg &= ISL38XX_INT_SOURCES;

         if (reg != 0) {
+               if (islpci_get_state(priv) != PRV_STATE_SLEEP)
+                       powerstate = ISL38XX_PSM_ACTIVE_STATE;
+
                 /* reset the request bits in the Identification register */
                 isl38xx_w32_flush(device, reg, ISL38XX_INT_ACK_REG);

@@ -340,6 +342,12 @@
                         isl38xx_handle_wakeup(priv->control_block,
                                               &powerstate, priv->device_base);
                 }
+       } else {
+#if VERBOSE > SHOW_ERROR_MESSAGES
+               DEBUG(SHOW_TRACING, "Assuming someone else called the IRQ\n");
+#endif
+               spin_unlock(&priv->slock);
+               return IRQ_NONE;
         }

         /* sleep -> ready */

Comments welcome before I commit.

Margit 




More information about the Prism54-devel mailing list