Commit 0598b8af authored by Jayamohan Kallickal's avatar Jayamohan Kallickal Committed by Christoph Hellwig

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: default avatarJohn Soni Jose <sony.john-n@emulex.com>
Signed-off-by: default avatarJayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent daa8dc08
...@@ -599,15 +599,7 @@ static struct beiscsi_hba *beiscsi_hba_alloc(struct pci_dev *pcidev) ...@@ -599,15 +599,7 @@ static struct beiscsi_hba *beiscsi_hba_alloc(struct pci_dev *pcidev)
pci_set_drvdata(pcidev, phba); pci_set_drvdata(pcidev, phba);
phba->interface_handle = 0xFFFFFFFF; phba->interface_handle = 0xFFFFFFFF;
if (iscsi_host_add(shost, &phba->pcidev->dev))
goto free_devices;
return phba; return phba;
free_devices:
pci_dev_put(phba->pcidev);
iscsi_host_free(phba->shost);
return NULL;
} }
static void beiscsi_unmap_pci_function(struct beiscsi_hba *phba) static void beiscsi_unmap_pci_function(struct beiscsi_hba *phba)
...@@ -5621,6 +5613,9 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev, ...@@ -5621,6 +5613,9 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
} }
hwi_enable_intr(phba); hwi_enable_intr(phba);
if (iscsi_host_add(phba->shost, &phba->pcidev->dev))
goto free_blkenbld;
if (beiscsi_setup_boot_info(phba)) if (beiscsi_setup_boot_info(phba))
/* /*
* log error but continue, because we may not be using * log error but continue, because we may not be using
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment