aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfad.c
diff options
context:
space:
mode:
authorKrishna Gudipati <kgudipat@brocade.com>2011-04-14 19:50:35 -0400
committerJames Bottomley <James.Bottomley@suse.de>2011-05-01 11:55:56 -0400
commit7c38c05b3ef1a8a9f7e0416072a8ea2730841c91 (patch)
tree673a2620a7e933b8d177734f7339d7ec87394e4d /drivers/scsi/bfa/bfad.c
parent61338a0b3493fddfca2980ece4423839748fcbab (diff)
[SCSI] bfa: Move debugfs initialization before bfa init.
Move the initialization of debugfs before bfa init, to enable us to collect driver/firmware traces if init fails. Also add a printk to display message on bfa_init failure. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa/bfad.c')
-rw-r--r--drivers/scsi/bfa/bfad.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index d9360bf18d33..59b5e9b61d71 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -232,6 +232,9 @@ bfad_sm_created(struct bfad_s *bfad, enum bfad_sm_event event)
232 if ((bfad->bfad_flags & BFAD_HAL_INIT_DONE)) { 232 if ((bfad->bfad_flags & BFAD_HAL_INIT_DONE)) {
233 bfa_sm_send_event(bfad, BFAD_E_INIT_SUCCESS); 233 bfa_sm_send_event(bfad, BFAD_E_INIT_SUCCESS);
234 } else { 234 } else {
235 printk(KERN_WARNING
236 "bfa %s: bfa init failed\n",
237 bfad->pci_name);
235 bfad->bfad_flags |= BFAD_HAL_INIT_FAIL; 238 bfad->bfad_flags |= BFAD_HAL_INIT_FAIL;
236 bfa_sm_send_event(bfad, BFAD_E_INIT_FAILED); 239 bfa_sm_send_event(bfad, BFAD_E_INIT_FAILED);
237 } 240 }
@@ -1001,10 +1004,6 @@ bfad_cfg_pport(struct bfad_s *bfad, enum bfa_lport_role role)
1001 bfad->pport.roles |= BFA_LPORT_ROLE_FCP_IM; 1004 bfad->pport.roles |= BFA_LPORT_ROLE_FCP_IM;
1002 } 1005 }
1003 1006
1004 /* Setup the debugfs node for this scsi_host */
1005 if (bfa_debugfs_enable)
1006 bfad_debugfs_init(&bfad->pport);
1007
1008 bfad->bfad_flags |= BFAD_CFG_PPORT_DONE; 1007 bfad->bfad_flags |= BFAD_CFG_PPORT_DONE;
1009 1008
1010out: 1009out:
@@ -1014,10 +1013,6 @@ out:
1014void 1013void
1015bfad_uncfg_pport(struct bfad_s *bfad) 1014bfad_uncfg_pport(struct bfad_s *bfad)
1016{ 1015{
1017 /* Remove the debugfs node for this scsi_host */
1018 kfree(bfad->regdata);
1019 bfad_debugfs_exit(&bfad->pport);
1020
1021 if ((supported_fc4s & BFA_LPORT_ROLE_FCP_IM) && 1016 if ((supported_fc4s & BFA_LPORT_ROLE_FCP_IM) &&
1022 (bfad->pport.roles & BFA_LPORT_ROLE_FCP_IM)) { 1017 (bfad->pport.roles & BFA_LPORT_ROLE_FCP_IM)) {
1023 bfad_im_scsi_host_free(bfad, bfad->pport.im_port); 1018 bfad_im_scsi_host_free(bfad, bfad->pport.im_port);
@@ -1399,6 +1394,10 @@ bfad_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid)
1399 bfad->pport.bfad = bfad; 1394 bfad->pport.bfad = bfad;
1400 INIT_LIST_HEAD(&bfad->pbc_vport_list); 1395 INIT_LIST_HEAD(&bfad->pbc_vport_list);
1401 1396
1397 /* Setup the debugfs node for this bfad */
1398 if (bfa_debugfs_enable)
1399 bfad_debugfs_init(&bfad->pport);
1400
1402 retval = bfad_drv_init(bfad); 1401 retval = bfad_drv_init(bfad);
1403 if (retval != BFA_STATUS_OK) 1402 if (retval != BFA_STATUS_OK)
1404 goto out_drv_init_failure; 1403 goto out_drv_init_failure;
@@ -1414,6 +1413,9 @@ out_bfad_sm_failure:
1414 bfa_detach(&bfad->bfa); 1413 bfa_detach(&bfad->bfa);
1415 bfad_hal_mem_release(bfad); 1414 bfad_hal_mem_release(bfad);
1416out_drv_init_failure: 1415out_drv_init_failure:
1416 /* Remove the debugfs node for this bfad */
1417 kfree(bfad->regdata);
1418 bfad_debugfs_exit(&bfad->pport);
1417 mutex_lock(&bfad_mutex); 1419 mutex_lock(&bfad_mutex);
1418 bfad_inst--; 1420 bfad_inst--;
1419 list_del(&bfad->list_entry); 1421 list_del(&bfad->list_entry);
@@ -1455,6 +1457,10 @@ bfad_pci_remove(struct pci_dev *pdev)
1455 spin_unlock_irqrestore(&bfad->bfad_lock, flags); 1457 spin_unlock_irqrestore(&bfad->bfad_lock, flags);
1456 bfad_hal_mem_release(bfad); 1458 bfad_hal_mem_release(bfad);
1457 1459
1460 /* Remove the debugfs node for this bfad */
1461 kfree(bfad->regdata);
1462 bfad_debugfs_exit(&bfad->pport);
1463
1458 /* Cleaning the BFAD instance */ 1464 /* Cleaning the BFAD instance */
1459 mutex_lock(&bfad_mutex); 1465 mutex_lock(&bfad_mutex);
1460 bfad_inst--; 1466 bfad_inst--;