diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_isr.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_isr.c | 85 |
1 files changed, 60 insertions, 25 deletions
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index ca463469063d..0ba4c8d37879 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -9,7 +9,6 @@ | |||
9 | #include <scsi/scsi_tcq.h> | 9 | #include <scsi/scsi_tcq.h> |
10 | 10 | ||
11 | static void qla2x00_mbx_completion(scsi_qla_host_t *, uint16_t); | 11 | static void qla2x00_mbx_completion(scsi_qla_host_t *, uint16_t); |
12 | static void qla2x00_async_event(scsi_qla_host_t *, uint16_t *); | ||
13 | static void qla2x00_process_completed_request(struct scsi_qla_host *, uint32_t); | 12 | static void qla2x00_process_completed_request(struct scsi_qla_host *, uint32_t); |
14 | static void qla2x00_status_entry(scsi_qla_host_t *, void *); | 13 | static void qla2x00_status_entry(scsi_qla_host_t *, void *); |
15 | static void qla2x00_status_cont_entry(scsi_qla_host_t *, sts_cont_entry_t *); | 14 | static void qla2x00_status_cont_entry(scsi_qla_host_t *, sts_cont_entry_t *); |
@@ -244,7 +243,7 @@ qla2x00_mbx_completion(scsi_qla_host_t *ha, uint16_t mb0) | |||
244 | * @ha: SCSI driver HA context | 243 | * @ha: SCSI driver HA context |
245 | * @mb: Mailbox registers (0 - 3) | 244 | * @mb: Mailbox registers (0 - 3) |
246 | */ | 245 | */ |
247 | static void | 246 | void |
248 | qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | 247 | qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) |
249 | { | 248 | { |
250 | #define LS_UNKNOWN 2 | 249 | #define LS_UNKNOWN 2 |
@@ -386,6 +385,11 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
386 | qla2x00_mark_all_devices_lost(ha, 1); | 385 | qla2x00_mark_all_devices_lost(ha, 1); |
387 | } | 386 | } |
388 | 387 | ||
388 | if (ha->parent) { | ||
389 | atomic_set(&ha->vp_state, VP_FAILED); | ||
390 | fc_vport_set_state(ha->fc_vport, FC_VPORT_FAILED); | ||
391 | } | ||
392 | |||
389 | set_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags); | 393 | set_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags); |
390 | 394 | ||
391 | ha->flags.management_server_logged_in = 0; | 395 | ha->flags.management_server_logged_in = 0; |
@@ -422,6 +426,11 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
422 | qla2x00_mark_all_devices_lost(ha, 1); | 426 | qla2x00_mark_all_devices_lost(ha, 1); |
423 | } | 427 | } |
424 | 428 | ||
429 | if (ha->parent) { | ||
430 | atomic_set(&ha->vp_state, VP_FAILED); | ||
431 | fc_vport_set_state(ha->fc_vport, FC_VPORT_FAILED); | ||
432 | } | ||
433 | |||
425 | ha->flags.management_server_logged_in = 0; | 434 | ha->flags.management_server_logged_in = 0; |
426 | ha->link_data_rate = PORT_SPEED_UNKNOWN; | 435 | ha->link_data_rate = PORT_SPEED_UNKNOWN; |
427 | if (ql2xfdmienable) | 436 | if (ql2xfdmienable) |
@@ -440,6 +449,11 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
440 | qla2x00_mark_all_devices_lost(ha, 1); | 449 | qla2x00_mark_all_devices_lost(ha, 1); |
441 | } | 450 | } |
442 | 451 | ||
452 | if (ha->parent) { | ||
453 | atomic_set(&ha->vp_state, VP_FAILED); | ||
454 | fc_vport_set_state(ha->fc_vport, FC_VPORT_FAILED); | ||
455 | } | ||
456 | |||
443 | set_bit(RESET_MARKER_NEEDED, &ha->dpc_flags); | 457 | set_bit(RESET_MARKER_NEEDED, &ha->dpc_flags); |
444 | 458 | ||
445 | ha->operating_mode = LOOP; | 459 | ha->operating_mode = LOOP; |
@@ -465,6 +479,11 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
465 | qla2x00_mark_all_devices_lost(ha, 1); | 479 | qla2x00_mark_all_devices_lost(ha, 1); |
466 | } | 480 | } |
467 | 481 | ||
482 | if (ha->parent) { | ||
483 | atomic_set(&ha->vp_state, VP_FAILED); | ||
484 | fc_vport_set_state(ha->fc_vport, FC_VPORT_FAILED); | ||
485 | } | ||
486 | |||
468 | if (!(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags))) { | 487 | if (!(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags))) { |
469 | set_bit(RESET_MARKER_NEEDED, &ha->dpc_flags); | 488 | set_bit(RESET_MARKER_NEEDED, &ha->dpc_flags); |
470 | } | 489 | } |
@@ -491,6 +510,11 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
491 | qla2x00_mark_all_devices_lost(ha, 1); | 510 | qla2x00_mark_all_devices_lost(ha, 1); |
492 | } | 511 | } |
493 | 512 | ||
513 | if (ha->parent) { | ||
514 | atomic_set(&ha->vp_state, VP_FAILED); | ||
515 | fc_vport_set_state(ha->fc_vport, FC_VPORT_FAILED); | ||
516 | } | ||
517 | |||
494 | set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags); | 518 | set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags); |
495 | set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags); | 519 | set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags); |
496 | break; | 520 | break; |
@@ -530,6 +554,10 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
530 | break; | 554 | break; |
531 | 555 | ||
532 | case MBA_RSCN_UPDATE: /* State Change Registration */ | 556 | case MBA_RSCN_UPDATE: /* State Change Registration */ |
557 | /* Check if the Vport has issued a SCR */ | ||
558 | if (ha->parent && test_bit(VP_SCR_NEEDED, &ha->vp_flags)) | ||
559 | break; | ||
560 | |||
533 | DEBUG2(printk("scsi(%ld): Asynchronous RSCR UPDATE.\n", | 561 | DEBUG2(printk("scsi(%ld): Asynchronous RSCR UPDATE.\n", |
534 | ha->host_no)); | 562 | ha->host_no)); |
535 | DEBUG(printk(KERN_INFO | 563 | DEBUG(printk(KERN_INFO |
@@ -589,6 +617,9 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
589 | ha->host_no, mb[1], mb[2])); | 617 | ha->host_no, mb[1], mb[2])); |
590 | break; | 618 | break; |
591 | } | 619 | } |
620 | |||
621 | if (!ha->parent && ha->num_vhosts) | ||
622 | qla2x00_alert_all_vps(ha, mb); | ||
592 | } | 623 | } |
593 | 624 | ||
594 | static void | 625 | static void |
@@ -889,19 +920,19 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt) | |||
889 | } | 920 | } |
890 | if (scsi_status & (SS_RESIDUAL_UNDER | SS_RESIDUAL_OVER)) { | 921 | if (scsi_status & (SS_RESIDUAL_UNDER | SS_RESIDUAL_OVER)) { |
891 | resid = resid_len; | 922 | resid = resid_len; |
892 | cp->resid = resid; | 923 | scsi_set_resid(cp, resid); |
893 | CMD_RESID_LEN(cp) = resid; | 924 | CMD_RESID_LEN(cp) = resid; |
894 | 925 | ||
895 | if (!lscsi_status && | 926 | if (!lscsi_status && |
896 | ((unsigned)(cp->request_bufflen - resid) < | 927 | ((unsigned)(scsi_bufflen(cp) - resid) < |
897 | cp->underflow)) { | 928 | cp->underflow)) { |
898 | qla_printk(KERN_INFO, ha, | 929 | qla_printk(KERN_INFO, ha, |
899 | "scsi(%ld:%d:%d:%d): Mid-layer underflow " | 930 | "scsi(%ld:%d:%d:%d): Mid-layer underflow " |
900 | "detected (%x of %x bytes)...returning " | 931 | "detected (%x of %x bytes)...returning " |
901 | "error status.\n", ha->host_no, | 932 | "error status.\n", ha->host_no, |
902 | cp->device->channel, cp->device->id, | 933 | cp->device->channel, cp->device->id, |
903 | cp->device->lun, resid, | 934 | cp->device->lun, resid, |
904 | cp->request_bufflen); | 935 | scsi_bufflen(cp)); |
905 | 936 | ||
906 | cp->result = DID_ERROR << 16; | 937 | cp->result = DID_ERROR << 16; |
907 | break; | 938 | break; |
@@ -963,7 +994,7 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt) | |||
963 | resid = fw_resid_len; | 994 | resid = fw_resid_len; |
964 | 995 | ||
965 | if (scsi_status & SS_RESIDUAL_UNDER) { | 996 | if (scsi_status & SS_RESIDUAL_UNDER) { |
966 | cp->resid = resid; | 997 | scsi_set_resid(cp, resid); |
967 | CMD_RESID_LEN(cp) = resid; | 998 | CMD_RESID_LEN(cp) = resid; |
968 | } else { | 999 | } else { |
969 | DEBUG2(printk(KERN_INFO | 1000 | DEBUG2(printk(KERN_INFO |
@@ -1042,26 +1073,26 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt) | |||
1042 | */ | 1073 | */ |
1043 | if (!(scsi_status & SS_RESIDUAL_UNDER)) { | 1074 | if (!(scsi_status & SS_RESIDUAL_UNDER)) { |
1044 | DEBUG2(printk("scsi(%ld:%d:%d:%d) Dropped " | 1075 | DEBUG2(printk("scsi(%ld:%d:%d:%d) Dropped " |
1045 | "frame(s) detected (%x of %x bytes)..." | 1076 | "frame(s) detected (%x of %x bytes)..." |
1046 | "retrying command.\n", ha->host_no, | 1077 | "retrying command.\n", ha->host_no, |
1047 | cp->device->channel, cp->device->id, | 1078 | cp->device->channel, cp->device->id, |
1048 | cp->device->lun, resid, | 1079 | cp->device->lun, resid, |
1049 | cp->request_bufflen)); | 1080 | scsi_bufflen(cp))); |
1050 | 1081 | ||
1051 | cp->result = DID_BUS_BUSY << 16; | 1082 | cp->result = DID_BUS_BUSY << 16; |
1052 | break; | 1083 | break; |
1053 | } | 1084 | } |
1054 | 1085 | ||
1055 | /* Handle mid-layer underflow */ | 1086 | /* Handle mid-layer underflow */ |
1056 | if ((unsigned)(cp->request_bufflen - resid) < | 1087 | if ((unsigned)(scsi_bufflen(cp) - resid) < |
1057 | cp->underflow) { | 1088 | cp->underflow) { |
1058 | qla_printk(KERN_INFO, ha, | 1089 | qla_printk(KERN_INFO, ha, |
1059 | "scsi(%ld:%d:%d:%d): Mid-layer underflow " | 1090 | "scsi(%ld:%d:%d:%d): Mid-layer underflow " |
1060 | "detected (%x of %x bytes)...returning " | 1091 | "detected (%x of %x bytes)...returning " |
1061 | "error status.\n", ha->host_no, | 1092 | "error status.\n", ha->host_no, |
1062 | cp->device->channel, cp->device->id, | 1093 | cp->device->channel, cp->device->id, |
1063 | cp->device->lun, resid, | 1094 | cp->device->lun, resid, |
1064 | cp->request_bufflen); | 1095 | scsi_bufflen(cp)); |
1065 | 1096 | ||
1066 | cp->result = DID_ERROR << 16; | 1097 | cp->result = DID_ERROR << 16; |
1067 | break; | 1098 | break; |
@@ -1084,7 +1115,7 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt) | |||
1084 | DEBUG2(printk(KERN_INFO | 1115 | DEBUG2(printk(KERN_INFO |
1085 | "PID=0x%lx req=0x%x xtra=0x%x -- returning DID_ERROR " | 1116 | "PID=0x%lx req=0x%x xtra=0x%x -- returning DID_ERROR " |
1086 | "status!\n", | 1117 | "status!\n", |
1087 | cp->serial_number, cp->request_bufflen, resid_len)); | 1118 | cp->serial_number, scsi_bufflen(cp), resid_len)); |
1088 | 1119 | ||
1089 | cp->result = DID_ERROR << 16; | 1120 | cp->result = DID_ERROR << 16; |
1090 | break; | 1121 | break; |
@@ -1393,6 +1424,10 @@ qla24xx_process_response_queue(struct scsi_qla_host *ha) | |||
1393 | case MS_IOCB_TYPE: | 1424 | case MS_IOCB_TYPE: |
1394 | qla24xx_ms_entry(ha, (struct ct_entry_24xx *)pkt); | 1425 | qla24xx_ms_entry(ha, (struct ct_entry_24xx *)pkt); |
1395 | break; | 1426 | break; |
1427 | case VP_RPT_ID_IOCB_TYPE: | ||
1428 | qla24xx_report_id_acquisition(ha, | ||
1429 | (struct vp_rpt_id_entry_24xx *)pkt); | ||
1430 | break; | ||
1396 | default: | 1431 | default: |
1397 | /* Type Not Supported. */ | 1432 | /* Type Not Supported. */ |
1398 | DEBUG4(printk(KERN_WARNING | 1433 | DEBUG4(printk(KERN_WARNING |
@@ -1633,7 +1668,7 @@ struct qla_init_msix_entry { | |||
1633 | uint16_t entry; | 1668 | uint16_t entry; |
1634 | uint16_t index; | 1669 | uint16_t index; |
1635 | const char *name; | 1670 | const char *name; |
1636 | irqreturn_t (*handler)(int, void *); | 1671 | irq_handler_t handler; |
1637 | }; | 1672 | }; |
1638 | 1673 | ||
1639 | static struct qla_init_msix_entry imsix_entries[QLA_MSIX_ENTRIES] = { | 1674 | static struct qla_init_msix_entry imsix_entries[QLA_MSIX_ENTRIES] = { |