diff options
author | James Smart <James.Smart@Emulex.Com> | 2008-04-07 10:16:05 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-04-10 08:53:12 -0400 |
commit | 97eab63490452f0a5242fa94ddaa9b727d69cb25 (patch) | |
tree | b85d3bf226d4acf208981f1fcdbc9fde98d1c6a6 | |
parent | 9b37960523afb1b519b406dec4c4f3155b82b2ba (diff) |
[SCSI] lpfc 8.2.6 : Miscellaneous Fixes
Miscellaneous Fixes
- Allow WRITE_VPARAM command when the virtual port is in a stopped state
- Fixed handling of our queue depth max that was unconditionally raising
the depth on all vports, rather than just the vport affected.
- Fix race in interrupt handler for mailbox processing that did not take
out the host lock.
- Removed unused functions: find_node, findnode_rpi, and fabric_abort_flogi
- Correct misspelled word unsolicited in message 0146
- Correct HW-error 5 handling - it should not reset the adapter
- Correct handling of IOCBs, which did not null out our pCmd field before
invoking the midlayer io done function.
- Changed our maximum supported target id to 4096
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r-- | drivers/scsi/lpfc/lpfc.h | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_attr.c | 4 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_ct.c | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_els.c | 36 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hbadisc.c | 32 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 3 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_scsi.c | 8 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 20 |
8 files changed, 21 insertions, 86 deletions
diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index c66d8d19c577..ec0b0f6e5e1a 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h | |||
@@ -23,7 +23,7 @@ | |||
23 | 23 | ||
24 | struct lpfc_sli2_slim; | 24 | struct lpfc_sli2_slim; |
25 | 25 | ||
26 | #define LPFC_MAX_TARGET 256 /* max number of targets supported */ | 26 | #define LPFC_MAX_TARGET 4096 /* max number of targets supported */ |
27 | #define LPFC_MAX_DISC_THREADS 64 /* max outstanding discovery els | 27 | #define LPFC_MAX_DISC_THREADS 64 /* max outstanding discovery els |
28 | requests */ | 28 | requests */ |
29 | #define LPFC_MAX_NS_RETRY 3 /* Number of retry attempts to contact | 29 | #define LPFC_MAX_NS_RETRY 3 /* Number of retry attempts to contact |
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 6917800fc1a7..74c9fc204211 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c | |||
@@ -1954,7 +1954,9 @@ sysfs_mbox_read(struct kobject *kobj, struct bin_attribute *bin_attr, | |||
1954 | (phba->sysfs_mbox.mbox->mb.mbxCommand != | 1954 | (phba->sysfs_mbox.mbox->mb.mbxCommand != |
1955 | MBX_DUMP_MEMORY && | 1955 | MBX_DUMP_MEMORY && |
1956 | phba->sysfs_mbox.mbox->mb.mbxCommand != | 1956 | phba->sysfs_mbox.mbox->mb.mbxCommand != |
1957 | MBX_RESTART)) { | 1957 | MBX_RESTART && |
1958 | phba->sysfs_mbox.mbox->mb.mbxCommand != | ||
1959 | MBX_WRITE_VPARMS)) { | ||
1958 | sysfs_mbox_idle(phba); | 1960 | sysfs_mbox_idle(phba); |
1959 | spin_unlock_irq(&phba->hbalock); | 1961 | spin_unlock_irq(&phba->hbalock); |
1960 | return -EPERM; | 1962 | return -EPERM; |
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index b64dc711cd8d..153afae567b5 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c | |||
@@ -63,7 +63,7 @@ lpfc_ct_ignore_hbq_buffer(struct lpfc_hba *phba, struct lpfc_iocbq *piocbq, | |||
63 | { | 63 | { |
64 | if (!mp) { | 64 | if (!mp) { |
65 | lpfc_printf_log(phba, KERN_INFO, LOG_ELS, | 65 | lpfc_printf_log(phba, KERN_INFO, LOG_ELS, |
66 | "0146 Ignoring unsolicted CT No HBQ " | 66 | "0146 Ignoring unsolicited CT No HBQ " |
67 | "status = x%x\n", | 67 | "status = x%x\n", |
68 | piocbq->iocb.ulpStatus); | 68 | piocbq->iocb.ulpStatus); |
69 | } | 69 | } |
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 6e0e991c6445..886c5f1b11d2 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c | |||
@@ -5097,39 +5097,3 @@ void lpfc_fabric_abort_hba(struct lpfc_hba *phba) | |||
5097 | (piocb->iocb_cmpl) (phba, piocb, piocb); | 5097 | (piocb->iocb_cmpl) (phba, piocb, piocb); |
5098 | } | 5098 | } |
5099 | } | 5099 | } |
5100 | |||
5101 | |||
5102 | #if 0 | ||
5103 | void lpfc_fabric_abort_flogi(struct lpfc_hba *phba) | ||
5104 | { | ||
5105 | LIST_HEAD(completions); | ||
5106 | struct lpfc_iocbq *tmp_iocb, *piocb; | ||
5107 | IOCB_t *cmd; | ||
5108 | struct lpfc_nodelist *ndlp; | ||
5109 | |||
5110 | spin_lock_irq(&phba->hbalock); | ||
5111 | list_for_each_entry_safe(piocb, tmp_iocb, &phba->fabric_iocb_list, | ||
5112 | list) { | ||
5113 | |||
5114 | cmd = &piocb->iocb; | ||
5115 | ndlp = (struct lpfc_nodelist *) piocb->context1; | ||
5116 | if (cmd->ulpCommand == CMD_ELS_REQUEST64_CR && | ||
5117 | ndlp != NULL && | ||
5118 | ndlp->nlp_DID == Fabric_DID) | ||
5119 | list_move_tail(&piocb->list, &completions); | ||
5120 | } | ||
5121 | spin_unlock_irq(&phba->hbalock); | ||
5122 | |||
5123 | while (!list_empty(&completions)) { | ||
5124 | piocb = list_get_first(&completions, struct lpfc_iocbq, list); | ||
5125 | list_del_init(&piocb->list); | ||
5126 | |||
5127 | cmd = &piocb->iocb; | ||
5128 | cmd->ulpStatus = IOSTAT_LOCAL_REJECT; | ||
5129 | cmd->un.ulpWord[4] = IOERR_SLI_ABORTED; | ||
5130 | (piocb->iocb_cmpl) (phba, piocb, piocb); | ||
5131 | } | ||
5132 | } | ||
5133 | #endif /* 0 */ | ||
5134 | |||
5135 | |||
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 7c8c3e6f399d..7cb68feb04fd 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c | |||
@@ -2948,24 +2948,6 @@ __lpfc_find_node(struct lpfc_vport *vport, node_filter filter, void *param) | |||
2948 | return NULL; | 2948 | return NULL; |
2949 | } | 2949 | } |
2950 | 2950 | ||
2951 | #if 0 | ||
2952 | /* | ||
2953 | * Search node lists for a remote port matching filter criteria | ||
2954 | * Caller needs to hold host_lock before calling this routine. | ||
2955 | */ | ||
2956 | struct lpfc_nodelist * | ||
2957 | lpfc_find_node(struct lpfc_vport *vport, node_filter filter, void *param) | ||
2958 | { | ||
2959 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); | ||
2960 | struct lpfc_nodelist *ndlp; | ||
2961 | |||
2962 | spin_lock_irq(shost->host_lock); | ||
2963 | ndlp = __lpfc_find_node(vport, filter, param); | ||
2964 | spin_unlock_irq(shost->host_lock); | ||
2965 | return ndlp; | ||
2966 | } | ||
2967 | #endif /* 0 */ | ||
2968 | |||
2969 | /* | 2951 | /* |
2970 | * This routine looks up the ndlp lists for the given RPI. If rpi found it | 2952 | * This routine looks up the ndlp lists for the given RPI. If rpi found it |
2971 | * returns the node list element pointer else return NULL. | 2953 | * returns the node list element pointer else return NULL. |
@@ -2976,20 +2958,6 @@ __lpfc_findnode_rpi(struct lpfc_vport *vport, uint16_t rpi) | |||
2976 | return __lpfc_find_node(vport, lpfc_filter_by_rpi, &rpi); | 2958 | return __lpfc_find_node(vport, lpfc_filter_by_rpi, &rpi); |
2977 | } | 2959 | } |
2978 | 2960 | ||
2979 | #if 0 | ||
2980 | struct lpfc_nodelist * | ||
2981 | lpfc_findnode_rpi(struct lpfc_vport *vport, uint16_t rpi) | ||
2982 | { | ||
2983 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); | ||
2984 | struct lpfc_nodelist *ndlp; | ||
2985 | |||
2986 | spin_lock_irq(shost->host_lock); | ||
2987 | ndlp = __lpfc_findnode_rpi(vport, rpi); | ||
2988 | spin_unlock_irq(shost->host_lock); | ||
2989 | return ndlp; | ||
2990 | } | ||
2991 | #endif /* 0 */ | ||
2992 | |||
2993 | /* | 2961 | /* |
2994 | * This routine looks up the ndlp lists for the given WWPN. If WWPN found it | 2962 | * This routine looks up the ndlp lists for the given WWPN. If WWPN found it |
2995 | * returns the node element list pointer else return NULL. | 2963 | * returns the node element list pointer else return NULL. |
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index dba6770b506b..fa757b251f82 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -729,8 +729,7 @@ lpfc_handle_eratt(struct lpfc_hba *phba) | |||
729 | if (!phba->cfg_enable_hba_reset) | 729 | if (!phba->cfg_enable_hba_reset) |
730 | return; | 730 | return; |
731 | 731 | ||
732 | if (phba->work_hs & HS_FFER6 || | 732 | if (phba->work_hs & HS_FFER6) { |
733 | phba->work_hs & HS_FFER5) { | ||
734 | /* Re-establishing Link */ | 733 | /* Re-establishing Link */ |
735 | lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT, | 734 | lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT, |
736 | "1301 Re-establishing Link " | 735 | "1301 Re-establishing Link " |
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 6df8bc003a88..0910a9ab76a5 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c | |||
@@ -169,6 +169,9 @@ lpfc_ramp_up_queue_handler(struct lpfc_hba *phba) | |||
169 | for(i = 0; i <= phba->max_vpi && vports[i] != NULL; i++) { | 169 | for(i = 0; i <= phba->max_vpi && vports[i] != NULL; i++) { |
170 | shost = lpfc_shost_from_vport(vports[i]); | 170 | shost = lpfc_shost_from_vport(vports[i]); |
171 | shost_for_each_device(sdev, shost) { | 171 | shost_for_each_device(sdev, shost) { |
172 | if (vports[i]->cfg_lun_queue_depth <= | ||
173 | sdev->queue_depth) | ||
174 | continue; | ||
172 | if (sdev->ordered_tags) | 175 | if (sdev->ordered_tags) |
173 | scsi_adjust_queue_depth(sdev, | 176 | scsi_adjust_queue_depth(sdev, |
174 | MSG_ORDERED_TAG, | 177 | MSG_ORDERED_TAG, |
@@ -606,6 +609,9 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, | |||
606 | result = cmd->result; | 609 | result = cmd->result; |
607 | sdev = cmd->device; | 610 | sdev = cmd->device; |
608 | lpfc_scsi_unprep_dma_buf(phba, lpfc_cmd); | 611 | lpfc_scsi_unprep_dma_buf(phba, lpfc_cmd); |
612 | spin_lock_irqsave(sdev->host->host_lock, flags); | ||
613 | lpfc_cmd->pCmd = NULL; /* This must be done before scsi_done */ | ||
614 | spin_unlock_irqrestore(sdev->host->host_lock, flags); | ||
609 | cmd->scsi_done(cmd); | 615 | cmd->scsi_done(cmd); |
610 | 616 | ||
611 | if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) { | 617 | if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) { |
@@ -614,7 +620,6 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, | |||
614 | * wake up the thread. | 620 | * wake up the thread. |
615 | */ | 621 | */ |
616 | spin_lock_irqsave(sdev->host->host_lock, flags); | 622 | spin_lock_irqsave(sdev->host->host_lock, flags); |
617 | lpfc_cmd->pCmd = NULL; | ||
618 | if (lpfc_cmd->waitq) | 623 | if (lpfc_cmd->waitq) |
619 | wake_up(lpfc_cmd->waitq); | 624 | wake_up(lpfc_cmd->waitq); |
620 | spin_unlock_irqrestore(sdev->host->host_lock, flags); | 625 | spin_unlock_irqrestore(sdev->host->host_lock, flags); |
@@ -685,7 +690,6 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, | |||
685 | * wake up the thread. | 690 | * wake up the thread. |
686 | */ | 691 | */ |
687 | spin_lock_irqsave(sdev->host->host_lock, flags); | 692 | spin_lock_irqsave(sdev->host->host_lock, flags); |
688 | lpfc_cmd->pCmd = NULL; | ||
689 | if (lpfc_cmd->waitq) | 693 | if (lpfc_cmd->waitq) |
690 | wake_up(lpfc_cmd->waitq); | 694 | wake_up(lpfc_cmd->waitq); |
691 | spin_unlock_irqrestore(sdev->host->host_lock, flags); | 695 | spin_unlock_irqrestore(sdev->host->host_lock, flags); |
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 741e94af4793..70a0a9eab211 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -3481,26 +3481,21 @@ lpfc_sli_hba_down(struct lpfc_hba *phba) | |||
3481 | phba->pport->work_port_events &= ~WORKER_MBOX_TMO; | 3481 | phba->pport->work_port_events &= ~WORKER_MBOX_TMO; |
3482 | spin_unlock(&phba->pport->work_port_lock); | 3482 | spin_unlock(&phba->pport->work_port_lock); |
3483 | 3483 | ||
3484 | /* Return any pending or completed mbox cmds */ | ||
3485 | list_splice_init(&phba->sli.mboxq, &completions); | ||
3484 | if (psli->mbox_active) { | 3486 | if (psli->mbox_active) { |
3485 | list_add_tail(&psli->mbox_active->list, &completions); | 3487 | list_add_tail(&psli->mbox_active->list, &completions); |
3486 | psli->mbox_active = NULL; | 3488 | psli->mbox_active = NULL; |
3487 | psli->sli_flag &= ~LPFC_SLI_MBOX_ACTIVE; | 3489 | psli->sli_flag &= ~LPFC_SLI_MBOX_ACTIVE; |
3488 | } | 3490 | } |
3489 | |||
3490 | /* Return any pending or completed mbox cmds */ | ||
3491 | list_splice_init(&phba->sli.mboxq, &completions); | ||
3492 | list_splice_init(&phba->sli.mboxq_cmpl, &completions); | 3491 | list_splice_init(&phba->sli.mboxq_cmpl, &completions); |
3493 | INIT_LIST_HEAD(&psli->mboxq); | ||
3494 | INIT_LIST_HEAD(&psli->mboxq_cmpl); | ||
3495 | |||
3496 | spin_unlock_irqrestore(&phba->hbalock, flags); | 3492 | spin_unlock_irqrestore(&phba->hbalock, flags); |
3497 | 3493 | ||
3498 | while (!list_empty(&completions)) { | 3494 | while (!list_empty(&completions)) { |
3499 | list_remove_head(&completions, pmb, LPFC_MBOXQ_t, list); | 3495 | list_remove_head(&completions, pmb, LPFC_MBOXQ_t, list); |
3500 | pmb->mb.mbxStatus = MBX_NOT_FINISHED; | 3496 | pmb->mb.mbxStatus = MBX_NOT_FINISHED; |
3501 | if (pmb->mbox_cmpl) { | 3497 | if (pmb->mbox_cmpl) |
3502 | pmb->mbox_cmpl(phba,pmb); | 3498 | pmb->mbox_cmpl(phba,pmb); |
3503 | } | ||
3504 | } | 3499 | } |
3505 | return 1; | 3500 | return 1; |
3506 | } | 3501 | } |
@@ -4201,6 +4196,7 @@ lpfc_intr_handler(int irq, void *dev_id) | |||
4201 | phba->pport->stopped = 1; | 4196 | phba->pport->stopped = 1; |
4202 | } | 4197 | } |
4203 | 4198 | ||
4199 | spin_lock(&phba->hbalock); | ||
4204 | if ((work_ha_copy & HA_MBATT) && | 4200 | if ((work_ha_copy & HA_MBATT) && |
4205 | (phba->sli.mbox_active)) { | 4201 | (phba->sli.mbox_active)) { |
4206 | pmb = phba->sli.mbox_active; | 4202 | pmb = phba->sli.mbox_active; |
@@ -4211,6 +4207,7 @@ lpfc_intr_handler(int irq, void *dev_id) | |||
4211 | /* First check out the status word */ | 4207 | /* First check out the status word */ |
4212 | lpfc_sli_pcimem_bcopy(mbox, pmbox, sizeof(uint32_t)); | 4208 | lpfc_sli_pcimem_bcopy(mbox, pmbox, sizeof(uint32_t)); |
4213 | if (pmbox->mbxOwner != OWN_HOST) { | 4209 | if (pmbox->mbxOwner != OWN_HOST) { |
4210 | spin_unlock(&phba->hbalock); | ||
4214 | /* | 4211 | /* |
4215 | * Stray Mailbox Interrupt, mbxCommand <cmd> | 4212 | * Stray Mailbox Interrupt, mbxCommand <cmd> |
4216 | * mbxStatus <status> | 4213 | * mbxStatus <status> |
@@ -4226,10 +4223,10 @@ lpfc_intr_handler(int irq, void *dev_id) | |||
4226 | /* clear mailbox attention bit */ | 4223 | /* clear mailbox attention bit */ |
4227 | work_ha_copy &= ~HA_MBATT; | 4224 | work_ha_copy &= ~HA_MBATT; |
4228 | } else { | 4225 | } else { |
4226 | phba->sli.mbox_active = NULL; | ||
4227 | spin_unlock(&phba->hbalock); | ||
4229 | phba->last_completion_time = jiffies; | 4228 | phba->last_completion_time = jiffies; |
4230 | del_timer(&phba->sli.mbox_tmo); | 4229 | del_timer(&phba->sli.mbox_tmo); |
4231 | |||
4232 | phba->sli.mbox_active = NULL; | ||
4233 | if (pmb->mbox_cmpl) { | 4230 | if (pmb->mbox_cmpl) { |
4234 | lpfc_sli_pcimem_bcopy(mbox, pmbox, | 4231 | lpfc_sli_pcimem_bcopy(mbox, pmbox, |
4235 | MAILBOX_CMD_SIZE); | 4232 | MAILBOX_CMD_SIZE); |
@@ -4282,7 +4279,8 @@ lpfc_intr_handler(int irq, void *dev_id) | |||
4282 | spin_unlock(&phba->pport->work_port_lock); | 4279 | spin_unlock(&phba->pport->work_port_lock); |
4283 | lpfc_mbox_cmpl_put(phba, pmb); | 4280 | lpfc_mbox_cmpl_put(phba, pmb); |
4284 | } | 4281 | } |
4285 | } | 4282 | } else |
4283 | spin_unlock(&phba->hbalock); | ||
4286 | if ((work_ha_copy & HA_MBATT) && | 4284 | if ((work_ha_copy & HA_MBATT) && |
4287 | (phba->sli.mbox_active == NULL)) { | 4285 | (phba->sli.mbox_active == NULL)) { |
4288 | send_current_mbox: | 4286 | send_current_mbox: |