Commit a12cf26c authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

nvme: add NVME_CTRLR_STATE_CHECK_EN



We're going to be adding some new states (READ_CAP
and READ_VS) in future patches, that we want to
come before the current "INIT" state.

So we will simply make "INIT" have the same
value as this new NVME_CTRLR_STATE_CHECK_EN state
for now.  That means existing code won't have to
change later once we add new states that come
before CHECK_EN.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I07ca92e28ab1cd8d838cdef5c3ff36ba80a224bf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8075


Reviewed-by: default avatarZiye Yang <ziye.yang@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
parent 3db73426
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1134,8 +1134,8 @@ nvme_ctrlr_state_string(enum nvme_ctrlr_state state)
	switch (state) {
	case NVME_CTRLR_STATE_INIT_DELAY:
		return "delay init";
	case NVME_CTRLR_STATE_INIT:
		return "init";
	case NVME_CTRLR_STATE_CHECK_EN:
		return "check en";
	case NVME_CTRLR_STATE_DISABLE_WAIT_FOR_READY_1:
		return "disable and wait for CSTS.RDY = 1";
	case NVME_CTRLR_STATE_DISABLE_WAIT_FOR_READY_0:
@@ -3124,7 +3124,7 @@ nvme_ctrlr_process_init(struct spdk_nvme_ctrlr *ctrlr)
		}
		break;

	case NVME_CTRLR_STATE_INIT:
	case NVME_CTRLR_STATE_CHECK_EN: /* synonymous with NVME_CTRLR_STATE_INIT */
		/* Begin the hardware initialization by making sure the controller is disabled. */
		if (cc.bits.en) {
			NVME_CTRLR_DEBUGLOG(ctrlr, "CC.EN = 1\n");
+7 −2
Original line number Diff line number Diff line
@@ -518,9 +518,14 @@ enum nvme_ctrlr_state {
	NVME_CTRLR_STATE_INIT_DELAY,

	/**
	 * Controller has not been initialized yet.
	 * Check EN to prepare for controller initialization.
	 */
	NVME_CTRLR_STATE_INIT,
	NVME_CTRLR_STATE_CHECK_EN,

	/**
	 * Controller has not started initialized yet.
	 */
	NVME_CTRLR_STATE_INIT = NVME_CTRLR_STATE_CHECK_EN,

	/**
	 * Waiting for CSTS.RDY to transition from 0 to 1 so that CC.EN may be set to 0.