aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_os.c
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2006-11-22 11:22:19 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-11-22 17:43:16 -0500
commitd19044c32baadeb80e135027124a9e845c6f057c (patch)
treee525d1b048d3ab68b02b1f90eeb6ce3b9925588d /drivers/scsi/qla2xxx/qla_os.c
parent1aa8fab2acf1cb8b341131b726773fcff0abc707 (diff)
[SCSI] qla2xxx: defer topology discovery to DPC thread during initialization.
Modify intialization semantics: - perform basic hardware configuration only (as usual) - allocate resources - load and execute firmware - defer link (transport) negotiations to the DPC thread - again the code in qla2x00_initialize_adapter() to stall probe() completion was needed for legacy-style scanning. - DPC thread stalls until probe() complete. - before probe() completes, set DPC flags to perform loop-resync logic (similar to what's done during cable-insertion/removal). Benefits: user does not have to wait 20+ seconds in case the FC cable is unplugged during driver load, code consolidation (removal of redundant link negotiation logic during initialize_adaoter()), and finilly, the driver no longer needs to defer the fc_remote_port_add() calls to hold off lun-scanning prior to returning from the probe() function. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 3eb4cd2cbc78..1cc8febcbadb 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1377,10 +1377,8 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
1377 struct Scsi_Host *host; 1377 struct Scsi_Host *host;
1378 scsi_qla_host_t *ha; 1378 scsi_qla_host_t *ha;
1379 unsigned long flags = 0; 1379 unsigned long flags = 0;
1380 unsigned long wait_switch = 0;
1381 char pci_info[20]; 1380 char pci_info[20];
1382 char fw_str[30]; 1381 char fw_str[30];
1383 fc_port_t *fcport;
1384 struct scsi_host_template *sht; 1382 struct scsi_host_template *sht;
1385 1383
1386 if (pci_enable_device(pdev)) 1384 if (pci_enable_device(pdev))
@@ -1631,24 +1629,15 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
1631 1629
1632 ha->isp_ops.enable_intrs(ha); 1630 ha->isp_ops.enable_intrs(ha);
1633 1631
1634 /* v2.19.5b6 */
1635 /*
1636 * Wait around max loop_reset_delay secs for the devices to come
1637 * on-line. We don't want Linux scanning before we are ready.
1638 *
1639 */
1640 for (wait_switch = jiffies + (ha->loop_reset_delay * HZ);
1641 time_before(jiffies,wait_switch) &&
1642 !(ha->device_flags & (DFLG_NO_CABLE | DFLG_FABRIC_DEVICES))
1643 && (ha->device_flags & SWITCH_FOUND) ;) {
1644
1645 qla2x00_check_fabric_devices(ha);
1646
1647 msleep(10);
1648 }
1649
1650 pci_set_drvdata(pdev, ha); 1632 pci_set_drvdata(pdev, ha);
1633
1634 /* Start link scan. */
1635 set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags);
1636 set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags);
1637 set_bit(RSCN_UPDATE, &ha->dpc_flags);
1651 ha->flags.init_done = 1; 1638 ha->flags.init_done = 1;
1639 ha->flags.online = 1;
1640
1652 num_hosts++; 1641 num_hosts++;
1653 1642
1654 ret = scsi_add_host(host, &pdev->dev); 1643 ret = scsi_add_host(host, &pdev->dev);
@@ -1669,10 +1658,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
1669 ha->flags.enable_64bit_addressing ? '+': '-', ha->host_no, 1658 ha->flags.enable_64bit_addressing ? '+': '-', ha->host_no,
1670 ha->isp_ops.fw_version_str(ha, fw_str)); 1659 ha->isp_ops.fw_version_str(ha, fw_str));
1671 1660
1672 /* Go with fc_rport registration. */
1673 list_for_each_entry(fcport, &ha->fcports, list)
1674 qla2x00_reg_remote_port(ha, fcport);
1675
1676 return 0; 1661 return 0;
1677 1662
1678probe_failed: 1663probe_failed: