aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/megaraid.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-07-26 13:28:47 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-26 13:28:47 -0700
commit2d986010ad13a00b83851238d52601d6092df40e (patch)
tree6a43ffd30290fc051435643d485ad12fb1448ed5 /drivers/scsi/megaraid.c
parent6b6a93c6876ea1c530d5d3f68e3678093a27fab0 (diff)
parente10fb91c4dc81a4ae47caf0828df152f600f2546 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-for-linus-2.6
Diffstat (limited to 'drivers/scsi/megaraid.c')
-rw-r--r--drivers/scsi/megaraid.c47
1 files changed, 8 insertions, 39 deletions
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index a70cdf31311..6f308ebe3e7 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -35,6 +35,7 @@
#include <linux/blkdev.h>
#include <asm/uaccess.h>
#include <asm/io.h>
+#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/proc_fs.h>
#include <linux/reboot.h>
@@ -1938,7 +1939,7 @@ megaraid_abort(Scsi_Cmnd *cmd)
static int
-__megaraid_reset(Scsi_Cmnd *cmd)
+megaraid_reset(struct scsi_cmnd *cmd)
{
adapter_t *adapter;
megacmd_t mc;
@@ -1950,7 +1951,6 @@ __megaraid_reset(Scsi_Cmnd *cmd)
mc.cmd = MEGA_CLUSTER_CMD;
mc.opcode = MEGA_RESET_RESERVATIONS;
- spin_unlock_irq(&adapter->lock);
if( mega_internal_command(adapter, LOCK_INT, &mc, NULL) != 0 ) {
printk(KERN_WARNING
"megaraid: reservation reset failed.\n");
@@ -1958,9 +1958,10 @@ __megaraid_reset(Scsi_Cmnd *cmd)
else {
printk(KERN_INFO "megaraid: reservation reset.\n");
}
- spin_lock_irq(&adapter->lock);
#endif
+ spin_lock_irq(&adapter->lock);
+
rval = megaraid_abort_and_reset(adapter, cmd, SCB_RESET);
/*
@@ -1968,24 +1969,11 @@ __megaraid_reset(Scsi_Cmnd *cmd)
* to be communicated over to the mid layer.
*/
mega_rundoneq(adapter);
-
- return rval;
-}
-
-static int
-megaraid_reset(Scsi_Cmnd *cmd)
-{
- adapter_t *adapter = (adapter_t *)cmd->device->host->hostdata;
- int rc;
-
- spin_lock_irq(&adapter->lock);
- rc = __megaraid_reset(cmd);
spin_unlock_irq(&adapter->lock);
- return rc;
+ return rval;
}
-
/**
* megaraid_abort_and_reset()
* @adapter - megaraid soft state
@@ -4490,8 +4478,6 @@ mega_internal_command(adapter_t *adapter, lockscope_t ls, megacmd_t *mc,
scb->idx = CMDID_INT_CMDS;
- scmd->state = 0;
-
/*
* Get the lock only if the caller has not acquired it already
*/
@@ -4501,15 +4487,7 @@ mega_internal_command(adapter_t *adapter, lockscope_t ls, megacmd_t *mc,
if( ls == LOCK_INT ) spin_unlock_irqrestore(&adapter->lock, flags);
- /*
- * Wait till this command finishes. Do not use
- * wait_event_interruptible(). It causes panic if CTRL-C is hit when
- * dumping e.g., physical disk information through /proc interface.
- */
-#if 0
- wait_event_interruptible(adapter->int_waitq, scmd->state);
-#endif
- wait_event(adapter->int_waitq, scmd->state);
+ wait_for_completion(&adapter->int_waitq);
rval = scmd->result;
mc->status = scmd->result;
@@ -4543,16 +4521,7 @@ mega_internal_done(Scsi_Cmnd *scmd)
adapter = (adapter_t *)scmd->device->host->hostdata;
- scmd->state = 1; /* thread waiting for its command to complete */
-
- /*
- * See comment in mega_internal_command() routine for
- * wait_event_interruptible()
- */
-#if 0
- wake_up_interruptible(&adapter->int_waitq);
-#endif
- wake_up(&adapter->int_waitq);
+ complete(&adapter->int_waitq);
}
@@ -4874,7 +4843,7 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
}
init_MUTEX(&adapter->int_mtx);
- init_waitqueue_head(&adapter->int_waitq);
+ init_completion(&adapter->int_waitq);
adapter->this_id = DEFAULT_INITIATOR_ID;
adapter->host->this_id = DEFAULT_INITIATOR_ID;