diff options
author | James Smart <James.Smart@Emulex.Com> | 2007-10-27 13:37:33 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-01-11 19:22:33 -0500 |
commit | 98c9ea5c026ee47efe2a0f595078dbf199d08f50 (patch) | |
tree | 4d07a863ed26b1d3efec0d198ce456e20fad3954 /drivers/scsi/lpfc/lpfc_init.c | |
parent | 0b727fea7a700e223bf52fb1eaf4c3a27c4340db (diff) |
[SCSI] lpfc 8.2.3 : Miscellaneous Small Fixes - part 1
Miscellaneous Small Fixes - part 1
- Fix typo kmzlloc -> kzalloc
- Fix discovery ndlp use after free panic
- Fix link event causing flood of 0108 messages
- Relieve some mbox congestion on link up with 100 vports
- Fix broken vport parameters
- Prevent lock recursion in logo_reglogin_issue
- Split uses of error variable in lpfc_pci_probe_one into retval and error
- Remove completion code related to dev_loss_tmo
- Remove unused LPFC_MAX_HBQ #define
- Don't compare pointers to 0 for sparse
- Make 2 functions static for sparse
- Fix default rpi cleanup code causing rogue ndlps to remain on the NPR list
- Remove annoying ELS messages when driver is unloaded
- Fix Cannot issue Register Fabric login problems on link up
- Remove LPFC_EVT_DEV_LOSS_DELAY
- Fix FC port swap test leads to device going offline
- Fix vport CT flags to only be set when accepted
- Add code to handle signals during vport_create
- Fix too many retries in FC-AL mode
- Pull lpfc_port_link_failure out of lpfc_linkdown_port
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 | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 8c7fdb8487e0..729694d97597 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -1143,9 +1143,8 @@ lpfc_post_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, int cnt, | |||
1143 | /* Allocate buffer to post */ | 1143 | /* Allocate buffer to post */ |
1144 | mp1 = kmalloc(sizeof (struct lpfc_dmabuf), GFP_KERNEL); | 1144 | mp1 = kmalloc(sizeof (struct lpfc_dmabuf), GFP_KERNEL); |
1145 | if (mp1) | 1145 | if (mp1) |
1146 | mp1->virt = lpfc_mbuf_alloc(phba, MEM_PRI, | 1146 | mp1->virt = lpfc_mbuf_alloc(phba, MEM_PRI, &mp1->phys); |
1147 | &mp1->phys); | 1147 | if (!mp1 || !mp1->virt) { |
1148 | if (mp1 == 0 || mp1->virt == 0) { | ||
1149 | kfree(mp1); | 1148 | kfree(mp1); |
1150 | lpfc_sli_release_iocbq(phba, iocb); | 1149 | lpfc_sli_release_iocbq(phba, iocb); |
1151 | pring->missbufcnt = cnt; | 1150 | pring->missbufcnt = cnt; |
@@ -1159,7 +1158,7 @@ lpfc_post_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, int cnt, | |||
1159 | if (mp2) | 1158 | if (mp2) |
1160 | mp2->virt = lpfc_mbuf_alloc(phba, MEM_PRI, | 1159 | mp2->virt = lpfc_mbuf_alloc(phba, MEM_PRI, |
1161 | &mp2->phys); | 1160 | &mp2->phys); |
1162 | if (mp2 == 0 || mp2->virt == 0) { | 1161 | if (!mp2 || !mp2->virt) { |
1163 | kfree(mp2); | 1162 | kfree(mp2); |
1164 | lpfc_mbuf_free(phba, mp1->virt, mp1->phys); | 1163 | lpfc_mbuf_free(phba, mp1->virt, mp1->phys); |
1165 | kfree(mp1); | 1164 | kfree(mp1); |
@@ -1762,7 +1761,7 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
1762 | struct Scsi_Host *shost = NULL; | 1761 | struct Scsi_Host *shost = NULL; |
1763 | void *ptr; | 1762 | void *ptr; |
1764 | unsigned long bar0map_len, bar2map_len; | 1763 | unsigned long bar0map_len, bar2map_len; |
1765 | int error = -ENODEV; | 1764 | int error = -ENODEV, retval; |
1766 | int i, hbq_count; | 1765 | int i, hbq_count; |
1767 | uint16_t iotag; | 1766 | uint16_t iotag; |
1768 | 1767 | ||
@@ -1878,9 +1877,11 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
1878 | lpfc_sli_setup(phba); | 1877 | lpfc_sli_setup(phba); |
1879 | lpfc_sli_queue_setup(phba); | 1878 | lpfc_sli_queue_setup(phba); |
1880 | 1879 | ||
1881 | error = lpfc_mem_alloc(phba); | 1880 | retval = lpfc_mem_alloc(phba); |
1882 | if (error) | 1881 | if (retval) { |
1882 | error = retval; | ||
1883 | goto out_free_hbqslimp; | 1883 | goto out_free_hbqslimp; |
1884 | } | ||
1884 | 1885 | ||
1885 | /* Initialize and populate the iocb list per host. */ | 1886 | /* Initialize and populate the iocb list per host. */ |
1886 | INIT_LIST_HEAD(&phba->lpfc_iocb_list); | 1887 | INIT_LIST_HEAD(&phba->lpfc_iocb_list); |
@@ -1946,8 +1947,8 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
1946 | pci_set_drvdata(pdev, shost); | 1947 | pci_set_drvdata(pdev, shost); |
1947 | 1948 | ||
1948 | if (phba->cfg_use_msi) { | 1949 | if (phba->cfg_use_msi) { |
1949 | error = pci_enable_msi(phba->pcidev); | 1950 | retval = pci_enable_msi(phba->pcidev); |
1950 | if (!error) | 1951 | if (!retval) |
1951 | phba->using_msi = 1; | 1952 | phba->using_msi = 1; |
1952 | else | 1953 | else |
1953 | lpfc_printf_log(phba, KERN_INFO, LOG_INIT, | 1954 | lpfc_printf_log(phba, KERN_INFO, LOG_INIT, |
@@ -1955,11 +1956,12 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
1955 | "with IRQ\n"); | 1956 | "with IRQ\n"); |
1956 | } | 1957 | } |
1957 | 1958 | ||
1958 | error = request_irq(phba->pcidev->irq, lpfc_intr_handler, IRQF_SHARED, | 1959 | retval = request_irq(phba->pcidev->irq, lpfc_intr_handler, IRQF_SHARED, |
1959 | LPFC_DRIVER_NAME, phba); | 1960 | LPFC_DRIVER_NAME, phba); |
1960 | if (error) { | 1961 | if (retval) { |
1961 | lpfc_printf_log(phba, KERN_ERR, LOG_INIT, | 1962 | lpfc_printf_log(phba, KERN_ERR, LOG_INIT, |
1962 | "0451 Enable interrupt handler failed\n"); | 1963 | "0451 Enable interrupt handler failed\n"); |
1964 | error = retval; | ||
1963 | goto out_disable_msi; | 1965 | goto out_disable_msi; |
1964 | } | 1966 | } |
1965 | 1967 | ||
@@ -1969,11 +1971,15 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
1969 | phba->HSregaddr = phba->ctrl_regs_memmap_p + HS_REG_OFFSET; | 1971 | phba->HSregaddr = phba->ctrl_regs_memmap_p + HS_REG_OFFSET; |
1970 | phba->HCregaddr = phba->ctrl_regs_memmap_p + HC_REG_OFFSET; | 1972 | phba->HCregaddr = phba->ctrl_regs_memmap_p + HC_REG_OFFSET; |
1971 | 1973 | ||
1972 | if (lpfc_alloc_sysfs_attr(vport)) | 1974 | if (lpfc_alloc_sysfs_attr(vport)) { |
1975 | error = -ENOMEM; | ||
1973 | goto out_free_irq; | 1976 | goto out_free_irq; |
1977 | } | ||
1974 | 1978 | ||
1975 | if (lpfc_sli_hba_setup(phba)) | 1979 | if (lpfc_sli_hba_setup(phba)) { |
1980 | error = -ENODEV; | ||
1976 | goto out_remove_device; | 1981 | goto out_remove_device; |
1982 | } | ||
1977 | 1983 | ||
1978 | /* | 1984 | /* |
1979 | * hba setup may have changed the hba_queue_depth so we need to adjust | 1985 | * hba setup may have changed the hba_queue_depth so we need to adjust |
@@ -2303,14 +2309,12 @@ lpfc_init(void) | |||
2303 | if (lpfc_transport_template == NULL) | 2309 | if (lpfc_transport_template == NULL) |
2304 | return -ENOMEM; | 2310 | return -ENOMEM; |
2305 | if (lpfc_enable_npiv) { | 2311 | if (lpfc_enable_npiv) { |
2306 | lpfc_transport_functions.vport_create = NULL; | ||
2307 | lpfc_transport_functions.vport_delete = NULL; | ||
2308 | lpfc_transport_functions.issue_fc_host_lip = NULL; | ||
2309 | lpfc_transport_functions.vport_disable = lpfc_vport_disable; | ||
2310 | lpfc_vport_transport_template = | 2312 | lpfc_vport_transport_template = |
2311 | fc_attach_transport(&lpfc_transport_functions); | 2313 | fc_attach_transport(&lpfc_vport_transport_functions); |
2312 | if (lpfc_vport_transport_template == NULL) | 2314 | if (lpfc_vport_transport_template == NULL) { |
2315 | fc_release_transport(lpfc_transport_template); | ||
2313 | return -ENOMEM; | 2316 | return -ENOMEM; |
2317 | } | ||
2314 | } | 2318 | } |
2315 | error = pci_register_driver(&lpfc_driver); | 2319 | error = pci_register_driver(&lpfc_driver); |
2316 | if (error) { | 2320 | if (error) { |