aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2013-05-31 17:05:27 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-06-26 13:48:53 -0400
commitb230b8a298d1f042fb501a4bbdbc954c927e9ff1 (patch)
treeadbaecbddc2206607dc34a15d4978a4b273feaa2
parent3be30e0e4486b3568044efe27caf405296d7845a (diff)
[SCSI] lpfc 8.3.40: Fixed issue mailbox wait routine failed to issue dump memory mbox command
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 876e61b5036b..bb78e4d45db9 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -10092,12 +10092,13 @@ lpfc_sli_issue_mbox_wait(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq,
10092 uint32_t timeout) 10092 uint32_t timeout)
10093{ 10093{
10094 DECLARE_WAIT_QUEUE_HEAD_ONSTACK(done_q); 10094 DECLARE_WAIT_QUEUE_HEAD_ONSTACK(done_q);
10095 MAILBOX_t *mb = NULL;
10095 int retval; 10096 int retval;
10096 unsigned long flag; 10097 unsigned long flag;
10097 10098
10098 /* The caller must leave context1 empty. */ 10099 /* The caller might set context1 for extended buffer */
10099 if (pmboxq->context1) 10100 if (pmboxq->context1)
10100 return MBX_NOT_FINISHED; 10101 mb = (MAILBOX_t *)pmboxq->context1;
10101 10102
10102 pmboxq->mbox_flag &= ~LPFC_MBX_WAKE; 10103 pmboxq->mbox_flag &= ~LPFC_MBX_WAKE;
10103 /* setup wake call as IOCB callback */ 10104 /* setup wake call as IOCB callback */
@@ -10113,7 +10114,8 @@ lpfc_sli_issue_mbox_wait(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq,
10113 msecs_to_jiffies(timeout * 1000)); 10114 msecs_to_jiffies(timeout * 1000));
10114 10115
10115 spin_lock_irqsave(&phba->hbalock, flag); 10116 spin_lock_irqsave(&phba->hbalock, flag);
10116 pmboxq->context1 = NULL; 10117 /* restore the possible extended buffer for free resource */
10118 pmboxq->context1 = (uint8_t *)mb;
10117 /* 10119 /*
10118 * if LPFC_MBX_WAKE flag is set the mailbox is completed 10120 * if LPFC_MBX_WAKE flag is set the mailbox is completed
10119 * else do not free the resources. 10121 * else do not free the resources.
@@ -10126,6 +10128,9 @@ lpfc_sli_issue_mbox_wait(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq,
10126 pmboxq->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 10128 pmboxq->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
10127 } 10129 }
10128 spin_unlock_irqrestore(&phba->hbalock, flag); 10130 spin_unlock_irqrestore(&phba->hbalock, flag);
10131 } else {
10132 /* restore the possible extended buffer for free resource */
10133 pmboxq->context1 = (uint8_t *)mb;
10129 } 10134 }
10130 10135
10131 return retval; 10136 return retval;