[SCSI] qla4xxx: regression - add start scan callout

We are seeing EXIST errors from sysfs during device addition.
We need a start scan callout so we do not start scanning sessions
found during hba setup, before the async scsi scan code is ready.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: David C Somayajulu <david.somayajulu@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

authored by Mike Christie and committed by James Bottomley 024f801f 50a29aec

+14 -12
+14 -12
drivers/scsi/qla4xxx/ql4_os.c
··· 75 static int qla4xxx_slave_alloc(struct scsi_device *device); 76 static int qla4xxx_slave_configure(struct scsi_device *device); 77 static void qla4xxx_slave_destroy(struct scsi_device *sdev); 78 79 static struct scsi_host_template qla4xxx_driver_template = { 80 .module = THIS_MODULE, ··· 91 .slave_destroy = qla4xxx_slave_destroy, 92 93 .scan_finished = iscsi_scan_finished, 94 95 .this_id = -1, 96 .cmd_per_lun = 3, ··· 299 ddb_entry->ha = ha; 300 ddb_entry->sess = sess; 301 return ddb_entry; 302 } 303 304 /* ··· 1192 int ret = -ENODEV, status; 1193 struct Scsi_Host *host; 1194 struct scsi_qla_host *ha; 1195 - struct ddb_entry *ddb_entry, *ddbtemp; 1196 uint8_t init_retry_count = 0; 1197 char buf[34]; 1198 ··· 1310 if (ret) 1311 goto probe_failed; 1312 1313 - /* Update transport device information for all devices. */ 1314 - list_for_each_entry_safe(ddb_entry, ddbtemp, &ha->ddb_list, list) { 1315 - if (ddb_entry->fw_ddb_device_state == DDB_DS_SESSION_ACTIVE) 1316 - if (qla4xxx_add_sess(ddb_entry)) 1317 - goto remove_host; 1318 - } 1319 - 1320 printk(KERN_INFO 1321 " QLogic iSCSI HBA Driver version: %s\n" 1322 " QLogic ISP%04x @ %s, host#=%ld, fw=%02d.%02d.%02d.%02d\n", ··· 1318 ha->patch_number, ha->build_number); 1319 scsi_scan_host(host); 1320 return 0; 1321 - 1322 - remove_host: 1323 - qla4xxx_free_ddb_list(ha); 1324 - scsi_remove_host(host); 1325 1326 probe_failed: 1327 qla4xxx_free_adapter(ha);
··· 75 static int qla4xxx_slave_alloc(struct scsi_device *device); 76 static int qla4xxx_slave_configure(struct scsi_device *device); 77 static void qla4xxx_slave_destroy(struct scsi_device *sdev); 78 + static void qla4xxx_scan_start(struct Scsi_Host *shost); 79 80 static struct scsi_host_template qla4xxx_driver_template = { 81 .module = THIS_MODULE, ··· 90 .slave_destroy = qla4xxx_slave_destroy, 91 92 .scan_finished = iscsi_scan_finished, 93 + .scan_start = qla4xxx_scan_start, 94 95 .this_id = -1, 96 .cmd_per_lun = 3, ··· 297 ddb_entry->ha = ha; 298 ddb_entry->sess = sess; 299 return ddb_entry; 300 + } 301 + 302 + static void qla4xxx_scan_start(struct Scsi_Host *shost) 303 + { 304 + struct scsi_qla_host *ha = shost_priv(shost); 305 + struct ddb_entry *ddb_entry, *ddbtemp; 306 + 307 + /* finish setup of sessions that were already setup in firmware */ 308 + list_for_each_entry_safe(ddb_entry, ddbtemp, &ha->ddb_list, list) { 309 + if (ddb_entry->fw_ddb_device_state == DDB_DS_SESSION_ACTIVE) 310 + qla4xxx_add_sess(ddb_entry); 311 + } 312 } 313 314 /* ··· 1178 int ret = -ENODEV, status; 1179 struct Scsi_Host *host; 1180 struct scsi_qla_host *ha; 1181 uint8_t init_retry_count = 0; 1182 char buf[34]; 1183 ··· 1297 if (ret) 1298 goto probe_failed; 1299 1300 printk(KERN_INFO 1301 " QLogic iSCSI HBA Driver version: %s\n" 1302 " QLogic ISP%04x @ %s, host#=%ld, fw=%02d.%02d.%02d.%02d\n", ··· 1312 ha->patch_number, ha->build_number); 1313 scsi_scan_host(host); 1314 return 0; 1315 1316 probe_failed: 1317 qla4xxx_free_adapter(ha);