aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_els.c
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2008-01-11 01:52:54 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-23 12:29:22 -0500
commit0937282036d9ae798e02c9c69a8b2ef044048855 (patch)
tree55c8ef65c9c55e74e8985b58396516b3d3b925ad /drivers/scsi/lpfc/lpfc_els.c
parent13815c8344a238c204e4f4339b22dc4833c6df0f (diff)
[SCSI] lpfc 8.2.4 : Miscellaneous Fixes
Miscellaneous Fixes: - Fix a couple of sparse complaints - Reset the FCP recovery flag when the node is not a FCP2 device. - Speed up offline prep delays - Fixed a memory leak in lpfc_mem_alloc failure path - Fixed external loopback test. - Fixed error code returned from the driver when HBA is over heated. - Correct Max NPIV vport to limits read from adapter - Add missing locks around fc_flag and FC_NEEDS_REG_VPI - Add missing hba ids for device identification - Added support for SET_VARIABLE and MBX_WRITE_WWN mailbox commands - Changed all temperature event messages from warning to error - Fix reporting of link speed when link is down - Added support for MBX_WRITE_WWN mailbox command - Change del_timer_sync() in ISR to del_timer() in interrupt handler - Correct instances of beXX_to_cpu() that should be cpu_to_beXX() - Perform target flush before releasing node references on module unload - Avoid bogus devloss_tmo messages when driver unloads - Fix panic when HBA generates ERATT interupt - Fix mbox race condition and a workaround on back-to-back mailbox commands - Force NPIV off for pt2pt mode between 2 NPorts - Stop worker thread before removing fc_host. - Fix up discovery timeout error case due to missing clear_la - Tighten mailbox polling code to speed up detection of fast completions - Only allow DUMP_MEMORY if adapter offline due to overtemp errors - Added extended error information to the log messages in chip init. Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_els.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_els.c42
1 files changed, 29 insertions, 13 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index f5e002435972..8da6e8be9d83 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -18,7 +18,7 @@
18 * more details, a copy of which can be found in the file COPYING * 18 * more details, a copy of which can be found in the file COPYING *
19 * included with this package. * 19 * included with this package. *
20 *******************************************************************/ 20 *******************************************************************/
21 21/* See Fibre Channel protocol T11 FC-LS for details */
22#include <linux/blkdev.h> 22#include <linux/blkdev.h>
23#include <linux/pci.h> 23#include <linux/pci.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
@@ -392,11 +392,12 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
392 } 392 }
393 if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) { 393 if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) {
394 lpfc_mbx_unreg_vpi(vport); 394 lpfc_mbx_unreg_vpi(vport);
395 spin_lock_irq(shost->host_lock);
395 vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI; 396 vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI;
397 spin_unlock_irq(shost->host_lock);
396 } 398 }
397 } 399 }
398 400
399 ndlp->nlp_sid = irsp->un.ulpWord[4] & Mask_DID;
400 lpfc_nlp_set_state(vport, ndlp, NLP_STE_REG_LOGIN_ISSUE); 401 lpfc_nlp_set_state(vport, ndlp, NLP_STE_REG_LOGIN_ISSUE);
401 402
402 if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED && 403 if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED &&
@@ -484,6 +485,9 @@ lpfc_cmpl_els_flogi_nport(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
484 lpfc_nlp_put(ndlp); 485 lpfc_nlp_put(ndlp);
485 } 486 }
486 487
488 /* If we are pt2pt with another NPort, force NPIV off! */
489 phba->sli3_options &= ~LPFC_SLI3_NPIV_ENABLED;
490
487 spin_lock_irq(shost->host_lock); 491 spin_lock_irq(shost->host_lock);
488 vport->fc_flag |= FC_PT2PT; 492 vport->fc_flag |= FC_PT2PT;
489 spin_unlock_irq(shost->host_lock); 493 spin_unlock_irq(shost->host_lock);
@@ -2068,7 +2072,7 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
2068 return 0; 2072 return 0;
2069} 2073}
2070 2074
2071int 2075static int
2072lpfc_els_free_data(struct lpfc_hba *phba, struct lpfc_dmabuf *buf_ptr1) 2076lpfc_els_free_data(struct lpfc_hba *phba, struct lpfc_dmabuf *buf_ptr1)
2073{ 2077{
2074 struct lpfc_dmabuf *buf_ptr; 2078 struct lpfc_dmabuf *buf_ptr;
@@ -2086,7 +2090,7 @@ lpfc_els_free_data(struct lpfc_hba *phba, struct lpfc_dmabuf *buf_ptr1)
2086 return 0; 2090 return 0;
2087} 2091}
2088 2092
2089int 2093static int
2090lpfc_els_free_bpl(struct lpfc_hba *phba, struct lpfc_dmabuf *buf_ptr) 2094lpfc_els_free_bpl(struct lpfc_hba *phba, struct lpfc_dmabuf *buf_ptr)
2091{ 2095{
2092 lpfc_mbuf_free(phba, buf_ptr->virt, buf_ptr->phys); 2096 lpfc_mbuf_free(phba, buf_ptr->virt, buf_ptr->phys);
@@ -2976,10 +2980,10 @@ lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
2976 "RCV RSCN defer: did:x%x/ste:x%x flg:x%x", 2980 "RCV RSCN defer: did:x%x/ste:x%x flg:x%x",
2977 ndlp->nlp_DID, vport->port_state, ndlp->nlp_flag); 2981 ndlp->nlp_DID, vport->port_state, ndlp->nlp_flag);
2978 2982
2983 spin_lock_irq(shost->host_lock);
2979 vport->fc_flag |= FC_RSCN_DEFERRED; 2984 vport->fc_flag |= FC_RSCN_DEFERRED;
2980 if ((rscn_cnt < FC_MAX_HOLD_RSCN) && 2985 if ((rscn_cnt < FC_MAX_HOLD_RSCN) &&
2981 !(vport->fc_flag & FC_RSCN_DISCOVERY)) { 2986 !(vport->fc_flag & FC_RSCN_DISCOVERY)) {
2982 spin_lock_irq(shost->host_lock);
2983 vport->fc_flag |= FC_RSCN_MODE; 2987 vport->fc_flag |= FC_RSCN_MODE;
2984 spin_unlock_irq(shost->host_lock); 2988 spin_unlock_irq(shost->host_lock);
2985 if (rscn_cnt) { 2989 if (rscn_cnt) {
@@ -3008,7 +3012,6 @@ lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
3008 vport->fc_rscn_id_cnt, vport->fc_flag, 3012 vport->fc_rscn_id_cnt, vport->fc_flag,
3009 vport->port_state); 3013 vport->port_state);
3010 } else { 3014 } else {
3011 spin_lock_irq(shost->host_lock);
3012 vport->fc_flag |= FC_RSCN_DISCOVERY; 3015 vport->fc_flag |= FC_RSCN_DISCOVERY;
3013 spin_unlock_irq(shost->host_lock); 3016 spin_unlock_irq(shost->host_lock);
3014 /* ReDiscovery RSCN */ 3017 /* ReDiscovery RSCN */
@@ -3023,7 +3026,9 @@ lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
3023 3026
3024 /* send RECOVERY event for ALL nodes that match RSCN payload */ 3027 /* send RECOVERY event for ALL nodes that match RSCN payload */
3025 lpfc_rscn_recovery_check(vport); 3028 lpfc_rscn_recovery_check(vport);
3029 spin_lock_irq(shost->host_lock);
3026 vport->fc_flag &= ~FC_RSCN_DEFERRED; 3030 vport->fc_flag &= ~FC_RSCN_DEFERRED;
3031 spin_unlock_irq(shost->host_lock);
3027 return 0; 3032 return 0;
3028 } 3033 }
3029 3034
@@ -3307,13 +3312,13 @@ lpfc_els_rsp_rps_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
3307 status |= 0x4; 3312 status |= 0x4;
3308 3313
3309 rps_rsp->rsvd1 = 0; 3314 rps_rsp->rsvd1 = 0;
3310 rps_rsp->portStatus = be16_to_cpu(status); 3315 rps_rsp->portStatus = cpu_to_be16(status);
3311 rps_rsp->linkFailureCnt = be32_to_cpu(mb->un.varRdLnk.linkFailureCnt); 3316 rps_rsp->linkFailureCnt = cpu_to_be32(mb->un.varRdLnk.linkFailureCnt);
3312 rps_rsp->lossSyncCnt = be32_to_cpu(mb->un.varRdLnk.lossSyncCnt); 3317 rps_rsp->lossSyncCnt = cpu_to_be32(mb->un.varRdLnk.lossSyncCnt);
3313 rps_rsp->lossSignalCnt = be32_to_cpu(mb->un.varRdLnk.lossSignalCnt); 3318 rps_rsp->lossSignalCnt = cpu_to_be32(mb->un.varRdLnk.lossSignalCnt);
3314 rps_rsp->primSeqErrCnt = be32_to_cpu(mb->un.varRdLnk.primSeqErrCnt); 3319 rps_rsp->primSeqErrCnt = cpu_to_be32(mb->un.varRdLnk.primSeqErrCnt);
3315 rps_rsp->invalidXmitWord = be32_to_cpu(mb->un.varRdLnk.invalidXmitWord); 3320 rps_rsp->invalidXmitWord = cpu_to_be32(mb->un.varRdLnk.invalidXmitWord);
3316 rps_rsp->crcCnt = be32_to_cpu(mb->un.varRdLnk.crcCnt); 3321 rps_rsp->crcCnt = cpu_to_be32(mb->un.varRdLnk.crcCnt);
3317 /* Xmit ELS RPS ACC response tag <ulpIoTag> */ 3322 /* Xmit ELS RPS ACC response tag <ulpIoTag> */
3318 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_ELS, 3323 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_ELS,
3319 "0118 Xmit ELS RPS ACC response tag x%x xri x%x, " 3324 "0118 Xmit ELS RPS ACC response tag x%x xri x%x, "
@@ -4276,7 +4281,9 @@ lpfc_cmpl_reg_new_vport(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
4276 struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *) pmb->context2; 4281 struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *) pmb->context2;
4277 MAILBOX_t *mb = &pmb->mb; 4282 MAILBOX_t *mb = &pmb->mb;
4278 4283
4284 spin_lock_irq(shost->host_lock);
4279 vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI; 4285 vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI;
4286 spin_unlock_irq(shost->host_lock);
4280 lpfc_nlp_put(ndlp); 4287 lpfc_nlp_put(ndlp);
4281 4288
4282 if (mb->mbxStatus) { 4289 if (mb->mbxStatus) {
@@ -4297,7 +4304,9 @@ lpfc_cmpl_reg_new_vport(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
4297 default: 4304 default:
4298 /* Try to recover from this error */ 4305 /* Try to recover from this error */
4299 lpfc_mbx_unreg_vpi(vport); 4306 lpfc_mbx_unreg_vpi(vport);
4307 spin_lock_irq(shost->host_lock);
4300 vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI; 4308 vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI;
4309 spin_unlock_irq(shost->host_lock);
4301 lpfc_initial_fdisc(vport); 4310 lpfc_initial_fdisc(vport);
4302 break; 4311 break;
4303 } 4312 }
@@ -4316,6 +4325,7 @@ static void
4316lpfc_register_new_vport(struct lpfc_hba *phba, struct lpfc_vport *vport, 4325lpfc_register_new_vport(struct lpfc_hba *phba, struct lpfc_vport *vport,
4317 struct lpfc_nodelist *ndlp) 4326 struct lpfc_nodelist *ndlp)
4318{ 4327{
4328 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
4319 LPFC_MBOXQ_t *mbox; 4329 LPFC_MBOXQ_t *mbox;
4320 4330
4321 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); 4331 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
@@ -4327,7 +4337,9 @@ lpfc_register_new_vport(struct lpfc_hba *phba, struct lpfc_vport *vport,
4327 if (lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT) 4337 if (lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT)
4328 == MBX_NOT_FINISHED) { 4338 == MBX_NOT_FINISHED) {
4329 mempool_free(mbox, phba->mbox_mem_pool); 4339 mempool_free(mbox, phba->mbox_mem_pool);
4340 spin_lock_irq(shost->host_lock);
4330 vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI; 4341 vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI;
4342 spin_unlock_irq(shost->host_lock);
4331 4343
4332 lpfc_vport_set_state(vport, FC_VPORT_FAILED); 4344 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
4333 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, 4345 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
@@ -4339,7 +4351,9 @@ lpfc_register_new_vport(struct lpfc_hba *phba, struct lpfc_vport *vport,
4339 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, 4351 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
4340 "0254 Register VPI: no memory\n"); 4352 "0254 Register VPI: no memory\n");
4341 4353
4354 spin_lock_irq(shost->host_lock);
4342 vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI; 4355 vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI;
4356 spin_unlock_irq(shost->host_lock);
4343 lpfc_nlp_put(ndlp); 4357 lpfc_nlp_put(ndlp);
4344 } 4358 }
4345} 4359}
@@ -4412,7 +4426,9 @@ lpfc_cmpl_els_fdisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
4412 lpfc_unreg_rpi(vport, np); 4426 lpfc_unreg_rpi(vport, np);
4413 } 4427 }
4414 lpfc_mbx_unreg_vpi(vport); 4428 lpfc_mbx_unreg_vpi(vport);
4429 spin_lock_irq(shost->host_lock);
4415 vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI; 4430 vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI;
4431 spin_unlock_irq(shost->host_lock);
4416 } 4432 }
4417 4433
4418 if (vport->fc_flag & FC_VPORT_NEEDS_REG_VPI) 4434 if (vport->fc_flag & FC_VPORT_NEEDS_REG_VPI)