diff options
author | Andy Fiddaman <illumos@fiddaman.net> | 2022-11-21 12:20:45 +0000 |
---|---|---|
committer | Andy Fiddaman <illumos@fiddaman.net> | 2022-11-23 09:22:58 +0000 |
commit | 3eaaeb3d8421fdd2f5e4d63f0483f6047911215f (patch) | |
tree | d59caf3bb6f560b9c3bae98381713311546759e5 | |
parent | b8af4a8966ef2150997d7664836f5c360b849005 (diff) | |
download | illumos-gate-3eaaeb3d8421fdd2f5e4d63f0483f6047911215f.tar.gz |
15202 nvme should recognise Format-in-progress generic status
Reviewed by: Robert Mustacchi <rm+illumos@fingolfin.org>
Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Approved by: Rich Lowe <richlowe@richlowe.net>
-rw-r--r-- | usr/src/uts/common/io/nvme/nvme.c | 9 | ||||
-rw-r--r-- | usr/src/uts/common/io/nvme/nvme_var.h | 1 | ||||
-rw-r--r-- | usr/src/uts/common/sys/nvme.h | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/usr/src/uts/common/io/nvme/nvme.c b/usr/src/uts/common/io/nvme/nvme.c index 2aa87600f4..fe8e31c145 100644 --- a/usr/src/uts/common/io/nvme/nvme.c +++ b/usr/src/uts/common/io/nvme/nvme.c @@ -1536,6 +1536,15 @@ nvme_check_generic_cmd_status(nvme_cmd_t *cmd) bd_error(cmd->nc_xfer, BD_ERR_NTRDY); return (EIO); + case NVME_CQE_SC_GEN_NVM_FORMATTING: + /* Format in progress (1.2) */ + if (!NVME_VERSION_ATLEAST(&cmd->nc_nvme->n_version, 1, 2)) + return (nvme_check_unknown_cmd_status(cmd)); + atomic_inc_32(&cmd->nc_nvme->n_nvm_ns_formatting); + if (cmd->nc_xfer != NULL) + bd_error(cmd->nc_xfer, BD_ERR_NTRDY); + return (EIO); + default: return (nvme_check_unknown_cmd_status(cmd)); } diff --git a/usr/src/uts/common/io/nvme/nvme_var.h b/usr/src/uts/common/io/nvme/nvme_var.h index ca3e7ef1a4..464fd3c923 100644 --- a/usr/src/uts/common/io/nvme/nvme_var.h +++ b/usr/src/uts/common/io/nvme/nvme_var.h @@ -240,6 +240,7 @@ struct nvme { uint32_t n_abort_sq_del; uint32_t n_nvm_cap_exc; uint32_t n_nvm_ns_notrdy; + uint32_t n_nvm_ns_formatting; uint32_t n_inv_cq_err; uint32_t n_inv_qid_err; uint32_t n_max_qsz_exc; diff --git a/usr/src/uts/common/sys/nvme.h b/usr/src/uts/common/sys/nvme.h index e7a685bd2f..1827ef61af 100644 --- a/usr/src/uts/common/sys/nvme.h +++ b/usr/src/uts/common/sys/nvme.h @@ -975,6 +975,7 @@ typedef union { #define NVME_CQE_SC_GEN_NVM_CAP_EXC 0x81 /* Capacity Exceeded */ #define NVME_CQE_SC_GEN_NVM_NS_NOTRDY 0x82 /* Namespace Not Ready */ #define NVME_CQE_SC_GEN_NVM_RSV_CNFLCT 0x83 /* Reservation Conflict */ +#define NVME_CQE_SC_GEN_NVM_FORMATTING 0x84 /* Format in progress (1.2) */ /* NVMe completion status code (command specific) */ #define NVME_CQE_SC_SPC_INV_CQ 0x0 /* Completion Queue Invalid */ |