diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_nx.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_nx.c | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c index 915b77a6e19..0a71cc71eab 100644 --- a/drivers/scsi/qla2xxx/qla_nx.c +++ b/drivers/scsi/qla2xxx/qla_nx.c | |||
@@ -2672,6 +2672,19 @@ qla82xx_start_scsi(srb_t *sp) | |||
2672 | sufficient_dsds: | 2672 | sufficient_dsds: |
2673 | req_cnt = 1; | 2673 | req_cnt = 1; |
2674 | 2674 | ||
2675 | if (req->cnt < (req_cnt + 2)) { | ||
2676 | cnt = (uint16_t)RD_REG_DWORD_RELAXED( | ||
2677 | ®->req_q_out[0]); | ||
2678 | if (req->ring_index < cnt) | ||
2679 | req->cnt = cnt - req->ring_index; | ||
2680 | else | ||
2681 | req->cnt = req->length - | ||
2682 | (req->ring_index - cnt); | ||
2683 | } | ||
2684 | |||
2685 | if (req->cnt < (req_cnt + 2)) | ||
2686 | goto queuing_error; | ||
2687 | |||
2675 | ctx = sp->ctx = mempool_alloc(ha->ctx_mempool, GFP_ATOMIC); | 2688 | ctx = sp->ctx = mempool_alloc(ha->ctx_mempool, GFP_ATOMIC); |
2676 | if (!sp->ctx) { | 2689 | if (!sp->ctx) { |
2677 | DEBUG(printk(KERN_INFO | 2690 | DEBUG(printk(KERN_INFO |
@@ -3307,16 +3320,19 @@ qla82xx_check_fw_alive(scsi_qla_host_t *vha) | |||
3307 | set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); | 3320 | set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); |
3308 | } | 3321 | } |
3309 | qla2xxx_wake_dpc(vha); | 3322 | qla2xxx_wake_dpc(vha); |
3323 | ha->flags.fw_hung = 1; | ||
3310 | if (ha->flags.mbox_busy) { | 3324 | if (ha->flags.mbox_busy) { |
3311 | ha->flags.fw_hung = 1; | ||
3312 | ha->flags.mbox_int = 1; | 3325 | ha->flags.mbox_int = 1; |
3313 | DEBUG2(qla_printk(KERN_ERR, ha, | 3326 | DEBUG2(qla_printk(KERN_ERR, ha, |
3314 | "Due to fw hung, doing premature " | 3327 | "Due to fw hung, doing premature " |
3315 | "completion of mbx command\n")); | 3328 | "completion of mbx command\n")); |
3316 | complete(&ha->mbx_intr_comp); | 3329 | if (test_bit(MBX_INTR_WAIT, |
3330 | &ha->mbx_cmd_flags)) | ||
3331 | complete(&ha->mbx_intr_comp); | ||
3317 | } | 3332 | } |
3318 | } | 3333 | } |
3319 | } | 3334 | } else |
3335 | vha->seconds_since_last_heartbeat = 0; | ||
3320 | vha->fw_heartbeat_counter = fw_heartbeat_counter; | 3336 | vha->fw_heartbeat_counter = fw_heartbeat_counter; |
3321 | } | 3337 | } |
3322 | 3338 | ||
@@ -3418,13 +3434,15 @@ void qla82xx_watchdog(scsi_qla_host_t *vha) | |||
3418 | "%s(): Adapter reset needed!\n", __func__); | 3434 | "%s(): Adapter reset needed!\n", __func__); |
3419 | set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); | 3435 | set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); |
3420 | qla2xxx_wake_dpc(vha); | 3436 | qla2xxx_wake_dpc(vha); |
3437 | ha->flags.fw_hung = 1; | ||
3421 | if (ha->flags.mbox_busy) { | 3438 | if (ha->flags.mbox_busy) { |
3422 | ha->flags.fw_hung = 1; | ||
3423 | ha->flags.mbox_int = 1; | 3439 | ha->flags.mbox_int = 1; |
3424 | DEBUG2(qla_printk(KERN_ERR, ha, | 3440 | DEBUG2(qla_printk(KERN_ERR, ha, |
3425 | "Need reset, doing premature " | 3441 | "Need reset, doing premature " |
3426 | "completion of mbx command\n")); | 3442 | "completion of mbx command\n")); |
3427 | complete(&ha->mbx_intr_comp); | 3443 | if (test_bit(MBX_INTR_WAIT, |
3444 | &ha->mbx_cmd_flags)) | ||
3445 | complete(&ha->mbx_intr_comp); | ||
3428 | } | 3446 | } |
3429 | } else { | 3447 | } else { |
3430 | qla82xx_check_fw_alive(vha); | 3448 | qla82xx_check_fw_alive(vha); |