diff options
author | Kashyap, Desai <kashyap.desai@lsi.com> | 2009-09-14 11:05:24 +0530 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-10-02 09:48:50 -0500 |
commit | bcfb6e6ea46d84bfb541069545e5b0d7f6cc3233 (patch) | |
tree | c6ddcd28cc123bf2c1abcb6b79b0c49a3521e1bd /drivers/scsi/mpt2sas/mpt2sas_ctl.c | |
parent | 77e63ed44305e89c0564f8292f9cd5764d4fddfb (diff) | |
download | linux-bcfb6e6ea46d84bfb541069545e5b0d7f6cc3233.tar.bz2 |
[SCSI] mpt2sas: Call init_completion on a per request basis.
Now driver call init_completion on a per request basis. At some
point the wait_for_completion_timeout is not waiting for the timeout,
instead returning immediately, thus going into diag reset. This fix will
address all request using the wait_for_completion_timeout API. The previous
implimentation was only calling init_completion at driver
load time.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_ctl.c')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_ctl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_ctl.c b/drivers/scsi/mpt2sas/mpt2sas_ctl.c index 33463ace0d48..57d724633906 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_ctl.c +++ b/drivers/scsi/mpt2sas/mpt2sas_ctl.c @@ -812,6 +812,7 @@ _ctl_do_mpt_command(struct MPT2SAS_ADAPTER *ioc, timeout = MPT2_IOCTL_DEFAULT_TIMEOUT; else timeout = karg.timeout; + init_completion(&ioc->ctl_cmds.done); timeleft = wait_for_completion_timeout(&ioc->ctl_cmds.done, timeout*HZ); if (mpi_request->Function == MPI2_FUNCTION_SCSI_TASK_MGMT) { @@ -1388,6 +1389,7 @@ _ctl_diag_register(void __user *arg, enum block_state state) cpu_to_le32(ioc->product_specific[buffer_type][i]); mpt2sas_base_put_smid_default(ioc, smid); + init_completion(&ioc->ctl_cmds.done); timeleft = wait_for_completion_timeout(&ioc->ctl_cmds.done, MPT2_IOCTL_DEFAULT_TIMEOUT*HZ); @@ -1654,6 +1656,7 @@ _ctl_send_release(struct MPT2SAS_ADAPTER *ioc, u8 buffer_type, u8 *issue_reset) mpi_request->VP_ID = 0; mpt2sas_base_put_smid_default(ioc, smid); + init_completion(&ioc->ctl_cmds.done); timeleft = wait_for_completion_timeout(&ioc->ctl_cmds.done, MPT2_IOCTL_DEFAULT_TIMEOUT*HZ); @@ -1915,6 +1918,7 @@ _ctl_diag_read_buffer(void __user *arg, enum block_state state) mpi_request->VP_ID = 0; mpt2sas_base_put_smid_default(ioc, smid); + init_completion(&ioc->ctl_cmds.done); timeleft = wait_for_completion_timeout(&ioc->ctl_cmds.done, MPT2_IOCTL_DEFAULT_TIMEOUT*HZ); |