Skip to content

Commit be2a266

Browse files
Narsimhulu Musinimartinkpetersen
authored andcommitted
snic: add scsi host after determining max IOs.
scsi host is added after negotiating the max number of IOs with Firmware. Signed-off-by: Narsimhulu Musini <[email protected]> Signed-off-by: Sesidhar Baddela <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 0da8519 commit be2a266

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

drivers/scsi/snic/snic_main.c

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -631,19 +631,6 @@ snic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
631631
goto err_free_tmreq_pool;
632632
}
633633

634-
/*
635-
* Initialization done with PCI system, hardware, firmware.
636-
* Add shost to SCSI
637-
*/
638-
ret = snic_add_host(shost, pdev);
639-
if (ret) {
640-
SNIC_HOST_ERR(shost,
641-
"Adding scsi host Failed ... exiting. %d\n",
642-
ret);
643-
644-
goto err_notify_unset;
645-
}
646-
647634
spin_lock_irqsave(&snic_glob->snic_list_lock, flags);
648635
list_add_tail(&snic->list, &snic_glob->snic_list);
649636
spin_unlock_irqrestore(&snic_glob->snic_list_lock, flags);
@@ -676,8 +663,6 @@ snic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
676663
for (i = 0; i < snic->intr_count; i++)
677664
svnic_intr_unmask(&snic->intr[i]);
678665

679-
snic_set_state(snic, SNIC_ONLINE);
680-
681666
/* Get snic params */
682667
ret = snic_get_conf(snic);
683668
if (ret) {
@@ -688,6 +673,21 @@ snic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
688673
goto err_get_conf;
689674
}
690675

676+
/*
677+
* Initialization done with PCI system, hardware, firmware.
678+
* Add shost to SCSI
679+
*/
680+
ret = snic_add_host(shost, pdev);
681+
if (ret) {
682+
SNIC_HOST_ERR(shost,
683+
"Adding scsi host Failed ... exiting. %d\n",
684+
ret);
685+
686+
goto err_get_conf;
687+
}
688+
689+
snic_set_state(snic, SNIC_ONLINE);
690+
691691
ret = snic_disc_start(snic);
692692
if (ret) {
693693
SNIC_HOST_ERR(shost, "snic_probe:Discovery Failed w err = %d\n",
@@ -712,6 +712,8 @@ snic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
712712
svnic_dev_disable(snic->vdev);
713713

714714
err_vdev_enable:
715+
svnic_dev_notify_unset(snic->vdev);
716+
715717
for (i = 0; i < snic->wq_count; i++) {
716718
int rc = 0;
717719

@@ -725,9 +727,6 @@ snic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
725727
}
726728
snic_del_host(snic->shost);
727729

728-
err_notify_unset:
729-
svnic_dev_notify_unset(snic->vdev);
730-
731730
err_free_tmreq_pool:
732731
mempool_destroy(snic->req_pool[SNIC_REQ_TM_CACHE]);
733732

0 commit comments

Comments
 (0)