Merge mulgrave-w:git/scsi-misc-2.6
[pandora-kernel.git] / drivers / scsi / aacraid / rx.c
index 9dadfb2..c715c4b 100644 (file)
@@ -394,6 +394,25 @@ static int aac_rx_send(struct fib * fib)
        return 0;
 }
 
+static int aac_rx_restart_adapter(struct aac_dev *dev)
+{
+       u32 var;
+
+       printk(KERN_ERR "%s%d: adapter kernel panic'd.\n",
+                       dev->name, dev->id);
+
+       if (aac_rx_check_health(dev) <= 0)
+               return 1;
+       if (rx_sync_cmd(dev, IOP_RESET, 0, 0, 0, 0, 0, 0,
+                       &var, NULL, NULL, NULL, NULL))
+               return 1;
+       if (var != 0x00000001)
+                return 1;
+       if (rx_readl(dev, MUnit.OMRx[0]) & KERNEL_PANIC)
+               return 1;
+       return 0;
+}
+
 /**
  *     aac_rx_init     -       initialize an i960 based AAC card
  *     @dev: device to configure
@@ -416,6 +435,9 @@ int aac_rx_init(struct aac_dev *dev)
        /*
         *      Check to see if the board panic'd while booting.
         */
+       if (rx_readl(dev, MUnit.OMRx[0]) & KERNEL_PANIC)
+               if (aac_rx_restart_adapter(dev))
+                       goto error_iounmap;
        /*
         *      Check to see if the board failed any self tests.
         */
@@ -423,13 +445,6 @@ int aac_rx_init(struct aac_dev *dev)
                printk(KERN_ERR "%s%d: adapter self-test failed.\n", dev->name, instance);
                goto error_iounmap;
        }
-       /*
-        *      Check to see if the board panic'd while booting.
-        */
-       if (rx_readl(dev, MUnit.OMRx[0]) & KERNEL_PANIC) {
-               printk(KERN_ERR "%s%d: adapter kernel panic.\n", dev->name, instance);
-               goto error_iounmap;
-       }
        /*
         *      Check to see if the monitor panic'd while booting.
         */
@@ -453,7 +468,7 @@ int aac_rx_init(struct aac_dev *dev)
                }
                msleep(1);
        }
-       if (request_irq(dev->scsi_host_ptr->irq, aac_rx_intr, SA_SHIRQ|SA_INTERRUPT, "aacraid", (void *)dev)<0) 
+       if (request_irq(dev->scsi_host_ptr->irq, aac_rx_intr, IRQF_SHARED|IRQF_DISABLED, "aacraid", (void *)dev)<0)
        {
                printk(KERN_ERR "%s%d: Interrupt unavailable.\n", name, instance);
                goto error_iounmap;