diff options
author | Kashyap, Desai <kashyap.desai@lsi.com> | 2009-09-14 01:35:24 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-10-02 10:48:50 -0400 |
commit | bcfb6e6ea46d84bfb541069545e5b0d7f6cc3233 (patch) | |
tree | c6ddcd28cc123bf2c1abcb6b79b0c49a3521e1bd /drivers/scsi/mpt2sas/mpt2sas_base.c | |
parent | 77e63ed44305e89c0564f8292f9cd5764d4fddfb (diff) |
[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_base.c')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_base.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index a9c71769b4ec..f679bff9fc33 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c | |||
@@ -2614,6 +2614,7 @@ mpt2sas_base_sas_iounit_control(struct MPT2SAS_ADAPTER *ioc, | |||
2614 | mpi_request->Operation == MPI2_SAS_OP_PHY_LINK_RESET) | 2614 | mpi_request->Operation == MPI2_SAS_OP_PHY_LINK_RESET) |
2615 | ioc->ioc_link_reset_in_progress = 1; | 2615 | ioc->ioc_link_reset_in_progress = 1; |
2616 | mpt2sas_base_put_smid_default(ioc, smid); | 2616 | mpt2sas_base_put_smid_default(ioc, smid); |
2617 | init_completion(&ioc->base_cmds.done); | ||
2617 | timeleft = wait_for_completion_timeout(&ioc->base_cmds.done, | 2618 | timeleft = wait_for_completion_timeout(&ioc->base_cmds.done, |
2618 | msecs_to_jiffies(10000)); | 2619 | msecs_to_jiffies(10000)); |
2619 | if ((mpi_request->Operation == MPI2_SAS_OP_PHY_HARD_RESET || | 2620 | if ((mpi_request->Operation == MPI2_SAS_OP_PHY_HARD_RESET || |
@@ -2715,6 +2716,7 @@ mpt2sas_base_scsi_enclosure_processor(struct MPT2SAS_ADAPTER *ioc, | |||
2715 | ioc->base_cmds.smid = smid; | 2716 | ioc->base_cmds.smid = smid; |
2716 | memcpy(request, mpi_request, sizeof(Mpi2SepReply_t)); | 2717 | memcpy(request, mpi_request, sizeof(Mpi2SepReply_t)); |
2717 | mpt2sas_base_put_smid_default(ioc, smid); | 2718 | mpt2sas_base_put_smid_default(ioc, smid); |
2719 | init_completion(&ioc->base_cmds.done); | ||
2718 | timeleft = wait_for_completion_timeout(&ioc->base_cmds.done, | 2720 | timeleft = wait_for_completion_timeout(&ioc->base_cmds.done, |
2719 | msecs_to_jiffies(10000)); | 2721 | msecs_to_jiffies(10000)); |
2720 | if (!(ioc->base_cmds.status & MPT2_CMD_COMPLETE)) { | 2722 | if (!(ioc->base_cmds.status & MPT2_CMD_COMPLETE)) { |
@@ -2991,6 +2993,7 @@ _base_send_port_enable(struct MPT2SAS_ADAPTER *ioc, int sleep_flag) | |||
2991 | mpi_request->VP_ID = 0; | 2993 | mpi_request->VP_ID = 0; |
2992 | 2994 | ||
2993 | mpt2sas_base_put_smid_default(ioc, smid); | 2995 | mpt2sas_base_put_smid_default(ioc, smid); |
2996 | init_completion(&ioc->base_cmds.done); | ||
2994 | timeleft = wait_for_completion_timeout(&ioc->base_cmds.done, | 2997 | timeleft = wait_for_completion_timeout(&ioc->base_cmds.done, |
2995 | 300*HZ); | 2998 | 300*HZ); |
2996 | if (!(ioc->base_cmds.status & MPT2_CMD_COMPLETE)) { | 2999 | if (!(ioc->base_cmds.status & MPT2_CMD_COMPLETE)) { |
@@ -3090,6 +3093,7 @@ _base_event_notification(struct MPT2SAS_ADAPTER *ioc, int sleep_flag) | |||
3090 | mpi_request->EventMasks[i] = | 3093 | mpi_request->EventMasks[i] = |
3091 | le32_to_cpu(ioc->event_masks[i]); | 3094 | le32_to_cpu(ioc->event_masks[i]); |
3092 | mpt2sas_base_put_smid_default(ioc, smid); | 3095 | mpt2sas_base_put_smid_default(ioc, smid); |
3096 | init_completion(&ioc->base_cmds.done); | ||
3093 | timeleft = wait_for_completion_timeout(&ioc->base_cmds.done, 30*HZ); | 3097 | timeleft = wait_for_completion_timeout(&ioc->base_cmds.done, 30*HZ); |
3094 | if (!(ioc->base_cmds.status & MPT2_CMD_COMPLETE)) { | 3098 | if (!(ioc->base_cmds.status & MPT2_CMD_COMPLETE)) { |
3095 | printk(MPT2SAS_ERR_FMT "%s: timeout\n", | 3099 | printk(MPT2SAS_ERR_FMT "%s: timeout\n", |
@@ -3486,7 +3490,6 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc) | |||
3486 | 3490 | ||
3487 | /* base internal command bits */ | 3491 | /* base internal command bits */ |
3488 | mutex_init(&ioc->base_cmds.mutex); | 3492 | mutex_init(&ioc->base_cmds.mutex); |
3489 | init_completion(&ioc->base_cmds.done); | ||
3490 | ioc->base_cmds.reply = kzalloc(ioc->reply_sz, GFP_KERNEL); | 3493 | ioc->base_cmds.reply = kzalloc(ioc->reply_sz, GFP_KERNEL); |
3491 | ioc->base_cmds.status = MPT2_CMD_NOT_USED; | 3494 | ioc->base_cmds.status = MPT2_CMD_NOT_USED; |
3492 | 3495 | ||
@@ -3494,7 +3497,6 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc) | |||
3494 | ioc->transport_cmds.reply = kzalloc(ioc->reply_sz, GFP_KERNEL); | 3497 | ioc->transport_cmds.reply = kzalloc(ioc->reply_sz, GFP_KERNEL); |
3495 | ioc->transport_cmds.status = MPT2_CMD_NOT_USED; | 3498 | ioc->transport_cmds.status = MPT2_CMD_NOT_USED; |
3496 | mutex_init(&ioc->transport_cmds.mutex); | 3499 | mutex_init(&ioc->transport_cmds.mutex); |
3497 | init_completion(&ioc->transport_cmds.done); | ||
3498 | 3500 | ||
3499 | /* task management internal command bits */ | 3501 | /* task management internal command bits */ |
3500 | ioc->tm_cmds.reply = kzalloc(ioc->reply_sz, GFP_KERNEL); | 3502 | ioc->tm_cmds.reply = kzalloc(ioc->reply_sz, GFP_KERNEL); |
@@ -3510,7 +3512,6 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc) | |||
3510 | ioc->ctl_cmds.reply = kzalloc(ioc->reply_sz, GFP_KERNEL); | 3512 | ioc->ctl_cmds.reply = kzalloc(ioc->reply_sz, GFP_KERNEL); |
3511 | ioc->ctl_cmds.status = MPT2_CMD_NOT_USED; | 3513 | ioc->ctl_cmds.status = MPT2_CMD_NOT_USED; |
3512 | mutex_init(&ioc->ctl_cmds.mutex); | 3514 | mutex_init(&ioc->ctl_cmds.mutex); |
3513 | init_completion(&ioc->ctl_cmds.done); | ||
3514 | 3515 | ||
3515 | for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) | 3516 | for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) |
3516 | ioc->event_masks[i] = -1; | 3517 | ioc->event_masks[i] = -1; |