[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/23] hw/nvme: fix csi field for cns 0x00 and 0x11
From: |
Klaus Jensen |
Subject: |
[PULL 05/23] hw/nvme: fix csi field for cns 0x00 and 0x11 |
Date: |
Tue, 29 Jun 2021 20:47:25 +0200 |
From: Gollu Appalanaidu <anaidu.gollu@samsung.com>
As per the TP 4056d Namespace types CNS 0x00 and CNS 0x11
CSI field shouldn't use but it is being used for these two
Identify command CNS values, fix that.
Remove 'nvme_csi_has_nvm_support()' helper as suggested by
Klaus we can safely assume NVM command set support for all
namespaces.
Suggested-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
---
hw/nvme/ctrl.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index 8dd9cb2ccbf3..7dea64b72e6a 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -4188,16 +4188,6 @@ static uint16_t nvme_rpt_empty_id_struct(NvmeCtrl *n,
NvmeRequest *req)
return nvme_c2h(n, id, sizeof(id), req);
}
-static inline bool nvme_csi_has_nvm_support(NvmeNamespace *ns)
-{
- switch (ns->csi) {
- case NVME_CSI_NVM:
- case NVME_CSI_ZONED:
- return true;
- }
- return false;
-}
-
static uint16_t nvme_identify_ctrl(NvmeCtrl *n, NvmeRequest *req)
{
trace_pci_nvme_identify_ctrl();
@@ -4254,7 +4244,7 @@ static uint16_t nvme_identify_ns(NvmeCtrl *n, NvmeRequest
*req, bool active)
}
}
- if (c->csi == NVME_CSI_NVM && nvme_csi_has_nvm_support(ns)) {
+ if (active || ns->csi == NVME_CSI_NVM) {
return nvme_c2h(n, (uint8_t *)&ns->id_ns, sizeof(NvmeIdNs), req);
}
@@ -4325,7 +4315,7 @@ static uint16_t nvme_identify_ns_csi(NvmeCtrl *n,
NvmeRequest *req,
}
}
- if (c->csi == NVME_CSI_NVM && nvme_csi_has_nvm_support(ns)) {
+ if (c->csi == NVME_CSI_NVM) {
return nvme_rpt_empty_id_struct(n, req);
} else if (c->csi == NVME_CSI_ZONED && ns->csi == NVME_CSI_ZONED) {
return nvme_c2h(n, (uint8_t *)ns->id_ns_zoned, sizeof(NvmeIdNsZoned),
--
2.32.0
- [PULL 00/23] hw/nvme patches, Klaus Jensen, 2021/06/29
- [PULL 01/23] hw/nvme: fix style, Klaus Jensen, 2021/06/29
- [PULL 02/23] hw/nvme: add identify namespace flbas/mc enums, Klaus Jensen, 2021/06/29
- [PULL 03/23] hw/nvme: fix lbaf formats initialization, Klaus Jensen, 2021/06/29
- [PULL 05/23] hw/nvme: fix csi field for cns 0x00 and 0x11,
Klaus Jensen <=
- [PULL 04/23] hw/nvme: add param to control auto zone transitioning to zone state closed, Klaus Jensen, 2021/06/29
- [PULL 07/23] hw/nvme: default for namespace EUI-64, Klaus Jensen, 2021/06/29
- [PULL 06/23] hw/nvme: namespace parameter for EUI-64, Klaus Jensen, 2021/06/29
- [PULL 08/23] hw/nvme: reimplement flush to allow cancellation, Klaus Jensen, 2021/06/29
- [PULL 10/23] hw/nvme: reimplement dsm to allow cancellation, Klaus Jensen, 2021/06/29
- [PULL 09/23] hw/nvme: add nvme_block_status_all helper, Klaus Jensen, 2021/06/29
- [PULL 11/23] hw/nvme: save reftag when generating pi, Klaus Jensen, 2021/06/29
- [PULL 12/23] hw/nvme: remove assert from nvme_get_zone_by_slba, Klaus Jensen, 2021/06/29
- [PULL 13/23] hw/nvme: use prinfo directly in nvme_check_prinfo and nvme_dif_check, Klaus Jensen, 2021/06/29
- [PULL 14/23] hw/nvme: add dw0/1 to the req completion trace event, Klaus Jensen, 2021/06/29