Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] qla2xxx: Correct FCP2 recovery handling.

The driver did not account for non-tape devices needing to employ
proper FCP2 recovery. Driver now checks the FCP2-capable flag
only, rather than using a midlayer-determined flag (TYPE_TAPE).

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>

authored by

Andrew Vasquez and committed by
James Bottomley
f08b7251 63c43b0e

+13 -14
+1 -2
drivers/scsi/qla2xxx/qla_def.h
··· 1586 1586 */ 1587 1587 #define FCF_FABRIC_DEVICE BIT_0 1588 1588 #define FCF_LOGIN_NEEDED BIT_1 1589 - #define FCF_TAPE_PRESENT BIT_2 1590 - #define FCF_FCP2_DEVICE BIT_3 1589 + #define FCF_FCP2_DEVICE BIT_2 1591 1590 1592 1591 /* No loop ID flag. */ 1593 1592 #define FC_NO_LOOP_ID 0x1000
+6 -6
drivers/scsi/qla2xxx/qla_init.c
··· 205 205 206 206 switch (data[0]) { 207 207 case MBS_COMMAND_COMPLETE: 208 - if (fcport->flags & FCF_TAPE_PRESENT) 208 + if (fcport->flags & FCF_FCP2_DEVICE) 209 209 opts |= BIT_1; 210 210 rval = qla2x00_get_port_database(vha, fcport, opts); 211 211 if (rval != QLA_SUCCESS) ··· 2726 2726 2727 2727 /* 2728 2728 * Logout all previous fabric devices marked lost, except 2729 - * tape devices. 2729 + * FCP2 devices. 2730 2730 */ 2731 2731 list_for_each_entry(fcport, &vha->vp_fcports, list) { 2732 2732 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) ··· 2739 2739 qla2x00_mark_device_lost(vha, fcport, 2740 2740 ql2xplogiabsentdevice, 0); 2741 2741 if (fcport->loop_id != FC_NO_LOOP_ID && 2742 - (fcport->flags & FCF_TAPE_PRESENT) == 0 && 2742 + (fcport->flags & FCF_FCP2_DEVICE) == 0 && 2743 2743 fcport->port_type != FCT_INITIATOR && 2744 2744 fcport->port_type != FCT_BROADCAST) { 2745 2745 ha->isp_ops->fabric_logout(vha, ··· 3018 3018 fcport->d_id.b24 = new_fcport->d_id.b24; 3019 3019 fcport->flags |= FCF_LOGIN_NEEDED; 3020 3020 if (fcport->loop_id != FC_NO_LOOP_ID && 3021 - (fcport->flags & FCF_TAPE_PRESENT) == 0 && 3021 + (fcport->flags & FCF_FCP2_DEVICE) == 0 && 3022 3022 fcport->port_type != FCT_INITIATOR && 3023 3023 fcport->port_type != FCT_BROADCAST) { 3024 3024 ha->isp_ops->fabric_logout(vha, fcport->loop_id, ··· 3272 3272 3273 3273 rval = qla2x00_fabric_login(vha, fcport, next_loopid); 3274 3274 if (rval == QLA_SUCCESS) { 3275 - /* Send an ADISC to tape devices.*/ 3275 + /* Send an ADISC to FCP2 devices.*/ 3276 3276 opts = 0; 3277 - if (fcport->flags & FCF_TAPE_PRESENT) 3277 + if (fcport->flags & FCF_FCP2_DEVICE) 3278 3278 opts |= BIT_1; 3279 3279 rval = qla2x00_get_port_database(vha, fcport, opts); 3280 3280 if (rval != QLA_SUCCESS) {
+6 -6
drivers/scsi/qla2xxx/qla_os.c
··· 1188 1188 scsi_qla_host_t *vha = shost_priv(sdev->host); 1189 1189 struct qla_hw_data *ha = vha->hw; 1190 1190 struct fc_rport *rport = starget_to_rport(sdev->sdev_target); 1191 - fc_port_t *fcport = *(fc_port_t **)rport->dd_data; 1192 1191 struct req_que *req = vha->req; 1193 1192 1194 1193 if (sdev->tagged_supported) ··· 1196 1197 scsi_deactivate_tcq(sdev, req->max_q_depth); 1197 1198 1198 1199 rport->dev_loss_tmo = ha->port_down_retry_count; 1199 - if (sdev->type == TYPE_TAPE) 1200 - fcport->flags |= FCF_TAPE_PRESENT; 1201 1200 1202 1201 return 0; 1203 1202 } ··· 2802 2805 2803 2806 fcport->login_retry--; 2804 2807 if (fcport->flags & FCF_FABRIC_DEVICE) { 2805 - if (fcport->flags & FCF_TAPE_PRESENT) 2808 + if (fcport->flags & FCF_FCP2_DEVICE) 2806 2809 ha->isp_ops->fabric_logout(vha, 2807 2810 fcport->loop_id, 2808 2811 fcport->d_id.b.domain, ··· 3138 3141 if (!IS_QLA2100(ha) && vha->link_down_timeout) 3139 3142 atomic_set(&vha->loop_state, LOOP_DEAD); 3140 3143 3141 - /* Schedule an ISP abort to return any tape commands. */ 3144 + /* 3145 + * Schedule an ISP abort to return any FCP2-device 3146 + * commands. 3147 + */ 3142 3148 /* NPIV - scan physical port only */ 3143 3149 if (!vha->vp_idx) { 3144 3150 spin_lock_irqsave(&ha->hardware_lock, ··· 3158 3158 if (sp->ctx) 3159 3159 continue; 3160 3160 sfcp = sp->fcport; 3161 - if (!(sfcp->flags & FCF_TAPE_PRESENT)) 3161 + if (!(sfcp->flags & FCF_FCP2_DEVICE)) 3162 3162 continue; 3163 3163 3164 3164 set_bit(ISP_ABORT_NEEDED,