diff options
Diffstat (limited to 'drivers/scsi/aacraid/commsup.c')
-rw-r--r-- | drivers/scsi/aacraid/commsup.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index 47434499e82b..ef67816a6fe5 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -41,11 +41,11 @@ #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) { |