diff options
author | James Smart <James.Smart@Emulex.Com> | 2008-08-24 21:50:00 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-10-13 09:28:53 -0400 |
commit | d7c255b26d8e3f12164d82093de3bf22efad2b4a (patch) | |
tree | 0b3467eda322ec2d90e5a7369891ab4ba12ff0a1 /drivers/scsi/lpfc/lpfc_init.c | |
parent | 34b02dcdcf1865405f4762b991965c0c3b8a3ae0 (diff) |
[SCSI] lpfc 8.2.8 : Miscellaneous Bug Fixes
Miscellaneous Fixes:
- Fix the wrong variable name used for checking node active usage status
- Fix numerous duplicate log message numbers
- Fix change KERN_WARNING messages to KERN_INFO.
- Stop sending erroneous LOGO to fabric after vport is already terminated
- Fix HBQ allocates that were kalloc'ing w/ GFP_KERNEL while holding a lock.
- Fix gcc 4.3.2 compiler warnings and a sparse warning
- Fix bugs in handling unsolicited ct event queue
- Reorder some of the initial link up checks, to remove odd VPI states.
- Correct poor VPI handling
- Add debug messages
- Expand Update_CFG mailbox definition
- Fix handling of VPD data offsets
- Reorder loopback flags
- convert to use offsetof()
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_init.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 6a7a039e8904..b8989c43aaf2 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -183,12 +183,9 @@ lpfc_config_port_prep(struct lpfc_hba *phba) | |||
183 | sizeof (phba->RandomData)); | 183 | sizeof (phba->RandomData)); |
184 | 184 | ||
185 | /* Get adapter VPD information */ | 185 | /* Get adapter VPD information */ |
186 | pmb->context2 = kmalloc(DMP_RSP_SIZE, GFP_KERNEL); | ||
187 | if (!pmb->context2) | ||
188 | goto out_free_mbox; | ||
189 | lpfc_vpd_data = kmalloc(DMP_VPD_SIZE, GFP_KERNEL); | 186 | lpfc_vpd_data = kmalloc(DMP_VPD_SIZE, GFP_KERNEL); |
190 | if (!lpfc_vpd_data) | 187 | if (!lpfc_vpd_data) |
191 | goto out_free_context2; | 188 | goto out_free_mbox; |
192 | 189 | ||
193 | do { | 190 | do { |
194 | lpfc_dump_mem(phba, pmb, offset); | 191 | lpfc_dump_mem(phba, pmb, offset); |
@@ -203,15 +200,14 @@ lpfc_config_port_prep(struct lpfc_hba *phba) | |||
203 | } | 200 | } |
204 | if (mb->un.varDmp.word_cnt > DMP_VPD_SIZE - offset) | 201 | if (mb->un.varDmp.word_cnt > DMP_VPD_SIZE - offset) |
205 | mb->un.varDmp.word_cnt = DMP_VPD_SIZE - offset; | 202 | mb->un.varDmp.word_cnt = DMP_VPD_SIZE - offset; |
206 | lpfc_sli_pcimem_bcopy(pmb->context2, lpfc_vpd_data + offset, | 203 | lpfc_sli_pcimem_bcopy(((uint8_t *)mb) + DMP_RSP_OFFSET, |
204 | lpfc_vpd_data + offset, | ||
207 | mb->un.varDmp.word_cnt); | 205 | mb->un.varDmp.word_cnt); |
208 | offset += mb->un.varDmp.word_cnt; | 206 | offset += mb->un.varDmp.word_cnt; |
209 | } while (mb->un.varDmp.word_cnt && offset < DMP_VPD_SIZE); | 207 | } while (mb->un.varDmp.word_cnt && offset < DMP_VPD_SIZE); |
210 | lpfc_parse_vpd(phba, lpfc_vpd_data, offset); | 208 | lpfc_parse_vpd(phba, lpfc_vpd_data, offset); |
211 | 209 | ||
212 | kfree(lpfc_vpd_data); | 210 | kfree(lpfc_vpd_data); |
213 | out_free_context2: | ||
214 | kfree(pmb->context2); | ||
215 | out_free_mbox: | 211 | out_free_mbox: |
216 | mempool_free(pmb, phba->mbox_mem_pool); | 212 | mempool_free(pmb, phba->mbox_mem_pool); |
217 | return 0; | 213 | return 0; |
@@ -425,9 +421,8 @@ lpfc_config_port_post(struct lpfc_hba *phba) | |||
425 | 421 | ||
426 | lpfc_init_link(phba, pmb, phba->cfg_topology, phba->cfg_link_speed); | 422 | lpfc_init_link(phba, pmb, phba->cfg_topology, phba->cfg_link_speed); |
427 | pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; | 423 | pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; |
428 | pmb->vport = vport; | ||
429 | rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT); | ||
430 | lpfc_set_loopback_flag(phba); | 424 | lpfc_set_loopback_flag(phba); |
425 | rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT); | ||
431 | if (rc != MBX_SUCCESS) { | 426 | if (rc != MBX_SUCCESS) { |
432 | lpfc_printf_log(phba, KERN_ERR, LOG_INIT, | 427 | lpfc_printf_log(phba, KERN_ERR, LOG_INIT, |
433 | "0454 Adapter failed to init, mbxCmd x%x " | 428 | "0454 Adapter failed to init, mbxCmd x%x " |
@@ -462,7 +457,7 @@ lpfc_config_port_post(struct lpfc_hba *phba) | |||
462 | rc); | 457 | rc); |
463 | mempool_free(pmb, phba->mbox_mem_pool); | 458 | mempool_free(pmb, phba->mbox_mem_pool); |
464 | } | 459 | } |
465 | return (0); | 460 | return 0; |
466 | } | 461 | } |
467 | 462 | ||
468 | /** | 463 | /** |
@@ -841,7 +836,7 @@ lpfc_handle_eratt(struct lpfc_hba *phba) | |||
841 | temp_event_data.data = (uint32_t)temperature; | 836 | temp_event_data.data = (uint32_t)temperature; |
842 | 837 | ||
843 | lpfc_printf_log(phba, KERN_ERR, LOG_INIT, | 838 | lpfc_printf_log(phba, KERN_ERR, LOG_INIT, |
844 | "0459 Adapter maximum temperature exceeded " | 839 | "0406 Adapter maximum temperature exceeded " |
845 | "(%ld), taking this port offline " | 840 | "(%ld), taking this port offline " |
846 | "Data: x%x x%x x%x\n", | 841 | "Data: x%x x%x x%x\n", |
847 | temperature, phba->work_hs, | 842 | temperature, phba->work_hs, |
@@ -1595,7 +1590,7 @@ lpfc_cleanup(struct lpfc_vport *vport) | |||
1595 | &vport->fc_nodes, nlp_listp) { | 1590 | &vport->fc_nodes, nlp_listp) { |
1596 | lpfc_printf_vlog(ndlp->vport, KERN_ERR, | 1591 | lpfc_printf_vlog(ndlp->vport, KERN_ERR, |
1597 | LOG_NODE, | 1592 | LOG_NODE, |
1598 | "0282: did:x%x ndlp:x%p " | 1593 | "0282 did:x%x ndlp:x%p " |
1599 | "usgmap:x%x refcnt:%d\n", | 1594 | "usgmap:x%x refcnt:%d\n", |
1600 | ndlp->nlp_DID, (void *)ndlp, | 1595 | ndlp->nlp_DID, (void *)ndlp, |
1601 | ndlp->nlp_usg_map, | 1596 | ndlp->nlp_usg_map, |
@@ -2320,10 +2315,10 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
2320 | goto out_iounmap; | 2315 | goto out_iounmap; |
2321 | 2316 | ||
2322 | memset(phba->slim2p.virt, 0, SLI2_SLIM_SIZE); | 2317 | memset(phba->slim2p.virt, 0, SLI2_SLIM_SIZE); |
2323 | phba->mbox = phba->slim2p.virt; | 2318 | phba->mbox = phba->slim2p.virt + offsetof(struct lpfc_sli2_slim, mbx); |
2324 | phba->pcb = (phba->slim2p.virt + sizeof(MAILBOX_t)); | 2319 | phba->pcb = (phba->slim2p.virt + offsetof(struct lpfc_sli2_slim, pcb)); |
2325 | phba->IOCBs = (phba->slim2p.virt + sizeof(MAILBOX_t) + | 2320 | phba->IOCBs = (phba->slim2p.virt + |
2326 | sizeof(struct _PCB)); | 2321 | offsetof(struct lpfc_sli2_slim, IOCBs)); |
2327 | 2322 | ||
2328 | phba->hbqslimp.virt = dma_alloc_coherent(&phba->pcidev->dev, | 2323 | phba->hbqslimp.virt = dma_alloc_coherent(&phba->pcidev->dev, |
2329 | lpfc_sli_hbq_size(), | 2324 | lpfc_sli_hbq_size(), |
@@ -2889,7 +2884,8 @@ lpfc_init(void) | |||
2889 | error = pci_register_driver(&lpfc_driver); | 2884 | error = pci_register_driver(&lpfc_driver); |
2890 | if (error) { | 2885 | if (error) { |
2891 | fc_release_transport(lpfc_transport_template); | 2886 | fc_release_transport(lpfc_transport_template); |
2892 | fc_release_transport(lpfc_vport_transport_template); | 2887 | if (lpfc_enable_npiv) |
2888 | fc_release_transport(lpfc_vport_transport_template); | ||
2893 | } | 2889 | } |
2894 | 2890 | ||
2895 | return error; | 2891 | return error; |