aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2007-08-02 11:10:09 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-08-01 13:21:26 -0400
commite8b62011d88d6fdba585fb2bb77c9274a63cadab (patch)
tree838c3abee73ec571456ae3ae83e51ecbed8e4a64 /drivers/scsi/lpfc/lpfc_init.c
parent3de2a653a127c468284c48e233719dc39769e354 (diff)
[SCSI] lpfc 8.2.2 : Rework the lpfc_printf_log() macro
Rework the lpfc_printf_log() macro so that logging is enabled on a per-vport basis. Used to be on a physical-port basis, thus logging with large numbers of vports became a mess. Required redefinition of the macro, and an update of every use. Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c74
1 files changed, 29 insertions, 45 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 83855a5a1826..7e5ea0774e58 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -107,10 +107,9 @@ lpfc_config_port_prep(struct lpfc_hba *phba)
107 107
108 if (rc != MBX_SUCCESS) { 108 if (rc != MBX_SUCCESS) {
109 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, 109 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX,
110 "%d:0324 Config Port initialization " 110 "0324 Config Port initialization "
111 "error, mbxCmd x%x READ_NVPARM, " 111 "error, mbxCmd x%x READ_NVPARM, "
112 "mbxStatus x%x\n", 112 "mbxStatus x%x\n",
113 phba->brd_no,
114 mb->mbxCommand, mb->mbxStatus); 113 mb->mbxCommand, mb->mbxStatus);
115 mempool_free(pmb, phba->mbox_mem_pool); 114 mempool_free(pmb, phba->mbox_mem_pool);
116 return -ERESTART; 115 return -ERESTART;
@@ -128,9 +127,8 @@ lpfc_config_port_prep(struct lpfc_hba *phba)
128 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL); 127 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL);
129 if (rc != MBX_SUCCESS) { 128 if (rc != MBX_SUCCESS) {
130 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 129 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
131 "%d:0439 Adapter failed to init, mbxCmd x%x " 130 "0439 Adapter failed to init, mbxCmd x%x "
132 "READ_REV, mbxStatus x%x\n", 131 "READ_REV, mbxStatus x%x\n",
133 phba->brd_no,
134 mb->mbxCommand, mb->mbxStatus); 132 mb->mbxCommand, mb->mbxStatus);
135 mempool_free( pmb, phba->mbox_mem_pool); 133 mempool_free( pmb, phba->mbox_mem_pool);
136 return -ERESTART; 134 return -ERESTART;
@@ -144,9 +142,8 @@ lpfc_config_port_prep(struct lpfc_hba *phba)
144 if (mb->un.varRdRev.rr == 0) { 142 if (mb->un.varRdRev.rr == 0) {
145 vp->rev.rBit = 0; 143 vp->rev.rBit = 0;
146 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 144 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
147 "%d:0440 Adapter failed to init, READ_REV has " 145 "0440 Adapter failed to init, READ_REV has "
148 "missing revision information.\n", 146 "missing revision information.\n");
149 phba->brd_no);
150 mempool_free(pmb, phba->mbox_mem_pool); 147 mempool_free(pmb, phba->mbox_mem_pool);
151 return -ERESTART; 148 return -ERESTART;
152 } 149 }
@@ -197,9 +194,8 @@ lpfc_config_port_prep(struct lpfc_hba *phba)
197 194
198 if (rc != MBX_SUCCESS) { 195 if (rc != MBX_SUCCESS) {
199 lpfc_printf_log(phba, KERN_INFO, LOG_INIT, 196 lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
200 "%d:0441 VPD not present on adapter, " 197 "0441 VPD not present on adapter, "
201 "mbxCmd x%x DUMP VPD, mbxStatus x%x\n", 198 "mbxCmd x%x DUMP VPD, mbxStatus x%x\n",
202 phba->brd_no,
203 mb->mbxCommand, mb->mbxStatus); 199 mb->mbxCommand, mb->mbxStatus);
204 mb->un.varDmp.word_cnt = 0; 200 mb->un.varDmp.word_cnt = 0;
205 } 201 }
@@ -253,9 +249,8 @@ lpfc_config_port_post(struct lpfc_hba *phba)
253 pmb->vport = vport; 249 pmb->vport = vport;
254 if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) { 250 if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) {
255 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 251 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
256 "%d:0448 Adapter failed init, mbxCmd x%x " 252 "0448 Adapter failed init, mbxCmd x%x "
257 "READ_SPARM mbxStatus x%x\n", 253 "READ_SPARM mbxStatus x%x\n",
258 phba->brd_no,
259 mb->mbxCommand, mb->mbxStatus); 254 mb->mbxCommand, mb->mbxStatus);
260 phba->link_state = LPFC_HBA_ERROR; 255 phba->link_state = LPFC_HBA_ERROR;
261 mp = (struct lpfc_dmabuf *) pmb->context1; 256 mp = (struct lpfc_dmabuf *) pmb->context1;
@@ -312,9 +307,8 @@ lpfc_config_port_post(struct lpfc_hba *phba)
312 pmb->vport = vport; 307 pmb->vport = vport;
313 if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) { 308 if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) {
314 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 309 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
315 "%d:0453 Adapter failed to init, mbxCmd x%x " 310 "0453 Adapter failed to init, mbxCmd x%x "
316 "READ_CONFIG, mbxStatus x%x\n", 311 "READ_CONFIG, mbxStatus x%x\n",
317 phba->brd_no,
318 mb->mbxCommand, mb->mbxStatus); 312 mb->mbxCommand, mb->mbxStatus);
319 phba->link_state = LPFC_HBA_ERROR; 313 phba->link_state = LPFC_HBA_ERROR;
320 mempool_free( pmb, phba->mbox_mem_pool); 314 mempool_free( pmb, phba->mbox_mem_pool);
@@ -344,9 +338,8 @@ lpfc_config_port_post(struct lpfc_hba *phba)
344 && !(phba->lmt & LMT_10Gb))) { 338 && !(phba->lmt & LMT_10Gb))) {
345 /* Reset link speed to auto */ 339 /* Reset link speed to auto */
346 lpfc_printf_log(phba, KERN_WARNING, LOG_LINK_EVENT, 340 lpfc_printf_log(phba, KERN_WARNING, LOG_LINK_EVENT,
347 "%d:1302 Invalid speed for this board: " 341 "1302 Invalid speed for this board: "
348 "Reset link speed to auto: x%x\n", 342 "Reset link speed to auto: x%x\n",
349 phba->brd_no,
350 phba->cfg_link_speed); 343 phba->cfg_link_speed);
351 phba->cfg_link_speed = LINK_SPEED_AUTO; 344 phba->cfg_link_speed = LINK_SPEED_AUTO;
352 } 345 }
@@ -402,9 +395,8 @@ lpfc_config_port_post(struct lpfc_hba *phba)
402 lpfc_set_loopback_flag(phba); 395 lpfc_set_loopback_flag(phba);
403 if (rc != MBX_SUCCESS) { 396 if (rc != MBX_SUCCESS) {
404 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 397 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
405 "%d:0454 Adapter failed to init, mbxCmd x%x " 398 "0454 Adapter failed to init, mbxCmd x%x "
406 "INIT_LINK, mbxStatus x%x\n", 399 "INIT_LINK, mbxStatus x%x\n",
407 phba->brd_no,
408 mb->mbxCommand, mb->mbxStatus); 400 mb->mbxCommand, mb->mbxStatus);
409 401
410 /* Clear all interrupt enable conditions */ 402 /* Clear all interrupt enable conditions */
@@ -588,8 +580,8 @@ lpfc_hb_timeout_handler(struct lpfc_hba *phba)
588 * need to take the HBA offline. 580 * need to take the HBA offline.
589 */ 581 */
590 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 582 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
591 "%d:0459 Adapter heartbeat failure, taking " 583 "0459 Adapter heartbeat failure, taking "
592 "this port offline.\n", phba->brd_no); 584 "this port offline.\n");
593 585
594 spin_lock_irq(&phba->hbalock); 586 spin_lock_irq(&phba->hbalock);
595 psli->sli_flag &= ~LPFC_SLI2_ACTIVE; 587 psli->sli_flag &= ~LPFC_SLI2_ACTIVE;
@@ -631,9 +623,9 @@ lpfc_handle_eratt(struct lpfc_hba *phba)
631 phba->work_hs & HS_FFER5) { 623 phba->work_hs & HS_FFER5) {
632 /* Re-establishing Link */ 624 /* Re-establishing Link */
633 lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT, 625 lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT,
634 "%d:1301 Re-establishing Link " 626 "1301 Re-establishing Link "
635 "Data: x%x x%x x%x\n", 627 "Data: x%x x%x x%x\n",
636 phba->brd_no, phba->work_hs, 628 phba->work_hs,
637 phba->work_status[0], phba->work_status[1]); 629 phba->work_status[0], phba->work_status[1]);
638 vports = lpfc_create_vport_work_array(phba); 630 vports = lpfc_create_vport_work_array(phba);
639 if (vports != NULL) 631 if (vports != NULL)
@@ -679,9 +671,9 @@ lpfc_handle_eratt(struct lpfc_hba *phba)
679 * twice. This is the adapter hardware error path. 671 * twice. This is the adapter hardware error path.
680 */ 672 */
681 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 673 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
682 "%d:0457 Adapter Hardware Error " 674 "0457 Adapter Hardware Error "
683 "Data: x%x x%x x%x\n", 675 "Data: x%x x%x x%x\n",
684 phba->brd_no, phba->work_hs, 676 phba->work_hs,
685 phba->work_status[0], phba->work_status[1]); 677 phba->work_status[0], phba->work_status[1]);
686 678
687 event_data = FC_REG_DUMP_EVENT; 679 event_data = FC_REG_DUMP_EVENT;
@@ -777,8 +769,7 @@ lpfc_handle_latt_err_exit:
777 /* The other case is an error from issue_mbox */ 769 /* The other case is an error from issue_mbox */
778 if (rc == -ENOMEM) 770 if (rc == -ENOMEM)
779 lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX, 771 lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX,
780 "%d:0300 READ_LA: no buffers\n", 772 "0300 READ_LA: no buffers\n");
781 phba->brd_no);
782 773
783 return; 774 return;
784} 775}
@@ -803,8 +794,7 @@ lpfc_parse_vpd(struct lpfc_hba *phba, uint8_t *vpd, int len)
803 794
804 /* Vital Product */ 795 /* Vital Product */
805 lpfc_printf_log(phba, KERN_INFO, LOG_INIT, 796 lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
806 "%d:0455 Vital Product Data: x%x x%x x%x x%x\n", 797 "0455 Vital Product Data: x%x x%x x%x x%x\n",
807 phba->brd_no,
808 (uint32_t) vpd[0], (uint32_t) vpd[1], (uint32_t) vpd[2], 798 (uint32_t) vpd[0], (uint32_t) vpd[1], (uint32_t) vpd[2],
809 (uint32_t) vpd[3]); 799 (uint32_t) vpd[3]);
810 while (!finished && (index < (len - 4))) { 800 while (!finished && (index < (len - 4))) {
@@ -1323,10 +1313,9 @@ lpfc_establish_link_tmo(unsigned long ptr)
1323 1313
1324 /* Re-establishing Link, timer expired */ 1314 /* Re-establishing Link, timer expired */
1325 lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, 1315 lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT,
1326 "%d:1300 Re-establishing Link, timer expired " 1316 "1300 Re-establishing Link, timer expired "
1327 "Data: x%x x%x\n", 1317 "Data: x%x x%x\n",
1328 phba->brd_no, phba->pport->fc_flag, 1318 phba->pport->fc_flag, phba->pport->port_state);
1329 phba->pport->port_state);
1330 vports = lpfc_create_vport_work_array(phba); 1319 vports = lpfc_create_vport_work_array(phba);
1331 if (vports != NULL) 1320 if (vports != NULL)
1332 for(i = 0; i < LPFC_MAX_VPORTS && vports[i] != NULL; i++) { 1321 for(i = 0; i < LPFC_MAX_VPORTS && vports[i] != NULL; i++) {
@@ -1382,8 +1371,7 @@ lpfc_online(struct lpfc_hba *phba)
1382 return 0; 1371 return 0;
1383 1372
1384 lpfc_printf_log(phba, KERN_WARNING, LOG_INIT, 1373 lpfc_printf_log(phba, KERN_WARNING, LOG_INIT,
1385 "%d:0458 Bring Adapter online\n", 1374 "0458 Bring Adapter online\n");
1386 phba->brd_no);
1387 1375
1388 lpfc_block_mgmt_io(phba); 1376 lpfc_block_mgmt_io(phba);
1389 1377
@@ -1468,8 +1456,7 @@ lpfc_offline(struct lpfc_hba *phba)
1468 /* stop all timers associated with this hba */ 1456 /* stop all timers associated with this hba */
1469 lpfc_stop_phba_timers(phba); 1457 lpfc_stop_phba_timers(phba);
1470 lpfc_printf_log(phba, KERN_WARNING, LOG_INIT, 1458 lpfc_printf_log(phba, KERN_WARNING, LOG_INIT,
1471 "%d:0460 Bring Adapter offline\n", 1459 "0460 Bring Adapter offline\n");
1472 phba->brd_no);
1473 /* Bring down the SLI Layer and cleanup. The HBA is offline 1460 /* Bring down the SLI Layer and cleanup. The HBA is offline
1474 now. */ 1461 now. */
1475 lpfc_sli_hba_down(phba); 1462 lpfc_sli_hba_down(phba);
@@ -1648,17 +1635,15 @@ int lpfc_scan_finished(struct Scsi_Host *shost, unsigned long time)
1648 } 1635 }
1649 if (time >= 30 * HZ) { 1636 if (time >= 30 * HZ) {
1650 lpfc_printf_log(phba, KERN_INFO, LOG_INIT, 1637 lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
1651 "%d:0461 Scanning longer than 30 " 1638 "0461 Scanning longer than 30 "
1652 "seconds. Continuing initialization\n", 1639 "seconds. Continuing initialization\n");
1653 phba->brd_no);
1654 stat = 1; 1640 stat = 1;
1655 goto finished; 1641 goto finished;
1656 } 1642 }
1657 if (time >= 15 * HZ && phba->link_state <= LPFC_LINK_DOWN) { 1643 if (time >= 15 * HZ && phba->link_state <= LPFC_LINK_DOWN) {
1658 lpfc_printf_log(phba, KERN_INFO, LOG_INIT, 1644 lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
1659 "%d:0465 Link down longer than 15 " 1645 "0465 Link down longer than 15 "
1660 "seconds. Continuing initialization\n", 1646 "seconds. Continuing initialization\n");
1661 phba->brd_no);
1662 stat = 1; 1647 stat = 1;
1663 goto finished; 1648 goto finished;
1664 } 1649 }
@@ -1910,17 +1895,16 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
1910 if (phba->cfg_use_msi) { 1895 if (phba->cfg_use_msi) {
1911 error = pci_enable_msi(phba->pcidev); 1896 error = pci_enable_msi(phba->pcidev);
1912 if (error) 1897 if (error)
1913 lpfc_printf_log(phba, KERN_INFO, LOG_INIT, "%d:0452 " 1898 lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
1914 "Enable MSI failed, continuing with " 1899 "0452 Enable MSI failed, continuing "
1915 "IRQ\n", phba->brd_no); 1900 "with IRQ\n");
1916 } 1901 }
1917 1902
1918 error = request_irq(phba->pcidev->irq, lpfc_intr_handler, IRQF_SHARED, 1903 error = request_irq(phba->pcidev->irq, lpfc_intr_handler, IRQF_SHARED,
1919 LPFC_DRIVER_NAME, phba); 1904 LPFC_DRIVER_NAME, phba);
1920 if (error) { 1905 if (error) {
1921 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 1906 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
1922 "%d:0451 Enable interrupt handler failed\n", 1907 "0451 Enable interrupt handler failed\n");
1923 phba->brd_no);
1924 goto out_disable_msi; 1908 goto out_disable_msi;
1925 } 1909 }
1926 1910