diff options
author | Chad Dupuis <chad.dupuis@qlogic.com> | 2012-08-22 14:21:24 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-09-24 04:10:52 -0400 |
commit | bf5b8ad7bd7ad56fc4d4132996babb74443672d6 (patch) | |
tree | 402f2494d8230c8dded4048d6013e69aec3b813a | |
parent | e92e4a8f003910d985b5e5f721724b1e1327208b (diff) |
[SCSI] qla2xxx: Fix for handling some error conditions in loopback.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/qla2xxx/qla_bsg.c | 14 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_dbg.c | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 3 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_isr.c | 25 |
4 files changed, 27 insertions, 17 deletions
diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c index d25f0fa3a2e1..2f9bddd3c616 100644 --- a/drivers/scsi/qla2xxx/qla_bsg.c +++ b/drivers/scsi/qla2xxx/qla_bsg.c | |||
@@ -568,9 +568,17 @@ qla81xx_set_loopback_mode(scsi_qla_host_t *vha, uint16_t *config, | |||
568 | if (!wait_for_completion_timeout(&ha->dcbx_comp, (20 * HZ))) { | 568 | if (!wait_for_completion_timeout(&ha->dcbx_comp, (20 * HZ))) { |
569 | ql_dbg(ql_dbg_user, vha, 0x7022, | 569 | ql_dbg(ql_dbg_user, vha, 0x7022, |
570 | "State change notification not received.\n"); | 570 | "State change notification not received.\n"); |
571 | } else | 571 | rval = -EINVAL; |
572 | ql_dbg(ql_dbg_user, vha, 0x7023, | 572 | } else { |
573 | "State change received.\n"); | 573 | if (ha->flags.idc_compl_status) { |
574 | ql_dbg(ql_dbg_user, vha, 0x70c3, | ||
575 | "Bad status in IDC Completion AEN\n"); | ||
576 | rval = -EINVAL; | ||
577 | ha->flags.idc_compl_status = 0; | ||
578 | } else | ||
579 | ql_dbg(ql_dbg_user, vha, 0x7023, | ||
580 | "State change received.\n"); | ||
581 | } | ||
574 | 582 | ||
575 | ha->notify_dcbx_comp = 0; | 583 | ha->notify_dcbx_comp = 0; |
576 | 584 | ||
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index 279f52c7dfcd..6d3cf6edd7c7 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c | |||
@@ -22,7 +22,7 @@ | |||
22 | * | Async Events | 0x5071 | 0x502b-0x502f | | 22 | * | Async Events | 0x5071 | 0x502b-0x502f | |
23 | * | | | 0x5047,0x5052 | | 23 | * | | | 0x5047,0x5052 | |
24 | * | Timer Routines | 0x6011 | | | 24 | * | Timer Routines | 0x6011 | | |
25 | * | User Space Interactions | 0x70c2 | 0x7018,0x702e, | | 25 | * | User Space Interactions | 0x70c3 | 0x7018,0x702e, | |
26 | * | | | 0x7039,0x7045, | | 26 | * | | | 0x7039,0x7045, | |
27 | * | | | 0x7073-0x7075, | | 27 | * | | | 0x7073-0x7075, | |
28 | * | | | 0x708c, | | 28 | * | | | 0x708c, | |
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index c4e77d7bb082..b214fd816135 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -2622,7 +2622,8 @@ struct qla_hw_data { | |||
2622 | uint32_t nic_core_reset_owner:1; | 2622 | uint32_t nic_core_reset_owner:1; |
2623 | uint32_t isp82xx_no_md_cap:1; | 2623 | uint32_t isp82xx_no_md_cap:1; |
2624 | uint32_t host_shutting_down:1; | 2624 | uint32_t host_shutting_down:1; |
2625 | /* 30 bits */ | 2625 | uint32_t idc_compl_status:1; |
2626 | /* 32 bits */ | ||
2626 | } flags; | 2627 | } flags; |
2627 | 2628 | ||
2628 | /* This spinlock is used to protect "io transactions", you must | 2629 | /* This spinlock is used to protect "io transactions", you must |
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index a551827d3edc..9a2e1fabc59c 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -294,17 +294,20 @@ qla81xx_idc_event(scsi_qla_host_t *vha, uint16_t aen, uint16_t descr) | |||
294 | "%04x %04x %04x %04x %04x %04x %04x.\n", | 294 | "%04x %04x %04x %04x %04x %04x %04x.\n", |
295 | event[aen & 0xff], mb[0], mb[1], mb[2], mb[3], | 295 | event[aen & 0xff], mb[0], mb[1], mb[2], mb[3], |
296 | mb[4], mb[5], mb[6]); | 296 | mb[4], mb[5], mb[6]); |
297 | if ((aen == MBA_IDC_COMPLETE && mb[1] >> 15)) { | ||
298 | vha->hw->flags.idc_compl_status = 1; | ||
299 | if (vha->hw->notify_dcbx_comp) | ||
300 | complete(&vha->hw->dcbx_comp); | ||
301 | } | ||
297 | 302 | ||
298 | if (IS_QLA81XX(vha->hw)) { | 303 | /* Acknowledgement needed? [Notify && non-zero timeout]. */ |
299 | /* Acknowledgement needed? [Notify && non-zero timeout]. */ | 304 | timeout = (descr >> 8) & 0xf; |
300 | timeout = (descr >> 8) & 0xf; | 305 | if (aen != MBA_IDC_NOTIFY || !timeout) |
301 | if (aen != MBA_IDC_NOTIFY || !timeout) | 306 | return; |
302 | return; | ||
303 | 307 | ||
304 | ql_dbg(ql_dbg_async, vha, 0x5022, | 308 | ql_dbg(ql_dbg_async, vha, 0x5022, |
305 | "%lu Inter-Driver Communication %s -- ACK timeout=%d.\n", | 309 | "%lu Inter-Driver Communication %s -- ACK timeout=%d.\n", |
306 | vha->host_no, event[aen & 0xff], timeout); | 310 | vha->host_no, event[aen & 0xff], timeout); |
307 | } | ||
308 | 311 | ||
309 | rval = qla2x00_post_idc_ack_work(vha, mb); | 312 | rval = qla2x00_post_idc_ack_work(vha, mb); |
310 | if (rval != QLA_SUCCESS) | 313 | if (rval != QLA_SUCCESS) |
@@ -989,13 +992,11 @@ skip_rio: | |||
989 | if ((mb[2] & 0x7fff) == MBC_PORT_RESET || | 992 | if ((mb[2] & 0x7fff) == MBC_PORT_RESET || |
990 | (mb[2] & 0x7fff) == MBC_SET_PORT_CONFIG) { | 993 | (mb[2] & 0x7fff) == MBC_SET_PORT_CONFIG) { |
991 | set_bit(ISP_QUIESCE_NEEDED, &vha->dpc_flags); | 994 | set_bit(ISP_QUIESCE_NEEDED, &vha->dpc_flags); |
992 | /* Ack that we have quiesced I/O */ | ||
993 | qla81xx_idc_event(vha, mb[0], mb[1]); | ||
994 | qla2xxx_wake_dpc(vha); | 995 | qla2xxx_wake_dpc(vha); |
995 | } | 996 | } |
996 | case MBA_IDC_COMPLETE: | 997 | case MBA_IDC_COMPLETE: |
997 | case MBA_IDC_TIME_EXT: | 998 | case MBA_IDC_TIME_EXT: |
998 | if (IS_QLA81XX(vha->hw)) | 999 | if (IS_QLA81XX(vha->hw) || IS_QLA8031(vha->hw)) |
999 | qla81xx_idc_event(vha, mb[0], mb[1]); | 1000 | qla81xx_idc_event(vha, mb[0], mb[1]); |
1000 | break; | 1001 | break; |
1001 | 1002 | ||