diff options
author | Dilip Kumar Uppugandla <dilip@purestorage.com> | 2015-12-17 20:57:11 +0100 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2016-01-07 22:57:50 +0100 |
commit | 3bb67df5b5f880a1c9c1086308cf2b981d824da5 (patch) | |
tree | 4c186864e131f65f338b9c81d19d5d6ac3efd4d0 /drivers/scsi/qla2xxx/qla_init.c | |
parent | qla2xxx: Set all queues to 4k (diff) | |
download | linux-3bb67df5b5f880a1c9c1086308cf2b981d824da5.tar.xz linux-3bb67df5b5f880a1c9c1086308cf2b981d824da5.zip |
qla2xxx: Check for online flag instead of active reset when transmitting responses
Driver has following initialization sequence for Target mode
1. Driver initialization starts
2. ISP Abort is scheduled when the target is enabled.
qla2xxx [0000:04:00.0]-4807:25: ISP abort scheduled
qla2xxx [0000:04:00.0]-00af:25: Performing ISP error recovery - ha=ffff880caa9e0000.
3. DPC thread starts the ISP Abort
4. While DPC is resetting the chip and initializing the firmware, we get
async events from the firmware about P2P mode, LOOP UP and PORT UPDATE.
5. PRLI from a initiator is delivered to us followed by a PLOGI and then a
SCSI command which creates a session.
6. If the SCSI command is a WRITE in this case, we issue XFR RDY and it
gets dropped as can be seen with messages RESET-XFR because ISP Abort
is still active
qla2xxx [0000:04:00.0]-e902:25: RESET-XFR active/old-count/new-count = 1/1/1.
7. If the SCSI command is a READ, we issue RESPONSE and they get dropped
as well because Abort is still active.
qla2xxx [0000:04:00.0]-e901:25: RESET-RSP active/old-count/new-count = 1/1/1
8. Now eventually, ISP Abort finishes clearing the DPC flags.
qla2xxx [0000:04:00.0]-8822:25: qla2x00_abort_isp succeeded.
qla2xxx [0000:04:00.0]-4808:25: ISP abort end.
9. Since we dropped SCSI commands silently (without any responses sent
to the initiator) initiator waits for a SCSI timeout (which is 60
seconds in our case), Sends an ABTS which fails since there
no se_cmd found for the tag that ABTS is referencing as the
commands were cleaned up in Step 6 and 7.
10. Initiator send an IO after the ABTS which succeed fine.
To fix the above case, the following changes have been made:
- To prevent target from dropping commands silently, use the online flag
instead to check for an active chip reset. Once the port is online during
a chip reset phase, we are good to process the commands.
- Clean up qla2x00_restart_isp to not set the online flag and process ATIO
as it is unnecessary. During a chip reset, interrupts are enabled only
after setting the online flag to 1, so ATIO's won't be missed and hence
no need to process ATIO's after setting the online flag.
Signed-off-by: Dilip Kumar Uppugandla <dilip@purestorage.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 993dd25279ff..52a87657c7dd 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -3065,6 +3065,26 @@ qla2x00_configure_loop(scsi_qla_host_t *vha) atomic_set(&vha->loop_state, LOOP_READY); ql_dbg(ql_dbg_disc, vha, 0x2069, "LOOP READY.\n"); + + /* + * Process any ATIO queue entries that came in + * while we weren't online. + */ + if (qla_tgt_mode_enabled(vha)) { + if (IS_QLA27XX(ha) || IS_QLA83XX(ha)) { + spin_lock_irqsave(&ha->tgt.atio_lock, + flags); + qlt_24xx_process_atio_queue(vha, 0); + spin_unlock_irqrestore( + &ha->tgt.atio_lock, flags); + } else { + spin_lock_irqsave(&ha->hardware_lock, + flags); + qlt_24xx_process_atio_queue(vha, 1); + spin_unlock_irqrestore( + &ha->hardware_lock, flags); + } + } } } @@ -4919,7 +4939,6 @@ qla2x00_restart_isp(scsi_qla_host_t *vha) struct qla_hw_data *ha = vha->hw; struct req_que *req = ha->req_q_map[0]; struct rsp_que *rsp = ha->rsp_q_map[0]; - unsigned long flags, flags2; /* If firmware needs to be loaded */ if (qla2x00_isp_firmware(vha)) { @@ -4941,19 +4960,6 @@ qla2x00_restart_isp(scsi_qla_host_t *vha) /* Issue a marker after FW becomes ready. */ qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL); - vha->flags.online = 1; - - /* - * Process any ATIO queue entries that came in - * while we weren't online. - */ - spin_lock_irqsave(&ha->hardware_lock, flags); - spin_lock_irqsave(&ha->tgt.atio_lock, flags2); - if (qla_tgt_mode_enabled(vha)) - qlt_24xx_process_atio_queue(vha, 1); - spin_unlock_irqrestore(&ha->tgt.atio_lock, flags2); - spin_unlock_irqrestore(&ha->hardware_lock, flags); - set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); } |