• Dilip Kumar Uppugandla's avatar
    qla2xxx: Check for online flag instead of active reset when transmitting responses · 3bb67df5
    Dilip Kumar Uppugandla authored
    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: default avatarDilip Kumar Uppugandla <dilip@purestorage.com>
    Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@qlogic.com>
    Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
qla_target.c 186 KB