11 #include <linux/slab.h>
17 static void qla2x00_process_completed_request(
struct scsi_qla_host *,
46 rsp = (
struct rsp_que *) dev_id;
49 "%s: NULL response queue pointer.\n", __func__);
58 vha = pci_get_drvdata(ha->
pdev);
59 for (iter = 50; iter--; ) {
62 if (pci_channel_offline(ha->
pdev))
85 if (mb[0] > 0x3fff && mb[0] < 0x8000) {
86 qla2x00_mbx_completion(vha, mb[0]);
88 }
else if (mb[0] > 0x7fff && mb[0] < 0xc000) {
96 "Unrecognized interrupt type (%d).\n",
109 spin_unlock_irqrestore(&ha->hardware_lock, flags);
143 rsp = (
struct rsp_que *) dev_id;
146 "%s: NULL response queue pointer.\n", __func__);
155 vha = pci_get_drvdata(ha->
pdev);
156 for (iter = 50; iter--; ) {
165 "Parity error -- HCCR=%x, Dumping "
166 "firmware.\n", hccr);
169 "RISC paused -- HCCR=%x, Dumping "
170 "firmware.\n", hccr);
186 switch (stat & 0xff) {
191 qla2x00_mbx_completion(vha,
MSW(stat));
220 "Unrecognized interrupt type (%d).\n", stat & 0xff);
226 spin_unlock_irqrestore(&ha->hardware_lock, flags);
259 ha->
flags.mbox_int = 1;
264 for (cnt = 1; cnt < ha->
mbx_count; cnt++) {
267 if ((cnt == 4 || cnt == 5) && (mboxes &
BIT_0))
269 else if (mboxes & BIT_0)
280 static char *
event[] =
281 {
"Complete",
"Request Notification",
"Time Extension" };
293 "Inter-Driver Communication %s -- "
294 "%04x %04x %04x %04x %04x %04x %04x.\n",
295 event[aen & 0xff], mb[0], mb[1], mb[2], mb[3],
296 mb[4], mb[5], mb[6]);
298 vha->
hw->flags.idc_compl_status = 1;
299 if (vha->
hw->notify_dcbx_comp)
304 timeout = (descr >> 8) & 0xf;
309 "%lu Inter-Driver Communication %s -- ACK timeout=%d.\n",
315 "IDC failed to post ACK.\n");
322 static char *link_speeds[] = {
"1",
"2",
"?",
"4",
"8",
"16",
"10"};
327 link_speed = link_speeds[0];
328 else if (fw_speed == 0x13)
329 link_speed = link_speeds[6];
334 link_speeds[fw_speed];
357 "mb[1] = 0x%x PH-status1: mb[2] = 0x%x PH-status1: mb[6] = 0x%x.\n",
358 mb[0], mb[1], mb[2], mb[6]);
360 "PH-status2: mb[7] = 0x%x Device-State: mb[4] = 0x%x "
361 "Drv-Presence: mb[5] = 0x%x.\n", mb[3], mb[7], mb[4], mb[5]);
365 ha->
flags.nic_core_hung = 1;
367 "83XX: F/W Error Reported: Check if reset required.\n");
370 uint32_t protocol_engine_id, fw_err_code, err_level;
385 protocol_engine_id = (mb[2] & 0xff);
386 fw_err_code = (((mb[2] & 0xff00) >> 8) |
387 ((mb[6] & 0x1fff) << 8));
388 err_level = ((mb[6] & 0xe000) >> 13);
390 "Register: protocol_engine_id=0x%x "
391 "fw_err_code=0x%x err_level=0x%x.\n",
392 protocol_engine_id, fw_err_code, err_level);
394 "Register: 0x%x%x.\n", mb[7], mb[3]);
397 "Not a fatal error, f/w has recovered "
401 "Recoverable Fatal error: Chip reset "
407 "Unrecoverable Fatal error: Set FAILED "
408 "state, reboot required.\n");
415 uint16_t peg_fw_state, nw_interface_link_up;
416 uint16_t nw_interface_signal_detect, sfp_status;
417 uint16_t htbt_counter, htbt_monitor_enable;
418 uint16_t sfp_additonal_info, sfp_multirate;
452 peg_fw_state = (mb[2] & 0x00ff);
453 nw_interface_link_up = ((mb[2] & 0x0100) >> 8);
454 nw_interface_signal_detect = ((mb[2] & 0x0200) >> 9);
455 sfp_status = ((mb[2] & 0x0c00) >> 10);
456 htbt_counter = ((mb[2] & 0x7000) >> 12);
457 htbt_monitor_enable = ((mb[2] & 0x8000) >> 15);
458 sfp_additonal_info = (mb[6] & 0x0003);
459 sfp_multirate = ((mb[6] & 0x0004) >> 2);
460 sfp_tx_fault = ((mb[6] & 0x0008) >> 3);
461 link_speed = ((mb[6] & 0x0070) >> 4);
462 dcbx_status = ((mb[6] & 0x7000) >> 12);
465 "Peg-to-Fc Status Register:\n"
466 "peg_fw_state=0x%x, nw_interface_link_up=0x%x, "
467 "nw_interface_signal_detect=0x%x"
468 "\nsfp_statis=0x%x.\n ", peg_fw_state,
469 nw_interface_link_up, nw_interface_signal_detect,
472 "htbt_counter=0x%x, htbt_monitor_enable=0x%x, "
473 "sfp_additonal_info=0x%x, sfp_multirate=0x%x.\n ",
474 htbt_counter, htbt_monitor_enable,
475 sfp_additonal_info, sfp_multirate);
477 "sfp_tx_fault=0x%x, link_state=0x%x, "
478 "dcbx_status=0x%x.\n", sfp_tx_fault, link_speed,
486 "Heartbeat Failure encountered, chip reset "
495 "IDC Device-State changed = 0x%x.\n", mb[4]);
576 if (!vha->
flags.online)
579 for (cnt = 0; cnt < handle_cnt; cnt++)
580 qla2x00_process_completed_request(vha, rsp->
req,
586 "Asynchronous RESET.\n");
595 "ISP System Error - mbx1=%xh mbx2=%xh mbx3=%xh "
596 "mbx7=%xh.\n", mb[1], mb[2], mb[3], mbx);
601 if (mb[1] == 0 && mb[2] == 0) {
603 "Unrecoverable Hardware Error: adapter "
604 "marked OFFLINE!\n");
605 vha->
flags.online = 0;
615 }
else if (mb[1] == 0) {
617 "Unrecoverable Hardware Error: adapter marked "
619 vha->
flags.online = 0;
627 "ISP Request Transfer Error (%x).\n", mb[1]);
634 "ISP Response Transfer Error.\n");
641 "Asynchronous WAKEUP_THRES.\n");
646 "LIP occurred (%x).\n", mb[1]);
662 vha->
flags.management_server_logged_in = 0;
673 "LOOP UP detected (%s Gbps).\n",
676 vha->
flags.management_server_logged_in = 0;
685 "LOOP DOWN detected (%x %x %x %x).\n",
686 mb[1], mb[2], mb[3], mbx);
700 vha->
flags.management_server_logged_in = 0;
707 "LIP reset occurred (%x).\n", mb[1]);
723 vha->
flags.management_server_logged_in = 0;
734 "DCBX Completed -- %04x %04x %04x.\n",
735 mb[1], mb[2], mb[3]);
741 "Asynchronous P2P MODE received.\n");
766 ha->
flags.gpsc_supported = 1;
767 vha->
flags.management_server_logged_in = 0;
775 "Configuration change detected: value=%x.\n", mb[1]);
811 ((mb[1] == 0xffff && (mb[3] & 0xff) != 0xff) ||
812 (mb[1] != 0xffff)) && vha->
vp_idx != (mb[3] & 0xff))
816 if (mb[1] == 0xffff && mb[2] == 0x7) {
818 "Port unavailable %04x %04x %04x.\n",
819 mb[1], mb[2], mb[3]);
821 "Link is offline.\n");
838 vha->
flags.management_server_logged_in = 0;
849 if (mb[1] != 0xffff || (mb[2] != 0x6 && mb[2] != 0x4)) {
851 "Asynchronous PORT UPDATE ignored %04x/%04x/%04x.\n",
852 mb[1], mb[2], mb[3]);
859 "Port database changed %04x %04x %04x.\n",
860 mb[1], mb[2], mb[3]);
862 "Link is operational (%s Gbps).\n",
872 if (vha->
vp_idx == 0 && !qla_ini_mode_enabled(vha))
886 if (ha->
flags.npiv_supported && vha->
vp_idx != (mb[3] & 0xff))
890 "RSCN database changed -- %04x %04x %04x.\n",
891 mb[1], mb[2], mb[3]);
893 rscn_entry = ((mb[1] & 0xff) << 16) | mb[2];
894 host_pid = (vha->
d_id.
b.domain << 16) | (vha->
d_id.
b.area << 8)
896 if (rscn_entry == host_pid) {
898 "Ignoring RSCN update to local host "
899 "port ID (%06x).\n", host_pid);
904 rscn_entry = ((mb[1] & 0x3ff) << 16) | mb[2];
907 vha->
flags.management_server_logged_in = 0;
917 "[R|Z]IO update completion.\n");
927 "Discard RND Frame -- %04x %04x %04x.\n",
928 mb[1], mb[2], mb[3]);
933 "Trace Notification -- %04x %04x.\n", mb[1], mb[2]);
938 "ISP84XX Alert Notification -- %04x %04x %04x.\n",
939 mb[1], mb[2], mb[3]);
945 "Alert 84XX: panic recovery %04x %04x.\n",
949 ha->
cs84xx->op_fw_version = mb[3] << 16 | mb[2];
951 "Alert 84XX: firmware version %x.\n",
952 ha->
cs84xx->op_fw_version);
955 ha->
cs84xx->diag_fw_version = mb[3] << 16 | mb[2];
957 "Alert 84XX: diagnostic firmware version %x.\n",
958 ha->
cs84xx->diag_fw_version);
961 ha->
cs84xx->diag_fw_version = mb[3] << 16 | mb[2];
962 ha->
cs84xx->fw_update = 1;
964 "Alert 84XX: gold firmware version %x.\n",
965 ha->
cs84xx->gold_fw_version);
969 "Alert 84xx: Invalid Alert %04x %04x %04x.\n",
970 mb[1], mb[2], mb[3]);
972 spin_unlock_irqrestore(&ha->
cs84xx->access_lock, flags);
976 "DCBX Started -- %04x %04x %04x.\n",
977 mb[1], mb[2], mb[3]);
981 "DCBX Parameters Updated -- %04x %04x %04x.\n",
982 mb[1], mb[2], mb[3]);
986 "FCF Configuration Error -- %04x %04x %04x.\n",
987 mb[1], mb[2], mb[3]);
1000 qla81xx_idc_event(vha, mb[0], mb[1]);
1013 "Unknown AEN:%04x %04x %04x %04x\n",
1014 mb[0], mb[1], mb[2], mb[3]);
1029 qla2x00_process_completed_request(
struct scsi_qla_host *vha,
1038 "Invalid SCSI command index (%x).\n", index);
1076 "Invalid command index (%x).\n", index);
1086 "Invalid completion handle (%x) -- timed-out.\n", index);
1089 if (sp->
handle != index) {
1091 "SRB handle (%x) mismatch %x.\n", sp->
handle, index);
1105 const char func[] =
"MBX-IOCB";
1113 sp = qla2x00_get_sp_from_handle(vha, func, req, mbx);
1120 data = lio->
u.
logio.data;
1127 "Async-%s error entry - hdl=%x portid=%02x%02x%02x "
1128 "entry-status=%x status=%x state-flag=%x "
1129 "status-flags=%x.\n", type, sp->
handle,
1136 (
uint8_t *)mbx,
sizeof(*mbx));
1147 "Async-%s complete - hdl=%x portid=%02x%02x%02x mbx1=%x.\n",
1176 "Async-%s failed - hdl=%x portid=%02x%02x%02x status=%x "
1177 "mb0=%x mb1=%x mb2=%x mb6=%x mb7=%x.\n", type, sp->
handle,
1184 sp->
done(vha, sp, 0);
1191 const char func[] =
"CT_IOCB";
1198 sp = qla2x00_get_sp_from_handle(vha, func, req, pkt);
1204 type =
"ct pass-through";
1217 bsg_job->
reply->reply_payload_rcv_len =
1221 "CT pass-through-%s error "
1222 "comp_status-status=0x%x total_byte = 0x%x.\n",
1224 bsg_job->
reply->reply_payload_rcv_len);
1227 "CT pass-through-%s error "
1228 "comp_status-status=0x%x.\n", type, comp_status);
1230 bsg_job->
reply->reply_payload_rcv_len = 0;
1233 (
uint8_t *)pkt,
sizeof(*pkt));
1236 bsg_job->
reply->reply_payload_rcv_len =
1241 sp->
done(vha, sp, res);
1248 const char func[] =
"ELS_CT_IOCB";
1257 sp = qla2x00_get_sp_from_handle(vha, func, req, pkt);
1269 type =
"ct pass-through";
1273 "Unrecognized SRB: (%p) type=%d.\n", sp, sp->
type);
1290 bsg_job->
reply->reply_payload_rcv_len =
1294 "ELS-CT pass-through-%s error hdl=%x comp_status-status=0x%x "
1295 "error subcode 1=0x%x error subcode 2=0x%x total_byte = 0x%x.\n",
1296 type, sp->
handle, comp_status, fw_status[1], fw_status[2],
1298 pkt)->total_byte_count));
1300 memcpy( fw_sts_ptr, fw_status,
sizeof(fw_status));
1304 "ELS-CT pass-through-%s error hdl=%x comp_status-status=0x%x "
1305 "error subcode 1=0x%x error subcode 2=0x%x.\n",
1306 type, sp->
handle, comp_status,
1308 pkt)->error_subcode_1),
1310 pkt)->error_subcode_2));
1312 bsg_job->
reply->reply_payload_rcv_len = 0;
1314 memcpy( fw_sts_ptr, fw_status,
sizeof(fw_status));
1317 (
uint8_t *)pkt,
sizeof(*pkt));
1325 sp->
done(vha, sp, res);
1332 const char func[] =
"LOGIO-IOCB";
1340 sp = qla2x00_get_sp_from_handle(vha, func, req, logio);
1347 data = lio->
u.
logio.data;
1354 "Async-%s error entry - hdl=%x"
1355 "portid=%02x%02x%02x entry-status=%x.\n",
1360 (
uint8_t *)logio,
sizeof(*logio));
1367 "Async-%s complete - hdl=%x portid=%02x%02x%02x "
1368 "iop0=%x.\n", type, sp->
handle, fcport->
d_id.
b.domain,
1377 if (iop[0] &
BIT_4) {
1381 }
else if (iop[0] &
BIT_5)
1400 data[1] =
LSW(iop[1]);
1411 "Async-%s failed - hdl=%x portid=%02x%02x%02x comp=%x "
1412 "iop0=%x iop1=%x.\n", type, sp->
handle, fcport->
d_id.
b.domain,
1419 sp->
done(vha, sp, 0);
1426 const char func[] =
"TMF-IOCB";
1434 sp = qla2x00_get_sp_from_handle(vha, func, req, tsk);
1444 "Async-%s error - hdl=%x entry-status(%x).\n",
1448 "Async-%s error - hdl=%x completion status(%x).\n",
1453 "Async-%s error - hdl=%x no response info(%x).\n",
1457 "Async-%s error - hdl=%x not enough response(%d).\n",
1459 }
else if (sts->
data[3]) {
1461 "Async-%s error - hdl=%x response(%x).\n",
1470 (
uint8_t *)sts,
sizeof(*sts));
1473 sp->
done(vha, sp, 0);
1490 vha = pci_get_drvdata(ha->
pdev);
1492 if (!vha->
flags.online)
1507 qla2x00_error_entry(vha, rsp, pkt);
1515 qla2x00_status_entry(vha, rsp, pkt);
1519 for (cnt = 0; cnt < handle_cnt; cnt++) {
1520 qla2x00_process_completed_request(vha, rsp->
req,
1526 for (cnt = 0; cnt < handle_cnt; cnt++) {
1527 qla2x00_process_completed_request(vha, rsp->
req,
1535 qla2x00_mbx_iocb_entry(vha, rsp->
req,
1544 "Received unknown response pkt type %x "
1545 "entry status=%x.\n",
1572 if (sense_len > par_sense_len)
1573 sense_len = par_sense_len;
1581 if (track_sense_len != 0) {
1588 "Check condition Sense data, nexus%ld:%d:%d cmd=%p.\n",
1631 "iocb(s) %p Returned STATUS.\n", sts24);
1634 "DIF ERROR in cmd 0x%x lba 0x%llx act ref"
1635 " tag=0x%x, exp ref_tag=0x%x, act app tag=0x%x, exp app"
1636 " tag=0x%x, act guard=0x%x, exp guard=0x%x.\n",
1637 cmd->
cmnd[0], (
u64)scsi_get_lba(cmd), a_ref_tag, e_ref_tag,
1638 a_app_tag, e_app_tag, a_guard, e_guard);
1645 if ((a_app_tag == 0xffff) &&
1647 (a_ref_tag == 0xffffffff))) {
1649 sector_t lba_s = scsi_get_lba(cmd);
1652 blocks_done = e_ref_tag - (
uint32_t)lba_s + 1;
1654 resid = scsi_bufflen(cmd) - (blocks_done *
1655 cmd->
device->sector_size);
1657 scsi_set_resid(cmd, resid);
1661 if (scsi_prot_sg_count(cmd)) {
1668 scsi_prot_sg_count(cmd), i) {
1670 if (
k + num_ent < blocks_done) {
1674 j = blocks_done -
k - 1;
1679 if (
k != blocks_done) {
1681 "unexpected tag values tag:lba=%x:%llx)\n",
1682 e_ref_tag, (
unsigned long long)lba_s);
1698 if (e_guard != a_guard) {
1708 if (e_ref_tag != a_ref_tag) {
1718 if (e_app_tag != a_app_tag) {
1749 "Invalid SCSI completion handle 0x%x.\n", index);
1761 "Req:%d: Invalid ISP SCSI completion handle(0x%x)\n",
1776 thread_id = bsg_job->
request->rqst_data.h_vendor.vendor_cmd[1];
1777 switch (comp_status) {
1779 if (scsi_status == 0) {
1780 bsg_job->
reply->reply_payload_rcv_len =
1788 "Command completed with date overrun thread_id=%d\n",
1795 "Command completed with date underrun thread_id=%d\n",
1801 "Command completed with read data overrun thread_id=%d\n",
1808 "Command completed with read and write data overrun "
1809 "thread_id=%d\n", thread_id);
1815 "Command completed with read data over and write data "
1816 "underrun thread_id=%d\n", thread_id);
1822 "Command completed with read data data underrun "
1823 "thread_id=%d\n", thread_id);
1829 "Command completed with read data under and write data "
1830 "overrun thread_id=%d\n", thread_id);
1836 "Command completed with read and write data underrun "
1837 "thread_id=%d\n", thread_id);
1843 "Command completed with data DMA error thread_id=%d\n",
1850 "Command completed with timeout thread_id=%d\n",
1856 "Command completed with completion status=0x%x "
1857 "thread_id=%d\n", comp_status, thread_id);
1861 bsg_job->
reply->reply_payload_rcv_len = 0;
1865 bsg_job->
reply->reply_data.vendor_reply.vendor_rsp[0] = rval;
1924 "Invalid status handle (0x%x).\n", sts->
handle);
1935 qla25xx_process_bidir_status_iocb(vha, pkt, req, handle);
1940 if (comp_status ==
CS_COMPLETE && scsi_status == 0) {
1941 qla2x00_process_completed_request(vha, req, handle);
1950 "Command already returned (0x%x/%p).\n",
1961 sense_len = par_sense_len = rsp_info_len = resid_len =
1972 rsp_info = sts24->
data;
1973 sense_data = sts24->
data;
1974 host_to_fcp_swap(sts24->
data,
sizeof(sts24->
data));
1976 par_sense_len =
sizeof(sts24->
data);
1978 if (scsi_status & SS_SENSE_LEN_VALID)
1980 if (scsi_status & SS_RESPONSE_INFO_LEN_VALID)
1989 if (scsi_status & SS_RESPONSE_INFO_LEN_VALID) {
1992 sense_data += rsp_info_len;
1993 par_sense_len -= rsp_info_len;
1995 if (rsp_info_len > 3 && rsp_info[3]) {
1997 "FCP I/O protocol failure (0x%x/0x%x).\n",
1998 rsp_info_len, rsp_info[3]);
2013 switch (comp_status) {
2016 if (scsi_status == 0) {
2022 scsi_set_resid(cp, resid);
2024 if (!lscsi_status &&
2025 ((
unsigned)(scsi_bufflen(cp) - resid) <
2028 "Mid-layer underflow "
2029 "detected (0x%x of 0x%x bytes).\n",
2030 resid, scsi_bufflen(cp));
2036 res =
DID_OK << 16 | lscsi_status;
2040 "QUEUE FULL detected.\n");
2048 if (!(scsi_status & SS_SENSE_LEN_VALID))
2051 qla2x00_handle_sense(sp, sense_data, par_sense_len, sense_len,
2058 scsi_set_resid(cp, resid);
2062 "Dropped frame(s) detected "
2063 "(0x%x of 0x%x bytes).\n",
2064 resid, scsi_bufflen(cp));
2067 goto check_scsi_status;
2070 if (!lscsi_status &&
2071 ((
unsigned)(scsi_bufflen(cp) - resid) <
2074 "Mid-layer underflow "
2075 "detected (0x%x of 0x%x bytes).\n",
2076 resid, scsi_bufflen(cp));
2089 "Dropped frame(s) detected (0x%x "
2090 "of 0x%x bytes).\n", resid,
2094 goto check_scsi_status;
2097 "scsi_status: 0x%x, lscsi_status: 0x%x\n",
2098 scsi_status, lscsi_status);
2101 res =
DID_OK << 16 | lscsi_status;
2109 if (lscsi_status != 0) {
2112 "QUEUE FULL detected.\n");
2120 if (!(scsi_status & SS_SENSE_LEN_VALID))
2123 qla2x00_handle_sense(sp, sense_data, par_sense_len,
2124 sense_len, rsp, res);
2152 "Port down status: port-state=0x%x.\n",
2164 logit = qla2x00_handle_dif_error(sp, sts24);
2174 if (state_flags & BIT_4)
2176 "Unsupported device '%s' found.\n",
2188 "FCP command status: 0x%x-0x%x (0x%x) "
2189 "nexus=%ld:%d:%d portid=%02x%02x%02x oxid=0x%x "
2190 "cdb=%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x len=0x%x "
2191 "rsp_info=0x%x resid=0x%x fw_resid=0x%x.\n",
2192 comp_status, scsi_status, res, vha->
host_no,
2194 fcport->
d_id.
b.area, fcport->
d_id.
b.al_pa, ox_id,
2197 cp->
cmnd[8], cp->
cmnd[9], scsi_bufflen(cp), rsp_info_len,
2198 resid_len, fw_resid_len);
2201 sp->
done(ha, sp, res);
2231 "cmd is NULL: already returned to OS (sp=%p).\n", sp);
2237 if (sense_len >
sizeof(pkt->
data))
2238 sense_sz =
sizeof(pkt->
data);
2244 host_to_fcp_swap(pkt->
data,
sizeof(pkt->
data));
2247 sense_ptr, sense_sz);
2249 sense_len -= sense_sz;
2250 sense_ptr += sense_sz;
2256 if (sense_len == 0) {
2272 const char func[] =
"ERROR-IOCB";
2278 "type of error status in response: 0x%x\n", pkt->
entry_status);
2288 sp = qla2x00_get_sp_from_handle(vha, func, req, pkt);
2290 sp->
done(ha, sp, res);
2295 "Error entry - invalid handle/queue.\n");
2326 ha->
flags.mbox_int = 1;
2350 if (!vha->
flags.online)
2365 qla2x00_error_entry(vha, rsp, (
sts_entry_t *) pkt);
2376 qla2x00_status_entry(vha, rsp, pkt);
2386 qla24xx_logio_entry(vha, rsp->
req,
2390 qla24xx_tm_iocb_entry(vha, rsp->
req,
2415 "Received unknown response pkt type %x "
2416 "entry status=%x.\n",
2473 "Additional code -- 0x55AA.\n");
2501 unsigned long flags;
2503 rsp = (
struct rsp_que *) dev_id;
2506 "%s: NULL response queue pointer.\n", __func__);
2518 vha = pci_get_drvdata(ha->
pdev);
2519 for (iter = 50; iter--; ) {
2528 "RISC paused -- HCCR=%x, Dumping firmware.\n",
2531 qla2xxx_check_risc_status(vha);
2539 switch (stat & 0xff) {
2544 qla24xx_mbx_completion(vha,
MSW(stat));
2568 "Unrecognized interrupt type (%d).\n", stat * 0xff);
2576 spin_unlock_irqrestore(&ha->hardware_lock, flags);
2588 qla24xx_msix_rsp_q(
int irq,
void *
dev_id)
2594 unsigned long flags;
2596 rsp = (
struct rsp_que *) dev_id;
2599 "%s: NULL response queue pointer.\n", __func__);
2607 vha = pci_get_drvdata(ha->
pdev);
2609 if (!ha->
flags.disable_msix_handshake) {
2613 spin_unlock_irqrestore(&ha->hardware_lock, flags);
2619 qla25xx_msix_rsp_q(
int irq,
void *dev_id)
2624 unsigned long flags;
2626 rsp = (
struct rsp_que *) dev_id;
2629 "%s: NULL response queue pointer.\n", __func__);
2635 if (!ha->
flags.disable_msix_handshake) {
2640 spin_unlock_irqrestore(&ha->hardware_lock, flags);
2648 qla24xx_msix_default(
int irq,
void *dev_id)
2658 unsigned long flags;
2660 rsp = (
struct rsp_que *) dev_id;
2663 "%s: NULL response queue pointer.\n", __func__);
2671 vha = pci_get_drvdata(ha->
pdev);
2681 "RISC paused -- HCCR=%x, Dumping firmware.\n",
2684 qla2xxx_check_risc_status(vha);
2692 switch (stat & 0xff) {
2697 qla24xx_mbx_completion(vha,
MSW(stat));
2721 "Unrecognized interrupt type (%d).\n", stat & 0xff);
2726 spin_unlock_irqrestore(&ha->hardware_lock, flags);
2744 {
"qla2xxx (default)", qla24xx_msix_default },
2745 {
"qla2xxx (rsp_q)", qla24xx_msix_rsp_q },
2746 {
"qla2xxx (multiq)", qla25xx_msix_rsp_q },
2769 ha->
flags.msix_enabled = 0;
2771 "Disabled the MSI.\n");
2777 #define MIN_MSIX_COUNT 2
2783 entries = kzalloc(
sizeof(
struct msix_entry) * ha->
msix_count,
2787 "Failed to allocate memory for msix_entry.\n");
2792 entries[i].
entry = i;
2796 if (ret < MIN_MSIX_COUNT)
2800 "MSI-X: Failed to enable support "
2801 "-- %d/%d\n Retry with %d vectors.\n",
2808 "MSI-X: Failed to enable support, "
2809 "giving up -- %d/%d.\n",
2819 "Failed to allocate memory for ha->msix_entries.\n");
2823 ha->
flags.msix_enabled = 1;
2827 qentry->
vector = entries[
i].vector;
2828 qentry->
entry = entries[
i].entry;
2834 for (i = 0; i < 2; i++) {
2838 qla82xx_msix_entries[i].
handler,
2839 0, qla82xx_msix_entries[i].
name, rsp);
2843 0, msix_entries[i].
name, rsp);
2847 "MSI-X: unable to register handler -- %x/%d.\n",
2849 qla24xx_disable_msix(ha);
2868 "mqiobase=%p, max_rsp_queues=%d, max_req_queues=%d.\n",
2871 "mqiobase=%p, max_rsp_queues=%d, max_req_queues=%d.\n",
2892 (ha->
pdev->subsystem_device == 0x7040 ||
2893 ha->
pdev->subsystem_device == 0x7041 ||
2894 ha->
pdev->subsystem_device == 0x1705)) {
2896 "MSI-X: Unsupported ISP 2432 SSVID/SSDID (0x%X,0x%X).\n",
2897 ha->
pdev->subsystem_vendor,
2898 ha->
pdev->subsystem_device);
2904 "MSI-X; Unsupported ISP2432 (0x%X, 0x%X).\n",
2909 ret = qla24xx_enable_msix(ha, rsp);
2912 "MSI-X: Enabled (0x%X, 0x%X).\n",
2914 goto clear_risc_ints;
2917 "MSI-X Falling back-to MSI mode -%d.\n", ret);
2924 ret = pci_enable_msi(ha->
pdev);
2928 ha->
flags.msi_enabled = 1;
2931 "MSI-X; Falling back-to INTa mode -- %d.\n", ret);
2944 "Failed to reserve interrupt %d already in use.\n",
2951 spin_lock_irq(&ha->hardware_lock);
2954 spin_unlock_irq(&ha->hardware_lock);
2974 if (ha->
flags.msix_enabled)
2975 qla24xx_disable_msix(ha);
2976 else if (ha->
flags.msi_enabled) {
2995 "MSI-X: Unable to register handler -- %x/%d.\n",