]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] prism54 URGENT - Fix IRQ handling
authorMargit Schubert-While <margitsw@t-online.de>
Tue, 10 Aug 2004 12:51:27 +0000 (08:51 -0400)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 10 Aug 2004 12:51:27 +0000 (08:51 -0400)
* We are handing back HANDLED even though the IRQ is not for us.
  We also change device state.
  This is plainly wrong.
  AFAICT we also need to take the spin lock early.
  Tested/running on UP/SMP for about a week now.
  (Discovered on one of my lappies that had the X driver on the same IRQ)
  (Proposed on Prism54 Devel with no objections)

drivers/net/wireless/prism54/islpci_dev.c

index 114eb29507a202875bf1bb350f9c14582bf9814a..d96d621f137a8df368f27c9e949060151a1f7d5c 100644 (file)
@@ -186,6 +186,9 @@ islpci_interrupt(int irq, void *config, struct pt_regs *regs)
        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 @@ islpci_interrupt(int irq, void *config, struct pt_regs *regs)
 #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 @@ islpci_interrupt(int irq, void *config, struct pt_regs *regs)
        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 @@ islpci_interrupt(int irq, void *config, struct pt_regs *regs)
                        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 */