@@ -3041,7 +3041,7 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res)
3041
3041
3042
3042
int
3043
3043
qla24xx_els_dcmd2_iocb (scsi_qla_host_t * vha , int els_opcode ,
3044
- fc_port_t * fcport , bool wait )
3044
+ fc_port_t * fcport )
3045
3045
{
3046
3046
srb_t * sp ;
3047
3047
struct srb_iocb * elsio = NULL ;
@@ -3056,8 +3056,7 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode,
3056
3056
if (!sp ) {
3057
3057
ql_log (ql_log_info , vha , 0x70e6 ,
3058
3058
"SRB allocation failed\n" );
3059
- fcport -> flags &= ~FCF_ASYNC_ACTIVE ;
3060
- return - ENOMEM ;
3059
+ goto done ;
3061
3060
}
3062
3061
3063
3062
fcport -> flags |= FCF_ASYNC_SENT ;
@@ -3066,9 +3065,6 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode,
3066
3065
ql_dbg (ql_dbg_io , vha , 0x3073 ,
3067
3066
"%s Enter: PLOGI portid=%06x\n" , __func__ , fcport -> d_id .b24 );
3068
3067
3069
- if (wait )
3070
- sp -> flags = SRB_WAKEUP_ON_COMP ;
3071
-
3072
3068
sp -> type = SRB_ELS_DCMD ;
3073
3069
sp -> name = "ELS_DCMD" ;
3074
3070
sp -> fcport = fcport ;
@@ -3084,7 +3080,7 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode,
3084
3080
3085
3081
if (!elsio -> u .els_plogi .els_plogi_pyld ) {
3086
3082
rval = QLA_FUNCTION_FAILED ;
3087
- goto out ;
3083
+ goto done_free_sp ;
3088
3084
}
3089
3085
3090
3086
resp_ptr = elsio -> u .els_plogi .els_resp_pyld =
@@ -3093,7 +3089,7 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode,
3093
3089
3094
3090
if (!elsio -> u .els_plogi .els_resp_pyld ) {
3095
3091
rval = QLA_FUNCTION_FAILED ;
3096
- goto out ;
3092
+ goto done_free_sp ;
3097
3093
}
3098
3094
3099
3095
ql_dbg (ql_dbg_io , vha , 0x3073 , "PLOGI %p %p\n" , ptr , resp_ptr );
@@ -3109,7 +3105,6 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode,
3109
3105
3110
3106
if (els_opcode == ELS_DCMD_PLOGI && DBELL_ACTIVE (vha )) {
3111
3107
struct fc_els_flogi * p = ptr ;
3112
-
3113
3108
p -> fl_csp .sp_features |= cpu_to_be16 (FC_SP_FT_SEC );
3114
3109
}
3115
3110
@@ -3118,32 +3113,27 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode,
3118
3113
(uint8_t * )elsio -> u .els_plogi .els_plogi_pyld ,
3119
3114
sizeof (* elsio -> u .els_plogi .els_plogi_pyld ));
3120
3115
3121
- init_completion (& elsio -> u .els_plogi .comp );
3122
3116
rval = qla2x00_start_sp (sp );
3123
3117
if (rval != QLA_SUCCESS ) {
3124
- rval = QLA_FUNCTION_FAILED ;
3118
+ fcport -> flags |= FCF_LOGIN_NEEDED ;
3119
+ set_bit (RELOGIN_NEEDED , & vha -> dpc_flags );
3120
+ goto done_free_sp ;
3125
3121
} else {
3126
3122
ql_dbg (ql_dbg_disc , vha , 0x3074 ,
3127
3123
"%s PLOGI sent, hdl=%x, loopid=%x, to port_id %06x from port_id %06x\n" ,
3128
3124
sp -> name , sp -> handle , fcport -> loop_id ,
3129
3125
fcport -> d_id .b24 , vha -> d_id .b24 );
3130
3126
}
3131
3127
3132
- if (wait ) {
3133
- wait_for_completion (& elsio -> u .els_plogi .comp );
3134
-
3135
- if (elsio -> u .els_plogi .comp_status != CS_COMPLETE )
3136
- rval = QLA_FUNCTION_FAILED ;
3137
- } else {
3138
- goto done ;
3139
- }
3128
+ return rval ;
3140
3129
3141
- out :
3142
- fcport -> flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE );
3130
+ done_free_sp :
3143
3131
qla2x00_els_dcmd2_free (vha , & elsio -> u .els_plogi );
3144
3132
/* ref: INIT */
3145
3133
kref_put (& sp -> cmd_kref , qla2x00_sp_release );
3146
3134
done :
3135
+ fcport -> flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE );
3136
+ qla2x00_set_fcport_disc_state (fcport , DSC_DELETED );
3147
3137
return rval ;
3148
3138
}
3149
3139
0 commit comments