nvme: add ERROR controller states in initialization
Change-Id: I1e5be0e282b9e29f7bf7ca7d2720b9fd00539be0 Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-on: https://review.gerrithub.io/424776 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
e9b5420f70
commit
1c79fadb23
@ -638,6 +638,8 @@ nvme_ctrlr_state_string(enum nvme_ctrlr_state state)
|
|||||||
return "set host ID";
|
return "set host ID";
|
||||||
case NVME_CTRLR_STATE_READY:
|
case NVME_CTRLR_STATE_READY:
|
||||||
return "ready";
|
return "ready";
|
||||||
|
case NVME_CTRLR_STATE_ERROR:
|
||||||
|
return "error";
|
||||||
}
|
}
|
||||||
return "unknown";
|
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");
|
SPDK_DEBUGLOG(SPDK_LOG_NVME, "Ctrlr already in ready state\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
case NVME_CTRLR_STATE_ERROR:
|
||||||
|
SPDK_ERRLOG("Ctrlr %s is in error state\n", ctrlr->trid.traddr);
|
||||||
|
return -1;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
nvme_ctrlr_fail(ctrlr, false);
|
nvme_ctrlr_fail(ctrlr, false);
|
||||||
|
@ -465,7 +465,12 @@ enum nvme_ctrlr_state {
|
|||||||
/**
|
/**
|
||||||
* Controller initialization has completed and the controller is ready.
|
* 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
|
#define NVME_TIMEOUT_INFINITE UINT64_MAX
|
||||||
|
Loading…
Reference in New Issue
Block a user