diff options
author | Christoph Hellwig <hch@lst.de> | 2005-06-19 07:42:05 -0400 |
---|---|---|
committer | James Bottomley <jejb@titanic.(none)> | 2005-06-26 13:16:24 -0400 |
commit | 8d115f845a0bd59cd263e791f739964f42b7b0e8 (patch) | |
tree | 8d4af0e70f0d8d5c04e2efa1d68fe507dc5d8923 /drivers/scsi/megaraid.c | |
parent | b4edcbcafdecc80ef5356ff6452768b1b926ea76 (diff) |
[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.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 6ee88c59953e..6fe884a2d00d 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/blkdev.h> | 35 | #include <linux/blkdev.h> |
36 | #include <asm/uaccess.h> | 36 | #include <asm/uaccess.h> |
37 | #include <asm/io.h> | 37 | #include <asm/io.h> |
38 | #include <linux/completion.h> | ||
38 | #include <linux/delay.h> | 39 | #include <linux/delay.h> |
39 | #include <linux/proc_fs.h> | 40 | #include <linux/proc_fs.h> |
40 | #include <linux/reboot.h> | 41 | #include <linux/reboot.h> |
@@ -4477,8 +4478,6 @@ mega_internal_command(adapter_t *adapter, lockscope_t ls, megacmd_t *mc, | |||
4477 | 4478 | ||
4478 | scb->idx = CMDID_INT_CMDS; | 4479 | scb->idx = CMDID_INT_CMDS; |
4479 | 4480 | ||
4480 | scmd->state = 0; | ||
4481 | |||
4482 | /* | 4481 | /* |
4483 | * Get the lock only if the caller has not acquired it already | 4482 | * Get the lock only if the caller has not acquired it already |
4484 | */ | 4483 | */ |
@@ -4488,15 +4487,7 @@ mega_internal_command(adapter_t *adapter, lockscope_t ls, megacmd_t *mc, | |||
4488 | 4487 | ||
4489 | if( ls == LOCK_INT ) spin_unlock_irqrestore(&adapter->lock, flags); | 4488 | if( ls == LOCK_INT ) spin_unlock_irqrestore(&adapter->lock, flags); |
4490 | 4489 | ||
4491 | /* | 4490 | wait_for_completion(&adapter->int_waitq); |
4492 | * Wait till this command finishes. Do not use | ||
4493 | * wait_event_interruptible(). It causes panic if CTRL-C is hit when | ||
4494 | * dumping e.g., physical disk information through /proc interface. | ||
4495 | */ | ||
4496 | #if 0 | ||
4497 | wait_event_interruptible(adapter->int_waitq, scmd->state); | ||
4498 | #endif | ||
4499 | wait_event(adapter->int_waitq, scmd->state); | ||
4500 | 4491 | ||
4501 | rval = scmd->result; | 4492 | rval = scmd->result; |
4502 | mc->status = scmd->result; | 4493 | mc->status = scmd->result; |
@@ -4530,16 +4521,7 @@ mega_internal_done(Scsi_Cmnd *scmd) | |||
4530 | 4521 | ||
4531 | adapter = (adapter_t *)scmd->device->host->hostdata; | 4522 | adapter = (adapter_t *)scmd->device->host->hostdata; |
4532 | 4523 | ||
4533 | scmd->state = 1; /* thread waiting for its command to complete */ | 4524 | complete(&adapter->int_waitq); |
4534 | |||
4535 | /* | ||
4536 | * See comment in mega_internal_command() routine for | ||
4537 | * wait_event_interruptible() | ||
4538 | */ | ||
4539 | #if 0 | ||
4540 | wake_up_interruptible(&adapter->int_waitq); | ||
4541 | #endif | ||
4542 | wake_up(&adapter->int_waitq); | ||
4543 | 4525 | ||
4544 | } | 4526 | } |
4545 | 4527 | ||
@@ -4861,7 +4843,7 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
4861 | } | 4843 | } |
4862 | 4844 | ||
4863 | init_MUTEX(&adapter->int_mtx); | 4845 | init_MUTEX(&adapter->int_mtx); |
4864 | init_waitqueue_head(&adapter->int_waitq); | 4846 | init_completion(&adapter->int_waitq); |
4865 | 4847 | ||
4866 | adapter->this_id = DEFAULT_INITIATOR_ID; | 4848 | adapter->this_id = DEFAULT_INITIATOR_ID; |
4867 | adapter->host->this_id = DEFAULT_INITIATOR_ID; | 4849 | adapter->host->this_id = DEFAULT_INITIATOR_ID; |