]> err.no Git - linux-2.6/blobdiff - drivers/scsi/aacraid/commsup.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[linux-2.6] / drivers / scsi / aacraid / commsup.c
index 81b36923e0ef487726715660035e25f176d44432..ef67816a6fe5940211247e96e1299343e3f4a298 100644 (file)
 #include <linux/delay.h>
 #include <linux/kthread.h>
 #include <linux/interrupt.h>
+#include <linux/semaphore.h>
 #include <scsi/scsi.h>
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_device.h>
 #include <scsi/scsi_cmnd.h>
-#include <asm/semaphore.h>
 
 #include "aacraid.h"
 
@@ -515,10 +515,12 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size,
                                }
                                udelay(5);
                        }
-               } else
-                       (void)down_interruptible(&fibptr->event_wait);
+               } else if (down_interruptible(&fibptr->event_wait) == 0) {
+                       fibptr->done = 2;
+                       up(&fibptr->event_wait);
+               }
                spin_lock_irqsave(&fibptr->event_lock, flags);
-               if (fibptr->done == 0) {
+               if ((fibptr->done == 0) || (fibptr->done == 2)) {
                        fibptr->done = 2; /* Tell interrupt we aborted */
                        spin_unlock_irqrestore(&fibptr->event_lock, flags);
                        return -EINTR;
@@ -594,7 +596,7 @@ void aac_consumer_free(struct aac_dev * dev, struct aac_queue *q, u32 qid)
        if (le32_to_cpu(*q->headers.consumer) >= q->entries)
                *q->headers.consumer = cpu_to_le32(1);
        else
-               *q->headers.consumer = cpu_to_le32(le32_to_cpu(*q->headers.consumer)+1);
+               le32_add_cpu(q->headers.consumer, 1);
 
        if (wasfull) {
                switch (qid) {
@@ -1458,7 +1460,7 @@ int aac_check_health(struct aac_dev * aac)
 
        printk(KERN_ERR "%s: Host adapter BLINK LED 0x%x\n", aac->name, BlinkLED);
 
-       if (!aac_check_reset || ((aac_check_reset != 1) &&
+       if (!aac_check_reset || ((aac_check_reset == 1) &&
                (aac->supplement_adapter_info.SupportedOptions2 &
                        AAC_OPTION_IGNORE_RESET)))
                goto out;