/[linux-patches]/genpatches-2.6/trunk/2.6.12/2300_qla2xxx-initialization.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.12/2300_qla2xxx-initialization.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 33 - (show annotations) (download)
Sat Jun 18 16:26:33 2005 UTC (13 years, 5 months ago) by dsd
File size: 4219 byte(s)
Add qla2xxx initialization fix
1 Author: Andrew Vasquez <andrew.vasquez@qlogic.com>
2 Date: Fri, 10 Jun 2005 00:21:28 +0000 (-0700)
3 Source: http://www.kernel.org/git/gitweb.cgi?p=linux/kernel/git/jejb/scsi-for-linus-2.6.git;a=commitdiff;h=a1541d5af66d02426655b1498f814c52347dd7d3
4
5 [SCSI] qla2xxx: Pull-down scsi-host-addition to follow board initialization.
6
7 Return to previous held-logic of calling scsi_add_host() only
8 after the board has been completely initialized. Also return
9 pci_*() error-codes during probe failure paths.
10
11 This also corrects an issue where only lun 0 is being scanned for
12 a given port.
13
14 Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
15 Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
16
17 --- a/drivers/scsi/qla2xxx/qla_os.c
18 +++ b/drivers/scsi/qla2xxx/qla_os.c
19 @@ -1150,7 +1150,7 @@ iospace_error_exit:
20 */
21 int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
22 {
23 - int ret;
24 + int ret = -ENODEV;
25 device_reg_t __iomem *reg;
26 struct Scsi_Host *host;
27 scsi_qla_host_t *ha;
28 @@ -1161,7 +1161,7 @@ int qla2x00_probe_one(struct pci_dev *pd
29 fc_port_t *fcport;
30
31 if (pci_enable_device(pdev))
32 - return -1;
33 + goto probe_out;
34
35 host = scsi_host_alloc(&qla2x00_driver_template,
36 sizeof(scsi_qla_host_t));
37 @@ -1183,9 +1183,8 @@ int qla2x00_probe_one(struct pci_dev *pd
38
39 /* Configure PCI I/O space */
40 ret = qla2x00_iospace_config(ha);
41 - if (ret != 0) {
42 - goto probe_alloc_failed;
43 - }
44 + if (ret)
45 + goto probe_failed;
46
47 /* Sanitize the information from PCI BIOS. */
48 host->irq = pdev->irq;
49 @@ -1258,23 +1257,10 @@ int qla2x00_probe_one(struct pci_dev *pd
50 qla_printk(KERN_WARNING, ha,
51 "[ERROR] Failed to allocate memory for adapter\n");
52
53 - goto probe_alloc_failed;
54 + ret = -ENOMEM;
55 + goto probe_failed;
56 }
57
58 - pci_set_drvdata(pdev, ha);
59 - host->this_id = 255;
60 - host->cmd_per_lun = 3;
61 - host->unique_id = ha->instance;
62 - host->max_cmd_len = MAX_CMDSZ;
63 - host->max_channel = ha->ports - 1;
64 - host->max_id = ha->max_targets;
65 - host->max_lun = ha->max_luns;
66 - host->transportt = qla2xxx_transport_template;
67 - if (scsi_add_host(host, &pdev->dev))
68 - goto probe_alloc_failed;
69 -
70 - qla2x00_alloc_sysfs_attr(ha);
71 -
72 if (qla2x00_initialize_adapter(ha) &&
73 !(ha->device_flags & DFLG_NO_CABLE)) {
74
75 @@ -1285,11 +1271,10 @@ int qla2x00_probe_one(struct pci_dev *pd
76 "Adapter flags %x.\n",
77 ha->host_no, ha->device_flags));
78
79 + ret = -ENODEV;
80 goto probe_failed;
81 }
82
83 - qla2x00_init_host_attr(ha);
84 -
85 /*
86 * Startup the kernel thread for this host adapter
87 */
88 @@ -1299,17 +1284,26 @@ int qla2x00_probe_one(struct pci_dev *pd
89 qla_printk(KERN_WARNING, ha,
90 "Unable to start DPC thread!\n");
91
92 + ret = -ENODEV;
93 goto probe_failed;
94 }
95 wait_for_completion(&ha->dpc_inited);
96
97 + host->this_id = 255;
98 + host->cmd_per_lun = 3;
99 + host->unique_id = ha->instance;
100 + host->max_cmd_len = MAX_CMDSZ;
101 + host->max_channel = ha->ports - 1;
102 + host->max_lun = MAX_LUNS;
103 + host->transportt = qla2xxx_transport_template;
104 +
105 if (IS_QLA2100(ha) || IS_QLA2200(ha))
106 ret = request_irq(host->irq, qla2100_intr_handler,
107 SA_INTERRUPT|SA_SHIRQ, ha->brd_info->drv_name, ha);
108 else
109 ret = request_irq(host->irq, qla2300_intr_handler,
110 SA_INTERRUPT|SA_SHIRQ, ha->brd_info->drv_name, ha);
111 - if (ret != 0) {
112 + if (ret) {
113 qla_printk(KERN_WARNING, ha,
114 "Failed to reserve interrupt %d already in use.\n",
115 host->irq);
116 @@ -1363,9 +1357,18 @@ int qla2x00_probe_one(struct pci_dev *pd
117 msleep(10);
118 }
119
120 + pci_set_drvdata(pdev, ha);
121 ha->flags.init_done = 1;
122 num_hosts++;
123
124 + ret = scsi_add_host(host, &pdev->dev);
125 + if (ret)
126 + goto probe_failed;
127 +
128 + qla2x00_alloc_sysfs_attr(ha);
129 +
130 + qla2x00_init_host_attr(ha);
131 +
132 qla_printk(KERN_INFO, ha, "\n"
133 " QLogic Fibre Channel HBA Driver: %s\n"
134 " QLogic %s - %s\n"
135 @@ -1384,9 +1387,6 @@ int qla2x00_probe_one(struct pci_dev *pd
136 probe_failed:
137 fc_remove_host(ha->host);
138
139 - scsi_remove_host(host);
140 -
141 -probe_alloc_failed:
142 qla2x00_free_device(ha);
143
144 scsi_host_put(host);
145 @@ -1394,7 +1394,8 @@ probe_alloc_failed:
146 probe_disable_device:
147 pci_disable_device(pdev);
148
149 - return -1;
150 +probe_out:
151 + return ret;
152 }
153 EXPORT_SYMBOL_GPL(qla2x00_probe_one);
154

  ViewVC Help
Powered by ViewVC 1.1.20