/* Locking Note: This function should not be called with the lport lock held.  */
int fc_fabric_login(struct fc_lport *lport)
/* Locking Note: This function should not be called with the lport lock held.  */
int fc_fabric_login(struct fc_lport *lport)
{
	int rc = -1;
	mutex_lock(&lport->lp_mutex);
	if (lport->state == LPORT_ST_DISABLED ||
	    lport->state == LPORT_ST_LOGO) {
		fc_lport_state_enter(lport, LPORT_ST_RESET);
		fc_lport_enter_reset(lport);
		rc = 0;
	}
	mutex_unlock(&lport->lp_mutex);
	return rc;
}