diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index f0396e79b6fa..d7b271339a5c 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -287,9 +287,12 @@ static int qla25xx_setup_mode(struct scsi_qla_host *vha) | |||
287 | int ques, req, ret; | 287 | int ques, req, ret; |
288 | struct qla_hw_data *ha = vha->hw; | 288 | struct qla_hw_data *ha = vha->hw; |
289 | 289 | ||
290 | if (!(ha->fw_attributes & BIT_6)) { | ||
291 | qla_printk(KERN_INFO, ha, | ||
292 | "Firmware is not multi-queue capable\n"); | ||
293 | goto fail; | ||
294 | } | ||
290 | if (ql2xmultique_tag) { | 295 | if (ql2xmultique_tag) { |
291 | /* CPU affinity mode */ | ||
292 | ha->wq = create_workqueue("qla2xxx_wq"); | ||
293 | /* create a request queue for IO */ | 296 | /* create a request queue for IO */ |
294 | options |= BIT_7; | 297 | options |= BIT_7; |
295 | req = qla25xx_create_req_que(ha, options, 0, 0, -1, | 298 | req = qla25xx_create_req_que(ha, options, 0, 0, -1, |
@@ -299,6 +302,7 @@ static int qla25xx_setup_mode(struct scsi_qla_host *vha) | |||
299 | "Can't create request queue\n"); | 302 | "Can't create request queue\n"); |
300 | goto fail; | 303 | goto fail; |
301 | } | 304 | } |
305 | ha->wq = create_workqueue("qla2xxx_wq"); | ||
302 | vha->req = ha->req_q_map[req]; | 306 | vha->req = ha->req_q_map[req]; |
303 | options |= BIT_1; | 307 | options |= BIT_1; |
304 | for (ques = 1; ques < ha->max_rsp_queues; ques++) { | 308 | for (ques = 1; ques < ha->max_rsp_queues; ques++) { |
@@ -309,6 +313,8 @@ static int qla25xx_setup_mode(struct scsi_qla_host *vha) | |||
309 | goto fail2; | 313 | goto fail2; |
310 | } | 314 | } |
311 | } | 315 | } |
316 | ha->flags.cpu_affinity_enabled = 1; | ||
317 | |||
312 | DEBUG2(qla_printk(KERN_INFO, ha, | 318 | DEBUG2(qla_printk(KERN_INFO, ha, |
313 | "CPU affinity mode enabled, no. of response" | 319 | "CPU affinity mode enabled, no. of response" |
314 | " queues:%d, no. of request queues:%d\n", | 320 | " queues:%d, no. of request queues:%d\n", |
@@ -317,8 +323,13 @@ static int qla25xx_setup_mode(struct scsi_qla_host *vha) | |||
317 | return 0; | 323 | return 0; |
318 | fail2: | 324 | fail2: |
319 | qla25xx_delete_queues(vha); | 325 | qla25xx_delete_queues(vha); |
326 | destroy_workqueue(ha->wq); | ||
327 | ha->wq = NULL; | ||
320 | fail: | 328 | fail: |
321 | ha->mqenable = 0; | 329 | ha->mqenable = 0; |
330 | kfree(ha->req_q_map); | ||
331 | kfree(ha->rsp_q_map); | ||
332 | ha->max_req_queues = ha->max_rsp_queues = 1; | ||
322 | return 1; | 333 | return 1; |
323 | } | 334 | } |
324 | 335 | ||
@@ -1923,6 +1934,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1923 | if (ret) | 1934 | if (ret) |
1924 | goto probe_init_failed; | 1935 | goto probe_init_failed; |
1925 | /* Alloc arrays of request and response ring ptrs */ | 1936 | /* Alloc arrays of request and response ring ptrs */ |
1937 | que_init: | ||
1926 | if (!qla2x00_alloc_queues(ha)) { | 1938 | if (!qla2x00_alloc_queues(ha)) { |
1927 | qla_printk(KERN_WARNING, ha, | 1939 | qla_printk(KERN_WARNING, ha, |
1928 | "[ERROR] Failed to allocate memory for queue" | 1940 | "[ERROR] Failed to allocate memory for queue" |
@@ -1959,11 +1971,14 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1959 | goto probe_failed; | 1971 | goto probe_failed; |
1960 | } | 1972 | } |
1961 | 1973 | ||
1962 | if (ha->mqenable) | 1974 | if (ha->mqenable) { |
1963 | if (qla25xx_setup_mode(base_vha)) | 1975 | if (qla25xx_setup_mode(base_vha)) { |
1964 | qla_printk(KERN_WARNING, ha, | 1976 | qla_printk(KERN_WARNING, ha, |
1965 | "Can't create queues, falling back to single" | 1977 | "Can't create queues, falling back to single" |
1966 | " queue mode\n"); | 1978 | " queue mode\n"); |
1979 | goto que_init; | ||
1980 | } | ||
1981 | } | ||
1967 | 1982 | ||
1968 | if (ha->flags.running_gold_fw) | 1983 | if (ha->flags.running_gold_fw) |
1969 | goto skip_dpc; | 1984 | goto skip_dpc; |