diff options
-rw-r--r-- | drivers/scsi/bfa/fcpim.c | 13 | ||||
-rw-r--r-- | drivers/scsi/bfa/fcs_rport.h | 2 | ||||
-rw-r--r-- | drivers/scsi/bfa/include/fcs/bfa_fcs_fcpim.h | 1 | ||||
-rw-r--r-- | drivers/scsi/bfa/rport.c | 4 |
4 files changed, 15 insertions, 5 deletions
diff --git a/drivers/scsi/bfa/fcpim.c b/drivers/scsi/bfa/fcpim.c index 7a0207e56693..d090f7a6368a 100644 --- a/drivers/scsi/bfa/fcpim.c +++ b/drivers/scsi/bfa/fcpim.c | |||
@@ -110,6 +110,7 @@ bfa_fcs_itnim_sm_offline(struct bfa_fcs_itnim_s *itnim, | |||
110 | switch (event) { | 110 | switch (event) { |
111 | case BFA_FCS_ITNIM_SM_ONLINE: | 111 | case BFA_FCS_ITNIM_SM_ONLINE: |
112 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_prli_send); | 112 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_prli_send); |
113 | itnim->prli_retries = 0; | ||
113 | bfa_fcs_itnim_send_prli(itnim, NULL); | 114 | bfa_fcs_itnim_send_prli(itnim, NULL); |
114 | break; | 115 | break; |
115 | 116 | ||
@@ -218,8 +219,16 @@ bfa_fcs_itnim_sm_prli_retry(struct bfa_fcs_itnim_s *itnim, | |||
218 | 219 | ||
219 | switch (event) { | 220 | switch (event) { |
220 | case BFA_FCS_ITNIM_SM_TIMEOUT: | 221 | case BFA_FCS_ITNIM_SM_TIMEOUT: |
221 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_prli_send); | 222 | if (itnim->prli_retries < BFA_FCS_RPORT_MAX_RETRIES) { |
222 | bfa_fcs_itnim_send_prli(itnim, NULL); | 223 | itnim->prli_retries++; |
224 | bfa_trc(itnim->fcs, itnim->prli_retries); | ||
225 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_prli_send); | ||
226 | bfa_fcs_itnim_send_prli(itnim, NULL); | ||
227 | } else { | ||
228 | /* invoke target offline */ | ||
229 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline); | ||
230 | bfa_fcs_rport_logo_imp(itnim->rport); | ||
231 | } | ||
223 | break; | 232 | break; |
224 | 233 | ||
225 | case BFA_FCS_ITNIM_SM_OFFLINE: | 234 | case BFA_FCS_ITNIM_SM_OFFLINE: |
diff --git a/drivers/scsi/bfa/fcs_rport.h b/drivers/scsi/bfa/fcs_rport.h index 9c8d1d292380..5242ee0f03c6 100644 --- a/drivers/scsi/bfa/fcs_rport.h +++ b/drivers/scsi/bfa/fcs_rport.h | |||
@@ -24,6 +24,8 @@ | |||
24 | 24 | ||
25 | #include <fcs/bfa_fcs_rport.h> | 25 | #include <fcs/bfa_fcs_rport.h> |
26 | 26 | ||
27 | #define BFA_FCS_RPORT_MAX_RETRIES (5) | ||
28 | |||
27 | void bfa_fcs_rport_uf_recv(struct bfa_fcs_rport_s *rport, struct fchs_s *fchs, | 29 | void bfa_fcs_rport_uf_recv(struct bfa_fcs_rport_s *rport, struct fchs_s *fchs, |
28 | u16 len); | 30 | u16 len); |
29 | void bfa_fcs_rport_scn(struct bfa_fcs_rport_s *rport); | 31 | void bfa_fcs_rport_scn(struct bfa_fcs_rport_s *rport); |
diff --git a/drivers/scsi/bfa/include/fcs/bfa_fcs_fcpim.h b/drivers/scsi/bfa/include/fcs/bfa_fcs_fcpim.h index e719f2c3eb35..9a35ecf5cdf0 100644 --- a/drivers/scsi/bfa/include/fcs/bfa_fcs_fcpim.h +++ b/drivers/scsi/bfa/include/fcs/bfa_fcs_fcpim.h | |||
@@ -41,6 +41,7 @@ struct bfa_fcs_itnim_s { | |||
41 | struct bfa_fcs_s *fcs; /* fcs instance */ | 41 | struct bfa_fcs_s *fcs; /* fcs instance */ |
42 | struct bfa_timer_s timer; /* timer functions */ | 42 | struct bfa_timer_s timer; /* timer functions */ |
43 | struct bfa_itnim_s *bfa_itnim; /* BFA itnim struct */ | 43 | struct bfa_itnim_s *bfa_itnim; /* BFA itnim struct */ |
44 | u32 prli_retries; /* max prli retry attempts */ | ||
44 | bfa_boolean_t seq_rec; /* seq recovery support */ | 45 | bfa_boolean_t seq_rec; /* seq recovery support */ |
45 | bfa_boolean_t rec_support; /* REC supported */ | 46 | bfa_boolean_t rec_support; /* REC supported */ |
46 | bfa_boolean_t conf_comp; /* FCP_CONF support */ | 47 | bfa_boolean_t conf_comp; /* FCP_CONF support */ |
diff --git a/drivers/scsi/bfa/rport.c b/drivers/scsi/bfa/rport.c index 2796403222e1..4e1fff21a5bc 100644 --- a/drivers/scsi/bfa/rport.c +++ b/drivers/scsi/bfa/rport.c | |||
@@ -36,8 +36,6 @@ | |||
36 | 36 | ||
37 | BFA_TRC_FILE(FCS, RPORT); | 37 | BFA_TRC_FILE(FCS, RPORT); |
38 | 38 | ||
39 | #define BFA_FCS_RPORT_MAX_RETRIES (5) | ||
40 | |||
41 | /* In millisecs */ | 39 | /* In millisecs */ |
42 | static u32 bfa_fcs_rport_del_timeout = | 40 | static u32 bfa_fcs_rport_del_timeout = |
43 | BFA_FCS_RPORT_DEF_DEL_TIMEOUT * 1000; | 41 | BFA_FCS_RPORT_DEF_DEL_TIMEOUT * 1000; |
@@ -356,8 +354,8 @@ bfa_fcs_rport_sm_plogi_retry(struct bfa_fcs_rport_s *rport, | |||
356 | */ | 354 | */ |
357 | 355 | ||
358 | case RPSM_EVENT_TIMEOUT: | 356 | case RPSM_EVENT_TIMEOUT: |
359 | rport->plogi_retries++; | ||
360 | if (rport->plogi_retries < BFA_FCS_RPORT_MAX_RETRIES) { | 357 | if (rport->plogi_retries < BFA_FCS_RPORT_MAX_RETRIES) { |
358 | rport->plogi_retries++; | ||
361 | bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogi_sending); | 359 | bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogi_sending); |
362 | bfa_fcs_rport_send_plogi(rport, NULL); | 360 | bfa_fcs_rport_send_plogi(rport, NULL); |
363 | } else { | 361 | } else { |