aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_isr.c
diff options
context:
space:
mode:
authorSaurav Kashyap <saurav.kashyap@qlogic.com>2011-07-14 15:00:13 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-07-27 06:16:17 -0400
commit7c3df1320e5e875478775e78d01a09aee96b8abe (patch)
tree215326b999b3db03f4a2268a79c3848803daaf7d /drivers/scsi/qla2xxx/qla_isr.c
parent3ce8866ceae87258cf66d1f7fd72abc918753cec (diff)
[SCSI] qla2xxx: Code changes to support new dynamic logging infrastructure.
The code is changed to support the new dynamic logging infrastructure. Following are the levels added. Default is 0 - no logging. 0x40000000 - Module Init & Probe. 0x20000000 - Mailbox Cmnds. 0x10000000 - Device Discovery. 0x08000000 - IO tracing. 0x04000000 - DPC Thread. 0x02000000 - Async events. 0x01000000 - Timer routines. 0x00800000 - User space. 0x00400000 - Task Management. 0x00200000 - AER/EEH. 0x00100000 - Multi Q. 0x00080000 - P3P Specific. 0x00040000 - Virtual Port. 0x00020000 - Buffer Dump. 0x00010000 - Misc. 0x7fffffff - For enabling all logs, can be too many logs. Setting ql2xextended_error_logging module parameter to any of the above value, will enable the debug for that particular level. Do LOGICAL OR of the value to enable more than one level. Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_isr.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c663
1 files changed, 328 insertions, 335 deletions
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index ae8e298746ba..b16b7725dee0 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -45,7 +45,7 @@ qla2100_intr_handler(int irq, void *dev_id)
45 rsp = (struct rsp_que *) dev_id; 45 rsp = (struct rsp_que *) dev_id;
46 if (!rsp) { 46 if (!rsp) {
47 printk(KERN_INFO 47 printk(KERN_INFO
48 "%s(): NULL response queue pointer\n", __func__); 48 "%s(): NULL response queue pointer.\n", __func__);
49 return (IRQ_NONE); 49 return (IRQ_NONE);
50 } 50 }
51 51
@@ -91,9 +91,9 @@ qla2100_intr_handler(int irq, void *dev_id)
91 qla2x00_async_event(vha, rsp, mb); 91 qla2x00_async_event(vha, rsp, mb);
92 } else { 92 } else {
93 /*EMPTY*/ 93 /*EMPTY*/
94 DEBUG2(printk("scsi(%ld): Unrecognized " 94 ql_dbg(ql_dbg_async, vha, 0x5025,
95 "interrupt type (%d).\n", 95 "Unrecognized interrupt type (%d).\n",
96 vha->host_no, mb[0])); 96 mb[0]);
97 } 97 }
98 /* Release mailbox registers. */ 98 /* Release mailbox registers. */
99 WRT_REG_WORD(&reg->semaphore, 0); 99 WRT_REG_WORD(&reg->semaphore, 0);
@@ -142,7 +142,7 @@ qla2300_intr_handler(int irq, void *dev_id)
142 rsp = (struct rsp_que *) dev_id; 142 rsp = (struct rsp_que *) dev_id;
143 if (!rsp) { 143 if (!rsp) {
144 printk(KERN_INFO 144 printk(KERN_INFO
145 "%s(): NULL response queue pointer\n", __func__); 145 "%s(): NULL response queue pointer.\n", __func__);
146 return (IRQ_NONE); 146 return (IRQ_NONE);
147 } 147 }
148 148
@@ -160,11 +160,13 @@ qla2300_intr_handler(int irq, void *dev_id)
160 160
161 hccr = RD_REG_WORD(&reg->hccr); 161 hccr = RD_REG_WORD(&reg->hccr);
162 if (hccr & (BIT_15 | BIT_13 | BIT_11 | BIT_8)) 162 if (hccr & (BIT_15 | BIT_13 | BIT_11 | BIT_8))
163 qla_printk(KERN_INFO, ha, "Parity error -- " 163 ql_log(ql_log_warn, vha, 0x5026,
164 "HCCR=%x, Dumping firmware!\n", hccr); 164 "Parity error -- HCCR=%x, Dumping "
165 "firmware.\n", hccr);
165 else 166 else
166 qla_printk(KERN_INFO, ha, "RISC paused -- " 167 ql_log(ql_log_warn, vha, 0x5027,
167 "HCCR=%x, Dumping firmware!\n", hccr); 168 "RISC paused -- HCCR=%x, Dumping "
169 "firmware.\n", hccr);
168 170
169 /* 171 /*
170 * Issue a "HARD" reset in order for the RISC 172 * Issue a "HARD" reset in order for the RISC
@@ -213,9 +215,8 @@ qla2300_intr_handler(int irq, void *dev_id)
213 qla2x00_async_event(vha, rsp, mb); 215 qla2x00_async_event(vha, rsp, mb);
214 break; 216 break;
215 default: 217 default:
216 DEBUG2(printk("scsi(%ld): Unrecognized interrupt type " 218 ql_dbg(ql_dbg_async, vha, 0x5028,
217 "(%d).\n", 219 "Unrecognized interrupt type (%d).\n", stat & 0xff);
218 vha->host_no, stat & 0xff));
219 break; 220 break;
220 } 221 }
221 WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT); 222 WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT);
@@ -262,11 +263,11 @@ qla2x00_mbx_completion(scsi_qla_host_t *vha, uint16_t mb0)
262 } 263 }
263 264
264 if (ha->mcp) { 265 if (ha->mcp) {
265 DEBUG3(printk("%s(%ld): Got mailbox completion. cmd=%x.\n", 266 ql_dbg(ql_dbg_async, vha, 0x5000,
266 __func__, vha->host_no, ha->mcp->mb[0])); 267 "Got mbx completion. cmd=%x.\n", ha->mcp->mb[0]);
267 } else { 268 } else {
268 DEBUG2_3(printk("%s(%ld): MBX pointer ERROR!\n", 269 ql_dbg(ql_dbg_async, vha, 0x5001,
269 __func__, vha->host_no)); 270 "MBX pointer ERROR.\n");
270 } 271 }
271} 272}
272 273
@@ -285,22 +286,24 @@ qla81xx_idc_event(scsi_qla_host_t *vha, uint16_t aen, uint16_t descr)
285 for (cnt = 0; cnt < QLA_IDC_ACK_REGS; cnt++, wptr++) 286 for (cnt = 0; cnt < QLA_IDC_ACK_REGS; cnt++, wptr++)
286 mb[cnt] = RD_REG_WORD(wptr); 287 mb[cnt] = RD_REG_WORD(wptr);
287 288
288 DEBUG2(printk("scsi(%ld): Inter-Driver Commucation %s -- " 289 ql_dbg(ql_dbg_async, vha, 0x5021,
289 "%04x %04x %04x %04x %04x %04x %04x.\n", vha->host_no, 290 "Inter-Driver Commucation %s -- "
290 event[aen & 0xff], 291 "%04x %04x %04x %04x %04x %04x %04x.\n",
291 mb[0], mb[1], mb[2], mb[3], mb[4], mb[5], mb[6])); 292 event[aen & 0xff], mb[0], mb[1], mb[2], mb[3],
293 mb[4], mb[5], mb[6]);
292 294
293 /* Acknowledgement needed? [Notify && non-zero timeout]. */ 295 /* Acknowledgement needed? [Notify && non-zero timeout]. */
294 timeout = (descr >> 8) & 0xf; 296 timeout = (descr >> 8) & 0xf;
295 if (aen != MBA_IDC_NOTIFY || !timeout) 297 if (aen != MBA_IDC_NOTIFY || !timeout)
296 return; 298 return;
297 299
298 DEBUG2(printk("scsi(%ld): Inter-Driver Commucation %s -- " 300 ql_dbg(ql_dbg_async, vha, 0x5022,
299 "ACK timeout=%d.\n", vha->host_no, event[aen & 0xff], timeout)); 301 "Inter-Driver Commucation %s -- ACK timeout=%d.\n",
302 vha->host_no, event[aen & 0xff], timeout);
300 303
301 rval = qla2x00_post_idc_ack_work(vha, mb); 304 rval = qla2x00_post_idc_ack_work(vha, mb);
302 if (rval != QLA_SUCCESS) 305 if (rval != QLA_SUCCESS)
303 qla_printk(KERN_WARNING, vha->hw, 306 ql_log(ql_log_warn, vha, 0x5023,
304 "IDC failed to post ACK.\n"); 307 "IDC failed to post ACK.\n");
305} 308}
306 309
@@ -393,15 +396,15 @@ skip_rio:
393 break; 396 break;
394 397
395 case MBA_RESET: /* Reset */ 398 case MBA_RESET: /* Reset */
396 DEBUG2(printk("scsi(%ld): Asynchronous RESET.\n", 399 ql_dbg(ql_dbg_async, vha, 0x5002,
397 vha->host_no)); 400 "Asynchronous RESET.\n");
398 401
399 set_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); 402 set_bit(RESET_MARKER_NEEDED, &vha->dpc_flags);
400 break; 403 break;
401 404
402 case MBA_SYSTEM_ERR: /* System Error */ 405 case MBA_SYSTEM_ERR: /* System Error */
403 mbx = IS_QLA81XX(ha) ? RD_REG_WORD(&reg24->mailbox7) : 0; 406 mbx = IS_QLA81XX(ha) ? RD_REG_WORD(&reg24->mailbox7) : 0;
404 qla_printk(KERN_INFO, ha, 407 ql_log(ql_log_warn, vha, 0x5003,
405 "ISP System Error - mbx1=%xh mbx2=%xh mbx3=%xh " 408 "ISP System Error - mbx1=%xh mbx2=%xh mbx3=%xh "
406 "mbx7=%xh.\n", mb[1], mb[2], mb[3], mbx); 409 "mbx7=%xh.\n", mb[1], mb[2], mb[3], mbx);
407 410
@@ -409,7 +412,7 @@ skip_rio:
409 412
410 if (IS_FWI2_CAPABLE(ha)) { 413 if (IS_FWI2_CAPABLE(ha)) {
411 if (mb[1] == 0 && mb[2] == 0) { 414 if (mb[1] == 0 && mb[2] == 0) {
412 qla_printk(KERN_ERR, ha, 415 ql_log(ql_log_fatal, vha, 0x5004,
413 "Unrecoverable Hardware Error: adapter " 416 "Unrecoverable Hardware Error: adapter "
414 "marked OFFLINE!\n"); 417 "marked OFFLINE!\n");
415 vha->flags.online = 0; 418 vha->flags.online = 0;
@@ -422,7 +425,7 @@ skip_rio:
422 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); 425 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
423 } 426 }
424 } else if (mb[1] == 0) { 427 } else if (mb[1] == 0) {
425 qla_printk(KERN_INFO, ha, 428 ql_log(ql_log_fatal, vha, 0x5005,
426 "Unrecoverable Hardware Error: adapter marked " 429 "Unrecoverable Hardware Error: adapter marked "
427 "OFFLINE!\n"); 430 "OFFLINE!\n");
428 vha->flags.online = 0; 431 vha->flags.online = 0;
@@ -431,31 +434,27 @@ skip_rio:
431 break; 434 break;
432 435
433 case MBA_REQ_TRANSFER_ERR: /* Request Transfer Error */ 436 case MBA_REQ_TRANSFER_ERR: /* Request Transfer Error */
434 DEBUG2(printk("scsi(%ld): ISP Request Transfer Error (%x).\n", 437 ql_log(ql_log_warn, vha, 0x5006,
435 vha->host_no, mb[1])); 438 "ISP Request Transfer Error (%x).\n", mb[1]);
436 qla_printk(KERN_WARNING, ha,
437 "ISP Request Transfer Error (%x).\n", mb[1]);
438 439
439 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); 440 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
440 break; 441 break;
441 442
442 case MBA_RSP_TRANSFER_ERR: /* Response Transfer Error */ 443 case MBA_RSP_TRANSFER_ERR: /* Response Transfer Error */
443 DEBUG2(printk("scsi(%ld): ISP Response Transfer Error.\n", 444 ql_log(ql_log_warn, vha, 0x5007,
444 vha->host_no)); 445 "ISP Response Transfer Error.\n");
445 qla_printk(KERN_WARNING, ha, "ISP Response Transfer Error.\n");
446 446
447 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); 447 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
448 break; 448 break;
449 449
450 case MBA_WAKEUP_THRES: /* Request Queue Wake-up */ 450 case MBA_WAKEUP_THRES: /* Request Queue Wake-up */
451 DEBUG2(printk("scsi(%ld): Asynchronous WAKEUP_THRES.\n", 451 ql_dbg(ql_dbg_async, vha, 0x5008,
452 vha->host_no)); 452 "Asynchronous WAKEUP_THRES.\n");
453 break; 453 break;
454 454
455 case MBA_LIP_OCCURRED: /* Loop Initialization Procedure */ 455 case MBA_LIP_OCCURRED: /* Loop Initialization Procedure */
456 DEBUG2(printk("scsi(%ld): LIP occurred (%x).\n", vha->host_no, 456 ql_log(ql_log_info, vha, 0x5009,
457 mb[1])); 457 "LIP occurred (%x).\n", mb[1]);
458 qla_printk(KERN_INFO, ha, "LIP occurred (%x).\n", mb[1]);
459 458
460 if (atomic_read(&vha->loop_state) != LOOP_DOWN) { 459 if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
461 atomic_set(&vha->loop_state, LOOP_DOWN); 460 atomic_set(&vha->loop_state, LOOP_DOWN);
@@ -488,10 +487,8 @@ skip_rio:
488 ha->link_data_rate = mb[1]; 487 ha->link_data_rate = mb[1];
489 } 488 }
490 489
491 DEBUG2(printk("scsi(%ld): Asynchronous LOOP UP (%s Gbps).\n", 490 ql_log(ql_log_info, vha, 0x500a,
492 vha->host_no, link_speed)); 491 "LOOP UP detected (%s Gbps).\n", link_speed);
493 qla_printk(KERN_INFO, ha, "LOOP UP detected (%s Gbps).\n",
494 link_speed);
495 492
496 vha->flags.management_server_logged_in = 0; 493 vha->flags.management_server_logged_in = 0;
497 qla2x00_post_aen_work(vha, FCH_EVT_LINKUP, ha->link_data_rate); 494 qla2x00_post_aen_work(vha, FCH_EVT_LINKUP, ha->link_data_rate);
@@ -500,12 +497,9 @@ skip_rio:
500 case MBA_LOOP_DOWN: /* Loop Down Event */ 497 case MBA_LOOP_DOWN: /* Loop Down Event */
501 mbx = IS_QLA81XX(ha) ? RD_REG_WORD(&reg24->mailbox4) : 0; 498 mbx = IS_QLA81XX(ha) ? RD_REG_WORD(&reg24->mailbox4) : 0;
502 mbx = IS_QLA82XX(ha) ? RD_REG_WORD(&reg82->mailbox_out[4]) : mbx; 499 mbx = IS_QLA82XX(ha) ? RD_REG_WORD(&reg82->mailbox_out[4]) : mbx;
503 DEBUG2(printk("scsi(%ld): Asynchronous LOOP DOWN " 500 ql_log(ql_log_info, vha, 0x500b,
504 "(%x %x %x %x).\n", vha->host_no, mb[1], mb[2], mb[3], 501 "LOOP DOWN detected (%x %x %x %x).\n",
505 mbx)); 502 mb[1], mb[2], mb[3], mbx);
506 qla_printk(KERN_INFO, ha,
507 "LOOP DOWN detected (%x %x %x %x).\n", mb[1], mb[2], mb[3],
508 mbx);
509 503
510 if (atomic_read(&vha->loop_state) != LOOP_DOWN) { 504 if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
511 atomic_set(&vha->loop_state, LOOP_DOWN); 505 atomic_set(&vha->loop_state, LOOP_DOWN);
@@ -525,9 +519,7 @@ skip_rio:
525 break; 519 break;
526 520
527 case MBA_LIP_RESET: /* LIP reset occurred */ 521 case MBA_LIP_RESET: /* LIP reset occurred */
528 DEBUG2(printk("scsi(%ld): Asynchronous LIP RESET (%x).\n", 522 ql_log(ql_log_info, vha, 0x500c,
529 vha->host_no, mb[1]));
530 qla_printk(KERN_INFO, ha,
531 "LIP reset occurred (%x).\n", mb[1]); 523 "LIP reset occurred (%x).\n", mb[1]);
532 524
533 if (atomic_read(&vha->loop_state) != LOOP_DOWN) { 525 if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
@@ -554,14 +546,15 @@ skip_rio:
554 break; 546 break;
555 547
556 if (IS_QLA8XXX_TYPE(ha)) { 548 if (IS_QLA8XXX_TYPE(ha)) {
557 DEBUG2(printk("scsi(%ld): DCBX Completed -- %04x %04x " 549 ql_dbg(ql_dbg_async, vha, 0x500d,
558 "%04x\n", vha->host_no, mb[1], mb[2], mb[3])); 550 "DCBX Completed -- %04x %04x %04x.\n",
551 mb[1], mb[2], mb[3]);
559 if (ha->notify_dcbx_comp) 552 if (ha->notify_dcbx_comp)
560 complete(&ha->dcbx_comp); 553 complete(&ha->dcbx_comp);
561 554
562 } else 555 } else
563 DEBUG2(printk("scsi(%ld): Asynchronous P2P MODE " 556 ql_dbg(ql_dbg_async, vha, 0x500e,
564 "received.\n", vha->host_no)); 557 "Asynchronous P2P MODE received.\n");
565 558
566 /* 559 /*
567 * Until there's a transition from loop down to loop up, treat 560 * Until there's a transition from loop down to loop up, treat
@@ -594,10 +587,7 @@ skip_rio:
594 if (IS_QLA2100(ha)) 587 if (IS_QLA2100(ha))
595 break; 588 break;
596 589
597 DEBUG2(printk("scsi(%ld): Asynchronous Change In Connection " 590 ql_log(ql_log_info, vha, 0x500f,
598 "received.\n",
599 vha->host_no));
600 qla_printk(KERN_INFO, ha,
601 "Configuration change detected: value=%x.\n", mb[1]); 591 "Configuration change detected: value=%x.\n", mb[1]);
602 592
603 if (atomic_read(&vha->loop_state) != LOOP_DOWN) { 593 if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
@@ -640,11 +630,9 @@ skip_rio:
640 630
641 /* Global event -- port logout or port unavailable. */ 631 /* Global event -- port logout or port unavailable. */
642 if (mb[1] == 0xffff && mb[2] == 0x7) { 632 if (mb[1] == 0xffff && mb[2] == 0x7) {
643 DEBUG2(printk("scsi(%ld): Asynchronous PORT UPDATE.\n", 633 ql_dbg(ql_dbg_async, vha, 0x5010,
644 vha->host_no)); 634 "Port unavailable %04x %04x %04x.\n",
645 DEBUG(printk(KERN_INFO 635 mb[1], mb[2], mb[3]);
646 "scsi(%ld): Port unavailable %04x %04x %04x.\n",
647 vha->host_no, mb[1], mb[2], mb[3]));
648 636
649 if (atomic_read(&vha->loop_state) != LOOP_DOWN) { 637 if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
650 atomic_set(&vha->loop_state, LOOP_DOWN); 638 atomic_set(&vha->loop_state, LOOP_DOWN);
@@ -674,17 +662,15 @@ skip_rio:
674 atomic_set(&vha->loop_down_timer, 0); 662 atomic_set(&vha->loop_down_timer, 0);
675 if (atomic_read(&vha->loop_state) != LOOP_DOWN && 663 if (atomic_read(&vha->loop_state) != LOOP_DOWN &&
676 atomic_read(&vha->loop_state) != LOOP_DEAD) { 664 atomic_read(&vha->loop_state) != LOOP_DEAD) {
677 DEBUG2(printk("scsi(%ld): Asynchronous PORT UPDATE " 665 ql_dbg(ql_dbg_async, vha, 0x5011,
678 "ignored %04x/%04x/%04x.\n", vha->host_no, mb[1], 666 "Asynchronous PORT UPDATE ignored %04x/%04x/%04x.\n",
679 mb[2], mb[3])); 667 mb[1], mb[2], mb[3]);
680 break; 668 break;
681 } 669 }
682 670
683 DEBUG2(printk("scsi(%ld): Asynchronous PORT UPDATE.\n", 671 ql_dbg(ql_dbg_async, vha, 0x5012,
684 vha->host_no)); 672 "Port database changed %04x %04x %04x.\n",
685 DEBUG(printk(KERN_INFO 673 mb[1], mb[2], mb[3]);
686 "scsi(%ld): Port database changed %04x %04x %04x.\n",
687 vha->host_no, mb[1], mb[2], mb[3]));
688 674
689 /* 675 /*
690 * Mark all devices as missing so we will login again. 676 * Mark all devices as missing so we will login again.
@@ -707,20 +693,17 @@ skip_rio:
707 if (ha->flags.npiv_supported && vha->vp_idx != (mb[3] & 0xff)) 693 if (ha->flags.npiv_supported && vha->vp_idx != (mb[3] & 0xff))
708 break; 694 break;
709 695
710 DEBUG2(printk("scsi(%ld): Asynchronous RSCR UPDATE.\n", 696 ql_dbg(ql_dbg_async, vha, 0x5013,
711 vha->host_no)); 697 "RSCN database changed -- %04x %04x %04x.\n",
712 DEBUG(printk(KERN_INFO 698 mb[1], mb[2], mb[3]);
713 "scsi(%ld): RSCN database changed -- %04x %04x %04x.\n",
714 vha->host_no, mb[1], mb[2], mb[3]));
715 699
716 rscn_entry = ((mb[1] & 0xff) << 16) | mb[2]; 700 rscn_entry = ((mb[1] & 0xff) << 16) | mb[2];
717 host_pid = (vha->d_id.b.domain << 16) | (vha->d_id.b.area << 8) 701 host_pid = (vha->d_id.b.domain << 16) | (vha->d_id.b.area << 8)
718 | vha->d_id.b.al_pa; 702 | vha->d_id.b.al_pa;
719 if (rscn_entry == host_pid) { 703 if (rscn_entry == host_pid) {
720 DEBUG(printk(KERN_INFO 704 ql_dbg(ql_dbg_async, vha, 0x5014,
721 "scsi(%ld): Ignoring RSCN update to local host " 705 "Ignoring RSCN update to local host "
722 "port ID (%06x)\n", 706 "port ID (%06x).\n", host_pid);
723 vha->host_no, host_pid));
724 break; 707 break;
725 } 708 }
726 709
@@ -747,8 +730,8 @@ skip_rio:
747 730
748 /* case MBA_RIO_RESPONSE: */ 731 /* case MBA_RIO_RESPONSE: */
749 case MBA_ZIO_RESPONSE: 732 case MBA_ZIO_RESPONSE:
750 DEBUG3(printk("scsi(%ld): [R|Z]IO update completion.\n", 733 ql_dbg(ql_dbg_async, vha, 0x5015,
751 vha->host_no)); 734 "[R|Z]IO update completion.\n");
752 735
753 if (IS_FWI2_CAPABLE(ha)) 736 if (IS_FWI2_CAPABLE(ha))
754 qla24xx_process_response_queue(vha, rsp); 737 qla24xx_process_response_queue(vha, rsp);
@@ -757,61 +740,68 @@ skip_rio:
757 break; 740 break;
758 741
759 case MBA_DISCARD_RND_FRAME: 742 case MBA_DISCARD_RND_FRAME:
760 DEBUG2(printk("scsi(%ld): Discard RND Frame -- %04x %04x " 743 ql_dbg(ql_dbg_async, vha, 0x5016,
761 "%04x.\n", vha->host_no, mb[1], mb[2], mb[3])); 744 "Discard RND Frame -- %04x %04x %04x.\n",
745 mb[1], mb[2], mb[3]);
762 break; 746 break;
763 747
764 case MBA_TRACE_NOTIFICATION: 748 case MBA_TRACE_NOTIFICATION:
765 DEBUG2(printk("scsi(%ld): Trace Notification -- %04x %04x.\n", 749 ql_dbg(ql_dbg_async, vha, 0x5017,
766 vha->host_no, mb[1], mb[2])); 750 "Trace Notification -- %04x %04x.\n", mb[1], mb[2]);
767 break; 751 break;
768 752
769 case MBA_ISP84XX_ALERT: 753 case MBA_ISP84XX_ALERT:
770 DEBUG2(printk("scsi(%ld): ISP84XX Alert Notification -- " 754 ql_dbg(ql_dbg_async, vha, 0x5018,
771 "%04x %04x %04x\n", vha->host_no, mb[1], mb[2], mb[3])); 755 "ISP84XX Alert Notification -- %04x %04x %04x.\n",
756 mb[1], mb[2], mb[3]);
772 757
773 spin_lock_irqsave(&ha->cs84xx->access_lock, flags); 758 spin_lock_irqsave(&ha->cs84xx->access_lock, flags);
774 switch (mb[1]) { 759 switch (mb[1]) {
775 case A84_PANIC_RECOVERY: 760 case A84_PANIC_RECOVERY:
776 qla_printk(KERN_INFO, ha, "Alert 84XX: panic recovery " 761 ql_log(ql_log_info, vha, 0x5019,
777 "%04x %04x\n", mb[2], mb[3]); 762 "Alert 84XX: panic recovery %04x %04x.\n",
763 mb[2], mb[3]);
778 break; 764 break;
779 case A84_OP_LOGIN_COMPLETE: 765 case A84_OP_LOGIN_COMPLETE:
780 ha->cs84xx->op_fw_version = mb[3] << 16 | mb[2]; 766 ha->cs84xx->op_fw_version = mb[3] << 16 | mb[2];
781 DEBUG2(qla_printk(KERN_INFO, ha, "Alert 84XX:" 767 ql_log(ql_log_info, vha, 0x501a,
782 "firmware version %x\n", ha->cs84xx->op_fw_version)); 768 "Alert 84XX: firmware version %x.\n",
769 ha->cs84xx->op_fw_version);
783 break; 770 break;
784 case A84_DIAG_LOGIN_COMPLETE: 771 case A84_DIAG_LOGIN_COMPLETE:
785 ha->cs84xx->diag_fw_version = mb[3] << 16 | mb[2]; 772 ha->cs84xx->diag_fw_version = mb[3] << 16 | mb[2];
786 DEBUG2(qla_printk(KERN_INFO, ha, "Alert 84XX:" 773 ql_log(ql_log_info, vha, 0x501b,
787 "diagnostic firmware version %x\n", 774 "Alert 84XX: diagnostic firmware version %x.\n",
788 ha->cs84xx->diag_fw_version)); 775 ha->cs84xx->diag_fw_version);
789 break; 776 break;
790 case A84_GOLD_LOGIN_COMPLETE: 777 case A84_GOLD_LOGIN_COMPLETE:
791 ha->cs84xx->diag_fw_version = mb[3] << 16 | mb[2]; 778 ha->cs84xx->diag_fw_version = mb[3] << 16 | mb[2];
792 ha->cs84xx->fw_update = 1; 779 ha->cs84xx->fw_update = 1;
793 DEBUG2(qla_printk(KERN_INFO, ha, "Alert 84XX: gold " 780 ql_log(ql_log_info, vha, 0x501c,
794 "firmware version %x\n", 781 "Alert 84XX: gold firmware version %x.\n",
795 ha->cs84xx->gold_fw_version)); 782 ha->cs84xx->gold_fw_version);
796 break; 783 break;
797 default: 784 default:
798 qla_printk(KERN_ERR, ha, 785 ql_log(ql_log_warn, vha, 0x501d,
799 "Alert 84xx: Invalid Alert %04x %04x %04x\n", 786 "Alert 84xx: Invalid Alert %04x %04x %04x.\n",
800 mb[1], mb[2], mb[3]); 787 mb[1], mb[2], mb[3]);
801 } 788 }
802 spin_unlock_irqrestore(&ha->cs84xx->access_lock, flags); 789 spin_unlock_irqrestore(&ha->cs84xx->access_lock, flags);
803 break; 790 break;
804 case MBA_DCBX_START: 791 case MBA_DCBX_START:
805 DEBUG2(printk("scsi(%ld): DCBX Started -- %04x %04x %04x\n", 792 ql_dbg(ql_dbg_async, vha, 0x501e,
806 vha->host_no, mb[1], mb[2], mb[3])); 793 "DCBX Started -- %04x %04x %04x.\n",
794 mb[1], mb[2], mb[3]);
807 break; 795 break;
808 case MBA_DCBX_PARAM_UPDATE: 796 case MBA_DCBX_PARAM_UPDATE:
809 DEBUG2(printk("scsi(%ld): DCBX Parameters Updated -- " 797 ql_dbg(ql_dbg_async, vha, 0x501f,
810 "%04x %04x %04x\n", vha->host_no, mb[1], mb[2], mb[3])); 798 "DCBX Parameters Updated -- %04x %04x %04x.\n",
799 mb[1], mb[2], mb[3]);
811 break; 800 break;
812 case MBA_FCF_CONF_ERR: 801 case MBA_FCF_CONF_ERR:
813 DEBUG2(printk("scsi(%ld): FCF Configuration Error -- " 802 ql_dbg(ql_dbg_async, vha, 0x5020,
814 "%04x %04x %04x\n", vha->host_no, mb[1], mb[2], mb[3])); 803 "FCF Configuration Error -- %04x %04x %04x.\n",
804 mb[1], mb[2], mb[3]);
815 break; 805 break;
816 case MBA_IDC_COMPLETE: 806 case MBA_IDC_COMPLETE:
817 case MBA_IDC_NOTIFY: 807 case MBA_IDC_NOTIFY:
@@ -838,10 +828,8 @@ qla2x00_process_completed_request(struct scsi_qla_host *vha,
838 828
839 /* Validate handle. */ 829 /* Validate handle. */
840 if (index >= MAX_OUTSTANDING_COMMANDS) { 830 if (index >= MAX_OUTSTANDING_COMMANDS) {
841 DEBUG2(printk("scsi(%ld): Invalid SCSI completion handle %d.\n", 831 ql_log(ql_log_warn, vha, 0x3014,
842 vha->host_no, index)); 832 "Invalid SCSI command index (%x).\n", index);
843 qla_printk(KERN_WARNING, ha,
844 "Invalid SCSI completion handle %d.\n", index);
845 833
846 if (IS_QLA82XX(ha)) 834 if (IS_QLA82XX(ha))
847 set_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags); 835 set_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags);
@@ -859,10 +847,7 @@ qla2x00_process_completed_request(struct scsi_qla_host *vha,
859 sp->cmd->result = DID_OK << 16; 847 sp->cmd->result = DID_OK << 16;
860 qla2x00_sp_compl(ha, sp); 848 qla2x00_sp_compl(ha, sp);
861 } else { 849 } else {
862 DEBUG2(printk("scsi(%ld) Req:%d: Invalid ISP SCSI completion" 850 ql_log(ql_log_warn, vha, 0x3016, "Invalid SCSI SRB.\n");
863 " handle(0x%x)\n", vha->host_no, req->id, index));
864 qla_printk(KERN_WARNING, ha,
865 "Invalid ISP SCSI completion handle\n");
866 851
867 if (IS_QLA82XX(ha)) 852 if (IS_QLA82XX(ha))
868 set_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags); 853 set_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags);
@@ -882,8 +867,8 @@ qla2x00_get_sp_from_handle(scsi_qla_host_t *vha, const char *func,
882 867
883 index = LSW(pkt->handle); 868 index = LSW(pkt->handle);
884 if (index >= MAX_OUTSTANDING_COMMANDS) { 869 if (index >= MAX_OUTSTANDING_COMMANDS) {
885 qla_printk(KERN_WARNING, ha, 870 ql_log(ql_log_warn, vha, 0x5031,
886 "%s: Invalid completion handle (%x).\n", func, index); 871 "Invalid command index (%x).\n", index);
887 if (IS_QLA82XX(ha)) 872 if (IS_QLA82XX(ha))
888 set_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags); 873 set_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags);
889 else 874 else
@@ -892,15 +877,13 @@ qla2x00_get_sp_from_handle(scsi_qla_host_t *vha, const char *func,
892 } 877 }
893 sp = req->outstanding_cmds[index]; 878 sp = req->outstanding_cmds[index];
894 if (!sp) { 879 if (!sp) {
895 qla_printk(KERN_WARNING, ha, 880 ql_log(ql_log_warn, vha, 0x5032,
896 "%s: Invalid completion handle (%x) -- timed-out.\n", func, 881 "Invalid completion handle (%x) -- timed-out.\n", index);
897 index);
898 return sp; 882 return sp;
899 } 883 }
900 if (sp->handle != index) { 884 if (sp->handle != index) {
901 qla_printk(KERN_WARNING, ha, 885 ql_log(ql_log_warn, vha, 0x5033,
902 "%s: SRB handle (%x) mismatch %x.\n", func, sp->handle, 886 "SRB handle (%x) mismatch %x.\n", sp->handle, index);
903 index);
904 return NULL; 887 return NULL;
905 } 888 }
906 889
@@ -937,17 +920,17 @@ qla2x00_mbx_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
937 data[1] = lio->u.logio.flags & SRB_LOGIN_RETRIED ? 920 data[1] = lio->u.logio.flags & SRB_LOGIN_RETRIED ?
938 QLA_LOGIO_LOGIN_RETRIED : 0; 921 QLA_LOGIO_LOGIN_RETRIED : 0;
939 if (mbx->entry_status) { 922 if (mbx->entry_status) {
940 DEBUG2(printk(KERN_WARNING 923 ql_dbg(ql_dbg_async, vha, 0x5043,
941 "scsi(%ld:%x): Async-%s error entry - portid=%02x%02x%02x " 924 "Async-%s error entry - portid=%02x%02x%02x "
942 "entry-status=%x status=%x state-flag=%x " 925 "entry-status=%x status=%x state-flag=%x "
943 "status-flags=%x.\n", 926 "status-flags=%x.\n",
944 fcport->vha->host_no, sp->handle, type, 927 type, fcport->d_id.b.domain, fcport->d_id.b.area,
945 fcport->d_id.b.domain, fcport->d_id.b.area,
946 fcport->d_id.b.al_pa, mbx->entry_status, 928 fcport->d_id.b.al_pa, mbx->entry_status,
947 le16_to_cpu(mbx->status), le16_to_cpu(mbx->state_flags), 929 le16_to_cpu(mbx->status), le16_to_cpu(mbx->state_flags),
948 le16_to_cpu(mbx->status_flags))); 930 le16_to_cpu(mbx->status_flags));
949 931
950 DEBUG2(qla2x00_dump_buffer((uint8_t *)mbx, sizeof(*mbx))); 932 ql_dump_buffer(ql_dbg_async + ql_dbg_buffer, vha, 0x5057,
933 (uint8_t *)mbx, sizeof(*mbx));
951 934
952 goto logio_done; 935 goto logio_done;
953 } 936 }
@@ -957,12 +940,10 @@ qla2x00_mbx_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
957 le16_to_cpu(mbx->mb0) == MBS_COMMAND_COMPLETE) 940 le16_to_cpu(mbx->mb0) == MBS_COMMAND_COMPLETE)
958 status = 0; 941 status = 0;
959 if (!status && le16_to_cpu(mbx->mb0) == MBS_COMMAND_COMPLETE) { 942 if (!status && le16_to_cpu(mbx->mb0) == MBS_COMMAND_COMPLETE) {
960 DEBUG2(printk(KERN_DEBUG 943 ql_dbg(ql_dbg_async, vha, 0x5045,
961 "scsi(%ld:%x): Async-%s complete - portid=%02x%02x%02x " 944 "Async-%s complete - portid=%02x%02x%02x mbx1=%x.\n",
962 "mbx1=%x.\n", 945 type, fcport->d_id.b.domain, fcport->d_id.b.area,
963 fcport->vha->host_no, sp->handle, type, 946 fcport->d_id.b.al_pa, le16_to_cpu(mbx->mb1));
964 fcport->d_id.b.domain, fcport->d_id.b.area,
965 fcport->d_id.b.al_pa, le16_to_cpu(mbx->mb1)));
966 947
967 data[0] = MBS_COMMAND_COMPLETE; 948 data[0] = MBS_COMMAND_COMPLETE;
968 if (ctx->type == SRB_LOGIN_CMD) { 949 if (ctx->type == SRB_LOGIN_CMD) {
@@ -987,14 +968,14 @@ qla2x00_mbx_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
987 break; 968 break;
988 } 969 }
989 970
990 DEBUG2(printk(KERN_WARNING 971 ql_log(ql_log_warn, vha, 0x5046,
991 "scsi(%ld:%x): Async-%s failed - portid=%02x%02x%02x status=%x " 972 "Async-%s failed - portid=%02x%02x%02x status=%x "
992 "mb0=%x mb1=%x mb2=%x mb6=%x mb7=%x.\n", 973 "mb0=%x mb1=%x mb2=%x mb6=%x mb7=%x.\n",
993 fcport->vha->host_no, sp->handle, type, fcport->d_id.b.domain, 974 type, fcport->d_id.b.domain,
994 fcport->d_id.b.area, fcport->d_id.b.al_pa, status, 975 fcport->d_id.b.area, fcport->d_id.b.al_pa, status,
995 le16_to_cpu(mbx->mb0), le16_to_cpu(mbx->mb1), 976 le16_to_cpu(mbx->mb0), le16_to_cpu(mbx->mb1),
996 le16_to_cpu(mbx->mb2), le16_to_cpu(mbx->mb6), 977 le16_to_cpu(mbx->mb2), le16_to_cpu(mbx->mb6),
997 le16_to_cpu(mbx->mb7))); 978 le16_to_cpu(mbx->mb7));
998 979
999logio_done: 980logio_done:
1000 lio->done(sp); 981 lio->done(sp);
@@ -1025,9 +1006,8 @@ qla2x00_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
1025 type = "ct pass-through"; 1006 type = "ct pass-through";
1026 break; 1007 break;
1027 default: 1008 default:
1028 qla_printk(KERN_WARNING, ha, 1009 ql_log(ql_log_warn, vha, 0x5047,
1029 "%s: Unrecognized SRB: (%p) type=%d.\n", func, sp, 1010 "Unrecognized SRB: (%p) type=%d.\n", sp, sp_bsg->type);
1030 sp_bsg->type);
1031 return; 1011 return;
1032 } 1012 }
1033 1013
@@ -1045,20 +1025,20 @@ qla2x00_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
1045 bsg_job->reply->reply_payload_rcv_len = 1025 bsg_job->reply->reply_payload_rcv_len =
1046 le16_to_cpu(((sts_entry_t *)pkt)->rsp_info_len); 1026 le16_to_cpu(((sts_entry_t *)pkt)->rsp_info_len);
1047 1027
1048 DEBUG2(qla_printk(KERN_WARNING, ha, 1028 ql_log(ql_log_warn, vha, 0x5048,
1049 "scsi(%ld): CT pass-through-%s error " 1029 "CT pass-through-%s error "
1050 "comp_status-status=0x%x total_byte = 0x%x.\n", 1030 "comp_status-status=0x%x total_byte = 0x%x.\n",
1051 vha->host_no, type, comp_status, 1031 type, comp_status,
1052 bsg_job->reply->reply_payload_rcv_len)); 1032 bsg_job->reply->reply_payload_rcv_len);
1053 } else { 1033 } else {
1054 DEBUG2(qla_printk(KERN_WARNING, ha, 1034 ql_log(ql_log_warn, vha, 0x5049,
1055 "scsi(%ld): CT pass-through-%s error " 1035 "CT pass-through-%s error "
1056 "comp_status-status=0x%x.\n", 1036 "comp_status-status=0x%x.\n", type, comp_status);
1057 vha->host_no, type, comp_status));
1058 bsg_job->reply->result = DID_ERROR << 16; 1037 bsg_job->reply->result = DID_ERROR << 16;
1059 bsg_job->reply->reply_payload_rcv_len = 0; 1038 bsg_job->reply->reply_payload_rcv_len = 0;
1060 } 1039 }
1061 DEBUG2(qla2x00_dump_buffer((uint8_t *)pkt, sizeof(*pkt))); 1040 ql_dump_buffer(ql_dbg_async + ql_dbg_buffer, vha, 0x5058,
1041 (uint8_t *)pkt, sizeof(*pkt));
1062 } else { 1042 } else {
1063 bsg_job->reply->result = DID_OK << 16; 1043 bsg_job->reply->result = DID_OK << 16;
1064 bsg_job->reply->reply_payload_rcv_len = 1044 bsg_job->reply->reply_payload_rcv_len =
@@ -1110,9 +1090,8 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
1110 type = "ct pass-through"; 1090 type = "ct pass-through";
1111 break; 1091 break;
1112 default: 1092 default:
1113 qla_printk(KERN_WARNING, ha, 1093 ql_log(ql_log_warn, vha, 0x503e,
1114 "%s: Unrecognized SRB: (%p) type=%d.\n", func, sp, 1094 "Unrecognized SRB: (%p) type=%d.\n", sp, sp_bsg->type);
1115 sp_bsg->type);
1116 return; 1095 return;
1117 } 1096 }
1118 1097
@@ -1132,27 +1111,31 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
1132 bsg_job->reply->reply_payload_rcv_len = 1111 bsg_job->reply->reply_payload_rcv_len =
1133 le16_to_cpu(((struct els_sts_entry_24xx*)pkt)->total_byte_count); 1112 le16_to_cpu(((struct els_sts_entry_24xx*)pkt)->total_byte_count);
1134 1113
1135 DEBUG2(qla_printk(KERN_WARNING, ha, 1114 ql_log(ql_log_info, vha, 0x503f,
1136 "scsi(%ld:0x%x): ELS-CT pass-through-%s error comp_status-status=0x%x " 1115 "ELS-CT pass-through-%s error comp_status-status=0x%x "
1137 "error subcode 1=0x%x error subcode 2=0x%x total_byte = 0x%x.\n", 1116 "error subcode 1=0x%x error subcode 2=0x%x total_byte = 0x%x.\n",
1138 vha->host_no, sp->handle, type, comp_status, fw_status[1], fw_status[2], 1117 type, comp_status, fw_status[1], fw_status[2],
1139 le16_to_cpu(((struct els_sts_entry_24xx*)pkt)->total_byte_count))); 1118 le16_to_cpu(((struct els_sts_entry_24xx *)
1119 pkt)->total_byte_count));
1140 fw_sts_ptr = ((uint8_t*)bsg_job->req->sense) + sizeof(struct fc_bsg_reply); 1120 fw_sts_ptr = ((uint8_t*)bsg_job->req->sense) + sizeof(struct fc_bsg_reply);
1141 memcpy( fw_sts_ptr, fw_status, sizeof(fw_status)); 1121 memcpy( fw_sts_ptr, fw_status, sizeof(fw_status));
1142 } 1122 }
1143 else { 1123 else {
1144 DEBUG2(qla_printk(KERN_WARNING, ha, 1124 ql_log(ql_log_info, vha, 0x5040,
1145 "scsi(%ld:0x%x): ELS-CT pass-through-%s error comp_status-status=0x%x " 1125 "ELS-CT pass-through-%s error comp_status-status=0x%x "
1146 "error subcode 1=0x%x error subcode 2=0x%x.\n", 1126 "error subcode 1=0x%x error subcode 2=0x%x.\n",
1147 vha->host_no, sp->handle, type, comp_status, 1127 type, comp_status,
1148 le16_to_cpu(((struct els_sts_entry_24xx*)pkt)->error_subcode_1), 1128 le16_to_cpu(((struct els_sts_entry_24xx *)
1149 le16_to_cpu(((struct els_sts_entry_24xx*)pkt)->error_subcode_2))); 1129 pkt)->error_subcode_1),
1130 le16_to_cpu(((struct els_sts_entry_24xx *)
1131 pkt)->error_subcode_2));
1150 bsg_job->reply->result = DID_ERROR << 16; 1132 bsg_job->reply->result = DID_ERROR << 16;
1151 bsg_job->reply->reply_payload_rcv_len = 0; 1133 bsg_job->reply->reply_payload_rcv_len = 0;
1152 fw_sts_ptr = ((uint8_t*)bsg_job->req->sense) + sizeof(struct fc_bsg_reply); 1134 fw_sts_ptr = ((uint8_t*)bsg_job->req->sense) + sizeof(struct fc_bsg_reply);
1153 memcpy( fw_sts_ptr, fw_status, sizeof(fw_status)); 1135 memcpy( fw_sts_ptr, fw_status, sizeof(fw_status));
1154 } 1136 }
1155 DEBUG2(qla2x00_dump_buffer((uint8_t *)pkt, sizeof(*pkt))); 1137 ql_dump_buffer(ql_dbg_async + ql_dbg_buffer, vha, 0x5056,
1138 (uint8_t *)pkt, sizeof(*pkt));
1156 } 1139 }
1157 else { 1140 else {
1158 bsg_job->reply->result = DID_OK << 16; 1141 bsg_job->reply->result = DID_OK << 16;
@@ -1201,25 +1184,24 @@ qla24xx_logio_entry(scsi_qla_host_t *vha, struct req_que *req,
1201 data[1] = lio->u.logio.flags & SRB_LOGIN_RETRIED ? 1184 data[1] = lio->u.logio.flags & SRB_LOGIN_RETRIED ?
1202 QLA_LOGIO_LOGIN_RETRIED : 0; 1185 QLA_LOGIO_LOGIN_RETRIED : 0;
1203 if (logio->entry_status) { 1186 if (logio->entry_status) {
1204 DEBUG2(printk(KERN_WARNING 1187 ql_log(ql_log_warn, vha, 0x5034,
1205 "scsi(%ld:%x): Async-%s error entry - " 1188 "Async-%s error entry - "
1206 "portid=%02x%02x%02x entry-status=%x.\n", 1189 "portid=%02x%02x%02x entry-status=%x.\n",
1207 fcport->vha->host_no, sp->handle, type, 1190 type, fcport->d_id.b.domain, fcport->d_id.b.area,
1208 fcport->d_id.b.domain, fcport->d_id.b.area, 1191 fcport->d_id.b.al_pa, logio->entry_status);
1209 fcport->d_id.b.al_pa, logio->entry_status)); 1192 ql_dump_buffer(ql_dbg_async + ql_dbg_buffer, vha, 0x5059,
1210 DEBUG2(qla2x00_dump_buffer((uint8_t *)logio, sizeof(*logio))); 1193 (uint8_t *)logio, sizeof(*logio));
1211 1194
1212 goto logio_done; 1195 goto logio_done;
1213 } 1196 }
1214 1197
1215 if (le16_to_cpu(logio->comp_status) == CS_COMPLETE) { 1198 if (le16_to_cpu(logio->comp_status) == CS_COMPLETE) {
1216 DEBUG2(printk(KERN_DEBUG 1199 ql_dbg(ql_dbg_async, vha, 0x5036,
1217 "scsi(%ld:%x): Async-%s complete - portid=%02x%02x%02x " 1200 "Async-%s complete - portid=%02x%02x%02x "
1218 "iop0=%x.\n", 1201 "iop0=%x.\n",
1219 fcport->vha->host_no, sp->handle, type, 1202 type, fcport->d_id.b.domain, fcport->d_id.b.area,
1220 fcport->d_id.b.domain, fcport->d_id.b.area,
1221 fcport->d_id.b.al_pa, 1203 fcport->d_id.b.al_pa,
1222 le32_to_cpu(logio->io_parameter[0]))); 1204 le32_to_cpu(logio->io_parameter[0]));
1223 1205
1224 data[0] = MBS_COMMAND_COMPLETE; 1206 data[0] = MBS_COMMAND_COMPLETE;
1225 if (ctx->type != SRB_LOGIN_CMD) 1207 if (ctx->type != SRB_LOGIN_CMD)
@@ -1256,14 +1238,14 @@ qla24xx_logio_entry(scsi_qla_host_t *vha, struct req_que *req,
1256 break; 1238 break;
1257 } 1239 }
1258 1240
1259 DEBUG2(printk(KERN_WARNING 1241 ql_dbg(ql_dbg_async, vha, 0x5037,
1260 "scsi(%ld:%x): Async-%s failed - portid=%02x%02x%02x comp=%x " 1242 "Async-%s failed - portid=%02x%02x%02x comp=%x "
1261 "iop0=%x iop1=%x.\n", 1243 "iop0=%x iop1=%x.\n",
1262 fcport->vha->host_no, sp->handle, type, fcport->d_id.b.domain, 1244 type, fcport->d_id.b.domain,
1263 fcport->d_id.b.area, fcport->d_id.b.al_pa, 1245 fcport->d_id.b.area, fcport->d_id.b.al_pa,
1264 le16_to_cpu(logio->comp_status), 1246 le16_to_cpu(logio->comp_status),
1265 le32_to_cpu(logio->io_parameter[0]), 1247 le32_to_cpu(logio->io_parameter[0]),
1266 le32_to_cpu(logio->io_parameter[1]))); 1248 le32_to_cpu(logio->io_parameter[1]));
1267 1249
1268logio_done: 1250logio_done:
1269 lio->done(sp); 1251 lio->done(sp);
@@ -1292,38 +1274,34 @@ qla24xx_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
1292 fcport = sp->fcport; 1274 fcport = sp->fcport;
1293 1275
1294 if (sts->entry_status) { 1276 if (sts->entry_status) {
1295 DEBUG2(printk(KERN_WARNING 1277 ql_log(ql_log_warn, vha, 0x5038,
1296 "scsi(%ld:%x): Async-%s error - entry-status(%x).\n", 1278 "Async-%s error - entry-status(%x).\n",
1297 fcport->vha->host_no, sp->handle, type, 1279 type, sts->entry_status);
1298 sts->entry_status));
1299 } else if (sts->comp_status != __constant_cpu_to_le16(CS_COMPLETE)) { 1280 } else if (sts->comp_status != __constant_cpu_to_le16(CS_COMPLETE)) {
1300 DEBUG2(printk(KERN_WARNING 1281 ql_log(ql_log_warn, vha, 0x5039,
1301 "scsi(%ld:%x): Async-%s error - completion status(%x).\n", 1282 "Async-%s error - completion status(%x).\n",
1302 fcport->vha->host_no, sp->handle, type, 1283 type, sts->comp_status);
1303 sts->comp_status));
1304 } else if (!(le16_to_cpu(sts->scsi_status) & 1284 } else if (!(le16_to_cpu(sts->scsi_status) &
1305 SS_RESPONSE_INFO_LEN_VALID)) { 1285 SS_RESPONSE_INFO_LEN_VALID)) {
1306 DEBUG2(printk(KERN_WARNING 1286 ql_log(ql_log_warn, vha, 0x503a,
1307 "scsi(%ld:%x): Async-%s error - no response info(%x).\n", 1287 "Async-%s error - no response info(%x).\n",
1308 fcport->vha->host_no, sp->handle, type, 1288 type, sts->scsi_status);
1309 sts->scsi_status));
1310 } else if (le32_to_cpu(sts->rsp_data_len) < 4) { 1289 } else if (le32_to_cpu(sts->rsp_data_len) < 4) {
1311 DEBUG2(printk(KERN_WARNING 1290 ql_log(ql_log_warn, vha, 0x503b,
1312 "scsi(%ld:%x): Async-%s error - not enough response(%d).\n", 1291 "Async-%s error - not enough response(%d).\n",
1313 fcport->vha->host_no, sp->handle, type, 1292 type, sts->rsp_data_len);
1314 sts->rsp_data_len));
1315 } else if (sts->data[3]) { 1293 } else if (sts->data[3]) {
1316 DEBUG2(printk(KERN_WARNING 1294 ql_log(ql_log_warn, vha, 0x503c,
1317 "scsi(%ld:%x): Async-%s error - response(%x).\n", 1295 "Async-%s error - response(%x).\n",
1318 fcport->vha->host_no, sp->handle, type, 1296 type, sts->data[3]);
1319 sts->data[3]));
1320 } else { 1297 } else {
1321 error = 0; 1298 error = 0;
1322 } 1299 }
1323 1300
1324 if (error) { 1301 if (error) {
1325 iocb->u.tmf.data = error; 1302 iocb->u.tmf.data = error;
1326 DEBUG2(qla2x00_dump_buffer((uint8_t *)sts, sizeof(*sts))); 1303 ql_dump_buffer(ql_dbg_async + ql_dbg_buffer, vha, 0x5055,
1304 (uint8_t *)sts, sizeof(*sts));
1327 } 1305 }
1328 1306
1329 iocb->done(sp); 1307 iocb->done(sp);
@@ -1360,8 +1338,8 @@ qla2x00_process_response_queue(struct rsp_que *rsp)
1360 } 1338 }
1361 1339
1362 if (pkt->entry_status != 0) { 1340 if (pkt->entry_status != 0) {
1363 DEBUG3(printk(KERN_INFO 1341 ql_log(ql_log_warn, vha, 0x5035,
1364 "scsi(%ld): Process error entry.\n", vha->host_no)); 1342 "Process error entry.\n");
1365 1343
1366 qla2x00_error_entry(vha, rsp, pkt); 1344 qla2x00_error_entry(vha, rsp, pkt);
1367 ((response_t *)pkt)->signature = RESPONSE_PROCESSED; 1345 ((response_t *)pkt)->signature = RESPONSE_PROCESSED;
@@ -1399,10 +1377,10 @@ qla2x00_process_response_queue(struct rsp_que *rsp)
1399 break; 1377 break;
1400 default: 1378 default:
1401 /* Type Not Supported. */ 1379 /* Type Not Supported. */
1402 DEBUG4(printk(KERN_WARNING 1380 ql_log(ql_log_warn, vha, 0x504a,
1403 "scsi(%ld): Received unknown response pkt type %x " 1381 "Received unknown response pkt type %x "
1404 "entry status=%x.\n", 1382 "entry status=%x.\n",
1405 vha->host_no, pkt->entry_type, pkt->entry_status)); 1383 pkt->entry_type, pkt->entry_status);
1406 break; 1384 break;
1407 } 1385 }
1408 ((response_t *)pkt)->signature = RESPONSE_PROCESSED; 1386 ((response_t *)pkt)->signature = RESPONSE_PROCESSED;
@@ -1418,6 +1396,7 @@ static inline void
1418qla2x00_handle_sense(srb_t *sp, uint8_t *sense_data, uint32_t par_sense_len, 1396qla2x00_handle_sense(srb_t *sp, uint8_t *sense_data, uint32_t par_sense_len,
1419 uint32_t sense_len, struct rsp_que *rsp) 1397 uint32_t sense_len, struct rsp_que *rsp)
1420{ 1398{
1399 struct scsi_qla_host *vha = sp->fcport->vha;
1421 struct scsi_cmnd *cp = sp->cmd; 1400 struct scsi_cmnd *cp = sp->cmd;
1422 1401
1423 if (sense_len >= SCSI_SENSE_BUFFERSIZE) 1402 if (sense_len >= SCSI_SENSE_BUFFERSIZE)
@@ -1435,11 +1414,13 @@ qla2x00_handle_sense(srb_t *sp, uint8_t *sense_data, uint32_t par_sense_len,
1435 if (sp->request_sense_length != 0) 1414 if (sp->request_sense_length != 0)
1436 rsp->status_srb = sp; 1415 rsp->status_srb = sp;
1437 1416
1438 DEBUG5(printk("%s(): Check condition Sense data, scsi(%ld:%d:%d:%d) " 1417 ql_dbg(ql_dbg_io, vha, 0x301c,
1439 "cmd=%p\n", __func__, sp->fcport->vha->host_no, 1418 "Check condition Sense data, scsi(%ld:%d:%d:%d) cmd=%p.\n",
1440 cp->device->channel, cp->device->id, cp->device->lun, cp)); 1419 sp->fcport->vha->host_no, cp->device->channel, cp->device->id,
1420 cp->device->lun, cp);
1441 if (sense_len) 1421 if (sense_len)
1442 DEBUG5(qla2x00_dump_buffer(cp->sense_buffer, sense_len)); 1422 ql_dump_buffer(ql_dbg_io + ql_dbg_buffer, vha, 0x302b,
1423 cp->sense_buffer, sense_len);
1443} 1424}
1444 1425
1445struct scsi_dif_tuple { 1426struct scsi_dif_tuple {
@@ -1457,6 +1438,7 @@ struct scsi_dif_tuple {
1457static inline void 1438static inline void
1458qla2x00_handle_dif_error(srb_t *sp, struct sts_entry_24xx *sts24) 1439qla2x00_handle_dif_error(srb_t *sp, struct sts_entry_24xx *sts24)
1459{ 1440{
1441 struct scsi_qla_host *vha = sp->fcport->vha;
1460 struct scsi_cmnd *cmd = sp->cmd; 1442 struct scsi_cmnd *cmd = sp->cmd;
1461 struct scsi_dif_tuple *ep = 1443 struct scsi_dif_tuple *ep =
1462 (struct scsi_dif_tuple *)&sts24->data[20]; 1444 (struct scsi_dif_tuple *)&sts24->data[20];
@@ -1473,15 +1455,15 @@ qla2x00_handle_dif_error(srb_t *sp, struct sts_entry_24xx *sts24)
1473 e_guard = be16_to_cpu(ep->guard); 1455 e_guard = be16_to_cpu(ep->guard);
1474 a_guard = be16_to_cpu(ap->guard); 1456 a_guard = be16_to_cpu(ap->guard);
1475 1457
1476 DEBUG18(printk(KERN_DEBUG 1458 ql_dbg(ql_dbg_io, vha, 0x3023,
1477 "%s(): iocb(s) %p Returned STATUS\n", __func__, sts24)); 1459 "iocb(s) %p Returned STATUS.\n", sts24);
1478 1460
1479 DEBUG18(printk(KERN_ERR "DIF ERROR in cmd 0x%x lba 0x%llx act ref" 1461 ql_dbg(ql_dbg_io, vha, 0x3024,
1462 "DIF ERROR in cmd 0x%x lba 0x%llx act ref"
1480 " tag=0x%x, exp ref_tag=0x%x, act app tag=0x%x, exp app" 1463 " tag=0x%x, exp ref_tag=0x%x, act app tag=0x%x, exp app"
1481 " tag=0x%x, act guard=0x%x, exp guard=0x%x\n", 1464 " tag=0x%x, act guard=0x%x, exp guard=0x%x.\n",
1482 cmd->cmnd[0], (u64)scsi_get_lba(cmd), a_ref_tag, e_ref_tag, 1465 cmd->cmnd[0], (u64)scsi_get_lba(cmd), a_ref_tag, e_ref_tag,
1483 a_app_tag, e_app_tag, a_guard, e_guard)); 1466 a_app_tag, e_app_tag, a_guard, e_guard);
1484
1485 1467
1486 /* check guard */ 1468 /* check guard */
1487 if (e_guard != a_guard) { 1469 if (e_guard != a_guard) {
@@ -1569,9 +1551,8 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
1569 sp = NULL; 1551 sp = NULL;
1570 1552
1571 if (sp == NULL) { 1553 if (sp == NULL) {
1572 qla_printk(KERN_WARNING, ha, 1554 ql_log(ql_log_warn, vha, 0x3017,
1573 "scsi(%ld): Invalid status handle (0x%x).\n", vha->host_no, 1555 "Invalid status handle (0x%x).\n", sts->handle);
1574 sts->handle);
1575 1556
1576 if (IS_QLA82XX(ha)) 1557 if (IS_QLA82XX(ha))
1577 set_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags); 1558 set_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags);
@@ -1582,9 +1563,9 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
1582 } 1563 }
1583 cp = sp->cmd; 1564 cp = sp->cmd;
1584 if (cp == NULL) { 1565 if (cp == NULL) {
1585 qla_printk(KERN_WARNING, ha, 1566 ql_log(ql_log_warn, vha, 0x3018,
1586 "scsi(%ld): Command already returned (0x%x/%p).\n", 1567 "Command already returned (0x%x/%p).\n",
1587 vha->host_no, sts->handle, sp); 1568 sts->handle, sp);
1588 1569
1589 return; 1570 return;
1590 } 1571 }
@@ -1629,10 +1610,9 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
1629 par_sense_len -= rsp_info_len; 1610 par_sense_len -= rsp_info_len;
1630 } 1611 }
1631 if (rsp_info_len > 3 && rsp_info[3]) { 1612 if (rsp_info_len > 3 && rsp_info[3]) {
1632 DEBUG2(qla_printk(KERN_INFO, ha, 1613 ql_log(ql_log_warn, vha, 0x3019,
1633 "scsi(%ld:%d:%d): FCP I/O protocol failure " 1614 "FCP I/O protocol failure (0x%x/0x%x).\n",
1634 "(0x%x/0x%x).\n", vha->host_no, cp->device->id, 1615 rsp_info_len, rsp_info[3]);
1635 cp->device->lun, rsp_info_len, rsp_info[3]));
1636 1616
1637 cp->result = DID_BUS_BUSY << 16; 1617 cp->result = DID_BUS_BUSY << 16;
1638 goto out; 1618 goto out;
@@ -1661,11 +1641,10 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
1661 if (!lscsi_status && 1641 if (!lscsi_status &&
1662 ((unsigned)(scsi_bufflen(cp) - resid) < 1642 ((unsigned)(scsi_bufflen(cp) - resid) <
1663 cp->underflow)) { 1643 cp->underflow)) {
1664 qla_printk(KERN_INFO, ha, 1644 ql_log(ql_log_warn, vha, 0x301a,
1665 "scsi(%ld:%d:%d): Mid-layer underflow " 1645 "Mid-layer underflow "
1666 "detected (0x%x of 0x%x bytes).\n", 1646 "detected (0x%x of 0x%x bytes).\n",
1667 vha->host_no, cp->device->id, 1647 resid, scsi_bufflen(cp));
1668 cp->device->lun, resid, scsi_bufflen(cp));
1669 1648
1670 cp->result = DID_ERROR << 16; 1649 cp->result = DID_ERROR << 16;
1671 break; 1650 break;
@@ -1674,9 +1653,8 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
1674 cp->result = DID_OK << 16 | lscsi_status; 1653 cp->result = DID_OK << 16 | lscsi_status;
1675 1654
1676 if (lscsi_status == SAM_STAT_TASK_SET_FULL) { 1655 if (lscsi_status == SAM_STAT_TASK_SET_FULL) {
1677 DEBUG2(qla_printk(KERN_INFO, ha, 1656 ql_log(ql_log_warn, vha, 0x301b,
1678 "scsi(%ld:%d:%d) QUEUE FULL detected.\n", 1657 "QUEUE FULL detected.\n");
1679 vha->host_no, cp->device->id, cp->device->lun));
1680 break; 1658 break;
1681 } 1659 }
1682 logit = 0; 1660 logit = 0;
@@ -1697,11 +1675,10 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
1697 scsi_set_resid(cp, resid); 1675 scsi_set_resid(cp, resid);
1698 if (scsi_status & SS_RESIDUAL_UNDER) { 1676 if (scsi_status & SS_RESIDUAL_UNDER) {
1699 if (IS_FWI2_CAPABLE(ha) && fw_resid_len != resid_len) { 1677 if (IS_FWI2_CAPABLE(ha) && fw_resid_len != resid_len) {
1700 DEBUG2(qla_printk(KERN_INFO, ha, 1678 ql_log(ql_log_warn, vha, 0x301d,
1701 "scsi(%ld:%d:%d) Dropped frame(s) detected " 1679 "Dropped frame(s) detected "
1702 "(0x%x of 0x%x bytes).\n", vha->host_no, 1680 "(0x%x of 0x%x bytes).\n",
1703 cp->device->id, cp->device->lun, resid, 1681 resid, scsi_bufflen(cp));
1704 scsi_bufflen(cp)));
1705 1682
1706 cp->result = DID_ERROR << 16 | lscsi_status; 1683 cp->result = DID_ERROR << 16 | lscsi_status;
1707 break; 1684 break;
@@ -1710,20 +1687,18 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
1710 if (!lscsi_status && 1687 if (!lscsi_status &&
1711 ((unsigned)(scsi_bufflen(cp) - resid) < 1688 ((unsigned)(scsi_bufflen(cp) - resid) <
1712 cp->underflow)) { 1689 cp->underflow)) {
1713 qla_printk(KERN_INFO, ha, 1690 ql_log(ql_log_warn, vha, 0x301e,
1714 "scsi(%ld:%d:%d): Mid-layer underflow " 1691 "Mid-layer underflow "
1715 "detected (0x%x of 0x%x bytes).\n", 1692 "detected (0x%x of 0x%x bytes).\n",
1716 vha->host_no, cp->device->id, 1693 resid, scsi_bufflen(cp));
1717 cp->device->lun, resid, scsi_bufflen(cp));
1718 1694
1719 cp->result = DID_ERROR << 16; 1695 cp->result = DID_ERROR << 16;
1720 break; 1696 break;
1721 } 1697 }
1722 } else { 1698 } else {
1723 DEBUG2(qla_printk(KERN_INFO, ha, 1699 ql_log(ql_log_warn, vha, 0x301f,
1724 "scsi(%ld:%d:%d) Dropped frame(s) detected (0x%x " 1700 "Dropped frame(s) detected (0x%x "
1725 "of 0x%x bytes).\n", vha->host_no, cp->device->id, 1701 "of 0x%x bytes).\n", resid, scsi_bufflen(cp));
1726 cp->device->lun, resid, scsi_bufflen(cp)));
1727 1702
1728 cp->result = DID_ERROR << 16 | lscsi_status; 1703 cp->result = DID_ERROR << 16 | lscsi_status;
1729 goto check_scsi_status; 1704 goto check_scsi_status;
@@ -1739,10 +1714,8 @@ check_scsi_status:
1739 */ 1714 */
1740 if (lscsi_status != 0) { 1715 if (lscsi_status != 0) {
1741 if (lscsi_status == SAM_STAT_TASK_SET_FULL) { 1716 if (lscsi_status == SAM_STAT_TASK_SET_FULL) {
1742 DEBUG2(qla_printk(KERN_INFO, ha, 1717 ql_log(ql_log_warn, vha, 0x3020,
1743 "scsi(%ld:%d:%d) QUEUE FULL detected.\n", 1718 "QUEUE FULL detected.\n");
1744 vha->host_no, cp->device->id,
1745 cp->device->lun));
1746 logit = 1; 1719 logit = 1;
1747 break; 1720 break;
1748 } 1721 }
@@ -1781,10 +1754,9 @@ check_scsi_status:
1781 break; 1754 break;
1782 } 1755 }
1783 1756
1784 DEBUG2(qla_printk(KERN_INFO, ha, 1757 ql_dbg(ql_dbg_io, vha, 0x3021,
1785 "scsi(%ld:%d:%d) Port down status: port-state=0x%x\n", 1758 "Port down status: port-state=0x%x.\n",
1786 vha->host_no, cp->device->id, cp->device->lun, 1759 atomic_read(&fcport->state));
1787 atomic_read(&fcport->state)));
1788 1760
1789 if (atomic_read(&fcport->state) == FCS_ONLINE) 1761 if (atomic_read(&fcport->state) == FCS_ONLINE)
1790 qla2x00_mark_device_lost(fcport->vha, fcport, 1, 1); 1762 qla2x00_mark_device_lost(fcport->vha, fcport, 1, 1);
@@ -1804,15 +1776,13 @@ check_scsi_status:
1804 1776
1805out: 1777out:
1806 if (logit) 1778 if (logit)
1807 DEBUG2(qla_printk(KERN_INFO, ha, 1779 ql_dbg(ql_dbg_io, vha, 0x3022,
1808 "scsi(%ld:%d:%d) FCP command status: 0x%x-0x%x (0x%x) " 1780 "FCP command status: 0x%x-0x%x (0x%x) "
1809 "portid=%02x%02x%02x oxid=0x%x cdb=%02x%02x%02x len=0x%x " 1781 "oxid=0x%x cdb=%02x%02x%02x len=0x%x "
1810 "rsp_info=0x%x resid=0x%x fw_resid=0x%x\n", vha->host_no, 1782 "rsp_info=0x%x resid=0x%x fw_resid=0x%x.\n",
1811 cp->device->id, cp->device->lun, comp_status, scsi_status, 1783 comp_status, scsi_status, cp->result, ox_id, cp->cmnd[0],
1812 cp->result, fcport->d_id.b.domain, fcport->d_id.b.area, 1784 cp->cmnd[1], cp->cmnd[2], scsi_bufflen(cp), rsp_info_len,
1813 fcport->d_id.b.al_pa, ox_id, cp->cmnd[0], cp->cmnd[1], 1785 resid_len, fw_resid_len);
1814 cp->cmnd[2], scsi_bufflen(cp), rsp_info_len, resid_len,
1815 fw_resid_len));
1816 1786
1817 if (rsp->status_srb == NULL) 1787 if (rsp->status_srb == NULL)
1818 qla2x00_sp_compl(ha, sp); 1788 qla2x00_sp_compl(ha, sp);
@@ -1830,16 +1800,15 @@ qla2x00_status_cont_entry(struct rsp_que *rsp, sts_cont_entry_t *pkt)
1830{ 1800{
1831 uint8_t sense_sz = 0; 1801 uint8_t sense_sz = 0;
1832 struct qla_hw_data *ha = rsp->hw; 1802 struct qla_hw_data *ha = rsp->hw;
1803 struct scsi_qla_host *vha = pci_get_drvdata(ha->pdev);
1833 srb_t *sp = rsp->status_srb; 1804 srb_t *sp = rsp->status_srb;
1834 struct scsi_cmnd *cp; 1805 struct scsi_cmnd *cp;
1835 1806
1836 if (sp != NULL && sp->request_sense_length != 0) { 1807 if (sp != NULL && sp->request_sense_length != 0) {
1837 cp = sp->cmd; 1808 cp = sp->cmd;
1838 if (cp == NULL) { 1809 if (cp == NULL) {
1839 DEBUG2(printk("%s(): Cmd already returned back to OS " 1810 ql_log(ql_log_warn, vha, 0x3025,
1840 "sp=%p.\n", __func__, sp)); 1811 "cmd is NULL: already returned to OS (sp=%p).\n",
1841 qla_printk(KERN_INFO, ha,
1842 "cmd is NULL: already returned to OS (sp=%p)\n",
1843 sp); 1812 sp);
1844 1813
1845 rsp->status_srb = NULL; 1814 rsp->status_srb = NULL;
@@ -1856,7 +1825,8 @@ qla2x00_status_cont_entry(struct rsp_que *rsp, sts_cont_entry_t *pkt)
1856 if (IS_FWI2_CAPABLE(ha)) 1825 if (IS_FWI2_CAPABLE(ha))
1857 host_to_fcp_swap(pkt->data, sizeof(pkt->data)); 1826 host_to_fcp_swap(pkt->data, sizeof(pkt->data));
1858 memcpy(sp->request_sense_ptr, pkt->data, sense_sz); 1827 memcpy(sp->request_sense_ptr, pkt->data, sense_sz);
1859 DEBUG5(qla2x00_dump_buffer(sp->request_sense_ptr, sense_sz)); 1828 ql_dump_buffer(ql_dbg_io + ql_dbg_buffer, vha, 0x302c,
1829 sp->request_sense_ptr, sense_sz);
1860 1830
1861 sp->request_sense_ptr += sense_sz; 1831 sp->request_sense_ptr += sense_sz;
1862 sp->request_sense_length -= sense_sz; 1832 sp->request_sense_length -= sense_sz;
@@ -1882,21 +1852,25 @@ qla2x00_error_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, sts_entry_t *pkt)
1882 uint32_t handle = LSW(pkt->handle); 1852 uint32_t handle = LSW(pkt->handle);
1883 uint16_t que = MSW(pkt->handle); 1853 uint16_t que = MSW(pkt->handle);
1884 struct req_que *req = ha->req_q_map[que]; 1854 struct req_que *req = ha->req_q_map[que];
1885#if defined(QL_DEBUG_LEVEL_2) 1855
1886 if (pkt->entry_status & RF_INV_E_ORDER) 1856 if (pkt->entry_status & RF_INV_E_ORDER)
1887 qla_printk(KERN_ERR, ha, "%s: Invalid Entry Order\n", __func__); 1857 ql_dbg(ql_dbg_async, vha, 0x502a,
1858 "Invalid Entry Order.\n");
1888 else if (pkt->entry_status & RF_INV_E_COUNT) 1859 else if (pkt->entry_status & RF_INV_E_COUNT)
1889 qla_printk(KERN_ERR, ha, "%s: Invalid Entry Count\n", __func__); 1860 ql_dbg(ql_dbg_async, vha, 0x502b,
1861 "Invalid Entry Count.\n");
1890 else if (pkt->entry_status & RF_INV_E_PARAM) 1862 else if (pkt->entry_status & RF_INV_E_PARAM)
1891 qla_printk(KERN_ERR, ha, 1863 ql_dbg(ql_dbg_async, vha, 0x502c,
1892 "%s: Invalid Entry Parameter\n", __func__); 1864 "Invalid Entry Parameter.\n");
1893 else if (pkt->entry_status & RF_INV_E_TYPE) 1865 else if (pkt->entry_status & RF_INV_E_TYPE)
1894 qla_printk(KERN_ERR, ha, "%s: Invalid Entry Type\n", __func__); 1866 ql_dbg(ql_dbg_async, vha, 0x502d,
1867 "Invalid Entry Type.\n");
1895 else if (pkt->entry_status & RF_BUSY) 1868 else if (pkt->entry_status & RF_BUSY)
1896 qla_printk(KERN_ERR, ha, "%s: Busy\n", __func__); 1869 ql_dbg(ql_dbg_async, vha, 0x502e,
1870 "Busy.\n");
1897 else 1871 else
1898 qla_printk(KERN_ERR, ha, "%s: UNKNOWN flag error\n", __func__); 1872 ql_dbg(ql_dbg_async, vha, 0x502f,
1899#endif 1873 "UNKNOWN flag error.\n");
1900 1874
1901 /* Validate handle. */ 1875 /* Validate handle. */
1902 if (handle < MAX_OUTSTANDING_COMMANDS) 1876 if (handle < MAX_OUTSTANDING_COMMANDS)
@@ -1923,10 +1897,8 @@ qla2x00_error_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, sts_entry_t *pkt)
1923 } else if (pkt->entry_type == COMMAND_A64_TYPE || pkt->entry_type == 1897 } else if (pkt->entry_type == COMMAND_A64_TYPE || pkt->entry_type ==
1924 COMMAND_TYPE || pkt->entry_type == COMMAND_TYPE_7 1898 COMMAND_TYPE || pkt->entry_type == COMMAND_TYPE_7
1925 || pkt->entry_type == COMMAND_TYPE_6) { 1899 || pkt->entry_type == COMMAND_TYPE_6) {
1926 DEBUG2(printk("scsi(%ld): Error entry - invalid handle\n", 1900 ql_log(ql_log_warn, vha, 0x5030,
1927 vha->host_no)); 1901 "Error entry - invalid handle.\n");
1928 qla_printk(KERN_WARNING, ha,
1929 "Error entry - invalid handle\n");
1930 1902
1931 if (IS_QLA82XX(ha)) 1903 if (IS_QLA82XX(ha))
1932 set_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags); 1904 set_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags);
@@ -1960,11 +1932,11 @@ qla24xx_mbx_completion(scsi_qla_host_t *vha, uint16_t mb0)
1960 } 1932 }
1961 1933
1962 if (ha->mcp) { 1934 if (ha->mcp) {
1963 DEBUG3(printk("%s(%ld): Got mailbox completion. cmd=%x.\n", 1935 ql_dbg(ql_dbg_async, vha, 0x504d,
1964 __func__, vha->host_no, ha->mcp->mb[0])); 1936 "Got mailbox completion. cmd=%x.\n", ha->mcp->mb[0]);
1965 } else { 1937 } else {
1966 DEBUG2_3(printk("%s(%ld): MBX pointer ERROR!\n", 1938 ql_dbg(ql_dbg_async, vha, 0x504e,
1967 __func__, vha->host_no)); 1939 "MBX pointer ERROR.\n");
1968 } 1940 }
1969} 1941}
1970 1942
@@ -1993,8 +1965,8 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
1993 } 1965 }
1994 1966
1995 if (pkt->entry_status != 0) { 1967 if (pkt->entry_status != 0) {
1996 DEBUG3(printk(KERN_INFO 1968 ql_dbg(ql_dbg_async, vha, 0x5029,
1997 "scsi(%ld): Process error entry.\n", vha->host_no)); 1969 "Process error entry.\n");
1998 1970
1999 qla2x00_error_entry(vha, rsp, (sts_entry_t *) pkt); 1971 qla2x00_error_entry(vha, rsp, (sts_entry_t *) pkt);
2000 ((response_t *)pkt)->signature = RESPONSE_PROCESSED; 1972 ((response_t *)pkt)->signature = RESPONSE_PROCESSED;
@@ -2030,10 +2002,10 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
2030 break; 2002 break;
2031 default: 2003 default:
2032 /* Type Not Supported. */ 2004 /* Type Not Supported. */
2033 DEBUG4(printk(KERN_WARNING 2005 ql_dbg(ql_dbg_async, vha, 0x5042,
2034 "scsi(%ld): Received unknown response pkt type %x " 2006 "Received unknown response pkt type %x "
2035 "entry status=%x.\n", 2007 "entry status=%x.\n",
2036 vha->host_no, pkt->entry_type, pkt->entry_status)); 2008 pkt->entry_type, pkt->entry_status);
2037 break; 2009 break;
2038 } 2010 }
2039 ((response_t *)pkt)->signature = RESPONSE_PROCESSED; 2011 ((response_t *)pkt)->signature = RESPONSE_PROCESSED;
@@ -2088,7 +2060,8 @@ qla2xxx_check_risc_status(scsi_qla_host_t *vha)
2088 2060
2089next_test: 2061next_test:
2090 if (RD_REG_DWORD(&reg->iobase_c8) & BIT_3) 2062 if (RD_REG_DWORD(&reg->iobase_c8) & BIT_3)
2091 qla_printk(KERN_INFO, ha, "Additional code -- 0x55AA.\n"); 2063 ql_log(ql_log_info, vha, 0x504c,
2064 "Additional code -- 0x55AA.\n");
2092 2065
2093done: 2066done:
2094 WRT_REG_DWORD(&reg->iobase_window, 0x0000); 2067 WRT_REG_DWORD(&reg->iobase_window, 0x0000);
@@ -2121,7 +2094,7 @@ qla24xx_intr_handler(int irq, void *dev_id)
2121 rsp = (struct rsp_que *) dev_id; 2094 rsp = (struct rsp_que *) dev_id;
2122 if (!rsp) { 2095 if (!rsp) {
2123 printk(KERN_INFO 2096 printk(KERN_INFO
2124 "%s(): NULL response queue pointer\n", __func__); 2097 "%s(): NULL response queue pointer.\n", __func__);
2125 return IRQ_NONE; 2098 return IRQ_NONE;
2126 } 2099 }
2127 2100
@@ -2142,8 +2115,9 @@ qla24xx_intr_handler(int irq, void *dev_id)
2142 2115
2143 hccr = RD_REG_DWORD(&reg->hccr); 2116 hccr = RD_REG_DWORD(&reg->hccr);
2144 2117
2145 qla_printk(KERN_INFO, ha, "RISC paused -- HCCR=%x, " 2118 ql_log(ql_log_warn, vha, 0x504b,
2146 "Dumping firmware!\n", hccr); 2119 "RISC paused -- HCCR=%x, Dumping firmware.\n",
2120 hccr);
2147 2121
2148 qla2xxx_check_risc_status(vha); 2122 qla2xxx_check_risc_status(vha);
2149 2123
@@ -2174,9 +2148,8 @@ qla24xx_intr_handler(int irq, void *dev_id)
2174 qla24xx_process_response_queue(vha, rsp); 2148 qla24xx_process_response_queue(vha, rsp);
2175 break; 2149 break;
2176 default: 2150 default:
2177 DEBUG2(printk("scsi(%ld): Unrecognized interrupt type " 2151 ql_dbg(ql_dbg_async, vha, 0x504f,
2178 "(%d).\n", 2152 "Unrecognized interrupt type (%d).\n", stat * 0xff);
2179 vha->host_no, stat & 0xff));
2180 break; 2153 break;
2181 } 2154 }
2182 WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_INT); 2155 WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_INT);
@@ -2205,7 +2178,7 @@ qla24xx_msix_rsp_q(int irq, void *dev_id)
2205 rsp = (struct rsp_que *) dev_id; 2178 rsp = (struct rsp_que *) dev_id;
2206 if (!rsp) { 2179 if (!rsp) {
2207 printk(KERN_INFO 2180 printk(KERN_INFO
2208 "%s(): NULL response queue pointer\n", __func__); 2181 "%s(): NULL response queue pointer.\n", __func__);
2209 return IRQ_NONE; 2182 return IRQ_NONE;
2210 } 2183 }
2211 ha = rsp->hw; 2184 ha = rsp->hw;
@@ -2235,7 +2208,7 @@ qla25xx_msix_rsp_q(int irq, void *dev_id)
2235 rsp = (struct rsp_que *) dev_id; 2208 rsp = (struct rsp_que *) dev_id;
2236 if (!rsp) { 2209 if (!rsp) {
2237 printk(KERN_INFO 2210 printk(KERN_INFO
2238 "%s(): NULL response queue pointer\n", __func__); 2211 "%s(): NULL response queue pointer.\n", __func__);
2239 return IRQ_NONE; 2212 return IRQ_NONE;
2240 } 2213 }
2241 ha = rsp->hw; 2214 ha = rsp->hw;
@@ -2268,8 +2241,8 @@ qla24xx_msix_default(int irq, void *dev_id)
2268 2241
2269 rsp = (struct rsp_que *) dev_id; 2242 rsp = (struct rsp_que *) dev_id;
2270 if (!rsp) { 2243 if (!rsp) {
2271 DEBUG(printk( 2244 printk(KERN_INFO
2272 "%s(): NULL response queue pointer\n", __func__)); 2245 "%s(): NULL response queue pointer.\n", __func__);
2273 return IRQ_NONE; 2246 return IRQ_NONE;
2274 } 2247 }
2275 ha = rsp->hw; 2248 ha = rsp->hw;
@@ -2286,8 +2259,9 @@ qla24xx_msix_default(int irq, void *dev_id)
2286 2259
2287 hccr = RD_REG_DWORD(&reg->hccr); 2260 hccr = RD_REG_DWORD(&reg->hccr);
2288 2261
2289 qla_printk(KERN_INFO, ha, "RISC paused -- HCCR=%x, " 2262 ql_log(ql_log_info, vha, 0x5050,
2290 "Dumping firmware!\n", hccr); 2263 "RISC paused -- HCCR=%x, Dumping firmware.\n",
2264 hccr);
2291 2265
2292 qla2xxx_check_risc_status(vha); 2266 qla2xxx_check_risc_status(vha);
2293 2267
@@ -2318,9 +2292,8 @@ qla24xx_msix_default(int irq, void *dev_id)
2318 qla24xx_process_response_queue(vha, rsp); 2292 qla24xx_process_response_queue(vha, rsp);
2319 break; 2293 break;
2320 default: 2294 default:
2321 DEBUG2(printk("scsi(%ld): Unrecognized interrupt type " 2295 ql_dbg(ql_dbg_async, vha, 0x5051,
2322 "(%d).\n", 2296 "Unrecognized interrupt type (%d).\n", stat & 0xff);
2323 vha->host_no, stat & 0xff));
2324 break; 2297 break;
2325 } 2298 }
2326 WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_INT); 2299 WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_INT);
@@ -2358,6 +2331,7 @@ qla24xx_disable_msix(struct qla_hw_data *ha)
2358{ 2331{
2359 int i; 2332 int i;
2360 struct qla_msix_entry *qentry; 2333 struct qla_msix_entry *qentry;
2334 scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);
2361 2335
2362 for (i = 0; i < ha->msix_count; i++) { 2336 for (i = 0; i < ha->msix_count; i++) {
2363 qentry = &ha->msix_entries[i]; 2337 qentry = &ha->msix_entries[i];
@@ -2368,6 +2342,8 @@ qla24xx_disable_msix(struct qla_hw_data *ha)
2368 kfree(ha->msix_entries); 2342 kfree(ha->msix_entries);
2369 ha->msix_entries = NULL; 2343 ha->msix_entries = NULL;
2370 ha->flags.msix_enabled = 0; 2344 ha->flags.msix_enabled = 0;
2345 ql_dbg(ql_dbg_init, vha, 0x0042,
2346 "Disabled the MSI.\n");
2371} 2347}
2372 2348
2373static int 2349static int
@@ -2377,11 +2353,15 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
2377 int i, ret; 2353 int i, ret;
2378 struct msix_entry *entries; 2354 struct msix_entry *entries;
2379 struct qla_msix_entry *qentry; 2355 struct qla_msix_entry *qentry;
2356 scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);
2380 2357
2381 entries = kzalloc(sizeof(struct msix_entry) * ha->msix_count, 2358 entries = kzalloc(sizeof(struct msix_entry) * ha->msix_count,
2382 GFP_KERNEL); 2359 GFP_KERNEL);
2383 if (!entries) 2360 if (!entries) {
2361 ql_log(ql_log_warn, vha, 0x00bc,
2362 "Failed to allocate memory for msix_entry.\n");
2384 return -ENOMEM; 2363 return -ENOMEM;
2364 }
2385 2365
2386 for (i = 0; i < ha->msix_count; i++) 2366 for (i = 0; i < ha->msix_count; i++)
2387 entries[i].entry = i; 2367 entries[i].entry = i;
@@ -2391,16 +2371,18 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
2391 if (ret < MIN_MSIX_COUNT) 2371 if (ret < MIN_MSIX_COUNT)
2392 goto msix_failed; 2372 goto msix_failed;
2393 2373
2394 qla_printk(KERN_WARNING, ha, 2374 ql_log(ql_log_warn, vha, 0x00c6,
2395 "MSI-X: Failed to enable support -- %d/%d\n" 2375 "MSI-X: Failed to enable support "
2396 " Retry with %d vectors\n", ha->msix_count, ret, ret); 2376 "-- %d/%d\n Retry with %d vectors.\n",
2377 ha->msix_count, ret, ret);
2397 ha->msix_count = ret; 2378 ha->msix_count = ret;
2398 ret = pci_enable_msix(ha->pdev, entries, ha->msix_count); 2379 ret = pci_enable_msix(ha->pdev, entries, ha->msix_count);
2399 if (ret) { 2380 if (ret) {
2400msix_failed: 2381msix_failed:
2401 qla_printk(KERN_WARNING, ha, "MSI-X: Failed to enable" 2382 ql_log(ql_log_fatal, vha, 0x00c7,
2402 " support, giving up -- %d/%d\n", 2383 "MSI-X: Failed to enable support, "
2403 ha->msix_count, ret); 2384 "giving up -- %d/%d.\n",
2385 ha->msix_count, ret);
2404 goto msix_out; 2386 goto msix_out;
2405 } 2387 }
2406 ha->max_rsp_queues = ha->msix_count - 1; 2388 ha->max_rsp_queues = ha->msix_count - 1;
@@ -2408,6 +2390,8 @@ msix_failed:
2408 ha->msix_entries = kzalloc(sizeof(struct qla_msix_entry) * 2390 ha->msix_entries = kzalloc(sizeof(struct qla_msix_entry) *
2409 ha->msix_count, GFP_KERNEL); 2391 ha->msix_count, GFP_KERNEL);
2410 if (!ha->msix_entries) { 2392 if (!ha->msix_entries) {
2393 ql_log(ql_log_fatal, vha, 0x00c8,
2394 "Failed to allocate memory for ha->msix_entries.\n");
2411 ret = -ENOMEM; 2395 ret = -ENOMEM;
2412 goto msix_out; 2396 goto msix_out;
2413 } 2397 }
@@ -2434,9 +2418,9 @@ msix_failed:
2434 0, msix_entries[i].name, rsp); 2418 0, msix_entries[i].name, rsp);
2435 } 2419 }
2436 if (ret) { 2420 if (ret) {
2437 qla_printk(KERN_WARNING, ha, 2421 ql_log(ql_log_fatal, vha, 0x00cb,
2438 "MSI-X: Unable to register handler -- %x/%d.\n", 2422 "MSI-X: unable to register handler -- %x/%d.\n",
2439 qentry->vector, ret); 2423 qentry->vector, ret);
2440 qla24xx_disable_msix(ha); 2424 qla24xx_disable_msix(ha);
2441 ha->mqenable = 0; 2425 ha->mqenable = 0;
2442 goto msix_out; 2426 goto msix_out;
@@ -2449,6 +2433,12 @@ msix_failed:
2449 /* Enable MSI-X vector for response queue update for queue 0 */ 2433 /* Enable MSI-X vector for response queue update for queue 0 */
2450 if (ha->mqiobase && (ha->max_rsp_queues > 1 || ha->max_req_queues > 1)) 2434 if (ha->mqiobase && (ha->max_rsp_queues > 1 || ha->max_req_queues > 1))
2451 ha->mqenable = 1; 2435 ha->mqenable = 1;
2436 ql_dbg(ql_dbg_multiq, vha, 0xc005,
2437 "mqiobase=%p, max_rsp_queues=%d, max_req_queues=%d.\n",
2438 ha->mqiobase, ha->max_rsp_queues, ha->max_req_queues);
2439 ql_dbg(ql_dbg_init, vha, 0x0055,
2440 "mqiobase=%p, max_rsp_queues=%d, max_req_queues=%d.\n",
2441 ha->mqiobase, ha->max_rsp_queues, ha->max_req_queues);
2452 2442
2453msix_out: 2443msix_out:
2454 kfree(entries); 2444 kfree(entries);
@@ -2460,6 +2450,7 @@ qla2x00_request_irqs(struct qla_hw_data *ha, struct rsp_que *rsp)
2460{ 2450{
2461 int ret; 2451 int ret;
2462 device_reg_t __iomem *reg = ha->iobase; 2452 device_reg_t __iomem *reg = ha->iobase;
2453 scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);
2463 2454
2464 /* If possible, enable MSI-X. */ 2455 /* If possible, enable MSI-X. */
2465 if (!IS_QLA2432(ha) && !IS_QLA2532(ha) && 2456 if (!IS_QLA2432(ha) && !IS_QLA2532(ha) &&
@@ -2470,30 +2461,30 @@ qla2x00_request_irqs(struct qla_hw_data *ha, struct rsp_que *rsp)
2470 (ha->pdev->subsystem_device == 0x7040 || 2461 (ha->pdev->subsystem_device == 0x7040 ||
2471 ha->pdev->subsystem_device == 0x7041 || 2462 ha->pdev->subsystem_device == 0x7041 ||
2472 ha->pdev->subsystem_device == 0x1705)) { 2463 ha->pdev->subsystem_device == 0x1705)) {
2473 DEBUG2(qla_printk(KERN_WARNING, ha, 2464 ql_log(ql_log_warn, vha, 0x0034,
2474 "MSI-X: Unsupported ISP2432 SSVID/SSDID (0x%X,0x%X).\n", 2465 "MSI-X: Unsupported ISP 2432 SSVID/SSDID (0x%X,0x%X).\n",
2475 ha->pdev->subsystem_vendor, 2466 ha->pdev->subsystem_vendor,
2476 ha->pdev->subsystem_device)); 2467 ha->pdev->subsystem_device);
2477 goto skip_msi; 2468 goto skip_msi;
2478 } 2469 }
2479 2470
2480 if (IS_QLA2432(ha) && (ha->pdev->revision < QLA_MSIX_CHIP_REV_24XX || 2471 if (IS_QLA2432(ha) && (ha->pdev->revision < QLA_MSIX_CHIP_REV_24XX ||
2481 !QLA_MSIX_FW_MODE_1(ha->fw_attributes))) { 2472 !QLA_MSIX_FW_MODE_1(ha->fw_attributes))) {
2482 DEBUG2(qla_printk(KERN_WARNING, ha, 2473 ql_log(ql_log_warn, vha, 0x0035,
2483 "MSI-X: Unsupported ISP2432 (0x%X, 0x%X).\n", 2474 "MSI-X; Unsupported ISP2432 (0x%X, 0x%X).\n",
2484 ha->pdev->revision, ha->fw_attributes)); 2475 ha->pdev->revision, ha->fw_attributes);
2485 goto skip_msix; 2476 goto skip_msix;
2486 } 2477 }
2487 2478
2488 ret = qla24xx_enable_msix(ha, rsp); 2479 ret = qla24xx_enable_msix(ha, rsp);
2489 if (!ret) { 2480 if (!ret) {
2490 DEBUG2(qla_printk(KERN_INFO, ha, 2481 ql_dbg(ql_dbg_init, vha, 0x0036,
2491 "MSI-X: Enabled (0x%X, 0x%X).\n", ha->chip_revision, 2482 "MSI-X: Enabled (0x%X, 0x%X).\n",
2492 ha->fw_attributes)); 2483 ha->chip_revision, ha->fw_attributes);
2493 goto clear_risc_ints; 2484 goto clear_risc_ints;
2494 } 2485 }
2495 qla_printk(KERN_WARNING, ha, 2486 ql_log(ql_log_info, vha, 0x0037,
2496 "MSI-X: Falling back-to MSI mode -- %d.\n", ret); 2487 "MSI-X Falling back-to MSI mode -%d.\n", ret);
2497skip_msix: 2488skip_msix:
2498 2489
2499 if (!IS_QLA24XX(ha) && !IS_QLA2532(ha) && !IS_QLA8432(ha) && 2490 if (!IS_QLA24XX(ha) && !IS_QLA2532(ha) && !IS_QLA8432(ha) &&
@@ -2502,18 +2493,19 @@ skip_msix:
2502 2493
2503 ret = pci_enable_msi(ha->pdev); 2494 ret = pci_enable_msi(ha->pdev);
2504 if (!ret) { 2495 if (!ret) {
2505 DEBUG2(qla_printk(KERN_INFO, ha, "MSI: Enabled.\n")); 2496 ql_dbg(ql_dbg_init, vha, 0x0038,
2497 "MSI: Enabled.\n");
2506 ha->flags.msi_enabled = 1; 2498 ha->flags.msi_enabled = 1;
2507 } else 2499 } else
2508 qla_printk(KERN_WARNING, ha, 2500 ql_log(ql_log_warn, vha, 0x0039,
2509 "MSI-X: Falling back-to INTa mode -- %d.\n", ret); 2501 "MSI-X; Falling back-to INTa mode -- %d.\n", ret);
2510skip_msi: 2502skip_msi:
2511 2503
2512 ret = request_irq(ha->pdev->irq, ha->isp_ops->intr_handler, 2504 ret = request_irq(ha->pdev->irq, ha->isp_ops->intr_handler,
2513 ha->flags.msi_enabled ? 0 : IRQF_SHARED, 2505 ha->flags.msi_enabled ? 0 : IRQF_SHARED,
2514 QLA2XXX_DRIVER_NAME, rsp); 2506 QLA2XXX_DRIVER_NAME, rsp);
2515 if (ret) { 2507 if (ret) {
2516 qla_printk(KERN_WARNING, ha, 2508 ql_log(ql_log_warn, vha, 0x003a,
2517 "Failed to reserve interrupt %d already in use.\n", 2509 "Failed to reserve interrupt %d already in use.\n",
2518 ha->pdev->irq); 2510 ha->pdev->irq);
2519 goto fail; 2511 goto fail;
@@ -2563,13 +2555,14 @@ int qla25xx_request_irq(struct rsp_que *rsp)
2563 struct qla_hw_data *ha = rsp->hw; 2555 struct qla_hw_data *ha = rsp->hw;
2564 struct qla_init_msix_entry *intr = &msix_entries[2]; 2556 struct qla_init_msix_entry *intr = &msix_entries[2];
2565 struct qla_msix_entry *msix = rsp->msix; 2557 struct qla_msix_entry *msix = rsp->msix;
2558 scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);
2566 int ret; 2559 int ret;
2567 2560
2568 ret = request_irq(msix->vector, intr->handler, 0, intr->name, rsp); 2561 ret = request_irq(msix->vector, intr->handler, 0, intr->name, rsp);
2569 if (ret) { 2562 if (ret) {
2570 qla_printk(KERN_WARNING, ha, 2563 ql_log(ql_log_fatal, vha, 0x00e6,
2571 "MSI-X: Unable to register handler -- %x/%d.\n", 2564 "MSI-X: Unable to register handler -- %x/%d.\n",
2572 msix->vector, ret); 2565 msix->vector, ret);
2573 return ret; 2566 return ret;
2574 } 2567 }
2575 msix->have_irq = 1; 2568 msix->have_irq = 1;