diff options
author | Jing Huang <huangj@brocade.com> | 2010-07-08 19:55:41 -0700 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-27 12:04:16 -0500 |
commit | 4b5e759dca9fb26d921c1267283350004dbf197b (patch) | |
tree | ef814001eb92a30b79d5a828c0f056ed61e13b26 /drivers/scsi/bfa/fcpim.c | |
parent | df2a52a6c8c4995e0bec0b739ddb2f51664837dd (diff) | |
download | linux-next-4b5e759dca9fb26d921c1267283350004dbf197b.tar.gz |
[SCSI] bfa: fix uf post and rport fcpim state machine
BFA UF module did not hold lock when seding uf post buffer message to firmware
causing CPE-Q corruption. Fix is to check present of FCS and if FCS present
hold lock while posting UF buffers.
Handle PRLO with sending acc to it and relogin with rport. Discard fcxp
before any state change.
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa/fcpim.c')
-rw-r--r-- | drivers/scsi/bfa/fcpim.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/scsi/bfa/fcpim.c b/drivers/scsi/bfa/fcpim.c index d090f7a6368a..6b8976ad22fa 100644 --- a/drivers/scsi/bfa/fcpim.c +++ b/drivers/scsi/bfa/fcpim.c @@ -175,8 +175,12 @@ bfa_fcs_itnim_sm_prli(struct bfa_fcs_itnim_s *itnim, switch (event) { case BFA_FCS_ITNIM_SM_RSP_OK: - bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_hcb_online); - bfa_itnim_online(itnim->bfa_itnim, itnim->seq_rec); + if (itnim->rport->scsi_function == BFA_RPORT_INITIATOR) { + bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_initiator); + } else { + bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_hcb_online); + bfa_itnim_online(itnim->bfa_itnim, itnim->seq_rec); + } break; case BFA_FCS_ITNIM_SM_RSP_ERROR: @@ -194,9 +198,7 @@ bfa_fcs_itnim_sm_prli(struct bfa_fcs_itnim_s *itnim, case BFA_FCS_ITNIM_SM_INITIATOR: bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_initiator); - /* - * dont discard fcxp. accept will reach same state - */ + bfa_fcxp_discard(itnim->fcxp); break; case BFA_FCS_ITNIM_SM_DELETE: @@ -476,7 +478,7 @@ bfa_fcs_itnim_prli_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg, BFA_RPORT_INITIATOR; itnim->stats.prli_rsp_acc++; bfa_sm_send_event(itnim, - BFA_FCS_ITNIM_SM_INITIATOR); + BFA_FCS_ITNIM_SM_RSP_OK); return; } @@ -803,7 +805,7 @@ bfa_fcs_fcpim_uf_recv(struct bfa_fcs_itnim_s *itnim, struct fchs_s *fchs, switch (els_cmd->els_code) { case FC_ELS_PRLO: - /* bfa_sm_send_event(itnim, BFA_FCS_ITNIM_SM_PRLO); */ + bfa_fcs_rport_prlo(itnim->rport, fchs->ox_id); break; default: |