aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJayamohan Kallickal <jayamohan.kallickal@emulex.com>2014-05-05 21:41:25 -0400
committerChristoph Hellwig <hch@lst.de>2014-05-28 12:13:14 -0400
commit0598b8afd65d6b0893d217f7cf77ea315cdfcb5b (patch)
tree8d70a64d7c9288e6636f89c9d99fcb5087e17334
parentdaa8dc081cd801635b2757aa6f257a79d9ac6d2c (diff)
be2iscsi: Fix exposing Host in sysfs after adapter initialization is complete
Before probe for function was completed, iSCSI Daemon had initiated login to target while OS was coming up. The targets which had node.startup=automatic, login process was initiated.Since function specific initialization was still in progress this lead to kernel panic. Fixed the issue by moving iscsi_host_add() call after adapter initialization is done. Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--drivers/scsi/be2iscsi/be_main.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 0d822297aa80..a73af296b29d 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -599,15 +599,7 @@ static struct beiscsi_hba *beiscsi_hba_alloc(struct pci_dev *pcidev)
599 pci_set_drvdata(pcidev, phba); 599 pci_set_drvdata(pcidev, phba);
600 phba->interface_handle = 0xFFFFFFFF; 600 phba->interface_handle = 0xFFFFFFFF;
601 601
602 if (iscsi_host_add(shost, &phba->pcidev->dev))
603 goto free_devices;
604
605 return phba; 602 return phba;
606
607free_devices:
608 pci_dev_put(phba->pcidev);
609 iscsi_host_free(phba->shost);
610 return NULL;
611} 603}
612 604
613static void beiscsi_unmap_pci_function(struct beiscsi_hba *phba) 605static void beiscsi_unmap_pci_function(struct beiscsi_hba *phba)
@@ -5621,6 +5613,9 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
5621 } 5613 }
5622 hwi_enable_intr(phba); 5614 hwi_enable_intr(phba);
5623 5615
5616 if (iscsi_host_add(phba->shost, &phba->pcidev->dev))
5617 goto free_blkenbld;
5618
5624 if (beiscsi_setup_boot_info(phba)) 5619 if (beiscsi_setup_boot_info(phba))
5625 /* 5620 /*
5626 * log error but continue, because we may not be using 5621 * log error but continue, because we may not be using