Commit 1c79fadb authored by Changpeng Liu's avatar Changpeng Liu Committed by Jim Harris
Browse files

nvme: add ERROR controller states in initialization



Change-Id: I1e5be0e282b9e29f7bf7ca7d2720b9fd00539be0
Signed-off-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/424776


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent e9b5420f
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -638,6 +638,8 @@ nvme_ctrlr_state_string(enum nvme_ctrlr_state state)
		return "set host ID";
	case NVME_CTRLR_STATE_READY:
		return "ready";
	case NVME_CTRLR_STATE_ERROR:
		return "error";
	}
	return "unknown";
};
@@ -1772,6 +1774,10 @@ nvme_ctrlr_process_init(struct spdk_nvme_ctrlr *ctrlr)
		SPDK_DEBUGLOG(SPDK_LOG_NVME, "Ctrlr already in ready state\n");
		return 0;

	case NVME_CTRLR_STATE_ERROR:
		SPDK_ERRLOG("Ctrlr %s is in error state\n", ctrlr->trid.traddr);
		return -1;

	default:
		assert(0);
		nvme_ctrlr_fail(ctrlr, false);
+6 −1
Original line number Diff line number Diff line
@@ -465,7 +465,12 @@ enum nvme_ctrlr_state {
	/**
	 * Controller initialization has completed and the controller is ready.
	 */
	NVME_CTRLR_STATE_READY
	NVME_CTRLR_STATE_READY,

	/**
	 * Controller inilialization has an error.
	 */
	NVME_CTRLR_STATE_ERROR
};

#define NVME_TIMEOUT_INFINITE	UINT64_MAX