summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/megaraid.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2005-06-19 13:42:05 +0200
committerJames Bottomley <jejb@titanic.(none)>2005-06-26 12:16:24 -0500
commit8d115f845a0bd59cd263e791f739964f42b7b0e8 (patch)
tree8d4af0e70f0d8d5c04e2efa1d68fe507dc5d8923 /drivers/scsi/megaraid.c
parentb4edcbcafdecc80ef5356ff6452768b1b926ea76 (diff)
downloadop-kernel-dev-8d115f845a0bd59cd263e791f739964f42b7b0e8.zip
op-kernel-dev-8d115f845a0bd59cd263e791f739964f42b7b0e8.tar.gz
[SCSI] remove scsi_cmnd->state
We never look at it except for the old megaraid driver that abuses it for sending internal commands. That usage can be fixed easily because those internal commands are single-threaded by a mutex and we can easily use a completion there. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/megaraid.c')
-rw-r--r--drivers/scsi/megaraid.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index 6ee88c5..6fe884a 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>
@@ -4477,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
*/
@@ -4488,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;
@@ -4530,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);
}
@@ -4861,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;
OpenPOWER on IntegriCloud