summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
Diffstat (limited to 'usr')
-rw-r--r--usr/src/uts/common/io/nvme/nvme.c9
-rw-r--r--usr/src/uts/common/io/nvme/nvme_var.h1
-rw-r--r--usr/src/uts/common/sys/nvme.h1
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 */