Commit ff179e0f authored by Krishna Gudipati's avatar Krishna Gudipati Committed by James Bottomley

[SCSI] bfa: Fix to avoid vport delete hang on request queue full scenario.

Fixed the LPS (Logical Port Services) state machine to send a
FDISC/FLOGI to the FW from the request queue wait state, when
there is space available again on the request queue.
Made changes to free the vport on LOGO/cleanup complete instead
of free'ing it from vport_delete_handler in the module unload scenario.
Signed-off-by: default avatarKrishna Gudipati <kgudipat@brocade.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent f0cdfcee
...@@ -5717,6 +5717,8 @@ bfa_fcs_vport_free(struct bfa_fcs_vport_s *vport) ...@@ -5717,6 +5717,8 @@ bfa_fcs_vport_free(struct bfa_fcs_vport_s *vport)
if (vport_drv->comp_del) if (vport_drv->comp_del)
complete(vport_drv->comp_del); complete(vport_drv->comp_del);
else
kfree(vport_drv);
bfa_lps_delete(vport->lps); bfa_lps_delete(vport->lps);
} }
......
...@@ -1280,6 +1280,7 @@ bfa_lps_sm_loginwait(struct bfa_lps_s *lps, enum bfa_lps_event event) ...@@ -1280,6 +1280,7 @@ bfa_lps_sm_loginwait(struct bfa_lps_s *lps, enum bfa_lps_event event)
switch (event) { switch (event) {
case BFA_LPS_SM_RESUME: case BFA_LPS_SM_RESUME:
bfa_sm_set_state(lps, bfa_lps_sm_login); bfa_sm_set_state(lps, bfa_lps_sm_login);
bfa_lps_send_login(lps);
break; break;
case BFA_LPS_SM_OFFLINE: case BFA_LPS_SM_OFFLINE:
...@@ -1578,7 +1579,7 @@ bfa_lps_login_rsp(struct bfa_s *bfa, struct bfi_lps_login_rsp_s *rsp) ...@@ -1578,7 +1579,7 @@ bfa_lps_login_rsp(struct bfa_s *bfa, struct bfi_lps_login_rsp_s *rsp)
break; break;
case BFA_STATUS_VPORT_MAX: case BFA_STATUS_VPORT_MAX:
if (!rsp->ext_status) if (rsp->ext_status)
bfa_lps_no_res(lps, rsp->ext_status); bfa_lps_no_res(lps, rsp->ext_status);
break; break;
......
...@@ -494,8 +494,11 @@ bfad_im_vport_delete(struct fc_vport *fc_vport) ...@@ -494,8 +494,11 @@ bfad_im_vport_delete(struct fc_vport *fc_vport)
unsigned long flags; unsigned long flags;
struct completion fcomp; struct completion fcomp;
if (im_port->flags & BFAD_PORT_DELETE) if (im_port->flags & BFAD_PORT_DELETE) {
goto free_scsi_host; bfad_scsi_host_free(bfad, im_port);
list_del(&vport->list_entry);
return 0;
}
port = im_port->port; port = im_port->port;
...@@ -526,7 +529,6 @@ bfad_im_vport_delete(struct fc_vport *fc_vport) ...@@ -526,7 +529,6 @@ bfad_im_vport_delete(struct fc_vport *fc_vport)
wait_for_completion(vport->comp_del); wait_for_completion(vport->comp_del);
free_scsi_host:
bfad_scsi_host_free(bfad, im_port); bfad_scsi_host_free(bfad, im_port);
list_del(&vport->list_entry); list_del(&vport->list_entry);
kfree(vport); kfree(vport);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment